Article | Open | Published:

# Dynamic contrast enhancement and flexible odor codes

Nature Communicationsvolume 9, Article number: 3062 (2018) | Download Citation

## Abstract

Sensory stimuli evoke spiking activities patterned across neurons and time that are hypothesized to encode information about their identity. Since the same stimulus can be encountered in a multitude of ways, how stable or flexible are these stimulus-evoked responses? Here we examine this issue in the locust olfactory system. In the antennal lobe, we find that both spatial and temporal features of odor-evoked responses vary in a stimulus-history dependent manner. The response variations are not random, but allow the antennal lobe circuit to enhance the uniqueness of the current stimulus. Nevertheless, information about the odorant identity is conf ounded due to this contrast enhancement computation. Notably, predictions from a linear logical classifier (OR-of-ANDs) that can decode information distributed in flexible subsets of neurons match results from behavioral experiments. In sum, our results suggest that a trade-off between stability and flexibility in sensory coding can be achieved using a simple computational logic.

## Introduction

The key task of a sensory system is to transduce and represent information about environmental cues as electrical neural activities so that the organism may generate an appropriate behavioral response. The precise format in which neural activities represent stimulus-specific information i.e., ‘the neural code’ has been a topic of great debate in neuroscience1,2,3,4,5,6. Both patterns of spiking activities distributed across an ensemble of neurons7,8,9,10,11,12,13,14 (i.e., ‘the spatial code’), and the temporal features of these neural spike trains, such as their synchronicity15,16, relative response latencies17,18,19, dynamics4,20,21,22,23,24,25,26 (i.e. ‘the temporal code’) have been shown to be important for sensory coding. While stimulus-specific information exists in both spatial and temporal dimensions, what is not understood is the stability or constancy with which these neural coding schemes allow recognition of the same stimulus encountered in a variety of different ways. We examined this issue in this study.

Alternately, flexibility in sensory representation will be necessary for carrying out certain computations. Often, sensory cues encountered by an organism change dynamically, and the same sensory cue can be encountered in a variety of different contexts (for example, coffee beans in a coffee shop or in a perfume shop). Therefore, emphasizing novelty/uniqueness or suppressing/masking redundancies becomes necessary for detecting changes in the environment. Previous electrophysiological24,27,28,29,30, imaging31, and psychophysical32 studies do indeed reveal such interactions exist particularly when sensory cues are dynamically encountered. Can certain aspects of the neural responses be adapted to allow the flexibility needed for adaptive computations, while at the same time maintaining stable recognition of stimulus identity?

We examined this issue in the locust olfactory system. The insect olfactory system has been widely used for studying odor coding9,14,15,16,22,23,24,25,33,34,35,36. In this system, an odor stimulus is detected by olfactory receptor neurons (ORNs) in the antenna and the transduced electrical signals get relayed downstream to the antennal lobe (analogous to the olfactory bulb in the vertebrates). In the antennal lobe, cholinergic projection neurons (PNs) and GABAergic local neurons (LNs) interact to reformat the sensory input received from the ORNs. The spatiotemporal activity patterns of the PNs are thought to represent odor identity and intensity14,23,24,35,37,38. In this work, we examined how the spatial and temporal aspects of neural responses are altered when a target stimulus is delivered in several non-overlapping distractor–target odor sequences. Our results suggest a surprisingly simple neural encoding solution that provides an adequate trade-off between the representational stability needed for robust recognition and flexibility needed for adaptive sensory computations.

## Results

### PN responses vary depending on stimulus history

We began by examining how stable or variable were odor-evoked individual PN responses when the same stimulus was delivered with different stimulus histories. Variations in stimulus histories were introduced by delivering the same odorant (‘target stimulus’) in various distractor-target odor sequences. A 500 ms inter-stimulus interval was used to separate the two stimuli delivered. Five different odorants were used as distractor cues and two target stimuli were used in all our experiments (Fig. 1a, b). It is worth noting that the distractor odorants comprised of four odorants belonging to different functional groups (2octanol (2oct)—an alcohol, isoamyl acetate (iaa)—an ester, benzaldehyde (bzald)—an aldehyde, citral—a terpene), and a complex blend (apple). The target odorant comprised of an odorant that has been shown previously as suitable for associative conditioning (hexanol), and an innately attractive odorant (geraniol)24.

We found that although responses of individual PNs during solitary introductions of the target stimulus were reliable across trials, they were altered when the same stimulus was delivered with different stimulus histories (Fig. 1c, d). When compared to the solitary target odor responses, the number of spikes increased for some stimulus histories (e.g. PN2 2oct-hex vs. PN2 hex) but reduced for others (PN2 bzald-hex vs PN2 hex). Further, note that increase/decrease in target stimulus response was not based on the chemical similarity between the two cues delivered in the sequence. Our results indicate a simple rule for cross-talk: if a PN responded strongly to the first cue in the sequence (i.e., the distractor) then its response to the second stimulus (i.e. the target) was likely to be reduced. Alternately, if the spiking activity reduced below baseline levels during exposure to the distractor cue, then its response to the following target increased in most cases (all comparison made with respect to the response evoked by the solitary target stimulus; Supplementary Fig. 1a, b).

Next, we examined how the variations observed at the individual PN level affected the ensemble neural representation of the target stimuli. To visualize odor-evoked population PN responses, we used a dimensionality reduction analysis. Individual PN responses were aligned with the odor onset and binned in 50 ms time windows. The spike count per time bin of each PN became a vector component, and the spike counts of all recorded PNs in that same time bin were regarded as the high-dimensional neural response. The time series of high-dimensional PN responses during the entire target stimulus presentation (4 s duration) was then projected along three principal component axes (Methods). We found that introduction of the same stimulus generated not one ensemble neural response trajectory but a family of trajectories, one for each stimulus history. Further, consistent with the earlier studies24,34,36,38, we found that all introductions of the target stimuli generated ensemble neural trajectories that included a fast-transient response component (~1–1.5 s from odor onset) that subsequently stabilized into steady state responses. Notably, the direction of the high-dimensional vectors (indicates variation in the set of PNs activated), and the direction of their evolution (variation in spatiotemporal patterning) during the target stimulus presentation varied in a history-dependent manner. This can be clearly noted from the misalignment between the family of neural response trajectories generated during the exposure to the same target stimulus (Fig. 1e, f, Supplementary Movies 1, 2).

