Direct Estimation of Firing Rates from Calcium Imaging Data

Elad Ganmor, Michael Krumin, L. Federico Rossi, Matteo Carandini, Eero P. SimoncelliarXiv 2016 · DOI · arXiv

Abstract

Two-photon imaging of calcium indicators allows simultaneous recording of responses of hundreds of neurons over hours and even days, but provides a relatively indirect measure of their spiking activity. Existing deconvolution algorithms attempt to recover spikes from observed imaging data, which are then commonly subjected to the same analyses that are applied to electrophysiologically recorded spikes (e.g., estimation of average firing rates, or tuning curves). Here we show, however, that in the presence of noise this approach is often heavily biased. We propose an alternative analysis that aims to estimate the underlying rate directly, by integrating over the unobserved spikes instead of committing to a single estimate of the spike train. This approach can be used to estimate average firing rates or tuning curves directly from the imaging data, and is sufficiently flexible to incorporate prior knowledge about tuning structure. We show that directly estimated rates are more accurate than those obtained from averaging of spikes estimated through deconvolution, both on simulated data and on imaging data acquired in mouse visual cortex.

Introduction: The Problem with Sequential Estimation

Two-photon calcium imaging has become a cornerstone of modern neuroscience, enabling researchers to monitor the activity of thousands of neurons simultaneously. However, the measured signal—fluorescence—is a blurry, indirect proxy for action potentials (spikes). The standard analytical workflow typically follows a "deconvolve-then-analyze" pipeline: first, an algorithm guesses exactly when spikes occurred; second, these guessed spikes are averaged to calculate firing rates or tuning curves.

This paper identifies a major flaw in this sequential approach: deconvolution is inherently difficult in noisy conditions. At low firing rates, noise is asymmetric; researchers are more likely to falsely detect a spike than to correctly ignore noise, leading to a systematic overestimation of baseline activity. Once a spike train is "guessed," any errors are baked into all subsequent analyses.

The Generative Model

To address these biases, the authors propose a Direct Estimation approach. This method is built upon a standard generative model that describes how external stimuli eventually manifest as measured fluorescence.

The generative model illustrates the hierarchical relationship from stimulus to measured fluorescence, where spikes act as a latent variable.

As shown in the model above, the process follows a clear hierarchy:

  1. Stimulus ($s$): External covariates drive the neural response.
  2. Firing Rate ($\\lambda$): The underlying rate of activity.
  3. Spike Count ($n$): Spikes are generated by a Poisson process based on the firing rate.
  4. Calcium Concentration ($c$): Each spike causes a jump in calcium, followed by exponential decay.
  5. Fluorescence ($f$): The final measured signal, which includes Gaussian measurement noise.

Innovation: Marginalizing Uncertainty

The core innovation of Direct Estimation is treating the spikes ($n$) as a "nuisance variable." Instead of picking the single most likely spike train, the authors mathematically integrate (marginalize) over all possible spike counts. By summing over the uncertainty of unobserved spikes rather than committing to one estimate, the method remains "aware" of the noise and avoids the systematic biases inherent in traditional deconvolution.

This approach is highly flexible, supporting:

  • Non-parametric models: Estimating unique rates for every stimulus.
  • Parametric models: Fitting specific shapes, such as Von Mises curves for orientation tuning, directly to raw imaging data.
  • Neural Coupling: Analyzing how the activity of one neuron influences another.

Key Results and Performance

The authors validated the model using surrogate data, ground-truth electrophysiology (simultaneous imaging and cell-attached recordings), and new experimental data from the mouse visual cortex (V1).

  • 2x Accuracy Boost: On ground-truth data, direct estimation outperformed sequential estimation by approximately a factor of two in terms of Root Mean Squared Error (RMSE).
  • Efficiency and Speed: The method achieves high accuracy with significantly less data than traditional methods. Furthermore, for non-parametric models, the likelihood function is convex, ensuring the algorithm finds the global optimum quickly—often in about 0.1 seconds on a standard laptop.
  • Robust Tuning Curves: When estimating orientation tuning, the direct method maintained a clean "bell curve" shape even under high noise levels, whereas sequential methods produced jagged, unreliable results.

Conclusion

By moving away from the "deconvolve-then-analyze" paradigm, Direct Estimation provides a more statistically sound way to interpret calcium imaging data. While the model currently assumes linear calcium summation and requires pre-defined Regions of Interest (ROIs), it represents a significant step forward in neural data analysis, offering higher accuracy and better experimental throughput for systems neuroscience.

Summary updated

Abstract

Two-photon imaging of calcium indicators allows simultaneous recording of responses of hundreds of neurons over hours and even days, but provides a relatively indirect measure of their spiking activity. Existing deconvolution algorithms attempt to recover spikes from observed imaging data, which are then commonly subjected to the same analyses that are applied to electrophysiologically recorded spikes (e.g., estimation of average firing rates, or tuning curves). Here we show, however, that in the presence of noise this approach is often heavily biased. We propose an alternative analysis that aims to estimate the underlying rate directly, by integrating over the unobserved spikes instead of committing to a single estimate of the spike train. This approach can be used to estimate average firing rates or tuning curves directly from the imaging data, and is sufficiently flexible to incorporate prior knowledge about tuning structure. We show that directly estimated rates are more accurate than those obtained from averaging of spikes estimated through deconvolution, both on simulated data and on imaging data acquired in mouse visual cortex.
BibTeX
@misc{ganmor2016direct,
  author = {Elad Ganmor and Michael Krumin and L. Federico Rossi and Matteo Carandini and Eero P. Simoncelli},
  title = {{Direct Estimation of Firing Rates from Calcium Imaging Data}},
  year = {2016},
  eprint = {1601.00364},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1601.00364},
}
Figure