Abstract
Decisions are driven by the coordinated activity of diverse neural populations. Inhibitory neurons play a critical role in decision-making models, but technical challenges have left untested their role in vivo, both in novice and expert decision-makers. To understand the contribution of excitatory and inhibitory neurons to decision-making, we simultaneously measured their activity in mice judging the repetition rate of multisensory pulses. Individual inhibitory neurons were slightly more selective and more strongly correlated than excitatory neurons. Further, inhibitory ensemble activity could be decoded to predict trial-by-trial choice with similar accuracy as excitatory ensembles. Finally, population activity in both cell types changed in parallel as mice transitioned from novice to expert decision-makers: population activity gradually became more choice-selective and prompt. The observations advocate for models in which excitatory and inhibitory connectivity (1) preserves choice selectivity in both populations and (2) is fine-tuned with experience to support expert decision-making.
Main
Theoretical models have been influential in interpreting behavioral and neural measurements during perceptual decision-making1–4. Models that incorporate inhibitory neurons are widely accepted1,5, but key aspects of model architecture and connectivity remain untested. In some architectures, inhibitory neurons are part of a single pool that is broadly innervated by excitatory neurons (Fig. 1a top1,4,6). In alternative architectures, inhibitory neurons are selective, because of targeted connectivity with excitatory neurons (Fig. 1a bottom). Targeted connectivity is supported on theoretical grounds because of stability2,7, and has experimental support in the goldfish oculomotor integrator8. However, such models have not been tested in decision-making due to the challenges in identifying inhibitory neurons reliably and in large numbers.
Outside of decision-making, the selectivity and connectivity of inhibitory neurons is well studied. Excitatory neurons in most cases are sharply tuned to visual stimulus features9–13, reflecting their specific and non-random connectivity12–17. Inhibitory neurons are likewise tuned to stimulus features, though their tuning is often reported as broader10–12,18–21 (but see22). A growing body of evidence suggests that the tuning in inhibitory neurons arises from strong connectivity with excitatory neurons tuned for the same stimulus7,23,24.
The applicability of these findings for decision-making is unclear: the experiments were carried out mainly in V1, largely in passively viewing or anaesthetized animals. In decision-making, by contrast, areas beyond V1 are recruited, including the posterior parietal cortex (PPC)25–27. Further, decisions require the animal to learn, as novices, the abstract relationship between a sensory stimulus and a motor response, and then, as experts, report binary choices reliably. The computations needed to fulfill these requirements could rely on quite different circuits from those that are activated during passive viewing.
Here, we aimed to compare the responses of excitatory and inhibitory neurons during decision-making. We demonstrate that inhibitory neurons are selective for the animal’s choice, both at the single-neuron and population level. These results argue that in decision structures, as in V1, there are subnetworks of neurons with similar response properties, conferring network stability and robustness.
Simultaneous imaging of excitatory and inhibitory neurons during decision-making
To test how excitatory and inhibitory neurons coordinate during decision-making, we measured neural activity in transgenic mice. First, we trained mice to report decisions about the repetition rate of a sequence of multisensory events by licking to a left or right waterspout (Fig. 1b; Extended Data Fig. 1a). Trials consisted of a series of auditory clicks and visual flashes, simultaneously presented at a rate that fluctuated stochastically over a 1000 ms period28,29. Mice reported whether event rates were high or low compared to an abstract category boundary (16 Hz) that they learned with experience. Decisions depended strongly on stimulus rate: performance was at chance when the stimulus rate was at the category boundary, and was higher at rates further from the category boundary (Fig. 1c). A logistic regression model demonstrated that choice depends on the current evidence strength, previous choice outcome30, and the time passed since the previous trial (Extended Data Fig. 1b). We imaged excitatory and inhibitory neural activity by injecting a viral vector containing the calcium indicator GCaMP6f to layer 2/3 of mouse Posterior Parietal Cortex (PPC; 2mm posterior to Bregma, 1.7mm lateral to midline25,26,30–33). Mice expressed the red fluorescent protein tdTomato transgenically in all GABAergic inhibitory neurons. We used a two-channel two-photon microscope to record the activity of all neurons, a subset of which were identified as inhibitory neurons (Fig. 1d). This allowed us to measure the activity of excitatory and inhibitory populations in the same animal.
To detect neurons and extract calcium signals from imaging data, we leveraged an algorithm that simultaneously identifies neurons, de-noises the fluorescence signal and de-mixes signals from spatially overlapping components34,35 (Fig. 1e middle). The algorithm also estimates spiking activity for each neuron (Fig. 1e right). We refer to this as “inferred spiking activity”, for simplicity, acknowledging that estimating spikes from calcium signals is challenging36. Analyses were performed on inferred spiking activity. To identify inhibitory neurons, we first corrected for bleed-through from the green to the red channel. Next, we identified a subset of GCaMP6f-expressing neurons as inhibitory neurons based on the signal intensity on the red channel as well as the spatial correlation between red and green channels (Fig. 1d right, cyan circles). Inhibitory neurons constituted ~10% of the population, close to previous reports37.
Confirming previous reports31,32,38, we observed that the activity of individual neurons peaked at time points that spanned the trial (Fig. 1f,g). Diverse temporal dynamics were evident in both cell types (Fig. 1f,g). The inferred spiking activity was significantly higher for inhibitory compared to excitatory neurons throughout the trial, as expected10,39 (Fig. 1h; t-test, p<0.001). In the moments before the choice (97.1ms, average of 3 frames), this difference was clear (Fig. 1i) and significant for all mice (Fig. 1j). The probable differences in GCaMP expression levels and calcium buffering between excitatory and inhibitory neurons make a direct estimate of the underlying firing rates difficult39; however, the significant difference in the inferred spiking activity between excitatory and inhibitory neurons provides further evidence that we successfully identified two separate neural populations.
Individual inhibitory neurons are selective for the animal’s choice
To assess the selectivity of individual excitatory and inhibitory neurons for the decision outcome, we performed receiver operating characteristic (ROC) analysis40 on single-neuron responses. For each neuron, at each time point, we calculated the area under ROC curve (AUC) as a measure of the amount of overlap between the response distributions for ipsilateral vs. contralateral choices. A neuron was identified as “choice-selective” if its AUC value was significantly different from a constructed shuffled distribution (Extended Data Fig 2a; Methods), indicating that the neural activity was significantly different for ipsi-vs. contralateral choices (Fig. 2a, shaded areas mark choice-selective neurons).
Our analysis of choice selectivity in both cell types revealed that 13% of individual neurons were significantly choice selective for either ipsilateral or contralateral choices (Fig. 2b). Choice selectivity values computed on correct vs. error trials were positively correlated (Extended Data Fig 2c,d). Positive correlations indicate that the majority of neurons reflect the impending choice, as opposed to the sensory stimulus that informed it (Methods). Variability across mice in the strength of this correlation may indicate that the balance of sensory vs. choice signals within individual neurons varied across subjects (perhaps due to imaged subregions within the window, Extended Data Fig. 2e). Finally, we found that choice selectivity gradually increased during the trial, peaking just after the animal reported its choice (Fig. 2c).
A careful comparison of choice selectivity revealed that inhibitory neurons reflected the animals’ choice to a slightly greater extent than excitatory neurons. A slightly higher fraction of inhibitory neurons were choice selective (Fig. 2a,b; fraction choice selective: 15% of inhibitory neurons and 12% of excitatory neurons), and there was slightly stronger overall choice selectivity in inhibitory neurons (Fig. 2a,c,d).
The existence of similarly strong choice selectivity in excitatory and inhibitory neurons is a first hint that the connectivity between the two cell types preserves choice selectivity, suggesting non-random connections between inhibitory and excitatory neurons7,24. If choice selectivity is preserved because excitatory and inhibitory neurons with the same choice preference tend to be preferentially connected, one prediction is that excitatory and inhibitory neurons with the same choice selectivity will be more strongly correlated with each other compared to excitatory and inhibitory neurons with the opposite choice selectivity. This was indeed the case (Fig. 2e, dark green bars above light green bars). The stronger correlation between neurons with the same choice selectivity was also evident in pairs consisting of only excitatory or only inhibitory neurons (Extended Data Fig. 2e,f), in keeping with previous observations in V1 during passive viewing12,14,15.
The animal’s choice can be decoded with equal accuracy from both populations
The ability of individual inhibitory neurons to distinguish the animal’s choice, to at least the same extent as excitatory neurons, argues against decision-making models that assume a non-selective inhibitory population. However, the small choice selectivity in single neurons (Fig. 2d) limits confidence in this conclusion. To further evaluate the discrimination ability of inhibitory neurons, we leveraged our ability to measure hundreds of neurons simultaneously. Specifically, we examined the ability of a linear classifier (support vector machines, SVM41) to predict the animal’s choice from the population activity (cross-validated; L2 penalty; see Methods). We first performed this analysis on all neurons imaged simultaneously in a single session (Fig. 3a, left), training the classifier separately for every moment in the trial (97 ms bins).
Classification accuracy gradually grew after stimulus onset and peaked at the time of the choice (Fig. 3b, black). Performance was at chance on a shuffle control in which trials were randomly assigned as left or right choice (Fig. 3b, shuffled). The ability of the entire population of PPC neurons to predict the animal’s upcoming choice confirms previous observations25,27,31,32. As with the single neuron data (Extended Data Fig. 2c,d), analysis of error trials indicated that the animal’s choice, rather than the stimulus, was generally the key feature driving the high classification accuracy we observed (Extended Data Fig. 3).
We then examined classifier accuracy for excitatory and inhibitory populations separately. For excitatory neurons, we subsampled the population so that the total number of neurons matched the number of inhibitory neurons in the same session (Fig. 3a, middle). As expected, overall classification accuracy was reduced due to the smaller population size; although performance was still well above chance and the temporal dynamics were the same as when all neurons were included (Fig. 3b, blue trace). Finally, we included all inhibitory neurons (Fig. 3a, right). Remarkably, the classification accuracy of inhibitory neurons closely mirrored that of excitatory neurons during the course of a trial (Fig. 3b, red and blue traces overlap). Similar classification accuracy for excitatory and inhibitory populations was observed in all subjects (Fig. 3c).
One possibility is that our analysis obscured a difference between excitatory and inhibitory neurons because it evaluated their performance separately, rather than considering how these neurons are leveraged collectively in a classifier that can take advantage of both cell types. To test this, we examined the classifier that was trained on all neurons (Fig. 3a left; Fig. 3b black), and compared the classifier weights assigned to excitatory vs. inhibitory neurons. If excitatory and inhibitory neurons contributed equally to the decoder, they should be assigned comparable weights by the classifier. This is indeed what we found: the weight magnitudes of excitatory and inhibitory neurons were matched for the entire course of the trial (Fig. 3d; absolute value of weights). Also the distributions of weights were overlapping (Fig. 3e: weights of all neurons of all mice. Fig. 3f: absolute weights). The comparable classifier weights for excitatory and inhibitory neurons demonstrate that both cell types were similarly informative about the animal’s upcoming choice. The average weights assigned by the classifier were slightly higher for inhibitory neurons (Fig. 3d-f), perhaps reflecting the slightly stronger choice selectivity in single neurons (Fig. 2d).
Finally, we tested whether excitatory and inhibitory populations are synergistic such that choice can be decoded more accurately from a mixed population. This could occur if excitatory and inhibitory populations have different sources of noise42,43. To assess this possibility we trained the classifier on a population that included half excitatory and half inhibitory neurons (Fig. 3g bottom), and compared its choice-prediction accuracy with the classifier that was trained on a population of the same size, but consisted only of excitatory neurons (Fig. 3g top). We found similar classification accuracy for both decoders during the entire trial (Fig. 3h,i), arguing against a synergistic effect of a mixed population and in favor of shared noise sources across all neurons.
Excitatory and inhibitory populations reflect the animals’ choice with similar stability
If excitatory and inhibitory neurons are connected within subnetworks with frequent cross talk, the two populations should not only predict the animal’s choice with similar accuracy, as shown above, but also with similar temporal dynamics. To assess this, we quantified each population’s stability: the extent to which a classifier trained at one moment could successfully classify neural activity as preceding left vs. right choice at different moments. If population-wide patterns of activity are similar over time (e.g., all neurons gradually increase their firing rates), classifiers trained at one moment can accurately classify neural activity at different moments. Excitatory and inhibitory populations might differ in this regard, with one population more stable than the other.
As the gap between testing and training time increased, a gradual drop occurred in the classifier accuracy, as expected (Fig. 4a,b). This drop in accuracy occurred at a very similar rate for excitatory and inhibitory populations (Fig. 4b). To quantify this, we determined the time window over which the classifier accuracy was within 2 standard deviations of the accuracy at the same training-testing time window (Fig. 4c). This was indistinguishable for excitatory and inhibitory neurons (Fig. 4d; Extended Data Fig. 4a). An alternate method for assessing stability, computing the angle between pairs of classifiers trained at different time windows, likewise suggested that excitatory and inhibitory populations are similarly stable (Extended Data Fig. 4c).
Correlated variability is higher in the inhibitory population
Our single-neuron analysis (Fig. 2) demonstrated that choice selectivity is slightly higher in inhibitory neurons; however, our population analysis demonstrated similar fidelity of the population code for choice in inhibitory vs. excitatory neurons (Fig. 3b,c). This discrepancy could be due to different amounts of shared variability, or noise correlations, in the two populations. Noise correlations are activity patterns that are correlated among neurons and vary across repeated presentations of the same input. Our dataset, which included simultaneous activity from hundreds of neurons, was especially well-suited to assess noise correlations: correlations can have a large effect at the population level even when their effect at the level of neuron pairs is small42,43.
To examine how noise correlations affected classification accuracy, we sorted neurons based on their individual choice selectivity and added them one by one to the population (from highest to lowest choice selectivity defined as |AUC-0.5|). We measured classification accuracy for each of these neuronal ensembles of increasingly bigger size. Classification accuracy improved initially as more neurons were included in the decoder, but quickly saturated (Fig. 5a black; 97–0 ms before the choice).
To understand why classification accuracy saturates, we tested the effect of noise correlations on classification accuracy. Specifically, we created “pseudo populations”, in which each neuron in the population was taken from a different trial (Fig. 5a gray). This removed noise correlations because those are shared across neurons within a single trial. Higher classification accuracy in pseudo populations compared to real populations indicates the presence of noise that overlaps with signal, constraining information. This is what we observed (Fig. 5a, gray trace above black trace). Across all mice, removing noise correlations resulted in a consistent increase in classification accuracy for the population including all neurons (Fig. 5b; filled vs. open circles). This establishes that correlations limit classification accuracy in the full population.
To test the hypothesis that inhibitory neurons are more correlated than excitatory neurons, we compared the strength of pairwise noise correlations for excitatory vs. inhibitory neurons (Fig. 5c,d). Inhibitory pairs had significantly higher noise correlations compared to excitatory pairs (Fig. 5,d). Similar results were observed when we measured correlations during spontaneous activity (Extended Data Fig. 5b). Importantly, we obtained the same results even when we restricted the analysis to those inhibitory and excitatory neurons that had the same inferred spiking activity (Extended Data Fig. 5c,d). This was done because the higher spiking activity of inhibitory neurons (Fig. 1h-j) could potentially muddle the comparison of pairwise noise correlations between excitatory and inhibitory neurons. These findings confirm previous studies that suggested the dense connectivity between inhibitory neurons leads to stronger correlations among inhibitory neurons compared to other cell types12,23. Also, similar to previous reports12,23, we found intermediate correlations for pairs consisting of one inhibitory neuron and one excitatory neuron (Extended Data Fig. 5). The higher correlations in inhibitory neurons offer insight into why individual inhibitory neurons are slightly more choice selective than excitatory neurons (Fig. 2), yet at the ensemble level, both neuronal populations reflect choice with near-equal accuracy (Fig. 3).
Inhibitory neurons mirror excitatory neurons during the course of learning
Our observations thus far argue that excitatory and inhibitory neurons are similarly choice selective and similarly stable, in keeping with the hypothesis that they form selective subnetworks24 according to their functional properties7. To distinguish whether these subnetworks are present in naïve animals or arise with experience, we measured neural activity as animals transitioned from novice to expert decision-makers. To achieve this, we leveraged the data from 3 mice in which the same neural population was imaged throughout learning (35–48 sessions; Extended Data Fig. 6a), to compare the dynamics of choice signal in excitatory and inhibitory populations over the course of learning.
Classification accuracy increased consistently as the animals became experts (Fig. 6a,d). This effect was significant in all animals and was present in both excitatory and inhibitory neurons (Fig. 6d). In all populations, classification accuracy was strongly correlated with the animal’s performance across training days (Fig. 6b).
Accurate classification of choice also became more prompt: it appeared progressively earlier in the trial as the animals became experts. Initially, classification accuracy was high only after the choice (Fig. 6a; e.g. black arrow). As the animals gained experience, high classification accuracy was evident progressively earlier in the trial, long before the choice (Fig. 6a; e.g. gray arrow). This resulted in a negative correlation between animal’s performance and the onset of super-threshold choice accuracy across training days (Fig. 6c). This effect was significant in all animals and was present in both excitatory and inhibitory neurons (Fig 6e).
Importantly, animal’s licking or running behavior could not explain the learning-induced changes in the magnitude of choice classifier (Extended Data Fig. 7). The center-spout licks that preceded the left vs. right choices were overall similar over the course of learning (Extended Data Fig. 7a), and did not differ in early vs. late training days (Extended Data Fig. 7b).
The similarity in lick movements for early vs. late sessions stands in contrast to the changes in the choice classifier for early vs. late sessions (Fig. 6). We also assessed animals’ running behavior during the course of learning (Extended Data Fig. 7c,d). In some sessions, the running distance differed preceding left vs. right choices (Extended Data Fig. 7c). Fortunately, when we restricted our analysis to days in which the running distance was indistinguishable for the two choices (97–0ms before the choice, t-test, P>0.05), we nonetheless were able to accurately classify the animal’s choice using neural activity (Extended Data Fig. 7d). These observations provide reassurance that the population activity does not entirely reflect preparation of licking and running movements and argues instead that the population activity reflects the animal’s stimulus-informed choice. Nevertheless, the correlation between movements and choice that we report here and others have observed44 argues that the link between movements, neural activity and decision-making must be more deeply investigated.
Finally, we studied how cofluctuations changed over the course of training. Pairwise correlations in neural activity were overall higher in early training days, when mice were novices, compared to late training days, as they approached expert level behavior (Fig. 6f, unsaturated colors above saturated colors). This effect was observed for all combinations of neural pairs (Fig. 6f, green: excitatory-inhibitory; blue: excitatory-excitatory; red: inhibitory-inhibitory). These findings are in agreement with previous reports suggesting that learning results in reduced noise correlations45–47, enhancing information that is encoded in neural populations42,48. To test if the learning-induced increase in classification accuracy (Fig. 6a,b,d) was all a consequence of the reduction in noise correlations (Fig. 6f), we studied how classification accuracy of pseudo populations (Fig. 5a,b), which lack noise correlations, changed with training. Interestingly, we still observed a significant increase in the classification accuracy of pseudo populations as a result of training (Extended Data Fig. 8a,b). Therefore, the reduction in noise correlations cannot alone account for the improved choice prediction that occurs in the population with training.
Discussion
Despite a wealth of studies assessing selectivity of inhibitory neurons during passive viewing of sensory stimuli, little is known about whether these principles extend to decision-making. This represents a critical gap in knowledge because many decision-making models rely on inhibitory neurons. To close this gap, we measured excitatory and inhibitory populations during perceptual decisions about multisensory stimuli.
We demonstrated that inhibitory populations can predict the animal’s impending choice with the same fidelity as excitatory populations. This advocates for specific connectivity between excitatory and inhibitory neurons that preserves selectivity for choice2. These observations are significant because they argue that decision circuits share the subnetwork structure characterized in primary sensory areas in which excitatory neurons target specific inhibitory populations24 with similar tuning7.
Our additional observations likewise suggest commonalities between decision circuits in PPC and sensory circuits in V1. In V1, inhibitory neurons are more interconnected20,39,49 and share more common input12 compared to excitatory neurons. Further, noise correlations are proportional to the tuning similarity of neurons14,15. Similarly, we found that among inhibitory neurons, noise correlations were stronger than among excitatory neurons, and that in both populations noise correlations were stronger between neurons selective for the same choice.
As mice learned the decision-making task, noise correlations gradually decreased while classification accuracy increased (Fig. 6). Multiple studies have shown that correlated variability changes with cognitive processes, such as perceptual learning and attention45–47,50. Here, the reduced noise correlations may partially account for the improved classification accuracy with learning. However, the reduction in noise correlations is unlikely to be the sole mechanism supporting the behavioral improvement: even in the absence of noise correlations, choice selectivity in the population increased with learning (Extended Data Fig 6a-b). Future experiments using causal manipulations will reveal whether the increased choice selectivity we observed in PPC originates there or is inherited from elsewhere in the brain.
We have brought to decision-making an approach that has been instrumental for understanding how incoming inputs are processed in early sensory areas7,9,11,12,21,22,36,51,52,10,53,54. Our results advocate for models in which the connectivity preserves the choice selectivity in inhibitory neurons, even as they are barraged with input from excitatory neurons. This targeted connectivity may implement a canonical neural computation, as it is present in early sensory areas and oculomotor areas, and is implicated on theoretical grounds because of stability and robustness2,7.
Methods
Imaging and behavioral dataset
Our simultaneous imaging and decision-making dataset includes 135 sessions from 4 mice (45, 48, 7, and 35 sessions per mouse). Median number of trials per session is 213, 253, 264, and 222, for each mouse. On average, 480 neurons were imaged per session, out of which 40 neurons were inhibitory and 330 were excitatory. Approximately 100 neurons per session were not classified as either excitatory or inhibitory since they did not meet our strict cell-type classification criteria (see below). In 3 of the mice, the same group of neurons was imaged throughout learning (35–48 training days).
Mice and surgical procedure
Gad2-IRES-CRE55 mice were crossed with Rosa-CAG-LSL-tdTomato-WPRE (aka Ai1456) to create mice in which all GABAergic inhibitory neurons were labeled. Adult mice (~2-month old) were used in the experiments. Meloxicam (analgesic), dexamethasone (anti-inflammatory) and Baytril (enrofloxacin; anti-biotic) were injected 30min before surgery. Using biopsy punch, a circular craniotomy (diameter: 3mm) was made over the left PPC (stereotaxic coordinates: 2 mm posterior, 1.7 mm lateral of bregma26 under isoflurane (~5%) anesthesia. Pipettes (10–20 um in diameter, cut at an angle to provide a beveled tip) were front-filled with AAV9-Synapsin-GCaMP6f (U Penn, Vector Core Facility) diluted 2X in PBS (Phosphae-buffered saline). The pipette was slowly advanced into the brain (Narishige MO-8 hydraulic micro-manipulator) to make ~3 injections of 50nL, slowly at an interval of ~5–10min, by applying air pressure using a syringe. Injections ware made near the center of craniotomy at a depth of 250–350um below the dura. A glass plug consisting of a 5mm coverslip attached to a 3mm coverslip (using IR-curable optical bond, Norland) was used to cover the craniotomy window. Vetbond, followed by metabond, was used to seal the window. All surgical and behavioral procedures conformed to the guidelines established by the National Institutes of Health and were approved by the Institutional Animal Care and Use Committee of Cold Spring Harbor Laboratory.
Imaging
We used a 2-photon Moveable Objective Microscope with resonant scanning at 30 frames per second (Sutter Instruments, San Francisco, CA). A 16X, 0.8 NA Nikon objective lens was used to focus light on fields of view of size 512×512 pixels (~575 μm × ~575 μm). A Ti:sapphire laser (Coherent) delivered excitation light at 930nm (average power: 20–70 mW). Red (ET670/50m) and green (ET 525/50m) filters (Chroma Technologies) were used to collect red and green emission light. The microscope was controlled by Mscan (Sutter). In mice in which chronic imaging was performed during learning, the same plane was identified on consecutive days using both coarse alignment, based on superficial blood vessels, as well as fine alignment, using reference images of the red channel (tdTomato expression channel) at multiple magnification levels. For each trial, imaging was started 500ms before the trial-initiation tone, and continued 500ms after reward or time-out.
Decision-making behavior
Mice were gradually water restricted over the course of a week, and were weighed daily. Mice harvested at least 1 mL of water per behavioral/imaging session, and completed 100–500 trials per session. After approximately one week of habituation to the behavioral setup, 15–30 training days were required to achieve 75% correct choice. Animal training took place in a sound isolation chamber. The stimulus in all trials was multisensory, consisting of a series of simultaneous auditory clicks and visual flashes, occurring with Poisson statistics57,58. Stimulus duration was 1000ms. Each pulse was 5ms; minimum interval between pulses was 32ms, and maximum interval was 250ms. The average repetition rate of the pulses varied between 5 to 27 Hz. The category boundary for marking high-rate and low-rate stimuli was 16Hz, at which animals were rewarded randomly on either side. The highest stimulus rates used here are known to elicit reliable, steady state flicker responses in retinal ERG in mice59,60.
Mice were on top of a cylindrical wheel and a rotary encoder was used to measure their running speed. Trials started with a 50ms initiation tone (Extended Data Fig. 1a). Mice had 5sec to initiate a trial by licking the center waterspout, after which the multisensory stimulus was played for 1 second. If mice again licked the center waterspout, they received 0.5 μL water on the center spout; also a 50ms go cue was immediately played. Animals had to report a choice by licking to the left or right waterspout within 2sec. Mice were required to confirm their choice by licking the same waterspout one more time within 300ms after the initial lick. If the choice was correct, mice received 2–4μL water on the corresponding waterspout. An incorrect choice was punished with a 2sec time-out. The experimenter-imposed inter-trial intervals (ITI) were drawn from a truncated exponential distribution, with minimum, maximum, and lambda equal to 1sec, 5sec, and 0.3sec, respectively. However, the actual ITIs could be much longer depending on when the animal initiates the next trial. Bcontrol28 with a Matlab interface was used to deliver trial events (stimulus, reward, etc) and collect data.
Logistic regression model of behavior
A modified version of the logistic regression model in61 was used to assess the extent to which the animal’s choice depends on the strength of sensory evidence, i.e. how far the stimulus rate is from the category boundary at 16Hz, the previous choice outcome (success or failure) and ITI, i.e. the time interval between the previous choice and the current stimulus onset (Extended Data Fig. 1b). where p is the probability of choosing the left choice, and z is the decision variable. R, S and F are vectors of indicator variables; each element corresponds to 1 trial. Stimulus strength (R) was divided into 6 bins (R1 to R6). Previous success (S) was divided into 2 bins (S1 to S2): success after a long ITI (> 7sec) and success after a short ITI (< 7sec). Previous failure (F) was divided into 2 bins (F1 to F2): failure after a long and short ITI. For instance, if a trial had stimulus strength 3Hz, and was preceded by a success choice with ITI 5sec, we will set all R, S and F parameters to 0, except for R2 and S1, which will be set to 1, indicating that the trial’s stimulus strength was in bin 2, and it was preceded by a success whose ITI was in bin 1 (Extended Data Fig. 1b).
For each session the scalar coefficients β0, βr1 to βr6, βs1, βs2, βf1 and βf2 were fitted using Matlab glmfit.m. Extended Data Fig. 1b left shows βr1 to βr6. Extended Data Fig. 1b middle shows βs1 and βs2, and Extended Data Fig. 1b right shows βf1 and βf2.
ROI extraction and deconvolution
The recorded movies from all trials were concatenated and corrected for motion artifacts by cross-correlation using DFT registration62. Subsequently, active ROIs (sources) were extracted using the CNMF algorithm34 as implemented in the CaImAn package35 in MATLAB. The traces of the identified neurons were ∆F/F normalized and then deconvolved by adapting the FOOPSI deconvolution algorithm34,63 to a multi-trial setup. More specifically, for each component, the activity trace over all the trials was used to determine the time constants of the calcium indicator dynamics as in34. Then the neural activity during each trial was deconvolved separately using the estimated time constant and a zero baseline (since the traces were ∆F/F normalized). A second order exponential was used to simulate the rise and decay of the indicator. The deconvolved neural activity (spikes) was normalized such that a deconvolved value of 1 corresponded to a spike that could generate a calcium transient that reaches a maximum 100% ∆F/F value (Fig. 1e). Spikes with amplitudes less than 0.5x the noise level were discarded.
Neuropil Contamination removal
The CNMF algorithm demixes the activity of overlapping neurons, also from background neuropil activity by explicitly modeling the neuropil activity as a low rank spatiotemporal matrix34. In this study a rank two matrix was used to capture the neuropil activity. To evaluate its efficacy we compared the traces obtained from CNMF to the traces from a “manual” method similar to36 (Extended Data Fig. 9): the set of spatial footprints (shapes) extracted from CNMF were binarized by thresholding each component at the 0.2x its maximum value level. The binary masks were then used to average the raw data and obtain an activity trace that also included neuropil effects. To estimate the background signal, an annulus around the binary mask was constructed with minimum distance 3 pixels from the binary mask and width 7 pixels (Extended Data Fig. 9a). The average of the raw data over the annulus defined the background trace, which was then subtracted from the activity trace. The resulted trace was then compared with the CNMF estimated temporal trace for this activity. The comparison showed a very high degree of similarity between the two traces (Extended Data Fig. 9; example component; r=0.96), with the differences between the components being attributed to noise and not neuropil related events. Note that this “manual” approach is only applicable in the case when the annulus does not overlap with any other detected sources. These results demonstrate the ability of the CNMF framework to properly capture neuropil contamination and remove it from the detected calcium traces.
ROI inclusion criteria
We excluded poor-quality ROIs identified by the CNMF algorithm based on a combination of criteria: 1) size of the spatial component, 2) decay time constant, 3) correlation of the spatial component with the raw ROI image built by averaging spiking frames, 4) correlation of the temporal component with the raw activity trace, and 5) the probability of fluorescence traces maintaining values above an estimated signal-to-noise level for the expected duration of a calcium transient35 (GCaMP6f, frame rate: 30Hz). A final manual inspection was performed on the selected ROIs to validate their shape and trace quality.
Identification of inhibitory neurons
We used a two-step method to identify inhibitory neurons. First, we corrected for bleed-through from green to red channel by solving the following common-slope regression model (“common” because it finds a single slope for all ROIs): where ri is the average of pixels that belong to ROI ‘i on the mean projection image of the red channel. Similarly gi is the average of pixels of that same ROI, but on the mean projection image of the green channel and β is an offset. We solved this equation simultaneously for all ROIs to get s, a common slope, which reflected the fraction bleed-through from green to red channel. Then we used this slope (s) to compute the bleedthrough-corrected image of the red-channel (I): where R is the mean projection image of the red channel, and G is the mean projection of the green channel.
Next, we identified inhibitory neurons on the bleedthrough-corrected image (I) using two measures. 1) A measure of local contrast, by computing, on the red channel, the average pixel intensity inside each ROI mask relative to its immediate surrounding mask (width=3 pixels). Given the distribution of contrast levels, we defined two threshold levels, TE and TI. ROIs whose contrast measure fell above TI were identified as inhibitory neurons. ROIs whose contrast measure fell below TE were identified as excitatory neurons, and ROIs with the contrast measure in between TE and TI were not classified as either group (“unsure” class). 2) In addition to a measure of local contrast, we computed for each ROI the correlation between the spatial component (ROI image on the green channel) and the corresponding area on the red channel. High correlation values indicate that the ROI on the green channel has a high signal on the red channel too; hence the ROI is an inhibitory neuron. We used this correlation measure to further refine the neuron classes computed from the local contrast measure (i.e. measure 1 above). ROIs that were identified as inhibitory based on their local contrast (measure 1) but had low red-green channel correlation (measure 2), were reset as “unsure” neurons. Similarly, ROIs that were classified as excitatory (based on their local contrast) but had high red-green channel correlation were reclassified as unsure. Unsure ROIs were included in the analysis of all-neuron populations (Fig. 3a left); but were excluded from the analysis of excitatory only or inhibitory only populations (Fig. 3a middle, right). Finally, we manually inspected the ROIs identified as inhibitory to confirm their validity. This method resulted in 8.3% inhibitory neurons, which is fairly in agreement with previous studies, although slightly lower than some reports37. This was expected given our strict method for identifying inhibitory neurons. The inhibitory population is likely biased towards parvalbumin positive (PV) neurons, because 1) we found higher inferred spiking activity for our inhibitory neurons (Fig. 1h-j) which is expected for PV neurons39; 2) PV cells are the most prevalent interneurons in cortical circuits64.
General analysis procedures
All analyses were performed on inferred spiking activity. Traces were down-sampled, so each bin was the non-overlapping moving average of 3 frames (97.1ms). Inferred spiking activity for each neuron was normalized so the max spiking activity for each neuron equaled 1. The trace of each trial was aligned to the time of the choice (i.e. the time of the 1st lick to either of the side waterspouts after the go tone). Two-tailed t-test was performed for testing statistical significance. Summary figures including all mice were performed on the time bin preceding the choice, i.e. 97–0ms before choice onset. All reported correlations are Pearson’s coefficients. Analyses were performed in Python and Matlab.
ROC analysis
The area under the ROC curve (AUC) was used to measure the choice preference of single neurons. Choice selectivity was defined as the absolute deviation of AUC from chance level (0.5). To identify significantly choice-selective neurons, for each neuron we performed ROC on shuffled trial labels (i.e. left and right choices were randomly assigned to each trial). This procedure was repeated 50 times to create a distribution of shuffled AUC values for each neuron (Extended Data Fig. 2a, “shuffled”). A neuron’s choice selectivity was considered to be significant if the probability of the actual AUC (Extended Data Fig. 2a, “real”) being drawn from the shuffled AUC distribution was less than 0.05.
Decoding population activity
A linear SVM (Python sklearn package) was trained on each bin of the population activity in each session (non-overlapping 97ms time bins). To break any dependencies on the sequence of trials, we shuffled the order of trials for the entire population. To avoid bias in favor of one choice over the other, we matched the number of left- and right-choice trials used for classifier training. L2 regularization was used to avoid over-fitting. 10-fold cross validation was performed by leaving out a random 10% subset of trials to test the classifier performance, and using the remaining trials for training the classifier. This procedure was repeated 50 times. A range of regularization values was tested, and the one that gave the smallest error on the validation dataset was chosen as the optimal regularization parameter. Classifier accuracy was computed as the percentage of testing trials in which the animal’s choice was accurately predicted by the classifier, and summarized as the average across the 50 repetitions of trial subsampling. A minimum of 10 correct trials per choice was required in order to run the SVM on a session. Inferred spiking activity of each neuron was z-scored before running the SVM.
When comparing classification accuracy for excitatory vs. inhibitory neurons, the excitatory population was randomly sub-sampled to match the population size of inhibitory neurons to enable a fair comparison (Fig. 3, blue vs. red). To compare the distribution of weights in the all-neuron classifier (Fig. 3 black), the weight vector for each session was normalized to unity length (Fig. 3d-f).
Stability
To test the stability of the population code, decoders were trained and tested at different time bins65 (Fig. 4). To avoid the potential effects of auto-correlation, we performed cross validation not only across time bins, but also across trials. In other words, even though the procedure was cross validated by testing the classifier at a time different from the training time, we added another level of cross-validation by testing on a subset of trials that were not used for training. This strict method allowed our measure of stability duration to be free of auto-correlation impacts.
As an alternative measure of stability, the angle between pairs of classifiers that were trained at different moments in the trial was computed (Extended Data Fig. 4c). Small angles indicate alignment, hence stability, of the classifiers. Large angles indicate misalignment, i.e. instability of the classifiers.
Noise correlations
Noise correlations were assessed at the level of the population as well as the neuron pairs. To estimate noise correlations at the population level, the order of trials was shuffled for each neuron independently. Shuffling was done within the trials of each choice, hence retaining the choice signal, while de-correlating the population activity to remove noise correlations. Then we classified population activity in advance of left vs. right choice (at time bin 97–0 ms before the choice) using the de-correlated population activity. This procedure was performed on neural ensembles of increasingly bigger size, with the most selective neurons (|AUC-0.5|) added first (Fig. 5a). To summarize how noise correlations affected classification accuracy in the population (Fig. 5b), we computed, for the largest neural ensemble (Fig. 5a, max value on the horizontal axis), the change in classifier accuracy in the de-correlated data (“pseudo populations”) vs. the original data. This analysis was only performed for the entire population; the small number of inhibitory neurons in each session prevented a meaningful comparison of classification accuracy on real vs. pseudo populations.
To measure pairwise noise correlations, we subtracted the trial-averaged response to a particular choice from the response of single trials of that choice. This allowed removing the effect of choice on neural responses. The remaining variability in trial-by-trial responses can be attributed to noise correlations, measured as the Pearson correlation coefficient for neuron pairs. We also measured noise correlations using the spontaneous activity defined as the neural responses in 97–0ms preceding the trial initiation tone (Extended Data Fig. 2f; Extended Data Fig. 5b). We computed the pairwise correlation coefficient (Pearson) for a given neuron with each other neuron within an ensemble (e.g., excitatory neurons). The resulting coefficients were then averaged to generate a single correlation value for that neuron. This was repeated for all neurons within the ensemble (Fig. 5c).
To compute pairwise correlations on excitatory and inhibitory neurons with the same inferred spiking activity (Extended Data Fig. 5c,d), we computed the median of inferred spiking activity across trials for individual excitatory and inhibitory neurons in a session. The medians were then divided into 50 bins. The firing-rate bin that included the maximum number of inhibitory neurons was identified (“max bin”); inhibitory and excitatory neurons whose firing rate was within this “max bin” were used for the analysis. The firing rates were matched for these neurons because their median firing rate was within the same small bin of firing rates. Pairwise correlations were then computed as above.
Learning analysis
In 3 of the mice, the same field of view was imaged each session during learning. This was achieved in two ways. First, the vasculature allowed a coarse alignment of the imaging location from day to day. Second, the image from the red channel was used for a finer alignment. Overall, most neurons were stably present across sessions (Extended Data Fig. 6). This allowed us to assess the population activity of a similar group of neurons during learning.
“Early days” (Fig. 6; Extended Data Fig. 8) included the initial training days in which the animal’s performance, defined as the fraction of correct choices on easy trials, was lower than the 20th percentile of performance across all days. “Late days” (Fig. 6; Extended Data Fig. 8) included the last training days in which the animal’s behavioral performance was above the 80th percentile of performance across all days.
To measure the timing of decision-related activity (Fig. 6c,e), we identified all sessions in which classifier accuracy was significantly different than the shuffle (t-test, p<0.05) over a window of significance that was at least 500 ms long. We defined the “choice signal onset” (Fig. 6c,e) as the trial time corresponding to the first moment of that window. Sessions in which the 500 ms window of significance was present are included in Fig. 6c. The number of points (and hence the relationship between session number and color in Fig. 6c) differs slightly across the three groups. This is because on some sessions, the window of significance was present in one group but not another. For example, in a session the population including all neurons might have a 500 ms window of significance, hence it will contribute a point to Fig. 6c left, while the population with only inhibitory neurons might be only transiently significant for <500ms, hence it will be absent from Fig. 6c right.
Data and Software Availability
The CNMF algorithm is publicly available on github: https://github.com/flatironinstitute/CaImAn-MATLAB
Code availability
All codes will be made publicly available on github before publication.
Author Contributions
Conceptualization and Writing: FN and AKC. Experiments and Analysis: FN. Decoding methodology and common-slope regression model: GFE, JPC and FN. Spike-inference methodology: EAP. Funding Acquisition, Resources and Supervision: AKC.
Acknowledgements
We thank Hien Nguyen for help with training mice, Matt Kaufman, Kachi Odoemene, Fred Marbach for technical assistance and thoughtful conversations. We thank Peter Latham, Robin Cao for helpful discussions on decision-making models. We thank Andrea Giovannucci for help with ROI inclusion criteria #5. We thank Ashley Juavinett, Simon Musall, and Sashank Pisupati for helpful discussions and feedback on the manuscript. The work was supported by the Simons Collaboration on the Global Brain, ONR MURI, the Klingenstein-Simons Foundation and the Pew Charitable Trust. Extended data Figure 1. Perceptual decisions about stimulus rate reflect current evidence, previous trial’s outcome, and the time passed since the previous trial.