How distinct or separable are these responses generated by the same stimulus? To examine this, we used a supervised dimensionality reduction technique (linear discriminant analysis or LDA) that seeks to capture the differences between the ensemble neural responses evoked by the target odorant. Projecting the data along the LDA axes, we found that the target stimulus-evoked PN responses created multiple, separable clusters, one for each stimulus history with which it was presented (Fig. 1g, h, Supplementary Movies 3, 4). This qualitative observation was further quantified using a classification analysis (Supplementary Fig. 1c, d; see Methods). Therefore, we conclude that both at the individual and population levels, PN responses that are thought to mediate identification of an olfactory stimulus in the insect olfactory system can vary significantly when the same stimulus is encountered with different histories.

### Stimulus-history dependent contrast enhancement

Are these variations in odor-evoked ensemble neural responses random? To examine this issue, we compared the neural responses evoked by solitary and sequential presentations of the target stimulus with the distractor cue (Fig. 2a, b; Supplementary Fig. 2a, b). Our results indicate each olfactory stimulus evoked a closed-loop trajectory that evolved in a unique direction. As can be expected from our earlier analysis, the solitary and the sequential introductions of the same target stimulus generated two different neural response trajectories. As a rule, compared to the solitary target stimulus response, when presented following the distractor cue, the ensemble response trajectory shifted further away from the responses evoked by the distractor cue. This is consistent with individual and ensemble PN response analyses (Fig. 1c, d and Supplementary Fig. 3) where we found that during sequential presentations of the target stimulus, common neurons were suppressed (i.e. responds to both target and the preceding distractor stimulus), whereas those that responded uniquely to the target odorant tended to increase.

As a direct consequence, the angular separation between neural response trajectories of the target and distractor cues increased, which can be expected to enhance discriminability between these two odorants (i.e. contrast enhancement). To quantify this, we used a correlation analysis where we compared the similarity between ensemble PN activities evoked by the target stimulus and the distractor cue. We made this comparison for both the solitary exposure of the target stimulus and the sequential presentations (Fig. 2c, d; similar analysis but for later response segments shown in Supplementary Fig. 2c, d). As can be noted, the correlation between the distractor cue and the target stimulus significantly reduced during sequential presentation of the target stimulus. Further, the shift in the ensemble responses were predictable using a linear approximation where the target odor response was added with the target-minus-distractor response (i.e. uniqueness; see Supplementary Fig. 4). Hence, our results indicate that alterations in the ensemble neural responses allow the antennal lobe circuit to enhance the uniqueness of the target stimulus with respect to the preceding cue i.e., dynamic, history-dependent contrast enhancement.

### Same stimulus can activate varying combinations of neurons

To enhance contrast with different distractor odorants, the same target stimulus must activate a different subset of the PNs. So, we wondered if there exists a unique set of neurons that is activated during all the target stimulus presentations to allow stable recognition. To understand this, we classified the PN responses into ‘responsive’ or ‘non-responsive’ categories (Methods). We found that the percentage of neurons activated and the composition of the set of responding neurons varied when the same target stimulus was presented with different histories (Fig. 3a, b). Further, the percentage of PNs that consistently responded to all introductions of hexanol and geraniol (the two target stimuli) was a smaller fraction of the set that responded to the solitary introductions of these two target stimuli.

To represent the identity of the target stimulus, the set of neurons must be consistent as well as unique. So, we examined how many of these consistent neurons were also unique responders i.e. respond to target stimuli alone (Fig. 3c, d). Surprisingly, we found that there was not a single PN that responded uniquely and consistently to hexanol in all the conditions. Only 2% neurons responded uniquely and consistently to geraniol presented with different stimulus histories. Therefore, our results indicate that combinatorial code involving a consistent and unique set of neurons may not be a suitable approach for achieving stable recognition of a sensory stimulus encountered with varying stimulus histories.

### Temporal response features also vary with stimulus history

How robust are temporal features such as response latency and pattern of stimulus-evoked spike trains in allowing stable odor recognition? To examine this, we defined the response latency as the first time bin when a neuron’s response exceeded a certain threshold value (Methods; Supplementary Fig. 5a, b). We then classified neurons as early responders (latency <600 ms) or late/non-responders (latency >600 ms). Note that the early responders were PNs that responded before behavioral response onset (median ~600 ms24,35). For visualization, we represented this classification of the response latency across the ensemble of PNs as a color bar (Fig. 4a, b). The response latency vector was generated for different introductions of the target stimulus and is shown as a color bar to allow comparisons. Our results indicate that depending on the stimulus history, some of the early responding projection neurons to the solitary presentations of the target stimulus became late/non-responsive in the sequential presentations, while some of the late/non-responders became early responders. Furthermore, only a small subset of neurons consistently responded early to the target stimuli. Similar to the combinations of PNs activated (Fig. 3), the sets of consistent early responders that were also unique responders to the target stimuli were empty or near empty sets (Fig. 4c, d).

How robust are other features of PN responses such as the pattern of their stimulus-evoked spike trains? To examine this, we considered the evolution of trial-averaged PN spike counts over time (during the 4 s of target stimulus presentation) as the temporal response vector. We computed the correlation between the PN temporal response vectors generated by the same target stimulus presented with different stimulus histories (Supplementary Fig. 5c, d). The distribution of this temporal pattern similarity metric for each target-history combination revealed that more correlation values were closer to a value of ‘zero’ rather than ‘one’ (Fig. 4e, f). This indicated that the temporal patterns of PN spiking activities also change considerably with stimulus history.

Taken together, these results indicate that temporal features of PN responses are also highly variable and may not allow robust recognition of a stimulus when it is encountered with different stimulus histories.

### Robust behavioral recognition

