# Computational Methods for Neuron Segmentation in Two-Photon Calcium Imaging Data: A Survey
## 5 Matrix Factorization-Based Methods
### Non-Negative Matrix Factorization-Based Approaches
The core idea behind this approach is when NMF is applied to a small patch of the stack, instead of the whole stack, the spatial and temporal components can be extracted with higher speed owing to the low complexity of factorization space. Then the method can be applied iteratively to all the patches. This approach has two benefits: one, it can be scaled linearly and two, since it is applied on localized patches, information from two spatially disjoint but visually similar patches will not leak. Moreover, they also argue that spatial and temporal downsampling can reduce speed while not compromising the overall performance, thus further boosting the processing speed. The patches are centred around potential neurons whose centres are extracted by local maxima, therefore this approach is also vulnerable to neuron-like noise. The authors have not provided any quantitative results in order to compare this approach to other state-of-the-art approaches in terms of detection accuracy, precision and recall. [PERSON] et al. proposed a pipeline for motion-correction, neuron detection and spike inference in calcium imaging. They call the pipeline Suite2p [67]. The pipeline can be scaled linearly with the number of neurons in the field of view. They formulate a generative model of the fluorescence image based upon spike times and neuropil signal. As per their argument, neuropil and soma signals are highly correlated and cell transients can be identified by the deviation from otherwise linear relationship between soma and neuropil. They model recorded signal as a weighted sum of temporally modulated cell signal and temporally modulated neuropil signal at each pixel. They find the parameters of temporal modulation, weights of soma and neuropil and noise parameters by applying expectation maximization on the observed data. They fix some parameters and iterate over the others in one optimization iteration. Once the ROIs are detected iteratively, a user defined threshold for the size of soma is used to identify soma and neuropil. In order to speed up the computations, they use SVD to reduce data dimensions and then apply the pipeline in lower dimensions. On the Neurofinder benchmark, this approach achieved good performance with a precision of \(57.8\%\pm 16\%\), a recall of \(56.8\%\pm 18\%\) and \(\text{F1}=55\%\pm 12.7\%\). One big advantage of this pipeline is that it can be scaled linearly with the number of recorded cells. However, since this pipeline relies on accurate parameter estimation for downstream analysis, it can face problems with a region with high cell density. Moreover, its robustness on highly occluded and spatially overlapped cells is also not well established. [PERSON] et al. approached cell detection, spike inference and impulse response calculation as a single optimization problem in extremely sparse calcium imaging stacks [68]. They assume that all the neurons in the field of view will fire an extremely sparse rate \(J\), much lower than number of cells \(K\). Moreover, each neuron (cell) can be decomposed into the convolution of a number of impulse responses \(L\) (again much lower than \(K\)). The \(J\), \(K\), \(L\) and \(H\) (size of convolutional kernel) are specified by the user. All the unknown variables in the optimization problem are first initialized from a non-negative Gaussian distribution. The optimization problem is then solved by fixing a group of variables while iterating over the other variables. The biggest disadvantage of this approach is that the user has to specify at least four parameters which makes this approach vulnerable to human error and makes it harder to be used by a non-expert. The authors have not reported any performance figures for neuron detection from this pipeline. [PERSON] et al. proposed an online framework for denoising, neuron detection and spike deconvolution which they call Online Analysis of streaming Calcium Imaging Data (OnACID) [69]. This approach is based on online dictionary learning approaches.