==== Front Neurophotonics Neurophotonics NEUROW NPh Neurophotonics 2329-423X 2329-4248 Society of Photo-Optical Instrumentation Engineers 10.1117/1.NPh.10.3.035004 NPh-22072GRRR 22072GRRR Research Papers Paper Comparing the segmentation of quantitative phase images of neurons using convolutional neural networks trained on simulated and augmented imagery Gil Eddie M. ab*gil82550@gmail.com Steelman Zachary A. czach.a.steelman@gmail.com Sedelnikova Anna bAnna.V.Sedelnikova@saic.com https://orcid.org/0000-0002-9970-4141 Bixler Joel N. cjoel.bixler.1@us.af.mil a Texas A&M University, Department of Biomedical Engineering, College Station, Texas, United States b SAIC, JBSA Fort Sam Houston, Texas, United States c Air Force Research Laboratory, JBSA Fort Sam Houston, Texas, United States * Address all correspondence to Eddie M. Gil, gil82550@gmail.com 30 6 2023 7 2023 30 6 2023 10 3 0350045 8 2022 14 6 2023 15 6 2023 © 2023 The Authors 2023 The Authors https://creativecommons.org/licenses/by/4.0/ Published by SPIE under a Creative Commons Attribution 4.0 International License. Distribution or reproduction of this work in whole or in part requires full attribution of the original publication, including its DOI. Abstract. Significance Quantitative phase imaging (QPI) can visualize cellular morphology and measure dry mass. Automated segmentation of QPI imagery is desirable for tracking neuron growth. Convolutional neural networks (CNNs) have provided state-of-the-art results for image segmentation. Improving the amount and robustness of training data is often crucial to improving CNN output on novel samples, but acquiring enough labeled data can be labor intensive. Data augmentation and simulation can be used to address this, but it is unclear whether low-complexity data can result in useful network generalization. Aim We trained CNNs on abstract images of neurons and on augmented images of real neurons. We then benchmarked the resulting models against human labeling. Approach We used a stochastic simulation of neuron growth to guide abstract QPI image and label generation. We then tested the segmentation performance of networks trained on augmented data and networks trained on simulated data against manual labeling established via consensus of three human labelers. Results We show that training on augmented real data resulted in a model that achieved the best Dice coefficients in our group of CNNs. The largest percent difference in dry mass estimation with respect to the ground truth was driven by segmentation errors of cell debris and phase noise. The error in dry mass when considering the cell body alone was similar between the CNNs. Neurite pixels only accounted for ∼6% of the total image space, making them a difficult feature to learn. Future efforts should consider methods for improving neurite segmentation quality. Conclusions Augmented data outperformed the simulated abstract data for this testing set. The quality of segmentation of neurites was the key difference in performance between the models. Notably, even humans performed poorly when segmenting neurites. Further work is needed to improve the segmentation quality of neurites. Keywords: quantitative phase imaging deep learning neuronal growth simulations Air Force Research LaboratoryFA8650-C-6024 Air Force Office of Scientific Research20RHCOR051 running-headGil et al.: Comparing the segmentation of quantitative phase images of neurons… ==== Body pmc1 Introduction Precise tracking of cell morphology over time is highly desirable for basic science.1,2 This is particularly true of neurons that exhibit intricate branching structure driven by their essential function as bioelectric signal transmitters. Classical measurement of neuronal growth generally involves fluorescence labeling and identification of one or more parameters, such as dendritic length or distribution of segments. However, there is an emerging understanding that more complete representations of cell and network morphology are required to fully capture the complex geometry and connectivity of multi-cell systems.3,4 An attractive path toward improved measurements of neuron growth is quantitative phase imaging (QPI) combined with convolutional neural networks (CNNs) for semantic segmentation. QPI is a label-free microscopy technique that creates images by measuring the optical pathlength difference at each point in a sample.5 Critically, it also enables the computation of cellular dry mass (i.e., the total non-water mass of cellular components) by integrating the phase over the area encompassed by the cell or subcellular component of interest.6 This measurement is highly useful since it is an independent and precise measurement of cell growth and metabolism, which is not available from fluorescence-based images.7 Automated segmentation of QPI images using deep learning would immediately identify the mass distribution and morphology of the neuronal network and could be used to rapidly process large batches of images. High-quality deep learning models have been trained to segment various cell types, across many imaging modalities8–10 including QPI.11 Unfortunately, deep learning models require thousands of labeled samples to gain generalizability. In our application, collection and labeling of thousands of QPI images is a demanding task, which would also necessitate the capture of variations in cell morphology, system magnification, field of view, and system noise characteristics. Moreover, simply increasing the number of training samples is not enough to design a robust network. The distribution of outputs from deep learning models tends to bias toward sample classes and feature sets that are overrepresented in the training data.12,13 In cases where subject data fail to capture the sources of variance expected in practice, acquiring additional training data does not always improve model performance.14 One way to address these issues is to pretrain a model with known benchmark data and then fine tune on a dataset that more closely represents the desired task.15,16 This approach is most useful when the source and target data contain similar patterns.17 Cellpose, a generalist model for cell segmentation, takes this approach, and incorporates cell images from brightfield microscopy and fluorescence microscopy, as well as non-microscopy images.18 While this model is highly effective at whole cell segmentation, and cytoplasm and nucleus segmentation, there are a few details that make it insufficient for our application. First, QPI images are not present in the training data, and thus QPI-specific noise sources and imaging aberrations are not captured by Cellpose’s dataset. Second, QPI is a projection-based imaging tool, so cytoplasm and nuclei cannot be separated to provide targets for segmentation in Cellpose. Finally, dry mass calculations for measuring growth dynamics require differentiating among the cell body, neurites, and the background segmentation masks. Thus there is a need to train a model to segment QPI images of neurons. An alternative solution to utilization of existing generalist models is to use data augmentation to expand the pool of available training data. Generative adversarial networks can do this by learning to generate realistic training samples, but fine control over the feature content of the generated data is challenging.19,20 Data augmentation can provide such control and is performed with techniques, such as affine transforms, pixel gamma variation, non-linear image warping, and image mixing via cropping and summing operations.21 Typically, only transforms, which preserve the relationship between the training data and labels, are selected, since failure to do so can lead to worse model performance. Augmentation is thought to work by having the network learn to average across orbits of data with larger variance than would otherwise exist without augmentation. This results in model invariance to transforms in the data augmentation policy.22 Although incredibly effective, determining the most effective augmentation policy for a particular task requires some tuning. Regardless, deep learning models do not generally handle abstraction well, which leads to poorer performance on novel data.23,24 Fortunately, abstract concepts are often based on a simple set of rules along with a high degree of variance.25–27 A stochastic model may provide the solution. In our case, a simulated model of neurons growing could provide images with more variance than augmenting a finite set. This approach also has the benefits of requiring zero training data or manual labeling and high tunability for various related tasks. In this study, we tested the effectiveness of neuron segmentation models trained on various types of data. In particular, we trained our networks on abstract simulated data, as well as augmented data, and compared the results to a known generalist cell segmentation model, and to human labelers. We implemented a 2D version of NETMORPH,28 a known stochastic biological model for neuron growth as the generator for our abstract training data. We generated a dataset of 5000 realistic QPI images of neurons. Labels were automatically generated for these images during the simulation process, and Gaussian speckle noise was added to approximate real-world imaging. We reserved 10% of the data to check for overfitting and trained on the remaining 90%. We trained a U-Net29 with residual units30 to segment images of neurons into cell bodies and neurites. We also included results from various formulations of data augmentation to compare the network output between an entirely simulated training set, and one which has been augmented from a small number of real images. Although abstract data were not as effective as augmentation, it may be beneficial in certain scenarios. We believe that our study serves as a useful examination of semantic segmentation training methodologies. 2 Methods 2.1 Considerations for Simulating Images with Patterns Similar to Lab-Acquired QPI Images The goal of the simulation step was to generate training data with patterns similar to those contained in the lab-acquired images, while staying abstract in nature. In lab-acquired QPI images, a cell is an object with specific shape, phase intensity, and texture-based features. The research focused primarily on simulating relevant geometric and biological features. Although this limited the number of patterns that the training dataset contained, these features allowed for effective segmentation. Prior to updating the neuron growth simulation from our preliminary work,31 a small set of 10 QPI images of neuroblastoma and glioma hybrid NG108-15 cells was acquired. These cells were grown and imaged independently of the final testing set acquired to validate the segmentation results. The QPI system6 was modified to utilize a 10× objective lens (Olympus UPlanFLN, 10×/0.30 NA) and a sensor (FLIR Blackfly S) with 3.45-μm square pixels. Because of the 10× objective, each pixel covered 0.345  μm. Sub-frames of 1024×1024  pixels were acquired from the central position of the sensor where the resulting image had a field of view of 353.3×353.3  μm. To match these parameters, the simulated neurons were generated in 512×512-pixel array unsigned 8-bit integers (uint8) and saved as portable network graphics (PNG) image files. Additionally, all lab-acquired images were resized to 512×512  pixels to match the input size of the training data. Resampling the PNGs in this way eased the computational burden when the CNN was in use. This was acceptable in the imaging system, as the diffraction-limited spot size of ∼1.3  μm was still effectively sampled under the Nyquist criterion after downsampling. Hand labeling was performed on all lab-acquired images. Ground truth labels were generated using the consensus of masks obtained from three human labelers. The 10 preliminary images were excluded from the testing set, since they were used to determine the approximate range of cell sizes. A region finding algorithm was used with the binarized image labels to isolate the cells and assign a rectangular bounding box to the cell body portion of the cells in the 10 preliminary images. The major and minor axes of the cell body contained in each bounding box were recorded. The 10 images were also the source images for the augmentation-generated training data. 2.2 Simulating Neurons We implemented a variation of the NETMORPH model outlined by Koene et al.28 The model has the ability to stochastically generate simulated “Petri dishes” of neurons within a defined field of view by assuming parameters for iterative neuron growth. At each time step, the model evaluates probabilistic functions controlling for elongation, neurite branching, and directional change of neurite growth cones. The program generated a list of points in x and y that defined placement of line segments representing discretized fractions of neurite into a 353.3×353.3-μm region. The images were uint8 arrays with pixel values between 0 and 255. The line segments were 1-pixel wide rectangles with image intensity of 255. A total of 200 Petri dishes with 25-time steps of simulated neuron growth were generated. For each dish, a maximum of 10 neurons were simulated, with a minimum of one neuron per dish. Each input image was normalized by its minimum and maximum so that it had value between 0 and 1 prior to being processed by the network. 2.2.1 Simulating cell bodies Ellipsoids were used to simulate cell bodies and were placed at the point where the neuron growth simulation begins the initial segment for each neuron. Each ellipsoid was generated using the following equation: z={r2−(ax2+by2),if  (ax2+by2)