Our electrophysiological results indicated that combinations of neurons and their temporal response features changed when the same stimulus was presented with different histories. Therefore, we wondered whether locusts can behaviorally recognize a conditioned stimulus if it is presented in a similar fashion. To determine this, we trained locusts using an appetitive-conditioning paradigm. Briefly, during the training phase, starved locusts were presented a conditioned stimulus (hexanol; also target stimulus in electrophysiology experiments) followed by a food reward (wheat grass) with significant stimulus-reward overlap (Methods). Six such training trials were sufficient for the locusts to learn the association between the olfactory cue and the reward. In an unrewarded test phase, locusts that learned this association between the stimulus and reward opened their sensory appendages close to their mouths called maxillary palps in anticipation of the reward. The distance between the palps was tracked using a custom-written software and used as a metric for successful recognition (Methods). Notably, responses of the trained locusts to the conditioned stimulus were consistent even when the same stimulus was presented multiple times without reward during the test phase. Therefore, we assayed the palp-opening responses of the trained locusts to the conditioned stimulus presented with varying stimulus histories (Fig. 5a–f).

We observed that trained locusts responded to the conditioned stimulus (hexanol) irrespective of whether it was presented solitarily or in a sequence following a distractor cue (Fig. 5g; Methods). While three of the five distractor cues did not elicit a palp-opening response (POR), two odorants (2oct and iaa) evoked POR responses that were weaker than those observed during solitary presentations of the conditioned stimulus (Fig. 5b–f, h). It is worth noting that both 2oct and iaa elicit PN responses that have considerable overlap with those evoked by hexanol35. So, there is some generalization of the learned POR response to these ‘similar’ odorants. Such olfactory generalizations have been reported in other invertebrate models39,40 and are consistent with our prior neural/behavioral results (2oct-hex odor pair24,35). Evaluation of POR responses to an expanded odor panel with five additional distractor-target odor sequences indicates that the behavioral responses of locusts are indeed highly selective to the trained odorant (Supplementary Fig. 6).

In sum, our behavioral data reveal that trained locusts were able to robustly recognize the conditioned stimulus.

### Decoding with an optimal linear classifier

Can the behavioral responses to distractor-conditioned stimulus sequences be predicted from the ensemble PN neural activities? To understand this, we first sought to determine whether the target can be robustly recognized in a distractor-target sequence (i.e. pairwise odor classification). For this approach, we used a linear optimal classifier (linear support vector machine11,41) to separate the target odorants from all five distractor stimuli (Fig. 6a). Surprisingly, we found that this was indeed feasible and the target stimulus can be robustly discriminated and recognized (Fig. 6b). Note that for ‘n’ neurons this approach would require ‘n + 1’ free parameters (n for the weight vector vsvm and 1 bias term). The PN responses to target odor and all the distractor odorants must be known to determine the right set of parameters. Furthermore, even though the classification results show that robust recognition of the target stimulus is feasible from the ensemble PN activities, it still does not match well with the behavioral POR observed for these stimuli. Particularly, it is worth noting that this approach did not generate the false positives for 2oct and iaa even though these odorants generated false PORs in the behavioral assay.

### Flexible neural decoder: OR-of-ANDs

We sought to determine the simplest approach to transform ensemble PN responses into behavioral PORs. To design this decoder, we exploited the observation that for pairs of target stimulus presentations with varying histories there was a substantial overlap in the set of neurons activated (Fig. 3a). However, when all stimulus histories were considered simultaneously, the set of consistent and unique PNs reduced significantly. Therefore, we reasoned that a decoder capable of exploiting information distributed in a flexible subset of neurons would allow robust recognition of the target stimulus.

To design the flexible classifier, we summed the contributions of all neurons activated by solitary introductions of the target stimulus and disregarded the contributions of all other projection neurons (i.e. weight of ‘1’ for each neuron activated by solitary introductions of the target stimulus, and ‘0’ for all others). Next, the classification threshold (m) was set to a value less than the number of neurons (n) assigned a weight of ‘1’ (i.e. m < n). It is worth to note that the classifier becomes analogous to an OR-of-ANDs logical operation: m-1 ANDs and n choose m ORs (or combinations) can generate an output of ‘target present’ from the classifier (Fig. 6c). Any m-out-of-n neurons that respond to the solitary introductions of the target stimulus are sufficient for robust recognition of the target stimulus. Also, note that the composition of the m neurons is allowed to vary across stimulus histories under this scheme.

We examined performances of both analog (PN firing rates were retained) or digital (binarized into ‘responsive’ and ‘non-responsive’) versions of this linear classifier (Fig. 6d—analog classifier, Supplementary Fig. 7—digital classifier). In both cases, the classification results from the OR-of-AND classifier revealed robust recognition of all presentations of the target stimulus. Interestingly, misclassifications were made for 2oct, iaa, and apple. It is worth noting that both 2oct and iaa evoked POR in locusts trained for recognizing hexanol. However, any further manipulation of classifier’s free parameter (i.e. threshold or value of m) to reduce misclassification for apple, resulted in overall recognition performance degradation.

An earlier work showed that following termination of an odor pulse, a nearly non-overlapping set of neurons are activated(OFF ensemble neural response)25. These odor-evoked OFF responses are stimulus-specific. More importantly, a pattern-match with the ON neurons allowed prediction of palp-opening response and a pattern-match with the OFF neurons were better indicators of palp-closing. Therefore, we modified the decoding scheme to include two OR-of-AND classifiers, one for monitoring similarity with the set of hex-ON neurons, and the other to track the similarity with the set of hex-OFF neurons. Note that the weight vectors used for the hex-ON and hex-OFF classifiers were highly non-overlapping (or orthogonal; Fig. 7a, b). Our results indicate that the performance of this ON–OFF flexible decoder (Fig. 7c–i) was comparable to the ON response model except for one important difference. We found that unlike 2oct and iaa, distractor cues that evoked POR, apple alone activated comparable pattern-matches with both hex-ON and hex-OFF neurons. When the classifier outputs were transformed into behavioral responses (Fig. 7i), these contributions canceled each other out (palp-opening vs. palp-closing). Therefore, the ON–OFF flexible decoder predicted mean POR trends that tightly matched with those observed in our behavioral experiments for all distractor-target odor sequences.

In sum, we conclude that a decoding scheme based on flexible combinations of neurons would allow stable recognition of an odorant while allowing the antennal lobe circuits to adapt their ensemble responses in a stimulus-history dependent manner.

## Discussion

