Optimality of sparse olfactory representations is not affected by network plasticity

The neural representation of a stimulus is repeatedly transformed as it moves from the sensory periphery to deeper layers of the nervous system. Sparsening transformations are thought to increase the separation between similar representations, encode stimuli with great specificity, maximize storage capacity of associative memories, and provide an energy efficient instantiation of information in neural circuits. In the insect olfactory system, odors are initially represented in the periphery as a combinatorial code with relatively simple temporal dynamics. Subsequently, in the antennal lobe this representation is transformed into a dense and complex spatiotemporal activity pattern. Next, in the mushroom body Kenyon cells (KCs), the representation is dramatically sparsened. Finally, in mushroom body output neurons (MBONs), the representation takes on a new dense spatiotemporal format. Here, we develop a computational model to simulate this chain of olfactory processing from the receptor neurons to MBONs. We demonstrate that representations of similar odorants are maximally separated, measured by the distance between the corresponding MBON activity vectors, when KC responses are sparse. Sparseness is maintained across variations in odor concentration by adjusting the feedback inhibition that KCs receive from an inhibitory neuron, the Giant GABAergic neuron. Different odor concentrations require different strength and timing of feedback inhibition for optimal processing. Importantly, as observed in vivo, the KC–MBON synapse is highly plastic, and, therefore, changes in synaptic strength after learning can change the balance of excitation and inhibition, potentially leading to changes in the distance between MBON activity vectors of two odorants for the same level of KC population sparseness. Thus, what is an optimal degree of sparseness before odor learning, could be rendered sub–optimal post learning. Here, we show, however, that synaptic weight changes caused by spike timing dependent plasticity increase the distance between the odor representations from the perspective of MBONs. A level of sparseness that was optimal before learning remains optimal post-learning.


Introduction
The neural representation of an odor is transformed repeatedly as it traverses different layers of the olfactory system [1]. Some transformations separate the representations of odorants to enable easy discrimination [2] [3]. Other transformations prepare an odor representation for eliciting behaviors by associating it with other sensory inputs and providing the context necessary for action and memory [4]. In the American desert locust, Schistocerca americana, neural networks peripheral to the KC-MBON synapse appear to work best as pattern decorrelators while downstream circuits appear to be specially structured to encode associative memories and organize behaviors elicited by stimuli. The olfactory network, from the receptor neurons through the antennal lobe and on to the mushroom body, is largely feedforward, and odor representations are progressively decorrelated and optimized in several ways as they traverse these layers. Odor representations arrive at the MBONs via synapses that are highly plastic and may change with the dynamic olfactory milieu of the animal [5]. Here, we ask, how does the olfactory network preserve an optimal odor representation despite activity-driven changes in the synaptic weights of the networks?
In the locust, olfactory processing in the nervous system begins when odorant molecules bind to receptors on neurons in the antennae. This leads to the opening of the receptor neuron's ion channels and a cascade of events that can lead to spiking, the suppression of spontaneous firing, or simple sequences of excitation and inhibition. Olfactory receptor neurons can be tuned narrowly or broadly, firing vigorously for some odors and less so or not at all for others [6,7]; thus, the identity of responsive receptor neurons helps encode the stimulus. Temporal features of receptor neuron spiking, including simple sequences of excitation and inhibition, also contribute to encoding the identity of the odor [8]. Olfactory receptor neurons provide input to excitatory PNs and local inhibitory (and likely some excitatory) interneurons in the antennal lobe. This dense network, with recurrent connections between excitatory and inhibitory neurons, transforms the odor representation arising in receptor neurons into a more elaborate spatiotemporal pattern [1,9,10] where the identity, concentration, and timing of the odor are represented by the identity of responsive PNs, the temporal structure of their spiking, and correlations across the PN population. Most PNs respond in some way to most odors [1,11], collectively providing a dense spatiotemporal representation of an odor. KCs in the mushroom body receive inputs from PNs and transform this dense representation into a sparse code [12] in which rare spikes occur with millisecond precision and great specificity, together describing the attributes of the eliciting odor. The sparseness of KC spiking is orchestrated by a combination of membrane conductances that ensure a high spike threshold, and feedback inhibition from a giant GABAergic neuron (GGN) proportional to the drive it receives from the full population of KCs [13]. Thus, GGN adaptively regulates the output of KCs, maintaining the sparseness of their code over a large range of odor concentrations. The successive transformations that odor representations undergo, from dense spatiotemporal to sparse activity patterns, are thought to progressively decorrelate and distinguish odor representations and prepare them for valence and motor decisions, and storage as memories [14]. A transformation of the representation from dense to sparse is also accompanied by an expansion in the dimension of the neuronal representations (such as from 830 PNs in the AL to nearly 50,000 KCs in the MB of the locust). A similar transformation from a dense to a sparse representation is seen in different species and a number of brain areas [15][16][17]. The expansion maps similar inputs to widely separated outputs in a high dimensional space. If the dimensionality of the representation is sufficiently high, similar odors can be distinctly classified even when the number of inputs to individual KCs is low [18]. This mapping format has the risk of amplifying noisy representations of the same odor. However, structured connectivity, where synaptic weights reflect the correlations of the inputs, make the sparse representation resilient to noise [19]. In locusts, convergent KC activity is read out by a relatively small number of MBONs. The KC-MBON synapse undergoes experience dependent plasticity [5] (see [20] for a similar circuit in Drosophila) in a form that can be modified by associating an olfactory stimulus with a reward [5,20] mediated by octopamine. Together these features mark the KC-MBON pathway as one where sparse, decorrelated odor representations are combined with input from a reward pathway [21].
Using a model network that simulates olfactory processing in the locust from receptor neurons to MBONs, we show that the distance between the representations of different odorants, measured as the distance between MBON activity vectors, is maximized for a particular level of KC response sparseness. The degree of sparseness is determined by transformations of the odor representation in circuits before the KC-MBON synapse. However, what level of sparseness is optimal for odor discrimination by MBONs is determined by the weights of KC-MBON synapses. KC-MBON synaptic weights are, in turn, subject to the animal's experiences, mediated by octopamine reward. This gives rise to a potential conundrum: the degree of sparseness determined by the circuits prior to the KC-MBON synapse could be rendered suboptimal by modulations to the weight of that KC-MBON synapse by associative learning of particular odors. Here, we explore how the olfactory system guards against this loss of optimal sparseness. We show that the spike timing dependent plasticity operating on the strength of KC-MBON synapse not only retains the value of optimal sparseness despite learning-dependent changes in synaptic strength, but further improves the ability of the olfactory system to differentiate between odors.
Though we focus on odor discrimination here, this need not be the sole optimizing principle operating in the KC-MBON circuit. In addition, MBONs likely play an important role in generalizing the representations of learned odors and associate it other sensory inputs.

