Penalized matrix decomposition for denoising, compression, and improved demixing of functional imaging data

E. Kelly Buchanan, Ian Kinsella, Ding Zhou, Rong Zhu, Pengcheng Zhou, Felipe Gerhard, John Ferrante, Ying Ma, Sharon Kim, Mohammed Rafi Shaik, Yajie Liang, Rongwen Lu, Jacob Reimer, Paul Fahey, Taliah Muhammad, Graham T. Dempsey, Elizabeth M. C. Hillman, Na Ji, Andreas S. Tolias, Liam PaninskibioRxiv 2018

Abstract

Calcium imaging has revolutionized systems neuroscience, providing the ability to image large neural populations with single-cell resolution. The resulting datasets are quite large (with scales of TB/hour in some cases), which has presented a barrier to routine open sharing of this data, slowing progress in reproducible research. State of the art methods for analyzing this data are based on non-negative matrix factorization (NMF); these approaches solve a non-convex optimization problem, and are highly effective when good initializations are available, but can break down e.g. in low-SNR settings where common initialization approaches fail. Here we introduce an improved approach to compressing and denoising functional imaging data. The method is based on a spatially-localized penalized matrix decomposition (PMD) of the data to separate (low-dimensional) signal from (temporally-uncorrelated) noise. This approach can be applied in parallel on local spatial patches and is therefore highly scalable, does not impose non-negativity constraints or require stringent identifiability assumptions (leading to significantly more robust results compared to NMF), and estimates all parameters directly from the data, so no hand-tuning is required. We have applied the method to a wide range of functional imaging data (including one-photon, two-photon, three-photon, widefield, somatic, axonal, dendritic, calcium, and voltage imaging datasets): in all cases, we observe ~2-4x increases in SNR and compression rates of 20-300x with minimal visible loss of signal, with no adjustment of hyperparameters; this in turn facilitates the process of demixing the observed activity into contributions from individual neurons. We focus on two challenging applications: dendritic calcium imaging data and voltage imaging data in the context of optogenetic stimulation. In both cases, we show that our new approach leads to faster and much more robust extraction of activity from the video data.

Introduction

Modern neuroscience relies on functional imaging to record the activity of thousands of neurons simultaneously. However, this progress has created two massive bottlenecks: data volume and signal quality. High-resolution movies can generate terabytes of data per hour, making storage and open-source sharing nearly impossible. Furthermore, raw data is often buried in noise, resulting in a low Signal-to-Noise Ratio (SNR). Existing methods like Non-negative Matrix Factorization (NMF) are powerful but sensitive to initialization and often require extensive hand-tuning of parameters, particularly when the signal is weak or the structures (like dendrites) are complex.

Methodology

The core innovation is a localized version of Penalized Matrix Decomposition (PMD). Instead of treating the entire video as one giant matrix, the algorithm breaks the data into overlapping spatial patches and processes them in parallel, ensuring high scalability.

Key technical components include:

  • Iterative Rank-One Deflation: The algorithm extracts signal components sequentially until only noise remains.
  • Dual Penalties: To separate signal from noise, the authors apply Total Variation (TV) penalties to the spatial factors (ensuring shapes are cohesive) and Trend Filtering (TF) to the temporal factors (ensuring activity is smooth while allowing for sharp spikes).
  • Automated Parameter Selection: The framework uses "roughness" statistics to automatically determine the local rank and the degree of smoothing required, removing the need for manual hyperparameter tuning.

Results and Discussion

The authors demonstrated the versatility of their method across a wide array of functional imaging types, including endoscopic, dendritic, three-photon, widefield, and voltage imaging.

Compression and SNR Gains

The PMD approach achieved compression rates between 20x and 300x with minimal loss of visible signal, effectively turning a 100GB dataset into a manageable 1-5GB file. Across all datasets, a 2-4x increase in SNR was observed, allowing for the detection of weak neural activity that was previously invisible in raw data.

Denoising performance on voltage imaging data. The red traces represent the noisy raw components, while the blue traces show the denoised results obtained via PMD. The zoomed panels on the right highlight the method's ability to preserve sharp transients while suppressing noise.

Improved Demixing

By denoising and compressing data as a preprocessing step, the subsequent NMF demixing step becomes significantly faster and more robust. In challenging dendritic and voltage imaging cases, the PMD-initialized pipeline extracted cleaner spatial components and more accurate temporal traces than state-of-the-art NMF baselines. The flexibility of Trend Filtering is particularly notable; unlike traditional calcium imaging models that assume specific physical spike shapes, TF can handle the complex, multi-directional fluctuations characteristic of voltage imaging.

Conclusion

This framework provides a "plug-and-play" solution for the massive datasets generated by modern functional imaging. While currently focused on offline processing, future work aims to adapt the algorithm for real-time, closed-loop experiments and integrate these methods into widely used neuroscience pipelines like CaImAn and CNMF-E.

Summary updated

BibTeX
@misc{buchanan2018penalized,
  author = {E. Kelly Buchanan and Ian Kinsella and Ding Zhou and Rong Zhu and Pengcheng Zhou and Felipe Gerhard and John Ferrante and Ying Ma and Sharon Kim and Mohammed Rafi Shaik and Yajie Liang and Rongwen Lu and Jacob Reimer and Paul Fahey and Taliah Muhammad and Graham T. Dempsey and Elizabeth M. C. Hillman and Na Ji and Andreas S. Tolias and Liam Paninski},
  title = {{Penalized matrix decomposition for denoising, compression, and improved demixing of functional imaging data}},
  year = {2018},
  eprint = {1807.06203},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1807.06203},
  howpublished = {bioRxiv},
}
Figure