What is the neural code for a sensory stimulus is a fundamental question in sensory neuroscience. Several encoding schemes that depend on a unique set of neurons activated (‘the combinatorial or spatial code’), or the temporal features of neural electric discharges (‘the temporal code’), or their combination (‘spatiotemporal schemes’) have been proposed for representing stimulus-specific information in sensory circuits. While it is well established that stimulus-specific information can indeed exist in both spatial and temporal dimensions, how robust are these schemes to extrinsic (for example, stimulus history27,35 or ambient conditions42), or intrinsic (for example, plasticity43 or internal-state, such as hungry vs. satiated44) perturbations? This is what we sought to determine in this study.

We examined the stability of neural representations to odorants when only the stimulus history was systematically varied. Surprisingly, this manipulation was enough to induce variations in spatial, temporal and spatiotemporal features of neural responses elicited by an odorant. Nevertheless, locusts trained to recognize a conditioned stimulus could robustly recognize and respond to the same. This mismatch between the lack of stability in the neural representation and robustness in behavior necessitated a re-examination of potential mapping schemes between neural inputs and behavioral outputs.

We used multiple decoding schemes to quantitatively examine whether robust odor recognition could be achieved when the same odorant was encountered with different stimulus histories. First, we used a linear support vector machine classifier that used n + 1 free parameters (where n is the number of neurons) to recognize the target odorant. Results from this approach revealed that although PN responses evoked by an odorant varied depending on the preceding stimulus, there was sufficient information to robustly recognize its identity. However, the behavioral predictions generated by this scheme mismatched with actual behavioral responses observed (Fig. 5). The false positives that we observed in the behavioral responses were not predicted using this decoding method.

Having determined that robust odor recognition was indeed possible, we next sought to determine the simplest possible decoding approach that would generate predictions consistent with the observed POR responses. For this purpose, we used a flexible decoding scheme (with ON responses only; Fig. 6d) that used only one tunable parameter. This simple scheme generated predictions that better matched with the actual behavioral responses, including the false positives. The only mismatch observed was the response to app. Although this scheme predicted a POR response to app, none were observed in the actual experimental data.

In a previous work25, we showed that the ensemble activity during (ON response) and immediately after (OFF response) odor exposure were orthogonal and highly non-overlapping in nature. Notably, we showed that the ON responses were a better indicator of when the locusts opened their palps, and the OFF responses were a better indicator of when the locusts closed their palps. So, we combined the outputs from two flexible decoding classifiers (i.e., flexible decoding with ON and OFF responses; uses two free parameters; Fig. 7b). One used the pattern match with the ON response template of the conditioned stimulus, the other did the same with the OFF-responses elicited by the conditioned stimulus. Notably, for the app odorant, the output of the flexible ON decoder and the flexible OFF decoder canceled each other out, thereby generating more accurate predictions of PORs elicited in our behavioral assay. In sum, our results indicate that a linear scheme that decodes information from flexible subsets of neurons was sufficient to transform variable neural responses to robust behavioral outputs.

The flexible decoding approach can be easily understood if the problem is recast as one of object recognition (Supplementary Fig. 8). A simple approach to recognize an object, say a ‘chair’, is to first segment it into simple features (such as 4 legs, seat, back rest, and hand rest). While the presence of all relevant features (all four features in this example) allows robust recognition of the prototype chair, it may not allow generalization when other instantiations of this object are presented. Therefore, to allow generalization, it would be necessary to relax the constraint that all the relevant features need to be present. Instead, determining the presence or absence of a meaningful subset of these features, any m features out of the possible n features (m < n), can be used for achieving robustness. Higher values of m allow more specificity, whereas lower values allow generalization. Our results indicate that such a decoding approach can indeed allow robust recognition of odorants presented with different stimulus histories (note that odor identity is analogous to the object to be recognized, and activation of a projection neuron is analogous to the presence of a feature). While results presented used weight vectors with components that were either a 0 or 1, we found further improvements in classification results could be achieved by using negative weights for non-responsive neurons (not shown).

Could such a flexible decoding scheme be implemented by the insect olfactory system? To understand this issue, it would be necessary to identify the basic components of the decoder: (i) convergence of input from multiple PNs onto downstream neurons, (ii) linear combination of the inputs, and (iii) a detection threshold that does not require all input neurons to be simultaneously co-active. Existing anatomical and functional studies have shown that downstream Kenyon cells in the mushroom body linearly combine inputs from multiple projection neurons45,46. Further, photostimulation of Kenyon cell dendritic claws in fruit flies have revealed that activating more than half of these input regions is sufficient for driving these cells to spike47 (i.e. n/2 < m < n is sufficient). Therefore, anatomical and functional evidences suggest that the downstream centers in the mushroom body can indeed implement such a decoding approach.

Our results also indicate that variations in the neural responses with stimulus history were not random. Rather, the response evoked by the current stimulus was reshaped to suppress overlap with the preceding cue and increase the responses of those PNs that responded uniquely to the current cue. This simple manipulation at the level of individual PNs resulted in contrast enhancement of population neural responses. Note that contrast enhancement in olfaction happens between stimuli over time, rather than in the spatial domain as in vision.

Could some or most of the results be simply explained due to mixing of vapors from the first delivered distractor stimulus with those from the target odorant (i.e. mixture coding)? A photo-ionization detector-based characterization of the stimulus overlap indicated that at least for some odorants (for example, 2oct followed by hex case), vapors from the first odor pulse lingered longer and overlapped with the target odor presentations (Supplementary Fig. 9). As can be expected, the overlap reduced as the gap between the two pulses was increased. Notably, our results indicate that hexanol presentation with a longer delay (2 s and 10 s after termination of distractor 2oct pulses) resulted in qualitatively similar contrast enhancement as that observed for shorter delays (Supplementary Fig. 10). These results indicate that the overlap between the first and second stimulus delivered in sequence is not necessary for the contrast enhancement results reported in this study.

