# Computational Methods for Neuron Segmentation in Two-Photon Calcium Imaging Data: A Survey
## 5 Matrix Factorization-Based Methods
### Non-Negative Matrix Factorization-Based Approaches
This approach is easier to use and adapt for imaging stacks acquired under different settings; however, it is not robust against spatially overlapped cells, varying noise levels and spatially variant background fluorescence. [PERSON] et al. proposed a structured matrix factorization approach to simultaneously detect and segment ROIs, separate overlapping ROIs and deconvolve the calcium activity traces in calcium imaging stacks [64]. They used the standard matrix factorization approach by treating the imaging stacks as the product of two low rank matrices, one matrix represents the spatial footprint of the neurons while the other matrix represents the temporal activity of the neurons. However, they put a hard constraint on the energy of residual signal between the raw data and denoised signal reconstructed from the factorized matrices. These hard threshold noise levels are estimated by exploiting the autoregressive structure of the calcium indicator dynamics in an iterative manner. This enforces the dynamics of the calcium indicator. Moreover, the authors have proposed warm initialization methods for matrix factorization to increase the computational efficiency. As the fluorescence from individual neurons is highly localized, the noise levels and ROI estimation is further facilitated by taking into account the noise levels and ROIs in previous iterations. To merge ROIs which might belong to the same neuron, they construct a graph where each vortex corresponds to a neuron which is connected to other neurons by an edge if those neurons overlap. If they edge is stronger than a threshold, the ROIs are merged. Moreover, if some ROIs do not contribute to the overall spatio-temporal activity, they are removed. The downside of this approach is that the number of initial ROIs must be known. The authors have validated their approach on in vivo mouse V1 spontaneous activity data, however, they have not compared the results to any ground truth, so a quantitative comparison is not done. [PERSON] et al. proposed a constrained matrix factorization-based approach for neuron detection by using the bleach line of background fluorescence to disassociate noise from calcium activity [65]. The matrix factorization approach follows the standard protocols by assuming that the observed calcium imaging data are the product of two low rank matrices, one corresponding to the spatial footprint of the neurons and the other corresponding to the temporal footprint. They also add a background noise term and base fluorescence term which itself is the product of baseline background spatial and temporal activity. All these terms are constrained to be positive. Overall, there are four unknowns which need to be estimated: \(S\) which represents the spatial footprint, \(A\) which represents the temporal activity, \(s_{b}\) which represents the baseline (background) spatial footprint and \(a_{b}\) which represents the baseline temporal footprint. All the matrices are randomly initialized. In one iteration, a least squares solution is found first for one matrix while the others are fixed and all the negative values are zeroed out. This process is repeated for pre-determined number of iterations. The ROIs detected in this approach are further refined by manual screening and merging. The authors have reported satisfactory performance on the spike deconvolution tasks and temporal activity extraction tasks when applied to both synthetic and real data. However, they have not reported its performance on a ground truth for cell detection, which can help us determine how well this algorithm works on cell/neuron detection tasks. [PERSON] et al. proposed an approach for large-scale neuron detection in whole brain imaging based on non-negative matrix factorization (NMF) applied to patches of the acquired calcium imaging stack, instead of applying the NMF to the whole field of view [66].