Abstract
Calcium imaging has been widely adopted for its ability to record from large neuronal populations. To summarize the time course of neural activity, dimensionality-reduction methods, which have been applied extensively to population spiking activity, may be particularly useful. However, it is unclear whether the dimensionality-reduction methods applied to spiking activity are appropriate for calcium imaging. We thus carried out a systematic study of design choices based on standard dimensionality-reduction methods. We have also developed a method to perform deconvolution and dimensionality reduction simultaneously (calcium imaging linear dynamical system, CILDS). CILDS most accurately recovered the single-trial, low-dimensional time courses from simulated calcium imaging data. CILDS also outperformed the other methods on calcium imaging recordings from larval zebrafish and mice. More broadly, this study represents a foundation for summarizing calcium-imaging recordings of large neuronal populations using dimensionality reduction in diverse experimental settings.
This is a preview of subscription content, access via your institution
Access options
Access Nature and 54 other Nature Portfolio journals
Get Nature+, our best-value online-access subscription
$29.99 / 30 days
cancel any time
Subscribe to this journal
Receive 12 digital issues and online access to articles
$99.00 per year
only $8.25 per issue
Rent or buy this article
Prices vary by article type
from$1.95
to$39.95
Prices may be subject to local taxes which are calculated during checkout






Data availability
Larval zebrafish DRN data are available at https://doi.org/10.6084/m9.figshare.21646682 (ref. 65). Mouse V1 data are available at https://doi.org/10.12751/g-node.wc3f8g (ref. 66) Source data are provided with this paper.
Code availability
A MATLAB implementation of CILDS is available on GitHub at https://github.com/kohth/cilds and on Zenodo at https://doi.org/10.5281/zenodo.7388544 (refs. 67)
References
Cunningham, J. P. & Yu, B. M. Dimensionality reduction for large-scale neural recordings. Nat. Neurosci. 17, 1500–1509 (2014).
Gallego, J. A., Perich, M. G., Miller, L. E. & Solla, S. A. Neural manifolds for the control of movement. Neuron 94, 978–984 (2017).
Gao, P. & Ganguli, S. On simplicity and complexity in the brave new world of large-scale neuroscience. Curr. Opin. Neurobiol. 32, 148–155 (2015).
Mante, V., Sussillo, D., Shenoy, K. V. & Newsome, W. T. Context-dependent computation by recurrent dynamics in prefrontal cortex. Nature 503, 78–84 (2013).
Churchland, M. M. et al. Neural population dynamics during reaching. Nature 487, 51–56 (2012).
Sadtler, P. T. et al. Neural constraints on learning. Nature 512, 423–426 (2014).
Murray, J. D. et al. Stable population coding for working memory coexists with heterogeneous neural dynamics in prefrontal cortex. Proc. Natl Acad. Sci. USA 114, 394–399 (2017).
Wang, J., Narain, D., Hosseini, E. A. & Jazayeri, M. Flexible timing by temporal scaling of cortical responses. Nat. Neurosci. 21, 102–110 (2018).
Cohen, M. R. & Maunsell, J. H. R. A neuronal population measure of attention predicts behavioral performance on individual trials. J. Neurosci. 30, 15241–15253 (2010).
Mazor, O. & Laurent, G. Transient dynamics versus fixed points in odor representations by locust antennal lobe projection neurons. Neuron 48, 661–673 (2005).
Bouchard, K. E., Mesgarani, N., Johnson, K. & Chang, E. F. Functional organization of human sensorimotor cortex for speech articulation. Nature 495, 327–332 (2013).
Peron, S., Chen, T.-W. & Svoboda, K. Comprehensive imaging of cortical networks. Curr. Opin. Neurobiol. 32, 115–123 (2015).
Chen, T.-W. et al. Ultrasensitive fluorescent proteins for imaging neuronal activity. Nature 499, 295–300 (2013).
Ahrens, M. B., Orger, M. B., Robson, D. N., Li, J. M. & Keller, P. J. Whole-brain functional imaging at cellular resolution using light-sheet microscopy. Nat. Methods 10, 413–420 (2013).
Briggman, K., Abarbanel, H. & Kristan, W. Optical imaging of neuronal populations during decision-making. Science 307, 896–901 (2005).
Harvey, C. D., Coen, P. & Tank, D. W. Choice-specific sequences in parietal cortex during a virtual-navigation decision task. Nature 484, 62–68 (2012).
Ahrens, M. B. et al. Brain-wide neuronal dynamics during motor adaptation in zebrafish. Nature 485, 471–477 (2012).
Kato, H., Chu, M., Isaacson, J. & Komiyama, T. Dynamic sensory representations in the olfactory bulb: modulation by wakefulness and experience. Neuron 76, 962–975 (2012).
Daie, K., Goldman, M. & Aksay, E. Spatial patterns of persistent neural activity vary with the behavioral context of short-term memory. Neuron 85, 847–860 (2015).
Morcos, A. S. & Harvey, C. D. History-dependent variability in population dynamics during evidence accumulation in cortex. Nat. Neurosci. 19, 1672–1681 (2016).
Makino, H. et al. Transformation of cortex-wide emergent properties during motor learning. Neuron 94, 880–890 (2017).
Driscoll, L. N., Pettit, N. L., Minderer, M., Chettih, S. N. & Harvey, C. D. Dynamic reorganization of neuronal activity patterns in parietal cortex. Cell 170, 986–999 (2017).
Stringer, C., Pachitariu, M., Steinmetz, N., Carandini, M. & Harris, K. D. High-dimensional geometry of population responses in visual cortex. Nature 571, 361–365 (2019).
Rumyantsev, O. I. et al. Fundamental bounds on the fidelity of sensory cortical coding. Nature 580, 100–105 (2020).
Pashkovski, S. L. et al. Structure and flexibility in cortical representations of odour space. Nature 583, 253–258 (2020).
Nieh, E. et al. Geometry of abstract learned knowledge in the hippocampus. Nature 595, 80–84 (2021).
Wei, Z. et al. A comparison of neuronal population dynamics measured with calcium imaging and electrophysiology. PLoS Comput. Biol. 16, e1008198 (2020).
Afshar, A. et al. Single-trial neural correlates of arm movement preparation. Neuron 71, 555–564 (2011).
Kiani, R., Cueva, C. J., Reppas, J. B. & Newsome, W. T. Dynamics of neural population responses in prefrontal cortex indicate changes of mind on single trials. Curr. Biol. 24, 1542–1547 (2014).
Gouvêa, T. S. et al. Striatal dynamics explain duration judgments. eLife 4, e11386 (2015).
Kaufman, M. T., Churchland, M. M., Ryu, S. I. & Shenoy, K. V. Vacillation, indecision and hesitation in moment-by-moment decoding of monkey motor cortex. eLife 4, e04677 (2015).
Vogelstein, J. T. et al. Fast nonnegative deconvolution for spike train inference from population calcium imaging. J. Neurophysiol. 104, 3691–3704 (2010).
Theis, L. et al. Benchmarking spike rate inference in population calcium imaging. Neuron 90, 471–482 (2016).
Friedrich, J., Zhou, P. & Paninski, L. Fast online deconvolution of calcium imaging data. PLoS Comput. Biol. 13, e1005423 (2017).
Runyan, C. A., Piasini, E., Panzeri, S. & Harvey, C. D. Distinct timescales of population coding across cortex. Nature 548, 92–96 (2017).
Zhu, F. et al. A deep learning framework for inference of single-trial neural population dynamics from calcium imaging with subframe temporal resolution. Nat. Neurosci. 25, 1724–1734 (2022).
Murray, J. D. et al. A hierarchy of intrinsic timescales across primate cortex. Nat. Neurosci. 17, 1661–1663 (2014).
Yu, B. M. et al. Gaussian-process factor analysis for low-dimensional single-trial analysis of neural population activity. J. Neurophysiol. 102, 614–635 (2009).
Pei, F. C. et al. Neural latents benchmark ‘21: evaluating latent variable models of neural population activity. In Thirty-fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track (Round 2) (eds Vanschoren, J. & Yeung, S.) Vol. 1 (Curran Associates, 2021).
Kawashima, T., Zwart, M. F., Yang, C.-T., Mensh, B. D. & Ahrens, M. B. The serotonergic system tracks the outcomes of actions to mediate short-term motor learning. Cell 167, 933–946 (2016).
Jeon, B. B., Swain, A. D., Good, J. T., Chase, S. M. & Kuhlman, S. J. Feature selectivity is stable in primary visual cortex across a range of spatial frequencies. Sci. Rep. 8, 15288–15288 (2018).
Pandarinath, C. et al. Inferring single-trial neural population dynamics using sequential auto-encoders. Nat. Methods 15, 805–815 (2018).
Churchland, M. et al. Stimulus onset quenches neural variability: a widespread cortical phenomenon. Nat. Neurosci. 13, 369–378 (2010).
Williamson, R. C. et al. Scaling properties of dimensionality reduction for neural populations and network models. PLoS Comput. Biol. 12, e1005141 (2016).
Umakantha, A. et al. Bridging neuronal correlations and dimensionality reduction. Neuron 109, 2740–2754 (2021).
Huang, C. et al. Circuit models of low-dimensional shared variability in cortical networks. Neuron 101, 337–348 (2019).
Triplett, M. A., Pujic, Z., Sun, B., Avitan, L. & Goodhill, G. J. Model-based decoupling of evoked and spontaneous neural activity in calcium imaging data. PLoS Comput. Biol. 16, e1008330 (2020).
Aitchison, L. et al. Model-based Bayesian inference of neural activity and connectivity from all-optical interrogation of a neural circuit. In Advances in Neural Information Processing Systems (eds Guyon, I. et al.) Vol. 30, 3486–3495 (Curran Associates, 2017).
Kao, J. C. et al. Single-trial dynamics of motor cortex and their applications to brain-machine interfaces. Nat. Commun. 6, 7759 (2015).
Williams, A. H. et al. Discovering precise temporal patterns in large-scale neural recordings through robust and interpretable time warping. Neuron 105, 246–259 (2020).
Kobak, D. et al. Demixed principal component analysis of neural population data. eLife 5, e10989 (2016).
Archer, E. W., Koster, U., Pillow, J. W. & Macke, J. H. Low-dimensional models of neural population activity in sensory cortical circuits. In Advances in Neural Information Processing Systems (eds Ghahramani, Z. et al.) Vol. 27, 343–351 (Curran Associates, 2014).
Lakshmanan, K. C., Sadtler, P. T., Tyler-Kabara, E. C., Batista, A. P. & Yu, B. M. Extracting low-dimensional latent structure from time series in the presence of delays. Neural Comput. 27, 1825–1856 (2015).
Elsayed, G. & Cunningham, J. Structure in neural population recordings: an expected byproduct of simpler phenomena?. Nat. Neurosci. 20, 1310–1318 (2017).
Pnevmatikakis, E. et al. Simultaneous denoising, deconvolution and demixing of calcium imaging data. Neuron 89, 285–299 (2016).
Deneux, T. et al. Accurate spike estimation from noisy calcium signals for ultrafast three-dimensional imaging of large neuronal populations in vivo. Nat. Commun. 7, 12190 (2016).
Jewell, S. & Witten, D. Exact spike train inference via ℓ0 optimization. Ann. Appl. Stat. 12, 2457–2482 (2017).
Prince, L. Y., Bakhtiari, S., Gillon, C. J. & Richards, B. A. Parallel inference of hierarchical latent dynamics in two-photon calcium imaging of neuronal populations. Preprint at https://www.biorxiv.org/content/early/2021/03/08/2021.03.05.434105.full.pdf (2021).
Bittner, S. R. et al. Population activity structure of excitatory and inhibitory neurons. PLoS ONE 12, e0181773 (2017).
Chen, J. L., Voigt, F. F., Javadzadeh, M., Krueppel, R. & Helmchen, F. Long-range population dynamics of anatomically defined neocortical networks. eLife 5, e14679 (2016).
Semedo, J. D., Gokcen, E., Machens, C. K., Kohn, A. & Yu, B. M. Statistical methods for dissecting interactions between brain areas. Curr. Opin. Neurobiol. 65, 59–69 (2020).
Pachitariu, M. et al. Suite2p: beyond 10,000 neurons with standard two-photon microscopy. Preprint at https://www.biorxiv.org/content/early/2017/07/20/061507.full.pdf (2017).
Freeman, J. et al. Mapping brain activity at scale with cluster computing. Nat. Methods 11, 941–950 (2014).
Santhanam, G. et al. Factor-analysis methods for higher-performance neural prostheses. J. Neurophysiol. 102, 1315–1330 (2009).
Kawashima, T. & Ahrens, M. B. Calcium imaging in the dorsal raphe nucleus of zebrafish. figshare https://doi.org/10.6084/m9.figshare.21646682.v6 (2022).
Jeon, B. & Kuhlman, S. Responses of V1 excitatory neurons to full-field grating. G-Node https://doi.org/10.12751/g-node.wc3f8g (2022).
Koh, T. kohth/cilds: cilds; https://doi.org/10.5281/zenodo.7388544 (2022).
Acknowledgements
We thank K. P. Nguyen for the animal illustrations. This work was supported by the Agency for Science, Technology and Research (A*STAR) Singapore (T.H.K.), Howard Hughes Medical Institute (W.E.B., T.K., Z.W. and M.B.A.), Simons Foundation Simons Collaboration on the Global Brain Award 542943 (M.B.A.) and 543065 (B.M.Y.), the Shurl and Kay Curci Foundation (S.M.C. and S.J.K.), NIH R01 HD071686 (S.M.C. and B.M.Y.), NIH R01 EY024678 (S.J.K.), NSF NCS BCS1533672 (S.M.C. and B.M.Y.), NSF CAREER award IOS1553252 (S.M.C.), NSF NCS DRL2124066 (B.M.Y. and S.M.C.), NSF NCS BCS1734916 (B.M.Y.), NIH CRCNS R01 NS105318 (B.M.Y.), NIH CRCNS R01 MH118929 (B.M.Y.) and NIH R01 EB026953 (B.M.Y.).
Author information
Authors and Affiliations
Contributions
T.H.K., W.E.B., S.M.C. and B.M.Y. designed the dimensionality-reduction and analysis methods. T.H.K. derived and implemented the dimensionality-reduction methods. T.H.K. performed the analyses, based on earlier analyses by R.S., T.K. and M.B.A. contributed to evaluation of the methods. T.K., B.B.J., Y.M., S.J.K. and M.B.A. designed the animal experiments. T.K. and Y.M. performed the larval zebrafish experiments, and B.B.J. performed the mouse experiments. Z.W. processed and segmented the 66-Hz single-plane larval zebrafish recordings. T.H.K., W.E.B., M.B.A., S.M.C. and B.M.Y. wrote the manuscript. All authors discussed the results and commented on the manuscript.
Corresponding authors
Ethics declarations
Competing interests
The authors declare no competing interests.
Peer review
Peer review information
Nature Computational Science thanks Germán Sumbre and the other, anonymous, reviewer(s) for their contribution to the peer review of this work. Primary Handling Editor: Ananya Rastogi, in collaboration with the Nature Computational Science team.
Additional information
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Supplementary information
Supplementary Information
Supplementary Figs. 1–12, Table 1 and methods.
Source data
Source Data Fig. 3
Statistical source data.
Source Data Fig. 4
Statistical source data.
Source Data Fig. 5
Statistical source data.
Source Data Fig. 6
Statistical source data.
Rights and permissions
Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.
About this article
Cite this article
Koh, T.H., Bishop, W.E., Kawashima, T. et al. Dimensionality reduction of calcium-imaged neuronal population activity. Nat Comput Sci 3, 71–85 (2023). https://doi.org/10.1038/s43588-022-00390-2
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1038/s43588-022-00390-2