Nevertheless, since there is some overlap between vapors for shorter latencies, we also examined how similar or different were the processing of the binary mixtures with the odor sequences. To do this, we reanalyzed a published dataset of hex and 2oct binary mixture and 2oct-short lag-hex odor sequences (lag: 0.25 or 0.5 s). We found that a binary mixture of these two odorants evoked responses that were an additive combination of two component neural activities. Therefore, the binary mixture odor responses traced an odor trajectory in-between the two component response trajectories (i.e. green trajectory (hex-2oct mixture) was in-between the red (hex) and the blue (2oct) trajectories; Supplementary Fig. 11). However, note that for both hexanol presentations, even with 0.25 and 0.5 s lag following 2oct, the responses elicited during hex presentations were more similar to hexanol than the binary mixture or the distractor. Further, the responses shifted away from the 2oct response trajectory (i.e. magenta trajectory) indicating contrast enhancement of hex-evoked responses with respect to the preceding 2oct stimulus. Together, these results indicate that the odorants encountered in sequential fashion are processed differently than simultaneously encountered odor mixtures.

How do trial-to-trial variations compare against the changes in neural responses observed across stimulus histories? We found that individual PN responses did vary considerably across trials (Supplementary Fig. 12a, b). However, at the ensemble level, responses were highly consistent across trials. Odor-evoked response during the early, mid and late set of trials were still aligned and traced trajectories that evolved in the same direction (Supplementary Fig. 2a, b). These results were further quantified using a correlation analysis which also confirmed that variability across trials was indeed less than those observed across stimulus histories (Supplementary Fig. 12c, d).

Can such dynamic contrast enhancement lead to other potential confounds? For example, how are PN responses altered when back-to-back pulses of the same odorant are presented? To determine this, we reanalyzed a recently published PN response dataset to two back-to-back pulses of hexanol (Supplementary Fig. 13). Our analysis revealed that in addition to a reduction in responses to the subsequent pulses36, a few PNs that did not respond to the first pulse were activated in the second pulse, and some responding to the first pulse were inactivated. Note that the same OR-of-ANDs classifier can robustly recognize the stimulus after this subtle response perturbation.

While our results do not provide mechanistic insights on how this adaptive computing may arise, a few candidate mechanisms can easily be identified. Activity-dependent synaptic depression between the sensory neurons and projections neurons48,49, interference due to stimulus-evoked OFF responses25, or adaptation at the level of sensory neurons50,51 can all contribute to the results observed in this study. Finally, while we perturbed odor-evoked neural responses using variations in stimulus histories, other factors such as ambient conditions (humidity, temperature, and air flow), presence of competing odorants, plasticity in central circuits have all been shown to introduce variations different from those that were examined here. Whether the same flexible decoding scheme proposed here can provide a generic framework for achieving trade-off between stability and flexibility remains to be determined.

## Methods

### Odor stimulation

Odor stimuli were delivered using a standard procedure24,25,35,36. The following odor panel was used: hexanol, geraniol, 2octanol, isoamyl acetate, benzaldehyde, citral, apple, and cyclohexanone. All odorants were diluted to their 1% concentration by volume (v/v) in mineral oil. A carrier stream of desiccated and filtered air stream (0.75 L min−1) was directed at the antenna to provide a constant flux. A constant volume (0.1 L min−1) from the odor bottle headspace (60 ml sealed bottles contained 20 ml diluted odor solutions) was injected into the carrier stream using a pneumatic pico-pump (WPI Inc., PV-820) during stimulus presentations. A vacuum funnel placed right behind the locust antenna ensured removal of odor vapors. Each solitary or sequential presentation of an odorant was delivered in a pseudo-randomized manner (blocks of 10 trials) with 60 s inter-trial intervals.

### Olfactory electrophysiology

Young locusts (Schistocerca americana) of either sex with fully developed wings (post fifth instar) were selected from a crowded colony. After immobilizing locusts, the brain was exposed, desheathed, and continually perfused with locust saline as reported previously36,52. Extracellular recordings from the antennal lobe were made using a 16-channel, 4 × 4 silicon probes (NeuroNexus). Each electrode contact pad was gold plated such that its impedance was in the 200–300 kΩ range. Raw extracellular signals were filtered between 0.3 and 6 kHz and amplified at 10 k gain using a custom-made 16-channel amplifier (Biology Electronics Shop; Caltech, Pasadena, CA). Raw data were acquired at 15 kHz sampling rate using a custom LabView data acquisition program.

### PN spike sorting

For spike sorting, we used a conservative approach that was described in earlier works53. We used the following criteria for the single-unit identification: cluster separation >5 noise s.d., the number of spikes within 20 ms <6.5%, and spike waveform variance <6.5 noise s.d. Using this approach, a total of 85 PNs were identified from 9 locusts (11 antennal lobes).

Similarly, 104 PNs were identified from 12 locusts (19 antennal lobes) for the data shown in Supplementary Fig. 10.

### Dimensionality reduction analyses

We used two-dimensionality reduction techniques for visualizing ensemble PN responses: principal component analysis (PCA) and linear discriminant analysis (LDA). For both analyses, spiking activity of each PN was binned in 50 ms non-overlapping time bins and averaged across trials. Spike counts of all recorded PNs were aligned with respect to the stimulus onset and concatenated to form an 85-dimensional PN response vector per 50 ms time window. Therefore, for each odorant, we obtained a response matrix of the following dimensions: 85 neurons (rows) × 80-time bins (columns; 4 s of activity).

To perform the PCA analysis shown in Fig. 1, we first concatenated the responses of the 85 PNs to solitary and sequential presentations of hexanol or geraniol (85 PNs × 480 time bins [6 presentations × 80 time bins]). Response covariance matrices (85 × 85) were computed for these concatenated data matrices. Each 85-dimensional PN response vector was then projected onto the three principal eigenvectors (for visualization).

PCA trajectories shown in Fig. 2 were computed using a different response covariance matrix. Here, the PN ensemble responses to three stimuli were concatenated to form the data matrix: solitary target stimulus (hex or ger; 4 s), solitary distractor stimulus (4 s), target stimulus after distractor stimulus (4 s of hex or ger exposure). This resulted in 85 PNs × 240 time bins data matrices [3 stimuli × 80 time bins].

For generating figures shown in Figs. 1, 2, PN responses after PCA dimensionality reduction were linked in the temporal order of occurrence to create odor trajectories. The pre-stimulus baseline activity in the first time bin was subtracted before plotting each response trajectory. The odor trajectories shown were also smoothed using a three-point moving-average, low-pass filter.