Results
In this study we sought to address two questions. First, from the perspective of MBONs, is there an optimal value of coding sparseness to maximally separate odor representations? Second, if an optimal sparseness exists, does plasticity at the KC-MBON synapse alter it, making post-learning odor representations sub-optimal? To address these questions, we constructed a computational model of the locust olfactory system consisting of the olfactory receptor neurons, the antennal lobe network of PNs and local inhibitory interneurons, the KCs of the mushroom body, and a layer of MBONs ( Fig 1A). The model antennal lobe network generates many of the key responses previously documented in the locust [22,23]. The output from the antennal lobe diverges widely to an array of 15,000 model KCs. This pattern of connectivity has been hypothesized to help decrease the overlap between odor representations [24,25]. KC output then converges onto a small group of MBONs. To establish whether an optimal value of sparseness exists, we systematically varied the sparseness of KC responses and checked the ability of MBONs to differentiate between two similar odorants. We then introduced spike timing dependent plasticity [5] in the KC-MBON synapse and simulated the network using multiple instances of randomly interleaved odorants to map the effect of synaptic plasticity on the optimal sparseness of KC responses.

Coding sparseness determines the distance between odor representations
Odor input activates the ORNs that drive the neurons of the antennal lobe. We did not explicitly model the ORNs; rather, we simulated ORN activity as a simplified, constant supra- threshold depolarizing input to a subset of PNs and interneurons [26][27][28]. This input had an initial rise time of 60ms and a decay time of 200ms (Fig 2C bottom trace). The amplitude of the input remained constant for 1000ms except for noise that was 5-10% of the amplitude of the pulse. Each odorant was defined by the subset of antennal lobe neurons it activated and the amplitude of the depolarizing input to each. In Fig 1B the amplitude of input to the PNs of the network is shown for two odorants (solid lines). The PNs were arranged such that the amplitude profile resembled a Gaussian curve. The input curve was set to zero when the amplitude decreased below a threshold value. Note that the arrangement of PN indices according to a Gaussian activation profile does not imply any spatial structure; that is, the neuron with index i need not be physically adjacent to neurons with index i-1 or i+1 since network connections were chosen randomly. However, by defining an odor in this manner, we could conveniently and continuously vary the identity and the concentration of odorants. The identity of an odorant could be varied by moving the location of the peak while the concentration could be increased by widening the Gaussian to recruit more PNs and interneurons (Fig 1B, dashed line) [29].
We measured the responses of antennal lobe model neurons to the odor input. As seen in earlier studies and in accordance with experiments done in vivo, the local field potential (measured in our model as the mean membrane potential of all the PNs) showed an odor-elicited 20Hz oscillation (Fig 2B). This global pattern was elicited by different odors and concentrations. The oscillations emerge from interactions between PNs and LNs [28]: reciprocally coupled pairs of PNs and LNs oscillate with phase shift at~20Hz when driven by an external depolarizing input. PN spikes elicit an LN spike that in turn delays the onset of subsequent spikes in post-synaptic PNs. The extent of this delay is a function of the strength of fast-GABAergic inhibition between LNs and PNs. For sufficiently high values of inhibitory coupling, the delay is determined by the decay time-constant of fast inhibition [30]. In the network of 100 LNs and 300 PNs, rhythmically spiking LNs synchronized PNs into transiently synchronous groups. Earlier studies have shown that when GABAergic interactions are blocked by picrotoxin, synchronization of PNs and the 20Hz oscillatory LFP are lost [30], [31]. Thus, inhibition plays an important role in synchronizing the activity of PNs and generating an oscillatory local field potential. As in vivo, in the model during each cycle of the oscillation different groups of PNs were transiently activated. This spatiotemporal representation continuously changed over the course of the odor presentation due to mutual and transient inhibition between interneurons that, in turn, coordinated the activity of PNs [26][27][28].
Each odor stimulus consisted of a 1000ms constant (except for a 10% noise) depolarizing input to a subset of PNs and LNs. The temporal response of the AL neurons, in contrast, changes over the time-scales ranging from 10-100's of milliseconds. Thus, the AL response reflects the intrinsic properties of PNs and LNs and the topology of the networks they form. One of the key drivers of the spatiotemporal patterning in the locust AL is spike frequency adaptation which causes the firing rates of LNs to decrease over the duration of odor input [28]. Adaptation in LNs is caused by a Ca 2+ dependent potassium current that builds up over time and delays the onset of subsequent spikes. As the spiking frequency of a neuron decreased, post-synaptic LNs were released from inhibition and became active. Thus, different groups of LNs were sequentially activated in response to a depolarizing input. The identity and the order of these spatiotemporal patterns were determined by the structure of the network [26]. As a result, different LNs and post-synaptic PNs are activated at different times during the odor presentation.
Each odor-concentration pair we tested elicited a different spatiotemporal pattern. An example pattern of activity is shown in Fig 2A and 2C. The amplitude of the local field potential increased with increasing concentration indicating tighter synchrony between the projection neurons that spike during each cycle, consistent with earlier studies [29,32].
The PN responses were used as input to a group of 15,000 KCs. KCs are known to respond sparsely (few neurons fire rarely) to odor stimuli [12]. However, the increased PN synchrony that accompanies increased odor concentrations [32] alone would lead to more densely spiking responses, disrupting the sparse code. How do KCs maintain sparseness over decadal variations in the concentration of the odor? Earlier studies hypothesized that input from PNs to KCs arrives along two pathways, a direct excitatory drive from the antennal lobe and slightly delayed feedforward inhibition from lateral horn interneurons (LHIs). Thus, cyclic pairs of excitatory and inhibitory input to KCs defined short windows of time during which KCs could integrate input from the antennal lobe [12]. Notably, the duration of this window was dynamically modulated by changes in the concentration of the odor, which allowed KCs to fire sparsely despite large changes in the concentration [29]. Recent work established that LHIs do not extend GABAergic projections to KCs, eliminating the possibility of feedforward inhibition [33]. However, the cyclic inhibition underlying the dynamically modulated integration windows is now known to be generated by feedback from a single inhibitory cell, termed the Giant GABAergic Neuron (GGN), which provides input to all KCs [13,22]. Thus, cyclic inhibition regulates the sparseness of KC responses in an adaptive, concentration dependent manner [33,34].
Given these earlier findings, we first sought to determine whether there exists an optimal value of lifetime sparseness (measured as the total number of spikes generated by all KCs during an odor presentation) to discriminate odors. To determine an optimal sparseness, if one such value existed, we needed to systematically vary the sparseness of KC responses and quantify the distance between odor representations from the perspective of downstream neurons that read KC output. KCs converge onto MBONs that generate distinct responses to odorants [35]. Therefore, we used the MBONs as a read-out of KC responses. The Hamming distances between odor representations generated by MBONs were plotted as a function of different manipulations to the upstream network that changed KC lifetime sparseness. In the locust olfactory system GGN regulates the sparseness of KC responses using feedback inhibition. Numerous studies have shown that feedback inhibition in excitatory-inhibitory circuits mainly reduces later portions of the excitatory responses in each cycle. As inhibition strengthens, its onset occurs faster, thus reducing the excitatory response [29]. This effect is self-limiting though, because excitation is needed to drive inhibition [34]. If we explicitly modeled the GGN, we would obtain a single window of integration for each concentration [34,36]. However, we were interested in understanding how MBON responses varied as a function of varying KC sparseness that is, in turn, dependent upon the width of the window of integration. Thus, rather than modeling the GGN, we modeled the effect of feedback inhibition by selectively eliminating PN spikes that occurred after a threshold phase of the LFP (Fig 3A). To do so we first filtered the LFP (40Hz) (red trace in Fig 3A) and calculated the instantaneous phase of the resulting 20 Hz oscillation using a Hilbert transform. Then we removed those spikes occurring beyond a threshold phase, denoted by ϕ, in each cycle of the LFP, shown by the shaded regions in Fig 3A. In this way we could directly control this threshold phase, and therefore artificially vary the window of integration and the sparseness of KC activity. As expected, as we widened the window of integration, KCs received more input from PNs and generated progressively denser spiking. We plotted the density of KC spiking as a function of ϕ for different values of odor concentration (σ) (Fig 3C). Increasing odor concentrations led to denser KC responses for a given value of ϕ. To maintain a specific value of sparseness that maximally separated odor representations across a range of odor concentrations, the window of integration had to be shifted to lower values as the concentration increased. In the locust olfactory system a leftward shift in phase is achieved by a mechanism that arises naturally from concentration-dependent changes in odor-response latencies in PNs [29,33].
To determine the separation between odor representations from the perspective of downstream targets, we used odor-elicited KC responses to drive a group of 100 MBONs (Fig 3B).
Here the MBONs were modeled using a two-dimensional map that integrates pre-synaptic input and generates spikes in response to it (see Methods). We binned the output of these neurons into temporal blocks, each block demarcated by the troughs of an LFP cycle. The response of MBONs during each cycle of an LFP oscillation was assigned one or zero to indicate whether it had spiked or not (Fig 3B).
We then calculated the Hamming distance between the representations of two odorants as a function of different windows of integration ϕ (Fig 4). Since the density of KC spikes was a monotonically increasing function of ϕ, we used ϕ as a proxy for KC sparseness. We found show the responses of a subset of KCs to two different odors. These spikes were then fed to a layer of 100 beta lobe neurons. The response of the beta lobe neurons was converted into a binary spatiotemporal pattern. For each neuron, a single cycle of the PN-LFP was marked either 1 (dark) or 0 (blank box), depending on whether that neuron fired a spike during the cycle (Panels on the right in b). The Euclidean distance between these binary spatiotemporal patterns was used to calculate the distance between odors. The number of KCs that spike in response to an external input is plotted in (c). https://doi.org/10.1371/journal.pcbi.1007461.g003 Optimality of sparse olfactory representations is not affected by network plasticity that, for low odor concentration values (σ < 0.25), the peak distance between odor representations occurred when more PN spikes were allowed to affect KC responses throughout each LFP cycle (Fig 4A). Indeed, for low odor concentrations, the synchronization and thus density of input PN spiking remained low and the responses of KCs remained sparse throughout the range of integration windows we simulated. With increasing odor concentrations, we found that the peak distance between odor representations shifted to lower values of ϕ. Furthermore, we observed a decrease in discrimination performance beyond a certain ϕ threshold. This occurred because KC responses became denser when the integration window expanded. Thus, for higher odor concentrations, we found a prominent single peak suggesting the existence of an optimal value of KC sparseness to maximize the distance between odor representations from the perspective of MBONs. Experimental recordings of lateral horn interneurons that receive convergent input from PNs show a phase shift [37] similar to shifts observed in models [29,34]. This is expected since increasing concentration also increases the amplitude of the LFP due to increased PN synchrony. GGN responds in a graded manner to PN inputs. The phase of the peak response of GGN with respect to the LFP remains invariant to changes in the concentration. GGNs respond to increased PN synchrony with stronger IPSPs that rise faster than weaker ones and regulate the window over which PN spikes are integrated [37].
Within a given animal the impact of KC spiking on MBONs can vary over time because the synapses linking them are plastic, changing in strength with experience [5]. By amplifying or decreasing the impact of KC spiking, this synaptic plasticity has the potential to degrade the effective, optimized sparseness of the KC output, potentially affecting the distance between odor representations from the perspective of MBONs. To investigate this possibility, we systematically varied the weight of the input synapses to MBONs to determine how plasticity affects the distance between odor representations. We then simulated delivery of two similar odors of the same concentration by shifting the peaks of the distributions that characterized the two odors by 5 units with respect to each other, and for two different concentrations by adjusting the widths of the distributions (Fig 1B). As before, patterns of antennal lobe activity served as input to KCs that, in turn, drove MBONs. Here, we used the output of MBONs to measure the distance between odor representations for different values of KC sparseness. The MBONs were modeled as simple map-based neurons, summing the input they received from KCs and generating a spike in response to supra-threshold inputs. We then systematically varied the weights of the synapse from 0.1 to 0.9. This manipulation led to a shift of the peak towards lower values of ϕ (Fig 4B). These simulations confirmed that the effective sparseness of KC output could change when the animal is exposed to different sets of odors that trigger plasticity in the KC-MBON pathway. This departure from optimal sparseness could be The post-synaptic neuron (red) spikes follow that of the pre-synaptic neuron (black), leading to an increase in the synaptic weight (facilitation) (Fig 5A top panel). The opposite temporal order (post-synaptic spikes occur before pre-synaptic spikes) leads to a decrease in synaptic weights (depression) (Fig 5A bottom panel). The increase/decrease in synaptic weight (Δw) is shown as a function of the time difference between the pre-and the post-synaptic spike (5b). When the presynaptic spike occurs before the post-synaptic spike is positive and otherwise negative. The distribution of synaptic weights of all KC-MBONs pairs evolves over time (c). In the left panel of (c) all the initial weights were set to 1.4. The system was then stimulated with different odors of varying concentrations. The weights were sampled at fixed intervals of time. The distribution of weights was plotted using a color map (see color bar for the frequency values). The mean synaptic weight was overlaid on the distribution (white trace). The right panel shows the temporal evolution of the synaptic weights when a low initial weight (0.6) was used.

