# Computational Methods for Neuron Segmentation in Two-Photon Calcium Imaging Data: A Survey
## 5 Matrix Factorization-Based Methods
### Non-Negative Matrix Factorization-Based Approaches
In this approach, they model the neuron detection as a matrix factorization problem. The observed data are assumed to be a product of spatial footprint and temporal footprint with some noise and background/neuropil contamination added. The background signal is further decomposed into spatial and temporal components and are estimated by non-negative matrix factorization. This matrix factorization regime works well if the number of sources (neurons) are fixed but struggles when more neurons are added/deleted. To overcome this, a new neuron is added if the correlation between the new neuron and current neurons in two successive data frames is lower than a threshold. Moreover, a Gaussian smoothing kernel is applied with a size similar to the size of expected new neuron and then search for point with maximum spatial variance. In order to speed-up the computation, parameter values in an iteration are initialized from the values in previous iterations. Moreover, the neurons statistics are updated only after certain number of steps, thus further reducing the processing time. The authors have validated their approach on both synthetic and real data. On synthetic data, this approach detected and tracked all the active sources with only one false positive. The approach was also bench-marked on data manually annotated by two persons. This dataset consisted of 90k frames acquired at 30 Hz (50 min). The proposed approach achieved precision = 0.87, recall = 0.72 and F1 = 0.79. Moreover, OnACID analysed the dataset in 27 min, suggesting that it can process almost 2 times faster than real time. [PERSON] et al. proposed a robust statistical optimization method for matrix factorization framework to detect and extract neural cells in calcium imaging ([70]). This optimization framework assumes the observed data are a matrix product of spatial and temporal footprints with background noise. The background noise is dominated by baseline activity modelled by a normal distribution. The cell extraction starts by detecting local maxima in the time maximum summary image, one at a time. Then at each iteration, the matrix factorization framework is solved for spatial and temporal footprints using M-estimator and Huber loss [71; 72]. This is repeated until a convergence criteria is satisfied. The redundant components and those components which have converged to zero are removed. The authors have validated their approach on both synthetic and real data. Although they provided a qualitative comparison of their proposed approach against some other matrix factorization frameworks, yet they have not provided any performance figures on a ground truth of established benchmarks, so the performance of this approach on benchmarks is not validated. [PERSON] et al. proposed another variant of constrained non-negative matrix factorization for extracting neurons in calcium imaging [73]. They model the observed data using three elements. The first element is the matrix product of spatial and temporal footprint of the neurons, the second element represents the background fluorescence while the third element is Gaussian noise. The constraints on spatial footprints are that they should be spatially localized and sparse. The temporal footprints are modelled as highly structured auto-regressive processes. Consequently, the combined spatio-temporal neural activity is structured and sparse. The background fluorescence is made of two elements, the baseline fluorescence and a fluctuating component. The fluctuating element at each pixel is estimated by the linear combination of nearby pixels which are not the nearest neighbours. This approach has been validated on both synthetic and real data. It identified all the neurons in a synthetic dataset. In a dorsal striatum dataset, this approach identified 692 neurons against 547 neurons identified by PCA/ICA. The authors have not provided any details about the performance of this approach on established benchmarks.