LDA dimensionality reduction41 analysis was also performed by first concatenating all high-dimensional PN response vectors that needed to be visualized. The projection vectors were determined such that they maximized separation between responses of different stimuli while at the same time also reducing variance within responses generated by a single stimulus.

### Confusion matrix calculations

To quantify variability across stimulus histories, we performed a classification analysis with a leave-one-trial-out cross validation (using the 85-dimensional PN responses). The test trial to be classified was assigned the same class label as the nearest cluster centroid (calculated using training samples that included hex or ger responses for different stimulus histories). The classification results are then shown as a confusion matrix in Supplementary Fig. 1c, d.

### PN response categorization

For analysis in this work, we classified projection neurons as ‘responders’ if the spike counts in any time bin during the stimulus presentation exceeded mean + 6.5 s.d. of pre-stimulus activity (2 s window just before onset of any stimulus). All PNs that did not meet this threshold were regarded as ‘non-responders'.

### Response latency for PNs

We defined PN response latency as the first 50 ms time bin when the criterion for the responsive neuron was met (i.e., spike counts exceed mean + 6.5 s.d. of pre-stimulus activity). For sequential presentations, the response latency was determined as the first time bin after the derivative of PSTH became positive (used in Fig. 4 and Supplementary Fig. 5).

### Support vector machine (SVM)

The PN response patterns to solitary introductions of hexanol, 2oct, iaa, bzald, cit, and app were used as training samples. We regarded this as a binary classification problem, where hex responses were considered as one class, and all other responses were regarded as the second class.

The separating hyperplane was found using an SVM classifier that maximizes the functional margin between the hyperplane and the classes41.

$$\gamma _i = y_i\left( {{\mathbf{v}}_{{\mathbf{svm}}}^{\mathrm{T}}{\mathbf{x}}_{\boldsymbol{i}} + b} \right),$$

where γi is the functional margin for the data point xi [85-dimensional PN spike counts in a 50 ms time bin], and yi is the true class label for the data point [1 for hex-ON and −1 for the rest]. The weight vector vsvm (also 85 dimensional; i.e. 85 free parameters to tune the model) plus the bias term b (86th model parameter), was calculated by solving the following optimization problem:

$${\rm min}_{\gamma,{\mathbf{v}}_{{\mathbf{svm}}},b}\frac{1}{2}|\left| {{\mathbf{v}}_{{\mathbf{svm}}}} \right||^2 + C\mathop {\sum }\limits_{i = 1}^m {\mathrm{\mu }}_i,$$$${\mathrm{s}}{\mathrm{.t}}{\mathrm{.}}\quad y_i\left( {{\mathbf{v}}_{{\mathbf{svm}}}^{\mathrm{T}}{\mathbf{x}}_{\boldsymbol{i}} + b} \right) \ge 1 - {\mathrm{\mu }}_i \; i = 1, \ldots ,m,$$$${\mathrm{\mu }}_i \ge 0,i = 1, \ldots ,m,$$

where m is the total number of data points in both the classes and μi is the slack variable that help us avoid overfitting while solving this optimization problem. This was done using fitcsvm in MATLAB by taking the box constraint to be 0.01. After determining the optimal weight vector $${\mathbf{v}}_{{\mathbf{svm}}}$$, we classified response patterns generated during sequential stimulus presentations as follows:

$$h\left( {{\mathbf{x}}({\mathbf{t}})} \right) = {\rm sign}\left( {{\mathbf{v}}_{{\mathbf{svm}}}^{\mathbf{T}}{\mathbf{x}}({\mathbf{t}}) + b} \right),$$

where x(t) is the 85-dimensional PN spike counts in a 50 ms time bin, the sign function results in ‘1’ when the input is classified as ‘hexanol present’ and ‘0’ corresponded to ‘hexanol absent.’ (used in Fig. 6a, b)

### Behavior experiments

Behavioral experiments were performed using locusts of either sex. All locusts used were from a crowded colony that was kept on a 12 h day–12 h night cycle (7 am–7 pm day). All behavioral experiments were performed between 10 am and 3:30 pm.

Locusts were starved for 24 h prior to their use in the appetitive-conditioning assay. The protocols that we used in this study for training locusts and tracking their palp movements were identical to an earlier study35. The odor delivery setup and the stimulus sequences used were identical to that described for the electrophysiology experiments.

Hexanol diluted in mineral oil (hex 1%) was used as the conditioned stimulus for all behavioral experiments in this study. Wheat grass was used as the unconditioned stimulus. During each training trial, the conditioned stimulus was presented for 6 s. Food reward was given 3 s after the onset of the conditioned stimulus. Food was given manually for the duration of ~10 s. The training phase included a total of six training trials with a 10-min interval between successive trials. Only locusts that accepted food reward in at least four out of the six training trials and had a palp-opening response (POR) in at least three training trials were regarded as ‘trained locusts’ and retained for the testing phase (75% of the locusts (30/40) fell into this category). The imaging software was not able to robustly track the palp movements of three of the trained locusts (3/30) and, therefore, these locusts were excluded from all analyses.

In the unrewarded testing phase, locust PORs were evaluated using six test trials. The first trial in all tests was the solitary presentation of 4 s of hexanol. This was done to ensure that trained locusts were able to recognize the solitary presentations of the trained stimulus (26/27 locusts had a strong POR to solitary hexanol). In the subsequent five trials, the conditioned stimulus was presented in non-overlapping two odor sequences used in electrophysiology experiments. The two odor stimulus sequences were presented in a pseudo-randomized manner. The inter-trial delay between test phase trials was set to at least 20 min.

Similar protocol was used for collecting the data shown in Supplementary Fig. 6. We tested for 5 additional distractor odors: neem oil, cyclohexanone (chex), geraniol (ger), L-carvone (L-carv), and methyl salicylate (m-sal). A total of 20 locusts (out of 30) met the training criteria described above.

### Locust response categorization

For analysis in Fig. 5g, h, we classified a locust to be ‘responsive’ when the POR to an odor presentation was 6.5 s.d. above pre-stimulus baseline response. Further, the POR during odor presentation had to remain >20% of its peak value for at least 1 s. All the other cases were marked as ‘non-responsive’.