Optimal sparseness persists despite spike timing dependent plasticity
KC-MBON synapses appear to be powerful: in vivo, a KC spike generates an EPSP in MBONs that is, on average, nearly an order of magnitude larger than EPSPs generated in KCs by PN spikes [5]. Previous work established that the KC-MBON synapse undergoes spike timing dependent plasticity (STDP): potentiation when the presynaptic neuron fires before the post synaptic one, and depression when the presynaptic neuron fires after the post synaptic one [5]. This plasticity has been shown to maintain the oscillatory parcellation of information that begins at the antennal lobe and cascades all the way down to the MBONs. How does this plasticity affect the distance between odor representations when viewed from the perspective of MBONs?
To address this question, we modeled STDP in the KC-MBON synapse using a simple phenomenological model (Fig 5B) [38,39]. Following STDP rules, the model effectively modified the weight of the synapse depending on the time of occurrence of the presynaptic and the postsynaptic spikes such that each occurrence of a presynaptic spike before the postsynaptic spike led to an increase in the synaptic weight, and a presynaptic spike after the postsynaptic spike led to a decrease in the synaptic weight (see Methods for implementation details). We modeled MBONs parsimoniously as reduced spiking neuron models represented by two dimensional maps [40,41] (see Methods for details of implementation). The increase/decrease in weights with each pre-post pair of spikes is shown in Fig 5A. We specified a minimum and a maximum value for the synaptic weights so that the response of MBONs extended over a wide range of sparseness values. The change in synaptic weights (dw) depended on how close the current weight of the synapse was to the maximum allowed synaptic weight. The STDP equations were modeled so that for large synaptic weights (w max ) synaptic depression dominates over potentiation and vice versa for small synaptic weights (w 0 ) [42]. Using this form of STDP, we then wired the 15,000 KCs to a layer of 100 MBONs. Each MBON received input from a randomly selected group consisting of 60% of the KCs. For simplicity, we did not implement lateral inhibitory connections between MBONs that are thought to enhance the contrast of input received from KCs [5].
To model odor stimulation, we randomly interleaved multiple instances of two similar odors (peak shifted by 5 units) and an odor that was different from these odors (peak shifted by 20 units) as input to the PNs. This simulated odor input evoked spatiotemporal patterns of activity in the antennal lobe that drove the KCs and the MBONs. Initially, the narrow distribution of synaptic weights of the KC-MBON synapses was, in separate simulations, centered around two different values (Fig 5C, left vs right). Over successive odor presentations these synaptic weights changed. The median value of the synaptic weight is shown by the white lines in Fig 5C. Since KC responses are very sparse, most of the weights did not change at all. Therefore, in subsequent analyses we chose a subset of weights that changed during the course of multiple odor presentations. We found that, over odor presentations, the distribution of synaptic weights evolved in a manner such that the median synaptic weight changed monotonically toward new value (approximately 1 in Fig 5C).
In our simulations we used two different initial weights distributions. Regardless of the specific initial weight distribution, we found that the median synaptic weight evolved towards the same value over multiple odor presentations. Thus, runaway excitation of the small population of MBONs would degrade the representation of an odor by increasing the overlap between nearby odor representations. However, STDP acts as a homeostatic mechanism that maintains the level of activity of MBONs.
Next, we investigated the evolution of the odor representation exhibited by MBONs concomitant with the STDP-dependent evolution of the network weights. Fig 6 shows the distance between odor representations as a function of φ as the network weights evolved (Fig 6A; lighter colored curves correspond to the weights later in training). We found that the location of the peak (optimal value of φ) remained the same despite changes in weights. At a low odor concentration (σ = 0.2) the changes in the distance curve (marked in progressively lighter shades) were small compared to the changes at higher concentrations (σ = 0.35, red curves in Fig 6A  and 6B). In all cases, however, the optimal degree of sparseness provided by the circuits before the KC-MBON synapse remained optimal after STDP-mediated changes of KC-MBON projections. However, there was a small, but significant change in the peak distance between odor representations. The peak distance between the representations of two similar odors increased (Fig 6B) while the weight distribution settled to its asymptotic values (Fig 5C). To test whether that the increase in the distance was significant, we simulated the network with three pairs of odorants over 10 trials. Thus, for each odor pair we obtained 40 values of the distance between MBON odor representations. A paired t-test showed the mean distance between odor pairs post-STDP was significantly different from that before the network was trained with a sequence of odors ( Fig 6C). Next, we simulated the network with three different initial weight distributions and randomly shuffled training inputs. The training inputs, as before, consisted of different trials of two similar odors (peaks shifted by 5 units) and one odor that was different from these (peak shifted by 20 units). In all cases the weight distribution evolved such that the median weights asymptotically approached each other (Fig 5C; two initial weight distributions are shown). Here too, the peak distance between odor representations increased post-STDP compared to the response of the pre-trained network (Fig 6D). Next, we classified the odors using a linear discriminant model. We first simulated twenty trials each of two odors and calculated the pairwise Hamming distance between each point. Using multidimensional scaling and the Hamming distance matrix as a measure of similarity between the representations we mapped the odor representations onto a two-dimensional plane. We then used a linear discriminant model to classify the data into two classes. The figures below show that classification boundaries determined by the model before and after the weights were modified by STDP. The points plotted in red indicate the trials that were misclassified while the blue dots show the trials that were correctly classified (Fig 6E and 6F). The simple linear classifier used here shows an improvement in the classification accuracy after learning (Fig 6F). Thus, we conclude, an effect of STDP was to improve the ability of the olfactory system to differentiate between odors ( Fig 6B). Further, we show the optimal sparseness does not change despite activity dependent changes in the synaptic weights ( Fig 6C).

