Rapid deep widefield neuron finder driven by virtual calcium imaging data

Yuanlong Zhang, Guoxun Zhang, Xiaofei Han, Jiamin Wu, Ziwei Li, Xinyang Li, Guihua Xiao, Hao Xie, Lu Fang, Qionghai DaibioRxiv 2022

TL;DR

This paper introduces DeepWonder, a deep learning-based tool that significantly accelerates and improves the accuracy of analyzing widefield calcium imaging data from the brain. By leveraging simulated data for training, DeepWonder overcomes the challenges of background noise and scattering, enabling faster and more comprehensive neuron activity mapping.

What Problem Does This Paper Address?

Widefield microscopy offers a powerful way to observe neural activity across large brain areas at high speeds. However, this technique is plagued by significant challenges: tissue scattering and background fluorescence obscure the true neuronal signals, making it difficult and time-consuming to accurately identify and track individual neurons and their activity. Traditional methods struggle with the sheer volume of data generated by these microscopes, often requiring days or weeks of processing for even moderate datasets. This bottleneck limits the scope and speed of neuroscience research, particularly for studies involving complex behaviors or large-scale neural circuits.

Methods

DeepWonder employs a two-stage deep learning approach:

  1. Removing Background Network (RB-Net): This network is trained using a novel simulator (NAOMi1p) that generates realistic synthetic widefield calcium imaging data. The simulator creates paired datasets: one with actual neuronal signals and another with the same signals but without background contamination. By training on these pairs, RB-Net learns to effectively remove background noise and scattering from experimental, contaminated images.
  2. Neuron Segmentation Network (NS-Net): After background removal, NS-Net, a lightweight convolutional neural network, efficiently segments the cleaned images to identify individual neurons. For closely packed or overlapping neurons, a local non-negative matrix factorization (NMF) algorithm is used for further demixing.

The key innovation lies in using simulated data to train the networks, circumventing the need for difficult-to-obtain, perfectly paired real-world data.

Datasets

  • Simulated Datasets: The authors developed a simulator (NAOMi1p) to generate realistic synthetic widefield calcium imaging data. This simulator can be adapted to various microscope parameters, producing paired "contaminated" and "background-free" recordings for training.
  • Experimental Datasets:
    • RUSH system: Terabyte-scale recordings from a high-resolution, large field-of-view system.
  • Macroscope: Recordings from a widefield microscope with a photographic lens.
  • Head-mounted miniscope: Recordings from a compact microscope for freely-moving animals.
  • Hybrid 1p-2p system: Data from a custom setup allowing simultaneous widefield and two-photon imaging, used for validation against a higher-resolution ground truth.

Key Insights and Ideas

  • Synthetic Data is Powerful: The success of DeepWonder hinges on the ability to generate realistic synthetic data. This bypasses the significant challenge of acquiring perfectly matched real-world data with and without background noise, a major hurdle for traditional deep learning approaches in this domain.
  • Two-Stage Approach for Robustness: Separating background removal from neuron segmentation allows each network to specialize, leading to more accurate results than a single end-to-end model might achieve, especially given the complexities of real-world data.
  • Speed and Accuracy Synergy: DeepWonder demonstrates that deep learning can not only improve accuracy but also dramatically reduce processing time, making large-scale neural data analysis feasible.

Key Results

  • Speed: DeepWonder achieves processing speeds approximately 10 times faster than traditional methods like CNMF-E. For terabyte-scale datasets, it reduced processing time from weeks to hours (e.g., 17 hours for 1 terabyte of data).
  • Accuracy:
    • Signal-to-Background Ratio (SBR): Achieved a fifty-fold improvement in SBR for real recordings.
  • Neuron Detection: Demonstrated improved F1 scores (e.g., 0.90 vs. 0.81 compared to CNMF-E) and precision (0.92 vs. 0.56).
  • Temporal Correlation: Showed a 21.5% improvement in temporal correlation scores with ground truth.
  • Scalability: Successfully processed recordings from various widefield microscopy platforms, including large-scale RUSH systems, macroscopes, and head-mounted miniscopes.

Limitations and Future Work

  • Limitations:
    • The current simulator is adapted for specific microscope parameters; further generalization might be needed for highly novel systems.
  • While effective, the method relies on the quality of the synthetic data generation.
  • Future Work:
    • The authors suggest that DeepWonder could be further enhanced by incorporating generative adversarial networks (GANs).
  • Extending the method to analyze deeper cortical layers and volumetric imaging (e.g., light-field or multifocus microscopy) is proposed.
  • The framework is designed to be adaptable to other functional imaging modalities (e.g., voltage imaging) by modifying the virtual recording generation.

Summary updated

Abstract

Widefield microscope provides optical access to multi-millimeter fields of view and thousands of neurons in mammalian brains at video rate. However, calcium imaging at cellular resolution has been mostly contaminated by tissue scattering and background signals, making neuronal activities extraction challenging and time-consuming. Here we present a deep widefield neuron finder (DeepWonder), which is fueled by simulated calcium recordings but effectively works on experimental data with an order of magnitude faster speed and improved inference accuracy than traditional approaches. The efficient DeepWonder accomplished fifty-fold signal-to-background ratio enhancement in processing terabytes-scale cortex-wide recording, with over 14000 neurons extracted in 17 hours in workstation-grade computing resources compared to nearly week-long processing time with previous methods. DeepWonder circumvented the numerous computational resources and could serve as a guideline to massive data processing in widefield neuronal imaging.
BibTeX
@misc{zhang2022rapid,
  author = {Yuanlong Zhang and Guoxun Zhang and Xiaofei Han and Jiamin Wu and Ziwei Li and Xinyang Li and Guihua Xiao and Hao Xie and Lu Fang and Qionghai Dai},
  title = {{Rapid deep widefield neuron finder driven by virtual calcium imaging data}},
  year = {2022},
  doi = {10.1101/2022.01.25.474600},
  howpublished = {bioRxiv},
}
Figure