### PID experiment

We used a fast photo-ionization detector (miniPID, Aurora Scientific) to characterize the dynamics of stimulus delivered. Raw data were amplified (gain = 5) and acquired at 15 kHz sampling rate using a custom LabView data acquisition program (Supplementary Fig. 9).

### Data availability

The data and code used in this study can be made available on reasonable request to the authors.

## Additional information

Publisher's note: Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## Change history

• ### 20 August 2018

This Article was originally published without the accompanying Peer Review File. This file is now available in the HTML version of the Article; the PDF was correct from the time of publication.

## References

1. 1.

Panzeri, S., Harvey, C. D., Piasini, E., Latham, P. E. & Fellin, T. Cracking the neural code for sensory perception by combining statistics, intervention, and behavior. Neuron 93, 491–507 (2017).

2. 2.

Jacobs, A. L. et al. Ruling out and ruling in neural codes. Proc. Natl Acad. Sci. USA 106, 5936–5941 (2009).

3. 3.

Bialek, W., Rieke, F., de Ruyter van Steveninck, R. R. & Warland, D. Reading a neural code. Science 252, 1854–1857 (1991).

4. 4.

Laurent, G. Olfactory network dynamics and the coding of multidimensional signals. Nat. Rev. Neurosci. 3, 884–895 (2002).

5. 5.

Stanley, G. B. Reading and writing the neural code. Nat. Neurosci. 16, 259–263 (2013).

6. 6.

Nicolelis, M. A. & Ribeiro, S. Seeking the neural code. Sci. Am. 295, 70–77 (2006).

7. 7.

Georgopoulos, A. P., Schwartz, A. B. & Kettner, R. E. Neuronal population coding of movement direction. Science 233, 1416–1419 (1986).

8. 8.

Choi, G. B. et al. Driving opposing behaviors with ensembles of piriform neurons. Cell 146, 1004–1015 (2011).

9. 9.

Kreher, S. A., Mathew, D., Kim, J. & Carlson, J. R. Translation of sensory input into behavioral output via an olfactory system. Neuron 59, 110–124 (2008).

10. 10.

Koulakov, A., Gelperin, A. & Rinberg, D. Olfactory coding with all-or-nothing glomeruli. J. Neurophysiol. 98, 3134–3142 (2007).

11. 11.

Mathis, A., Rokni, D., Kapoor, V., Bethge, M. & Murthy, V. N. Reading out olfactory receptors: feedforward circuits detect odors in mixtures without demixing. Neuron 91, 1110–1123 (2016).

12. 12.

Bell, J. S. & Wilson, R. I. Behavior reveals selective summation and max pooling among olfactory processing channels. Neuron 91, 425–438 (2016).

13. 13.

Semmelhack, J. L. & Wang, J. W. Select Drosophila glomeruli mediate innate olfactory attraction and aversion. Nature 459, 218–223 (2009).

14. 14.

Galan, R. F., Sachse, S., Galizia, C. G. & Herz, A. V. M. Odor-driven attractor dynamics in the antennal lobe allow for simple and rapid olfactory pattern classification. Neural Comput. 16, 999–1012 (2004).

15. 15.

Riffell, J. A., Lei, H. & Hildebrand, J. G. Neural correlates of behavior in the moth Manduca sexta in response to complex odors. Proc. Natl Acad. Sci. USA 106, 19219–19226 (2009).

16. 16.

Stopfer, M., Bhagavan, S., Smith, B. H. & Laurent, G. Impaired odour discrimination on desynchronization of odour-encoding neural assemblies. Nature 390, 70–74 (1997).

17. 17.

Cury, K. M. & Uchida, N. Robust odor coding via inhalation-coupled transient activity in the mammalian olfactory bulb. Neuron 68, 570–585 (2010).

18. 18.

Haddad, R. et al. Olfactory cortical neurons read out a relative time code in the olfactory bulb. Nat. Neurosci. 16, 949–957 (2013).

19. 19.

Junek, S., Kludt, E., Wolf, F. & Schild, D. Olfactory coding with patterns of response latencies. Neuron 67, 872–884 (2010).

20. 20.

Friedrich, R. W. & Laurent, G. Dynamic optimization of odor representations by slow temporal patterning of mitral cell activity. Science 291, 889–894 (2001).

21. 21.

Laurent, G., Wehr, M. & Davidowitz, H. Temporal representations of odors in an olfactory network. J. Neurosci. 16, 3837–3847 (1996).

22. 22.

Vickers, N. J., Christensen, T. A., Baker, T. C. & Hildebrand, J. G. Odour-plume dynamics influence the brain’s olfactory code. Nature 410, 466–470 (2001).

23. 23.

Stopfer, M., Jayaraman, V. & Laurent, G. Intensity versus identity coding in an olfactory system. Neuron 39, 991–1004 (2003).

24. 24.

Saha, D. et al. A spatiotemporal coding mechanism for backgroundinvariant odor recognition. Nat. Neurosci. 16, 1830–1839 (2013).

25. 25.

Saha, D. et al. Engaging and disengaging recurrent inhibition coincides with sensing and unsensing of a sensory stimulus. Nat. Commun. 8, 15413 (2017).

26. 26.

Bathellier, B., Buhl, D. L., Accolla, R. & Carleton, A. Dynamic ensemble odor coding in the mammalian olfactory bulb: Sensory information at different timescales. Neuron 57, 586–598 (2008).

27. 27.

Broome, B. M., Jayaraman, V. & Laurent, G. Encoding and decoding of overlapping odor sequences. Neuron 51, 467–482 (2006).

28. 28.

Bartlett, E. L. & Wang, X. Long-lasting modulation by stimulus context in primate auditory cortex. J. Neurophysiol. 94, 83–104 (2005).

29. 29.

Benucci, A., Ringach, D. L. & Carandini, M. Coding of stimulus sequences by population responses in visual cortex. Nat. Neurosci. 12, 1317–1324 (2009).

30. 30.

Morcos, A. S. & Harvey, C. D. History-dependent variability in population dynamics during evidence accumulation in cortex. Nat. Neurosci. 19, 1672–1681 (2016).

31. 31.