Discussion
In Drosophila and in locust, sparseness in KC firing is achieved by intrinsic high firing thresholds and feedback inhibition from a single neuron in each lobe, the anterior paired lateral (APL) neuron in Drosophila [43,44] and GGN in locust [13,22,33,35]. This simple architecture, with a single neuron exerting outsized influence over the olfactory system, allows relatively simple experimental perturbations that selectively change the sparseness of KC responses. Indeed, as KC spiking increases in density, the ability of insects to differentiate between similar odors decreases, but the ability to differentiate dissimilar odors is not affected [44]. This observation suggests that decreased sparseness increases the overlap between representations, but that KC representations of dissimilar odors are sufficiently distant and continue to be separable even when sparseness is compromised.
Here, we developed a model that couples multiple layers of the locust olfactory system. Our results demonstrate that a specific value of the window of integration (ϕ) of the PN inputs to KCs maximally separates the KC representations of similar odors from the perspective of their follower MBONs. As the concentration increased we found that the optimal value of ϕ decreased. In our model we artificially varied ϕ across a range of values. In contrast, in the Each line in the plot shows the odor distance-relationship at different snapshots in time ranging from 0 to 100 seconds. Darker shades indicate earlier times. (b) shows the maximum distance between two similar odors for high (σ = 0.35 red) and low (σ = 0.2 gray) concentration values over the time that STDP re-weighted the KC-MBON connections. Note, that the ϕ value maximizing the distance does not change during STDP-mediated learning. c)Box plot showing the distance between pairs of odors before and after STDP. The difference between the mean distances before and after STDP was statistically significant at p = 0.02. d) Box plot showing the distance between pairs of odors before and after STDP for three different STDP protocols. Each STDP protocol had a different set of initial weights and randomly shuffled learning trials. The difference between the mean distances before and after STDP was statistically significant at p = 0.02. (e-f) The response of the MBONs was projected onto a 2D Euclidean plane while preserving the Hamming distance between points. Points in the figures corresponds to 40 odor trials. Each trial may belong to one of two similar odors. We used a linear discriminant model to classify odors as belonging to one of two classes depending on where it was mapped on the plane. Misclassified odors are shown in red. The number of misclassified odors after learning (f) were less that the number before learning (e).
https://doi.org/10.1371/journal.pcbi.1007461.g006 locust AL, ϕ is adaptively modulated by feedback inhibition and decreases with increasing concentration. Thus, the system seems wired to naturally move towards this optimum.
We hypothesized that changes in synaptic weights caused by experience-dependent plasticity could degrade what had been an optimal representation. However, our simulations show that, despite STDP-induced changes to the strength of the KC-MBON synapse, the value of optimal sparseness was maintained. This finding is particularly notable because the overall feedforward architecture of the insect olfactory system, featuring a near absence of feedback across layers, implies that downstream layers cannot 'error-correct' upstream representations. Thus, the connectivity between layers must assure that an optimal representation constructed in one layer continues to be optimal from the perspective of subsequent layers. Our model allowed us to explore the mechanism underlying the maintenance of optimal sparseness across circuit layers and despite neural plasticity.
In the locust olfactory system, odor representations are parceled into cyclic 50ms packets of information, a process that begins in the antennal lobe and cascades at least two synapses forward to the MBONs. This parcellation is maintained and stabilized against noise and other corruption by STDP that adjusts the strength of synapses when pre-synaptic input leads or lags post-synaptic output by tens of milliseconds (within an oscillatory cycle). Lateral inhibition across MBONs may further sharpen the odor representation.
We show that odor representations are optimally separated despite STDP dependent weight changes to the KC-MBON synapse. However, the goal of MBONs is not solely to separate odor representations. Presynaptic circuits already seem wired to achieve this goal. KC-MBON synapses are a locus for associative conditioning in insects [45] where octopamine mediates appetitive while dopamine mediates aversive conditioning. How are activity patterns (KC spike patterns that evoke an MBON response) associated with a reward signal? A causal interaction between a KC and an MBON can be reinforced or degraded by STDP that increases or decreases the conductance of the synapse. However, these dynamic weight changes alone cannot associate neural responses to a reward because the reward signal arrives long after the activity pattern to be rewarded has subsided. Associative conditioning requires two elements to be in order. First, the system must reliably encode the odor. Second, the reward signal must be paired with the right pattern of activity. The intervening time between the pattern to be rewarded and the reward itself is likely corrupted with random spikes. Theoretical studies posit that STDP evokes a synaptic "tag" that decays on a slow time scale and persists when a diffuse neuromodulatory signal like Octopamine or Dopamine is initiated by a reward [46]. The reward signal affects only those synapses that were potentiated by STDP and continue to exhibit traces of the "tag".
Thus, STDP plays two roles. One, it homeostatically regulates the MBON response. In the absence of such regulation, the density of MBON spikes would increase, potentially obscuring the differences between odor representations. A consequence of maintaining this homeostasis is, optimal odor representations remain optimal despite activity-dependent modulation of synaptic weights. Our paper examines this particular aspect of STDP in the absence of a reward signal. The second role of STDP becomes evident only when a reward is present. A sparse set of synapses are "tagged" by STDP, and the functional form of STDP for those synapses is modified. Associative conditioning is encoded as changes in a sparse set of KC-MBON synaptic weights. Therefore, though the sole purpose of MBONs is not pattern separation, its activity must not obscure optimality arrived at by presynaptic circuits.
The KC-MBON junction may be the location where the imperative of insect olfactory system changes from identifying the odor to associating the odor with other sensory and reward inputs. If so, MBONs may not require a precise representation of the odor. In fact, in Drosophila, the MBONs have been shown to be broadly tuned, and thus instantiate a representation more redundant than that of the population of narrowly tuned KCs. However, studies in locust have shown that the odor-elicited responses of MBONs, though densely spiking, are sensitive to the temporal ordering of KC input [35], and contain information about odor identity [47]. In our analysis we included the dynamics of MBONs throughout the odor stimulus, parsing its spike trains into 50 millisecond bins (equivalent to one oscillatory cycle in locusts) and calculating the ability of the system to discriminate odorants over the entire duration of the odor. Our study suggests that odor representations are maximally separated when the neural representation of the odor in the mushroom body is optimally sparse. Despite challenges, the olfactory circuit of insects maintains this optimal sparseness over variations in the concentration and experience dependent plasticity.

