Bayesian inference of neuronal assemblies
Bayesian inference of neuronal assemblies
Diana, Giovanni;Sainsbury, Thomas T. J.;Meyer, Martin P.
2019-10-31 00:00:00
a1111111111 In many areas of the brain, both spontaneous and stimulus-evoked activity can manifest as a1111111111 a1111111111 synchronous activation of neuronal assemblies. The characterization of assembly structure a1111111111 and dynamics provides important insights into how brain computations are distributed a1111111111 across neural networks. The proliferation of experimental techniques for recording the activ- ity of neuronal assemblies calls for a comprehensive statistical method to describe, analyze and characterize these high dimensional datasets. The performance of existing methods for defining assemblies is sensitive to noise and stochasticity in neuronal firing patterns and OPENACCESS assembly heterogeneity. To address these problems, we introduce a generative hierarchical Citation: Diana G, Sainsbury TTJ, Meyer MP model of synchronous activity to describe the organization of neurons into assemblies. (2019) Bayesian inference of neuronal assemblies. Unlike existing methods, our analysis provides a simultaneous estimation of assembly com- PLoS Comput Biol 15(10): e1007481. https://doi. position, dynamics and within-assembly statistical features, such as the levels of activity, org/10.1371/journal.pcbi.1007481 noise and assembly synchrony. We have used our method to characterize population activ- Editor: Claus C Hilgetag, University Medical Center ity throughout the tectum of larval zebrafish, allowing us to make statistical inference on the Eppendorf, Hamburg University, GERMANY spatiotemporal organization of tectal assemblies, their composition and the logic of their Received: June 10, 2019 interactions. We have also applied our method to functional imaging and neuropixels record- Accepted: October 9, 2019 ings from the mouse, allowing us to relate the activity of identified assemblies to specific Published: October 31, 2019 behaviours such as running or changes in pupil diameter. Peer Review History: PLOS recognizes the benefits of transparency in the peer review process; therefore, we enable the publication of all of the content of peer review and author Author summary responses alongside final, published articles. The editorial history of this article is available here: Characterization of the structure and dynamics of population activity can provide insight https://doi.org/10.1371/journal.pcbi.1007481 into how computations are distributed within neural networks. Here we develop a new Copyright:© 2019 Diana et al. This is an open statistical method to describe patterns of synchronous activity in neural population access article distributed under the terms of the recordings. Our method can accurately describe how neurons are organized into co-active Creative Commons Attribution License, which populations (assemblies) and reveals dynamic features of assemblies such as their firing permits unrestricted use, distribution, and pattern, firing duration, and the degree of synchronous and asynchronous firing of their reproduction in any medium, provided the original constituent neurons. We demonstrate how our technique can be used to dissect complex author and source are credited. neuronal population recording data into its behaviorally relevant components. Data Availability Statement: Our C++ software implementing the inference method described in this work together with custom R-scripts to reproduce the analysis are publicly available on the This is a PLOS Computational Biology Methods paper. GitHub repository https://github.com/ giovannidiana/BINE. The recordings from the PLOS Computational Biology | https://doi.org/10.1371/journal.pcbi.1007481 October 31, 2019 1 / 31 Bayesian inference of neuronal assemblies zebrafish tectum are publicly available on figshare: Introduction https://doi.org/10.6084/m9.figshare.9994799.v1. Donald Hebb proposed that neural circuits are specifically built to enable the generation of Funding: Martin Meyer was financially supported sequential activity patterns and that through synaptic plasticity, coactive neurons would be by a Wellcome Trust Investigator Award bound together into Hebbian assemblies—groups of neurons that tend to be coactive. Recent MPM:204788/Z/16/Z (https://wellcome.ac.uk). The advances in multineuronal recording techniques such as calcium imaging and neuropixels funders had no role in study design, data collection probes have revealed that a hallmark of population activity is indeed the organization of neu- and analysis, decision to publish, or preparation of the manuscript. rons into assemblies [1–6]. Furthermore, activation of specific assemblies has been shown to correlate with diverse aspects of brain function from encoding of sensory stimuli to generation Competing interests: The authors have declared of motor output [6–8]. Thus, neural assemblies are increasingly believed to be the units of that no competing interests exist. brain computation [9, 10]. The characterization of assembly structure and dynamics may therefore provide crucial insights into how brain computations are distributed across neural networks. However, quantitatively identifying and extracting features of assemblies based on popula- tion firing statistics is challenging. Neurons can fire independently of the assembly of which they are a member and not all neurons within an assembly are recruited when the assembly fires. Assemblies can also exhibit temporal overlap or hierarchical organization, which makes it difficult to distinguish them from one another. Neurons may not participate in assembly activity at all, in which case their activity contributes to noise in the data. Finally, assemblies themselves may be of different sizes, have different activity rates, and neurons within them may be recruited over different timescales. In the absence of a quantitative definition of neuronal assemblies, previous works applied heuristic methodologies such as dimensionality reduction techniques (e.g. principal compo- nent analysis, PCA) combined with factor analysis and graph-theoretic methods to character- ize assemblies [5, 6, 8, 11–15]. Common to all these approaches is that they generate an abstract representation of the data. For example PCA describes the data in terms of principal components while spectral clustering requires embedding activity patterns in a network (see Materials and methods for details). These approaches present significant problems when try- ing to determine the correct number of assemblies present in neuronal recordings. PCA-based methods assume that this number is equal to the number of principal components required to describe the variance of the data that cannot be explained by chance according to theoretical bounds or null models obtained by shuffling the data. Graph-theoretic approaches rely on the fidelity of a graph representation and the equivalence of neuronal assemblies to network com- munities in the graph. However the construction of the representative network requires several arbitrary decisions (number of nearest neighbours and similarity matrix, for instance) which are not directly related to biological features. In instances where the data are clearly structured into synchronous events and there is minimal noise these methods can perform well [16]. However, these methods can lead to erroneous conclusions about how neurons are organised into assemblies as noise and data complexity increase [16]. The poor performance of some of the current analysis pipelines is perhaps not surprising given that standard clustering algo- rithms are mainly used as exploratory tools and not for statistical inference. Importantly, because information about the level of structure in the data is generally not known a priori, the accuracy of these estimations is also not known. Furthermore, because these methods are not based on statistical inference, their conclusions cannot be supported by statistical evidence. In order to address these problems we have developed a method that is specifically tailored to neuronal data where data features such as noise, level of within-assembly synchrony and assembly activity are directly estimated from the data and simultaneously used to cluster neu- rons into assemblies. We have developed a hierarchical model of neuronal activity and used Bayesian inference to fit the observed synchrony among neurons with our model. The method PLOS Computational Biology | https://doi.org/10.1371/journal.pcbi.1007481 October 31, 2019 2 / 31 Bayesian inference of neuronal assemblies allows us to obtain information about assembly structure and dynamics from the recorded population activity, without the need of dimensionality reduction or similarity measures. By employing statistical inference, neurons are grouped into assemblies based on the most likely scenario that is consistent with the data and the model assumptions. Our method generates probabilistic estimates of assembly ON/OFF states over time and within-assembly statistical features such as synchronous and asynchronous firing probabilities. A common issues in all existing methods is the difficulty of determining how many assemblies are present in neuronal population activity data. In our Bayesian method, this number is also estimated from the data by introducing the Dirichlet process, which allows us to treat the number of assemblies as any other model parameter. In our method all the assumptions underlying the definition of neuronal assemblies are transparent and explicitly stated as parameters in the model. Furthermore, because our model is grounded on Bayesian inference, all our conclusions are supported by statistical evidence. Earlier works have used Bayesian estimation of neural connectivity in the context of realistic models of neural dynamics such as the leaky integrate-and-fire model [17, 18]. However, the complexity of these models introduces scalability issues when applied to large datasets. To determine the range of applicability of our method we tested it on simulated data and compared its performance against existing techniques over a broad range of sample size, assembly number and assembly features. We demonstrate that (1) our method outperforms existing techniques over a broad range of conditions and (2) our method provides optimal inference when testing data are simulated from the same generative model used for inference. Using our method we have characterized neuronal assemblies from large-scale functional imaging data obtained from zebrafish tectum and mouse visual cortex, and from a neuropixels probe located in mouse visual cortex, hippocampus and thalamus [19]. We demonstrate that our method can provide a statistically rigorous approach to identifying assemblies, their intrin- sic dynamics, interactions and coordinated activation and deactivation during behavior. Results Bayesian statistics Given a model which describes observations in terms of a set of unobserved (latent) features Z and model parameters θ, the aim of Bayesian statistics is to quantify the probability distribu- tion of parameters and latent variables conditional to the data using the Bayes’ theorem data likelihood prior zfflfflfflfflfflfflfflffl}|fflfflfflfflfflfflfflffl{ zffl}|ffl{ PðZ; yjdataÞ / Pðdata; ZjyÞ� PðyÞ ð1Þ which expresses this probability in terms of the likelihood of observing the data (given the model parameters) and the prior distribution of the parameters which represents our a priori knowledge about the model. In the context of neuronal activity, the latent variables Z describe how neurons are organized into assemblies. Therefore, to perform statistical inference, we first need to introduce a model which allows us to calculate the likelihood of both observed neuro- nal activity and the latent configuration representing assembly structure. The generative model In this section we outline our approach to characterize neuronal activity of N neurons orga- nized into A assemblies for M time frames. We assume that each neuron belongs to one assem- bly and denote their memberships by vector of integer labels {t ,���, t } between 1 and A. The 1 N state of all assemblies over time is specified by a binary matrix ω (0 = “off”, 1 = “on”) of size PLOS Computational Biology | https://doi.org/10.1371/journal.pcbi.1007481 October 31, 2019 3 / 31 Bayesian inference of neuronal assemblies M × A. In the following we will adopt the shorthand notation μ = {i2 {1,���, N}: t = μ} to indi- cate the set of neurons assigned to the same assembly μ. Vectors of parameters will be denoted by dropping their indexes, i.e. p� {p ,���, p }. The neuronal memberships and the assembly 1 A activity matrix are unobserved variables that we want to estimate from the observed neuronal activity data. Our model is specified by the following three generative steps: (1) draw neuronal member- ship t from a categorical distribution with probabilities n , μ = 1, . . ., A. (2) draw indepen- i μ dently the activity states ω = {0, 1} of assembly μ at time k from a Bernoulli distribution with kμ assembly-specific probabilities p � P(ω = 1). (3) draw the activity of all neurons at all times, μ kμ denoted by the binary matrix s , from the conditional probability ik l ðzÞ � Pðs ¼ 1jo ¼ zÞ ð2Þ t ik kt i i which depends on the state z2 {0, 1} of the corresponding assembly t . The parametersλ (1) i μ andλ (0) represent the probabilities of any of the neurons belonging to the assembly μ to fire when the assembly is active or inactive respectively. From here onward we will refer toλ (0) as the level of asynchrony in the assembly and toλ (1) as assembly synchrony, characterizing the propensity of the assembly’s constituent neurons to fire synchronously. The model parameters θ = {n, p,λ} provide a full characterization of the assemblies based on their statistical properties, including firing frequency, size, synchrony and asynchrony lev- els. As discussed in the following sections, our approach allows us to estimate the model parameters from the data together with the latent variables of the model. Likelihood From the generative rules outlined in the section above, we can calculate the joint probability of neuronal membership t, the assembly activity matrix ω and the neuronal activity matrix s conditional to the model parameters θ (likelihood) as ! ! N A M Y YY 1 o o km km Pðt; o; sjyÞ ¼ n � p ð1 p Þ � t m m i¼1 m¼1 k¼1 ð3Þ N M YY s ð1 s Þ ik ik � ½l ðo Þ� ½1 l ðo Þ� t kt t kt i i i i i¼1 k¼1 Next, we need to define the distributions used as priors on the model parameters, as indicated in Eq (1). In particular, we use a beta distribution for the assembly activation probabilities p’s and the synchronous/asynchronous firing probabilitiesλ’s whereas for the relative sizes of each assembly n’s we employ a Dirichlet distribution which imposes the normalization condi- tion ∑ n = 1. Our prior distributions are then summarized as μ μ ðpÞ ðpÞ p � Betaða ; b Þ; ð4Þ m m m ðlÞ ðlÞ l ðzÞ � Betaða ; b Þ; ð5Þ m z;m z;m ðnÞ ðnÞ fn ;��� ; n g � Dirða ;��� ; a Þ ð6Þ 1 A 1 A where the standard notation x * P means that x is drawn from the distribution P.α’s andβ’s are the (hyper-)parameters describing our prior knowledge on the model parameters such as the expected temporal sparsity of the synchronous activation of neuronal populations. This model can be represented graphically as in S1 Fig (panel A). PLOS Computational Biology | https://doi.org/10.1371/journal.pcbi.1007481 October 31, 2019 4 / 31 Bayesian inference of neuronal assemblies The present formulation of the generative model could be used directly to draw posterior samples of parameters and latent features by deriving their full conditional distributions (Gibbs sampling). However, this strategy would introduce several problems in dealing with a variable number of assemblies, as continuous features (such as the vector n of relative size for instance) would have variable dimensionality. We can derive a more efficient sampler by inte- grating out the continuous parameters θ and obtaining the marginal probability P(t, ω, s). This procedure leads to the “collapsed” model depicted in S1 Fig (panel B) which in general reduces the uncertainty associated with the estimation of the remaining variables. To proceed our deri- vation we first introduce the summary variables G ¼ d ð7Þ m m;t i¼1 M M X X ðpÞ ðpÞ H ¼ a þ o ; H ¼ b þ ð1 o Þ ð8Þ m km m km k¼1 k¼1 X X 0 0 0 zz zz zz ^ ^ T ¼ d d ; T ¼ g þ T ð9Þ 0 0 z;o z ;s zz S;mk S;m S;mk km ik i2S k¼1 ðlÞ ðlÞ g ¼ a ; g ¼ b ð10Þ z1 z z0 z whereδ is the Kronecker delta function and S is any subset of indexes in the range 1 to N. To ij simplify the notation we also introduce additional matrices derived from Eq (9) ^ ^ T ¼ T ; T ¼ T ð11Þ mk μ;mk m μ;m ^ ^ ð12Þ T ¼ T ; T ¼ T ; mni;k μni;mk mni μni;m ^ ^ T ¼ T ; T ¼ T ð13Þ i;mk fig;mk i;m fig;m For each assembly μ, G is the assembly size, H and H denote (up to an additive constant) μ μ zz the number of active and inactive events over time respectively, while the matrix T counts S;m how many times the state (ω , s ) = (z, z ) is observed across time and the neurons in the set S kμ ik (up to an additive constant). Due to the conjugate character of the prior distributions (see Materials and methods for details) the integration over θ can be carried out analytically, leading to the marginal likeli- hood Pðt; o; sÞ ¼ dy Pðt; o; sjyÞPðyÞ ¼ ( ) ð14Þ A z1 z0 ðnÞ � Y Y BðT ; T Þ BðGþ a Þ BðH ; H Þ m m m m ¼ � ðpÞ ðlÞ ðnÞ ðlÞ ðpÞ Bða Þ Bða ; b Þ Bða ; b Þ m¼1 z2f0;1g z where B(�,�) is the Euler beta function and B is defined as the product of gamma functions Gða Þ Bðfa ;��� ; a gÞ � : ð15Þ 1 n Gð a Þ k k After integrating out θ we can rewrite the joint probability in Eq (14) as the product between PLOS Computational Biology | https://doi.org/10.1371/journal.pcbi.1007481 October 31, 2019 5 / 31 Bayesian inference of neuronal assemblies the likelihood A z1 z0 ðnÞ Y Y BðT ; T Þ BðGþ a Þ m m Pðt; sjoÞ ¼ � ð16Þ ðnÞ ðlÞ ðlÞ Bða Þ Bða ; b Þ m¼1 z2f0;1g and the prior on the latent variables ( ) Y � BðH ; H Þ m m PðoÞ ¼ : ð17Þ ðpÞ ðpÞ Bða ; b Þ m¼1 We will employ this “collapsed” formulation of the model to make inference on cell member- ship and assembly activity. Inference Given the data on neural activities in the form of a binary matrix s, we can use the generative model described above to make inference on neuronal identities and assembly activity along with the model parameters. Within our probabilistic framework, we can estimate these quanti- ties by evaluating their expectations with respect to the conditional distribution P(t, ω|s). These averages can be computed via Monte Carlo methods by generating random samples from the joint distribution. We first consider the case where the number of neuronal assemblies A is known. To obtain samples from P(t, ω, s) in Eq (14) we can use a Gibbs sampler where cell membership and assembly activities are drawn sequentially from the conditional distributions P(t|ω, s) and P(ω| t, s) respectively (Algorithm 1). Algorithm 1 Collapsed Gibbs sampling 1: Initialize t 2: while convergence criteria do 3: for each assembly μ 2 {1, ���, A} time k 2 {1, ���, M} do 4: draw ω * P(ω |t, s) kμ kμ 5: for each cell i 2 {1, ���, N} do 6: draw t * P(t|ω, s) 7: draw θ * P(θ|t, ω, s) The conditional distribution of the membership of the ith data point t can be written as z1 z0 BðT ; T Þ m m ðnÞ Pðt ¼ mjt ; o; sÞ / ðG þ a Þ ð18Þ i i m m z1 z0 BðT ; T Þ mni mni z2f0;1g where we used the notation t = {t ,���, t , t ,���, t }. −j 1 j−1 j+1 N The conditional probability for the assembly activation matrix ω is given by Pðo ¼ 1jt; o ; sÞ ¼ ð19Þ km km 1þ r km z1 z0 ðpÞ Y BðT ; T Þj H þ a m m o ¼0 km r ¼ � ð20Þ km ðpÞ z1 z0 BðT ; T Þj H þ b m m o ¼1 m z km Sampling the parameters θ from the posterior distribution P(θ|t, ω, s) is easy thanks to our choice of the corresponding priors. The posterior distributions of p ,λ and n retain the same μ μ μ PLOS Computational Biology | https://doi.org/10.1371/journal.pcbi.1007481 October 31, 2019 6 / 31 Bayesian inference of neuronal assemblies functional form as in Eqs (4, 5 and 6) with updated hyper-parameters ðpÞ ðpÞ ~ � a ~ ¼ H ; b ¼ H ð21Þ m m m m ðlÞ ðlÞ 01 00 a ~ ¼ T ; b ¼ T ð22Þ 0;m 0;m m m ðlÞ ðlÞ 11 10 a ~ ¼ T ; b ¼ T ð23Þ 1;m 1;m m m ðnÞ ðnÞ a ~ ¼ a þ G ð24Þ m m Where we have added an extra label μ to the posterior hyperparameters corresponding to dif- ferent assemblies. Having obtained the analytical expression of the marginal likelihood for the collapsed model in Eq (14) we have designed a Gibbs Monte Carlo sampler which allows us to make inference on latent features and model parameters. However, so far we have kept the number of assemblies A fixed. In the next section we will discuss how to extend the current sampling strategy to accommodate a variable number of assemblies, providing a way to esti- mate this number directly from the data. Inference of the number of neuronal assemblies Since in general the number of assemblies is not known a priori, we need to extend the frame- work described in the previous section in order to estimate this number from the data. This can be achieved by introducing a scheme in which the number of assemblies is treated as a latent feature for which we need to draw posterior samples analogously to the other parameters of the model. Estimating the number of components in a mixture is a common issue in unsupervised machine learning. In the context of our model we employ the Dirichlet process(DP) [20] as a prior on the mixing measure describing the composition of the data (see panel C in S1 Fig for a graphical representation). The DP prior can be implemented by introducing specific Metrop- olis-Hastings acceptance rules to increase or decrease the number of components [21], which generalize the inference problem to an arbitrary number of assemblies. Here we adapted the algorithm described in Neal [21] to our generative model of neuronal assemblies. In particular, during each iteration of the sampler, when assigning a given neuron i to an assembly, the rule proposed by Neal corresponds to draw a new membership μ from the proposal ð