Sun, Y. et al. Neural signatures of dynamic stimulus selection in Drosophila. Nat. Neurosci. 20, 1104–1113 (2017).

32. 32.

Wegel, R. L. & Lane, C. E. The auditory masking of one pure tone by another and its probable relation to the dynamics of the inner ear. Phys. Rev. 23, 266–285 (1924).

33. 33.

Ito, I., Ong, R. C. Y., Raman, B. & Stopfer, M. Sparse odor representation and olfactory learning. Nat. Neurosci. 11, 1177–1184 (2008).

34. 34.

Mazor, O. & Laurent, G. Transient dynamics versus fixed points in odor representations by locust antennal lobe projection neurons. Neuron 48, 661–673 (2005).

35. 35.

Saha, D. et al. Behavioural correlates of combinatorial versus temporal features of odour codes. Nat. Commun. 6, 6953 (2015).

36. 36.

Brown, S. L., Joseph, J. & Stopfer, M. Encoding a temporally structured stimulus with a temporally structured neural representation. Nat. Neurosci. 8, 1568–1576 (2005).

37. 37.

Laurent, G., Wehr, M. & Davidowitz, H. Temporal representations of odors in an olfactory network. J. Neurosci. 16, 3837–3847 (1996).

38. 38.

Raman, B., Joseph, J., Tang, J. & Stopfer, M. Temporally diverse firing patterns in olfactory receptor neurons underlie spatiotemporal neural codes for odors. J. Neurosci. 30, 1994–2006 (2010).

39. 39.

Daly, K. C., Chandra, S., Durtschi, M. L. & Smith, B. H. The generalization of an olfactory-based conditioned response reveals unique but overlapping odour representations in the moth Manduca sexta. J. Exp. Biol. 204, 3085–3095 (2001).

40. 40.

Guerrieri, F., Schubert, M., Sandoz, J. C. & Giurfa, M. Perceptual and neural olfactory similarity in honeybees. PLoS Biol. 3, e60 (2005).

41. 41.

Bishop, C. M. Pattern Recognition and Machine Learning (Springer, New York, 2006).

42. 42.

Joseph, J., Dunn, F. A. & Stopfer, M. Spontaneous olfactory receptor neuron activity determines follower cell response properties. J. Neurosci. 32, 2900–2910 (2012).

43. 43.

Stopfer, M. & Laurent, G. Short-term memory in olfactory network dynamics. Nature 402, 664–668 (1999).

44. 44.

Min, S., Ai, M., Shin, S. A. & Suh, G. S. Dedicated olfactory neurons mediating attraction behavior to ammonia and amines in Drosophila. Proc. Natl Acad. Sci. USA 110, E1321–E1329 (2013).

45. 45.

Inada, K., Tsuchimoto, Y. & Kazama, H. Origins of cell-type-specific olfactory processing in the Drosophila mushroom body circuit. Neuron 95, 357–367 e354 (2017).

46. 46.

Jortner, R. A., Farivar, S. S. & Laurent, G. A simple connectivity scheme for sparse coding in an olfactory system. J. Neurosci. 27, 1659–1669 (2007).

47. 47.

Gruntman, E. & Turner, G. C. Integration of the olfactory code across dendritic claws of single mushroom body neurons. Nat. Neurosci. 16, 1821–1829 (2013).

48. 48.

Nagel, K. I., Hong, E. J. & Wilson, R. I. Synaptic and circuit mechanisms promoting broadband transmission of olfactory stimulus dynamics. Nat. Neurosci. 18, 56–65 (2015).

49. 49.

Kazama, H. & Wilson, R. I. Homeostatic matching and nonlinear amplification at identified central synapses. Neuron 58, 401–413 (2008).

50. 50.

Kurahashi, T. & Menini, A. Mechanism of odorant adaptation in the olfactory receptor cell. Nature 385, 725–729 (1997).

51. 51.

Nagel, K. I. & Wilson, R. I. Biophysical mechanisms underlying olfactory receptor neuron dynamics. Nat. Neurosci. 14, 208–216 (2011).

52. 52.

Saha, D., Leong, K., Katta, N. & Raman, B. Multi-unit recording methods to characterize neural activity in the locust (Schistocerca americana) olfactory circuits. J. Vis. Exp. 71, e50139(2013).

53. 53.

Pouzat, C., Mazor, O. & Laurent, G. Using noise signature to optimize spike-sorting and to assess neuronal classification quality. J. Neurosci. Methods 122, 43–57 (2002).

Download references

## Acknowledgements

We thank Dirk Albrecht (Worcester Polytechnic Institute), Shinung Ching Lab (Washington University in St. Louis), Keith Hengen Lab (Washington University in St. Louis), Nitin Gupta (Indian Institute of Technology, Kanpur), and members of the Raman Lab (Washington University in St. Louis) for feedback on the manuscript. This research was supported by an Office of Naval Research grant (N00014-16-1-2426) and an NSF CAREER grant (#1453022) to B.R.

## Author information

### Author notes

1. These authors contributed equally: Srinath Nizampatnam, Debajit Saha, Rishabh Chandak.

### Affiliations

1. #### Department of Biomedical Engineering, Washington University in St. Louis, St. Louis, 63130, USA

• Srinath Nizampatnam
• , Debajit Saha
• , Rishabh Chandak
•  & Baranidharan Raman
2. #### Department of Electrical and Systems Engineering, Washington University in St. Louis, St. Louis, 63130, USA

• Srinath Nizampatnam
•  & Baranidharan Raman

### Contributions

B.R. conceived the study and designed the experiments/analyses. S.N. did all the analyses, generated all the figures and wrote the first draft of the manuscript. D.S. and S.N. performed the electrophysiological recordings. R.C. did the behavioral experiments. B.R. revised the paper taking inputs from all the authors. S.N., D.S., and R.C. are equally contributing first authors.

### Competing interests

The authors declare no competing interests.

### Corresponding author

Correspondence to Baranidharan Raman.

## About this article

### DOI

https://doi.org/10.1038/s41467-018-05533-6

## Comments

By submitting a comment you agree to abide by our Terms and Community Guidelines. If you find something abusive or that does not comply with our terms or guidelines please flag it as inappropriate.