Methods
The model antennal lobe consisted of a scaled-down network of 350 PNs and 100 inhibitory interneurons (the locust antennal lobe contains roughly 830 PNs and 350 local neurons). Each neuron was modeled as a single compartment with voltage and calcium dependent currents with Hodgkin-Huxley kinetics. PNs generated Na + spikes while inhibitory interneurons generated Ca 2+ spikelets, as seen in the locust olfactory system [47]. The model of inhibitory interneurons included a Ca 2+ current (I Ca ) and a Ca 2+ dependent K current that caused spike rate adaptation. Model PNs included a fast sodium current I Ca , a fast potassium current I K [48], a transient potassium A-current I A [49], and a potassium leak current I KL . The equations governing the dynamics of the neurons are as follows, C m dV PN dt ¼ À g L ðV PN À E L Þ À I Na À I K À I A À g KL ðV PN À E KL Þ À I GABA A À I nACh À I ext1 ð1:1Þ C m dV LN dt ¼ À g L ðV LN À E L Þ À I Ca À I KðCaÞ À I K À g KL ðV LN À E KL Þ À I GABA A À I nACh À I ext2 ð1:2Þ The passive parameters of the model were set as follows. C M = 1.43×10 −4 μS, g L = 0.15μS and g KL = 0.05μS. E L = −55mV and E KL = −95mV. The passive parameters were set the same for both the PNs (subscript PN in all the equations) and the inhibitory local interneurons (subscript LN in the equations). The intrinsic currents governing the dynamics of each neuron is given below.
Sodium current I Na is given by, where, the Na conductance, g Na = 50μS and the reversal potential, E Na = 50mV. m and h are the activation and inactivation variables that are given by, The equations describing the potassium current I K for both PNs and inhibitory interneurons are as follows, where, g K = 10 and E K = −95. The activation variable of the K current is given by, where, n 1 ¼ a 3 a 3 þb 3 and t n ¼ 1 a 3 þb 3 . a 3 ¼ À 0 0:02ð30þVÞ

