Laboratory of Computational Neuroscience, Brain Mind Institute, School of Computer and Communication Sciences and School of Life Sciences, École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland
Laboratory of Sensory Processing, Brain Mind Institute, School of Life Sciences, École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland
Machine Learning Research Unit, Technical University of Vienna (TU Wien), Vienna, Austria
A. The three steps to reconstruct the reference circuit (RefCirc) using a biologically informed RNN (bioRNN) or a simgoidal RNN (σRNN) and evaluate the reconstruction based on perturbation tests. B. Summary of the differences between a bioRNN and a σRNN. C. Example raster plots for bioRNN1 and σRNN1, neurons fitted to spike trains from inhibitory cells in RefCirc are shown in red. D. Trial-averaged activity of area A of the two circuits during hit (black-dashed: RefCirc1; blue: bioRNN1; pink: σRNN1) and miss (grey-dashed: RefCirc1; light blue: bioRNN1; light pink: σRNN1) trials. All models display a hit rate of p 5 ≈ 0%. E. Same as D during inactivation of area B. is the recorded change of hit rate for the feedforward circuit RefCirc1, so a successful reconstruction achieves .
A. Parameters of bioRNN1, bioRNN2, σRNN1 and σRNN2 are optimized to reconstruct RefCirc1 or RefCirc2 from spiking recordings. The bioRNNs and σRNNs are blind to the structural difference of RefCirc1 and 2 and must infer this from the spiking data alone. BioRNN variants are defined by removing one of the biologically inspired features, for instance “No Dale’s law” refers to a bioRNN without sign constraints in the weight matrix, or removing the trial-matching loss function (No TM). B. Trial-averaged activity in area A under activation/inactivation of area B. Dashed black lines indicate the activity of RefCirc1 (thick dashed) and RefCirc2 (thin dashed). All the RNNs are tested with the same reference circuit and training data, each bioRNN model variant is shown with a different color. C. Error between the change of hit probability after perturbations in the RNN and in the RefCirc. D. The distance of network dynamics between each RNN and RefCirc, as a function of perturbation strength applied to area B (horizontal axis: light power in arbitrary units). E. Same quantity as D but averaged for each RNN under the strongest light power condition of perturbation of area B (activation/inactivation across the strongest power level). Statistical significance is computed using the mean over multiple network initializations and compared with the full bioRNN method, significance is indicated with 0 to 4 stars corresponding to p-values thresholds: 0.05, 0.01, 0.001 and 0.0001.
Trial-matching loss test loss ℒ trial of the different reconstruction methods with the real recordings from (Esmaeili et al., 2021) ± indicates the 95% confidence interval.
Predicting optogenetic perturbations for in vivo electrophysiology data
A. During a delayed whisker detection task, the mouse reports a whisker stimulation by licking to obtain a water reward. Jaw movements are recorded by a camera. Our model simulates the jaw movements and the neural activity from six areas. B. The experimentalists performed optogenetic inactivations of cortical areas (one area at a time) in three temporal windows. C. Example hit trial of a reconstructed network (left). Using the same random seed, the trial turns into a miss trial if we inactivate area wS1 (right, light stimulus indicated by blue shading) during the whisker period by stimulation of inhibitory neurons (red dots). D. Error of the change in lick frequency caused by the perturbation, is predicted by the model, and Δp𝒟 is recorded in mice. Light-shaded circles show individual reconstructed networks with different initializations. The whiskers are the standard error of means. E. Examples of hit rate changes under perturbation for wS1 (Top) and tjM1 (Bottom). See Suppl. Fig. S6 for the other areas.
Measuring circuit gradients with µ-perturbations
A-B. Numerical verification for equation (1). A shows the change of jaw movement ΔY following inactivations in a “No Spike” bioRNN. From left to right, we reduce the size of the spatiotemporal window for the optogenetic stimulation. B. Gradients values that approximate ΔY from A using equation (1). C-D. Verification that gradients predict the change of movement on single trials. In C, we display the gradients and jaw movement for three different trials, the neurons targeted by the µ-perturbation are boxed and the perturbed jaw movement is blue. Results averaged for every 100ms stimulation windows are shown in D: positive (resp. negative) modulated means that the 20 neurons with highest (resp. lowest) gradients are targeted, random neurons are selected for the shuffled case.
Gradient targeted µ-perturbations could precisely bias an animal behavior
A. Protocol to deliver an optimal µ-perturbation on the experimental preparation based on jaw gradients. (Step 1) The circuit is recorded until stimulation time t∗. (Step 2) The closest bioRNN trial to the ongoing recorded trial is retrieved from the databank. ℬ (Step 3) We select the neurons with the highest (or lowest) gradient value for the µ-perturbation. (Step 4) The µ-perturbation is delivered at t∗. B. Effect of the µ-perturbation using the artificial setup A under different light protocols. Practically, for “High gradient”, we keep step 3 as it is, for “Low gradient”, we change the sign of the gradient, and for “Zero gradient”, we pick the 40 neurons with lowest gradient norm. C. Speculative schematic of a close-up setup implementing the protocol A inspired by the all optical “read-write” setup from Packer et al. (2015).
The loss ℒ trial measures the distance between the network dynamics in single trials.
Here for the synthetic dataset, we report the distance between activity statistics in area A during stimulation of area B. The column “light” reports the distance between RNN and RefCirc dynamics during perturbation with the highest light amplitude, the column “no light” reports the same value when no stimulation is delivered. ± indicates the 95% confidence interval.
Modeling “optogenetic” perturbations.
A. Two different network hypotheses for implementing a detection task. In RefCirc1, area A projects to area B but not vice versa. In RefCirc2, the areas are recurrently connected. B. Raster plots of all neurons in RefCirc1 during a single hit trial under normal conditions (control, left) and under optogenetic perturbation of excitatory (middle) and inhibitory (right) neurons. The duration of the light stimulus is shown with a blue shading. C. Same for RefCirc2 D. Trial-averaged activity of the two circuits during Hit (blue: RefCirc1; green: RefCirc2) and Miss (yellow: RefCirc 1; red: RefCirc2) trials. A trial is classified as “Hit” if area A reaches a transient firing rate above 8Hz; and otherwise as “Miss”. For the control case, the maximal difference between the trial average activity of the two networks is below 0.51 Hz (zoom inset).
Fitting Reconstructed networks to the synthetic dataset.
A. Schematic representation of the RefCirc1 and bioRNN1. and probability of hit trials. B. Histogram of the firing rate distribution of the RefCirc1 and all the RNN1 versions. We observe that all RNN1 versions fit well with the RefCirc1. C. Left: Neuron loss of the different RNN1 variants. Right: Trial-matching loss of the different RNN1 variants. We observe that the model without the trial-matching loss function behaves considerably worse. The whiskers show the 95% confidence interval of the mean across trials. D-F. Same as A-B for RefCirc2 and RNNs2.
Picking the sparsity level.
A. Grid search for the optimal maximum regularization strength (λ3) without a drop in performance. As a performance measure, we used the trial-matching loss, Ltrial.
In contrast to Figure 2C, here we show separately the change of hit probability for RefCirc1 (left) and RefCirc2 (right).
Reconstruction of the real recordings.
A. Probability of hit trials of the different variant models. B. Histogram of the firing rate distribution from the real recordings and all the variants. C. Top: Neuron loss of the different RNN1 variants. All RNN versions have a similar loss value. Bottom: Trial-matching loss of the different model variants. We observe that the model without the trial-matching loss function behaves considerably worse. The whiskers show the 95% confidence interval.
A Change of lick probability under inactivation of all areas in all the different temporal windows. We show the Δp from the data and reconstruction model variants.