Abstract
We present efficient Bayesian methods for extracting neuronal spiking information from calcium imaging data. The goal of our methods is to sample from the posterior distribution of spike trains and model parameters (baseline concentration, spike amplitude etc) given noisy calcium imaging data. We present discrete time algorithms where we sample the existence of a spike at each time bin using Gibbs methods, as well as continuous time algorithms where we sample over the number of spikes and their locations at an arbitrary resolution using Metropolis-Hastings methods for point processes. We provide Rao-Blackwellized extensions that (i) marginalize over several model parameters and (ii) provide smooth estimates of the marginal spike posterior distribution in continuous time. Our methods serve as complements to standard point estimates and allow for quantification of uncertainty in estimating the underlying spike train and model parameters.
Introduction
Calcium imaging has become a cornerstone of modern neuroscience, enabling the simultaneous monitoring of hundreds of neurons. However, the fluorescent signals recorded are an indirect measure of neural activity. While electrical spikes occur on a millisecond timescale, calcium indicators exhibit slow decay over hundreds of milliseconds. Furthermore, these signals are often obscured by significant noise.
Standard approaches, such as Maximum A Posteriori (MAP) inference, provide a single "best guess" for the spike train. While effective at high signal-to-noise ratios (SNR), these deterministic methods struggle with noisy data or when multiple spikes occur within a single imaging frame. Crucially, they fail to provide a measure of confidence. This work introduces a robust Bayesian framework that addresses these challenges by inferring full posterior distributions of spike trains and model parameters.
Methodology
The authors propose two primary Bayesian sampling approaches designed for efficiency and accuracy:
- Discrete-Time Binary Sampler: This approach treats the spike train as a binary sequence across time bins. It utilizes a Metropolized Gibbs (MG) sampler to infer the presence of a spike in each bin. By exploiting the temporal independence of distant spikes, the algorithm achieves a computational complexity of $O(T)$, where $T$ is the number of time bins.
- Continuous-Time Sampler: This "super-resolution" method moves beyond the constraints of the imaging frame rate. It uses Metropolis-Hastings (MH) for point processes to sample the exact number and timing of spikes. This is particularly effective for capturing neural "bursting," where multiple spikes occur within a single time bin. Its complexity scales with the number of spikes ($O(K)$), ensuring efficiency for sparse neural activity.
A significant technical contribution is the application of Rao-Blackwellization and Collapsed Gibbs Sampling. By analytically marginalizing out nuisance parameters like baseline fluorescence, the authors improve algorithm convergence and produce smoother estimates of the marginal spike posterior.
Experimental Validation
The methods were validated using in-vitro spinal cord neuronal data labeled with the high-sensitivity calcium sensor GCaMP6s. Ground truth was established via antidromic stimulation, providing a gold standard for assessing accuracy. The dataset included both low-SNR traces and high-SNR traces (generated by pixel averaging).
Key Insights and Results
Embracing Uncertainty
Unlike deterministic methods, the Bayesian approach provides a probability for each spike. In low-SNR conditions, the model might indicate a 40% probability of a spike, offering a more nuanced and honest representation of the data than a binary "yes/no" guess. This uncertainty quantification is vital for downstream statistical analyses.
Super-Resolution and Burst Detection
The continuous-time sampler allows for spike inference at a higher resolution than the camera's sampling rate. This capability is essential for mapping neural connectivity (connectomics), where the precise temporal order of spikes is critical. As shown in the results, the sampler effectively identifies multiple spikes within a single time bin, accurately reflecting true spiking behavior during bursts.
Parameter Estimation and Efficiency
The "Collapsed" version of the sampler provides stable, low-variance estimates for model parameters such as spike amplitude and baseline concentration. By optimizing the underlying mathematics—specifically exploiting the banded structure of the involved matrices—the authors ensure that these Bayesian methods scale linearly with data size, making them practical for large-scale experimental datasets.
Conclusion and Future Work
This Bayesian framework provides a powerful alternative to standard point estimates for spike inference. By providing full posterior distributions, it allows researchers to quantify uncertainty and achieve super-resolution timing.
Future work will address limitations such as baseline drift, which is common in in-vivo experiments. Additionally, the authors aim to scale these methods to spatial setups involving overlapping signals from multiple neurons, requiring sophisticated de-mixing techniques. The integration of more advanced sampling methods, such as Hamiltonian Monte Carlo, may further enhance computational efficiency.
Summary updated