# Computational Methods for Neuron Segmentation in Two-Photon Calcium Imaging Data: A Survey
## 6 Machine Learning-Based Methods
### ML Methods Applied to 3D Calcium Imaging Stacks
The decoding layer consist of one convolutional operation and one concatenation with 8, 16 and 32 filters respectively. The output probability score for each voxel is thresholded at 0.5 and then neurons are segmented by Gaussian blurring and watershed segmentation. The original 3D image stacks are \(512\times 1024\times 28\), therefore they divided the initial raw images into \(160\times 160\times 16\) sized smaller images. They have used one 3D stack for training and reported that the pipeline tracked 98% of neurons in the test data. They have also reported that the pipeline was able to track 91% of the neurons even when artificial noise was added. [PERSON] et al. [87] proposed a dictionary learning-based approach, called SCALPEL, for neuron detection in calcium imaging data. First, they binarize every frame in the image stack after standardization. Then they use the connected thresholds [88] method to segment candidate neurons from the background. After segmentation, they filter candidate neurons which are smaller or larger than an expected size range. Then they generate a dissimilarity matrix based on temporal and spatial properties of candidate neurons in which each element represents how dissimilar a candidate neuron is compared to another candidate neuron. Using the dissimilarity matrix, they cluster similar candidate neurons together by hierarchical clustering approach [89]. In the final step, they optionally filter the refined dictionary elements, arguing that clusters with a larger number of members are more likely to be true neurons. They have validated their pipeline on three calcium videos/image stacks. The first video is a one-photon video, collected by the lab of [PERSON] ([[https://wittenlab.org/](https://wittenlab.org/)]([https://wittenlab.org/](https://wittenlab.org/)), accessed on 2 July 2022) at the Princeton Neuroscience Institute, with 3000 frames of size \(205\times 226\) pixels sampled at 10 Hz. They have only reported the successful detection of neurons, but no precision, recall or F1 scores. The second and third videos are two-photon videos from Allen Brain Observatory ([[http://observatory.brain-map.org/visualcoding](http://observatory.brain-map.org/visualcoding)]([http://observatory.brain-map.org/visualcoding](http://observatory.brain-map.org/visualcoding)), accessed on 2 July 2022), containing 105,698 and 105,710 frames respectively of size \(512\times 512\). Once again, they have reported successful detection of quite large number of neurons but no precision, recall or F1 scores. [PERSON] et al. proposed a spatio-temporal neural network architecture for segmenting active neurons in calcium imaging data [90]. Their architecture is based on DensVNet [91]. Like other popular fully CNNs for semantic segmentation of medical images (e.g., UNet [21] and VNet [92]), DenseVNet is composed of encoding layers, decoding layers and skip connection components. Each encoder stage of DenseVNet is a dense feature stack. The input to each convolutional layer of the stack is the concatenated outputs from all preceding layers of the stack. The authors made the following two modifications to DenseVNet: (i) they changed the last convolutional layer of DenseVNet to have 10 output channels instead of the number of classes and (ii) they added a temporal max-pooling layer to the upsampled features, followed by a 2D convolutional layer with ten \(3\times 3\) kernels and a final convolutional layer with two \(3\times 3\) kernels to the output of DenseVNet. They optimized the network using Dice-loss objective function. They validated their pipeline on a subset of the Allen Brain dataset ([[http://observatory.brain-map.org/visualcoding](http://observatory.brain-map.org/visualcoding)]([http://observatory.brain-map.org/visualcoding](http://observatory.brain-map.org/visualcoding)), accessed on 2 July 2022) and the Neurofinder Challenge dataset ([[http://neurofinder.codeneuro.org/](http://neurofinder.codeneuro.org/)]([http://neurofinder.codeneuro.org/](http://neurofinder.codeneuro.org/)), accessed on 2 July 2022).