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 sigmoidal RNN (σRNN) and evaluate the reconstruction based on perturbation tests. B. Summary of the differences between a bioRNN and a σRNN. C. 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 ≈ 50%. D. Same as C during inactivation of area B. ΔpD = 0 is the recorded change of hit rate for the feedforward circuit RefCirc1, so a successful reconstruction achieves . E. Quantitative results on perturbation tests showing that σRNN achieves the lowest loss function on the unperturbed test trials, but only the bioRNN retains an accurate fit to the perturbed trials.
BioRNN is more robust to optogenetic perturbations than σRNN.
The table reports the trial matching (TM) loss ℒtrial on test trials, it measures the distance between the distributions of single trial network dynamics Sourmpis et al. (2023) in area A when stimulating area B. Column “no light” indicates values on the unperturbed test trials, and “light” the perturbation trials. ± indicates the 95% confidence interval, best values are shown in bold and major failure with distance above 0.5 is in red.
Reconstruction of network mechanisms.
A. RefCirc1 is feedforward and RefCirc2 is recurrent. B. The fitted RNNs are blind to the structural difference of RefCirc1 and 2 and must infer this from the spiking data. C. Raster plot showing an example trial of the bioRNN and σRNN models, neurons in red are mapped to inhibitory neurons. D. To study which model feature matters, bioRNN variants are defined by removing one of the features, for instance “No Dale’s law” refers to a bioRNN without weight sign constraints. Trial-averaged activity in area A under activation/inactivation of area B. All the RNNs are tested with the same reference circuit and training data (No spike and No Sparsity models are shown in Suppl. Fig. S4). E. Error between the change of hit probability after perturbations in the RNN and in the RefCirc ΔpD. F. The distance of network dynamics between each RNN and RefCirc (horizontal axis: light power in arbitrary units). G. Same quantity as D but averaged for each RNN under the strongest light power condition (averaging activations and inactivations of area B). Statistical significance in comparison with bioRNN is computed using the mean over multiple network initializations and is indicated with 0 to 4 stars corresponding to p-values thresholds: 0.05, 10−2, 10−3 and 10−4.
Trial-matching loss test loss Ltrial 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 ΔpD 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). The black circles refer to the hit rate change from the recordings, ΔpD. See Suppl. Fig. S7 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 Aravanis et al. (2007); Packer et al. (2015).
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, ℒtrial.
Trial averaged traces across RNN variants.
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.
In contrast to Figure 2E, 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.