Extracting neural signals from semi-immobilized animals with deformable non-negative matrix factorization

Amin Nejatbakhsh, Erdem Varol, Eviatar Yemini, Vivek Venkatachalam, Albert Lin, Aravinthan D. T. Samuel, Liam PaninskibioRxiv 2020 · DOI

TL;DR

This paper introduces a novel "deformable non-negative matrix factorization" (dNMF) method that simultaneously corrects for animal movement and extracts neural activity signals from microscopy videos. This approach significantly outperforms existing methods, especially in scenarios with non-rigid motion, and is accompanied by a new time-series normalization technique for comparing neural signals across different experiments.

What Problem Does This Paper Address?

Studying the complex dynamics of neural populations in living animals is crucial for understanding behavior. A key challenge in this field is accurately extracting neural activity signals, particularly calcium traces, from microscopy videos. This is complicated by two main issues:

  1. Motion Artifacts: Animals, even when semi-immobilized, move. This movement, especially non-rigid deformations, can cause signals to shift and overlap, making it difficult to isolate individual neuron activity. Traditional image registration methods struggle with these complex movements.
  2. Signal Overlap: Due to the limited resolution of optical microscopy, signals from nearby neurons can blend together, making it hard to distinguish their individual contributions.

Existing methods often address these problems separately (e.g., motion correction followed by signal demixing), which can lead to suboptimal results. This paper aims to solve these challenges by developing a unified framework that handles both motion and signal extraction simultaneously.

Methods

The core innovation is the deformable non-negative matrix factorization (dNMF) framework. Unlike traditional NMF, which assumes static spatial footprints of neurons, dNMF models these footprints as being deformable over time.

Here's a breakdown of the key components:

  • Joint Optimization: dNMF simultaneously optimizes for:
  • Deformation parameters ($\beta_t$): These capture the non-rigid motion of the animal's body over time.
  • Spatial footprints (A): These represent the underlying, static shapes of neurons.
  • Temporal activity coefficients (C): These represent the actual calcium signals of each neuron over time.
  • The model aims to reconstruct the observed video frames Y(t) by transforming the static spatial footprints A using the learned deformations $\beta_t$ and then multiplying by the temporal activity coefficients C.
  • Spatial Component Parameterization: The paper offers two ways to represent the spatial footprints:
  • Non-parametric model: Similar to standard NMF, where each pixel contributes to a neuron's footprint.
  • Gaussian functions: A more constrained model that assumes neuron shapes can be approximated by 3D Gaussian distributions, reducing the number of parameters.
  • Regularization: To ensure stable and biologically plausible results, dNMF incorporates several regularization terms:
  • Temporal continuity: Encourages smooth changes in neural activity and motion over time.
  • Jacobian constraints: Prevents unrealistic deformations (e.g., shrinking or expanding volumes).
  • Quantile Regression Normalization: After extracting neural traces, a new time-series normalization technique called quantile regression (QR) is introduced. This method robustly normalizes neural signals across different animals by matching their distributions (histograms), preserving signal baselines and magnitudes better than standard z-scoring, especially in the presence of outliers. A non-negative variant (NQR) is also provided.

Datasets

The authors evaluate their method on:

  • Simulated data: A synthetic dataset was generated to mimic calcium imaging data with controlled motion and signal properties. This allowed for quantitative evaluation against ground truth.
  • Real semi-immobilized C. elegans microscopy videos: The method was applied to videos of C. elegans worms, which exhibit significant non-rigid motion. This dataset includes recordings from 21 worm heads and 21 worm tails, each lasting 4 minutes and capturing neural activity with GCaMP6s.

Key Insights and Ideas

  • Unified Approach is Key: The most significant insight is that jointly optimizing for motion correction and signal demixing is superior to performing these steps sequentially. This allows the model to leverage information about neural activity to inform motion correction and vice-versa, leading to more accurate results.
  • Deformable Models for Biological Motion: Standard rigid or piecewise-rigid registration methods are insufficient for capturing the complex, non-rigid movements of biological subjects like worms. dNMF's deformable model is crucial for accurate tracking.
  • Quantile Regression for Robust Normalization: Standard normalization techniques like z-scoring can distort neural signals and misrepresent baselines, especially when comparing across many animals. Quantile regression offers a more robust way to align signal distributions, making cross-animal comparisons more reliable.
  • dNMF as a General Framework: The dNMF framework is presented as modular, allowing for different spatial parameterizations, loss functions, and regularizers, suggesting its applicability to a broader range of imaging and biological scenarios.

Key Results

  • Superior Demixing and Registration: dNMF consistently outperformed traditional methods (Normcorre + NMF, ROI tracking) in both simulated and real C. elegans data.
  • In simulations, dNMF achieved higher signal and trajectory correlation across various signal-to-noise ratios, cell densities, and activity densities.
  • For real C. elegans data, dNMF successfully extracted uncoupled signals from spatially close neurons, whereas other methods showed significant signal mixing and loss of signal.
  • Improved Registration Quality: dNMF-based registration resulted in sharper mean images and tighter clustering of cell centers compared to Normcorre, indicating more accurate correction of motion.
  • Robust Time-Series Normalization: Quantile regression (QR) and non-negative quantile regression (NQR) demonstrated better preservation of neural signal baselines and magnitudes across multiple animals compared to z-scoring, as visualized in Figure 2 and 7.

Limitations and Future Work

  • Computational Cost: While the paper mentions optimizations like stochastic variants, dNMF is likely more computationally intensive than simpler methods due to the joint optimization of deformation and signal parameters.
  • Model Assumptions: The Gaussian parameterization of spatial components is an assumption that might not hold for all neuron shapes or imaging modalities. The non-parametric model offers more flexibility but might require more data or stronger regularization.
  • Future Work: The authors suggest that the dNMF framework is modular and can be extended with different loss functions, regularizers, and deformation parameterizations. They also point to the potential utility of their method with other calcium indicators and in different biological preparations (e.g., zebrafish, Drosophila, Hydra), and mention that improved tracking methods could complement their approach.

Summary updated

Abstract

Extracting calcium traces from populations of neurons is a critical step in the study of the large-scale neural dynamics that govern behavior. Accurate activity extraction requires the correction of motion and movement-induced deformations as well as demixing of signals that may overlap spatially due to limitations in optical resolution. Traditionally, non-negative matrix factorization (NMF) methods have been successful in demixing and denoising cellular calcium activity in relatively motionless or pre-registered videos. However, standard NMF methods fail in animals undergoing significant non-rigid motion; similarly, standard image registration methods based on template matching can fail when large changes in activity lead to mismatches with the image template. To address these issues simultaneously, we introduce a deformable non-negative matrix factorization (dNMF) framework that jointly optimizes registration with signal demixing. On simulated data and real semi-immobilized C. elegans microscopy videos, dNMF outperforms traditional demixing methods that account for motion and demixing separately. Finally, following the extraction of neural traces from multiple imaging experiments, we develop a quantile regression time-series normalization technique to account for varying neural signal intensity baselines across different animals or different imaging setups. Open source code implementing this pipeline is available at https://github.com/amin-nejat/dNMF .
BibTeX
@misc{nejatbakhsh2020extracting,
  author = {Amin Nejatbakhsh and Erdem Varol and Eviatar Yemini and Vivek Venkatachalam and Albert Lin and Aravinthan D. T. Samuel and Liam Paninski},
  title = {{Extracting neural signals from semi-immobilized animals with deformable non-negative matrix factorization}},
  year = {2020},
  doi = {10.1101/2020.07.07.192120},
  howpublished = {bioRxiv},
}
Figure