À �
A transient potassium current, I A , in PNs was described by the following equation,

À �
Fast GABAergic synapses between interneurons and between PNs and inhibitory interneurons were modelled using first order activation schemes. Similarly, nicotinic cholinergic input from PNs was used to drive the inhibitory interneurons. 50 of the 350 PNs extended excitatory input to the other PNs. All other PNs did not extend direct connections to each other. GABAergic and cholinergic synapses were both described by the following equations, where the reversal potential is E nAch = 0mV for cholinergic receptors and E GABA A ¼ À 70mV for fast GABA receptors.
[O] is the fraction of open channels that is calculated according to, d½O� dt ¼ að1 À ½O�Þ½T� À b½O� ð1:13Þ The rate constants, α = 10ms −1 and β = 0.16ms −1 for GABAergic synapses and α = 10ms −1 and β = 0.2ms −1 for cholinergic synapses. When the receptors are activated following a spike, the term [T] becomes non-zero. For cholinergic neurons this was modelled as the product of Heaviside functions in the following form, where, t 0 is the time of receptor activation, A = 0.5 and t max = 0.3ms. For GABAergic synapses,

Kenyon cells and MBONS
We modeled a large array (15000) of KCs and 100 MBONs. Given the large number of KCs, we modeled each as a two-dimensional map that can replicate in a computationally efficient way the dynamics of a variety of conductance-based neurons and networks of these neurons, but is computationally efficient [40,41]. KCs and MBONs were modeled as regular spiking cells governed by the following equations, x nþ1 ¼ f ðx n ; x nÀ 1 ; y n þ b n Þ ð1:16Þ where the function, f(x n ,x n−1 ,y n +β n ) is defined as, f ðx n ; x nÀ 1 ; y n þ b n Þ ¼ a=ð1 À x n Þ þ u for x n � 0 ¼ a þ u for 0 < x n < a þ u ¼ À 1 for x n � a þ u or x nÀ 1 > 0 ð1:17Þ where u = y n +β n μ = 0.0005. Both KCs and MBONs received feedforward excitatory input. We did not model any lateral inhibition in these layers. Synaptic input is described by the following equations, The KC-MBON synapse showed spike timing dependent plasticity. We modeled STDP using an online update rule. Each pre-synaptic KC spike activated a variable that decayed exponentially post activation in the absence of other spikes. The dynamics followed the equation, where, t f is the time at which a spike occurs. The effect of the spike on the weight of the KC-MBON synapse is given by the factor a + . In the absence of a spike the variable x decays exponentially to zero. A similar synaptic trace was defined to respond to postsynaptic spikes given by the following equation, The weight of the synapse evolved in response to the timing of the pre-and post-synaptic spikes according to the following equation, dðt À t f Þ À A À yðtÞ X n dðt À t f Þ ð1:21Þ Further, the factors A + and A − changed in a manner that depended on the current weight w (t) of the synapse. Increases in weight when the synapse was close to a maximum weight were lower in magnitude than when it was further away from W max . This was achieved by introducing soft bounds to the weight by setting A + = (W max −w)η + and A − = wη −