2 Institute of Medical Physics and Biophysics, University of Münster, Münster, Germany
Single Image Estimation of Cell Migration Direction by Deep Circular Regression
Abstract
In this paper we study the problem of estimating the migration direction of cells based on a single image. To the best of our knowledge, there is only one related work that uses a classification CNN for four classes (quadrants). This approach does not allow detailed directional resolution. We solve the single image estimation problem using deep circular regression with special attention to cycle-sensitive methods. On two databases we achieve an average accuracy of 17∘, which is a significant improvement over the previous work.
Keywords:
Single cell migration migration direction single image estimation circular data deep circular regression1 Introduction
Cell images are widely used in biomedical research. Information extraction from cell images is a crucial prerequisite for answering challenging biomedical questions. Important cell image analysis tasks include segmentation, classification, and tracking [6, 17]. In this work we study the problem of single image estimation of cell migration direction (SIECMD), i.e. estimating the future direction of cell migration from a single image of a cell, see Figure 1 for examples.
Cell migration direction can be easily obtained from cell tracking in videos [7]. In contrast, performing this estimation by using a single image is much more challenging. There are, however, biological indications that this estimation is possible: A cell’s first reaction to a chemical cue, which promotes migration towards or away of the gradient, is to polarize and extend protrusions in the direction of migration. The cell uses these protrusions to exert forces to the substrate, causing the cell to migrate in the direction of these protrusions, see [12] for a detailed explanation. The study [4] shows that the migration direction (of an adhering mammalian cell) is influenced by its enforced polarity, i.e. a large front and a small rear. Consequently, there exists a clear relationship between the motility and shape of individual migrating cells [8].
In this work we use deep circular regression to learn shape features for SIECMD. A detailed prediction of motion direction from single images is of relevance for various biomedical applications. One such example are histological probes from biopsies or other human tissue. These samples can only be obtained in small quantities and preclude live cell analysis. Here, SIECMD may advance our understanding on single cell dynamics under physiological and pathologcial (e.g. cancer) conditions. A second example, where a prediction of motion analysis may be advantageous, is for high-throughput screening. To probe the effectiveness of pharmaceutical compounds on cell motility is time and data intensive. Replacing single cell tracking data with kinetic information inferred from SIECMD may significantly augment the throughout of such assays. Finally, the estimated migration could be even used for applications beyond biomedical data. One possible application is to complement the cellular Potts model (CPM), an established framework for cell simulation originally proposed in [1] (a current toolbox can be found in [15]). The estimated migration direction from SIECMD could be integrated into CPM to enable a more robust simulation.
The task of SIECMD has been hardly studied so far. To our best knowledge, the only relevant work is done by Nishimoto et al. [9]. It is based on a CNN of 14 layers designed for solving a 4-class classification problem (upper left, upper right, lower left, lower right; i.e. one class for each quadrant). We consider this formulation to be a major drawback of that work, as it represents only a very coarse sampling of the entire space of directions (on a unit circle) and thus does not allow for a more detailed directional resolution. The thesis work [19] also considers SIECMD. It extends the approach in [9] by a variable number of classes (instead of constant 4) that is tuned during the training phase. However, this number is selected using information from two consecutive images at and , thus not applicable to a single-image context. In addition, the estimated migration direction has not been separately evaluated, but is only used to support cell tracking in videos with low frame rate. Another single-image problem is that of classifying the cell migration modes (continuous, discontinuous) [2].
We solve the problem of SIECMD using deep regression with special attention to the circular nature of direction data. We present the details of our methods in Section 2. The experimental results and discussions follow in Section 3. Then, further discussion concludes the paper.
![Refer to caption](extracted/5695533/datasets3.png)
2 Methods
To design a deep neural network for estimating the cell migration direction we need to specify several details (direction encoding, activation function, loss function). For each of them there are various choices. In the following we present these design options and a way of finding an optimal configuration. In particular, dealing with directions (angles) means working with circular data. Because of the special nature of circular data, traditional techniques meant for Euclidean space may not be applicable. Instead, cycle-sensitive methods are needed [5, 11].
2.1 Direction encoding
We consider two schemes of direction encoding: 1) an angle . 2) a point on the unit circle . The choice of encoding also determines the number of output neurons (1 or 2) of a deep neural network for migration direction estimation.
2.2 Activation functions
ReLU is used for the activation function except the last (output) layer. There, we define for the angle direction encoding the following activation function:
(1) |
For the circle direction encoding we consider two options: the identity function and the Sigmoid function:
(2) |
In the case of modulo operator and Sigmoid function the activation function has the purpose of normalization (to and , respectively).
2.3 Loss functions
For the angle direction encoding we define two loss functions together with their quadratic variants to compare the network output and ground truth:
(3) | |||||
(4) | |||||
(5) |
The loss functions (4) and (5) take the circular nature of direction data into account and are thus expected to perform better than the two in (3). In addition, we define another loss function that is also cycle-sensitive:
(6) |
For the circle direction encoding we define two simple loss functions:
(7) | |||||
(8) |
While all the loss functions above are easy to understand, the one in (6) has a mathematical interpretation in terms of maximum likelihood estimation. Given a machine learning model (CNN in our case) with parameters for predicting an angle for an input cell image , the uncertainty of the decision can be modeled using a probability distribution, particularly the normal distribution. For circular data this corresponds to the von Mises distribution [5, 11]:
(9) |
where is its concentration, parameter is the modified Bessel function of the first kind of order 0. We use the training data with the related ground truth to determine the unknown parameters by maximizing the likelihood function:
(10) |
To simplify the optimization, we use the log likelihood function:
(11) |
Maximizing the (log) likelihood function is thus equivalent to minimizing the following error function:
(12) |
which exactly corresponds to the loss function (6).
2.4 Deep neural networks
In Sections 2.1–2.3 we described several encoding schemes, activation functions (for the output layer), and loss functions to the studied. In total there are nine combinations. We introduce a small-size CNN to probe the best combination (configuration) and then only use this optimal configuration to test the performance of larger networks. This probing CNN consists of two convolutional layers followed by max pooling layers. The head of this model consists of three dense (fully connected) layers ending with one or two neurons, depending on the direction encoding (see Table 1).
Fine-tuning pre-trained neural networks to a specific task minimizes the training effort and leads to good results [18, 20]. Therefore, we explore several backbones of prominent neural networks (YOLOv8, ResNet50 [3], and EfficientNet [13]). Of these networks, we have chosen the smallest architecture in each case. To test these models for our task, we only used the backbone (i.e. all layers up to first fully-connected layers). Our head was adapted to the complexity of the foreign architectures (see Table 2). The backbones of these networks were pre-trained on known datasets and therefore only need minimal re-training. To do this, we first trained the entire model for 10 epochs, then freeze the weights of the respective backbone and trained the model for further 50 epochs.
Layer | Output | # Parameters |
---|---|---|
Input layer | (128, 128) | 0 |
Conv2D (5x5), activation=ReLU | (124, 124, 16) | 416 |
MaxPooling2D | (62, 62, 16) | 0 |
Conv2D (3x3), activation=ReLU | (60, 60, 32) | 4640 |
MaxPooling2D | (30, 30, 32) | 0 |
Flatten | (28800) | 0 |
Dense, activation=ReLU | (256) | 7373056 |
Dense, activation=ReLU | (16) | 4112 |
Dense, activation= | () |
Layer | Output | # Parameters |
---|---|---|
Backbone | ||
GlobalAveragePooling2D | (#) | 0 |
Dense, activation=ReLU | (1024) | # |
Dense, activation=ReLU | (256) | 262400 |
Dense, activation= | () |
2.5 Test-time augmentation
Since SIECMD is a challenging task, we also explore the potential of test-time augmentation (TTA) for ensemble effect [10, 16]. For this propose multiple images are randomly generated for an input cell image by rotations. The migration direction estimated for each rotated image is corrected by the applied rotation. For a total number of cell images (one original, rotated versions) we thus yield migration direction angles that are fused to obtain the final result, see Figure 2 for an example. We applied a heuristic averaging method: 1) We sort all predictions to receive a sorted ascending list . 2) We calculate the distance . 3) We add to the smallest prediction and start with these new predictions at 1). Our goal is to find the list of predictions with the smallest possible difference . On that resulting list we finally calculate the mean and then use the modulo operator to get the averaging result .
![Refer to caption](extracted/5695533/rotation.png)
Dataset | Encoding | Activation | Loss | ||
---|---|---|---|---|---|
NIH3T3 | 1N | 97.81 | 0.51 | ||
97.82 | 0.59 | ||||
97.86 | 0.54 | ||||
97.83 | 0.53 | ||||
66.54 | 12.10 | ||||
2N | 33.27 | 1.79 | |||
34.29 | 2.20 | ||||
30.53 | 2.21 | ||||
30.51 | 0.86 | ||||
U373 | 1N | 87.05 | 1.73 | ||
87.06 | 1.77 | ||||
86.97 | 1.71 | ||||
87.11 | 1.85 | ||||
33.79 | 3.76 | ||||
2N | 21.59 | 1.27 | |||
22.70 | 1.63 | ||||
22.92 | 2.15 | ||||
21.90 | 1.05 |
with the standard deviation in column ””.
Dataset | Backbone | Pre-training | ||
---|---|---|---|---|
NIH3T3 | YOLOv8 | coco | 23.77 | 0.64 |
EfficientNet | imagenet | 17.27 | 2.26 | |
Resnet50 | imagenet | 20.07 | 0.53 | |
U373 | YOLOv8 | coco | 18.19 | 2.73 |
EfficientNet | imagenet | 16.93 | 3.69 | |
Resnet50 | imagenet | 23.77 | 4.59 |
Dataset | Testset Rotation | ||
---|---|---|---|
NIH3T3 | Original image | 17.27 | 2.26 |
+ 1 rotated version | 17.41 | 2.48 | |
+ 5 rotated versions | 17.33 | 1.88 | |
+ 9 rotated versions | 17.24 | 2.15 | |
+ 13 rotated versions | 17.18 | 2.17 | |
U373 | Original image | 16.93 | 3.69 |
+ 1 rotated version | 17.59 | 2.95 | |
+ 5 rotated versions | 17.77 | 2.53 | |
+ 9 rotated versions | 17.57 | 2.86 | |
+ 13 rotated versions | 17.47 | 2.59 |
3 Experimental validation
3.1 Datasets
Our performance evaluation is based two datasets used in [9] that contain time-lapse phase-contrast microscopic images of cell migration in different ways.
-
•
NIH3T3. Fibroblasts were seeded onto dishes made of glass. Following a night of incubation, an inverted microscope was used to track the migration of the cells. Phase-contrast footage was captured using CCD cameras.
-
•
U373. This dataset was part of the ISBI (International Symposium on Biomedical Imaging) cell tracking challenge in 2015 [14].
Example images can be found in Figure 1, where the left (right) block shows images from NIH3T3 (U373). The NIH3T3 (U373) dataset contains 830 (1011) images with 170 (260) distinct ground truth angles. Note that in [9] results are also reported on a third dataset hTERT-RPE1. Although available to us, however, this dataset was already in a form prepared for the 4-class problem so that no angle ground truth could be obtained. For this reason this dataset was not used for our study.
The tracking information given in the datasets consists of the position for each cell in the frames. With this information, it was possible to obtain a ground truth angle for all cells that migrated a distance of more than 5m during image acquisition.
We multiplied the training data using augmentation. This includes a random combination of rotation , and shift percent of the image size, scaling with factor , and vertical and horizontal mirroring.
3.2 Experimental results
We used a 4-fold validation, where each fold was randomly generated and split into 40% training, 10% validation and 50% test. For the evaluation, we used the mean deviation over all predictions and corresponding ground truth as a metric for the migration direction estimation accuracy :
(13) |
The performance of the probing CNN is shown in Table 5. When considering both datasets, the configuration: circle encoding, activation function , loss function , can be considered optimal, as marked in color. The loss function has a sound mathematical interpretation, but does not perform best (for these two datasets). The reason may be the discontinuous nature of the cyclic activation function in (1). It is not compatible with (stochastic) gradient descent-type optimization algorithms and needs specialized handling.
Then, we use this optimal configuration to test the performance of three networks YOLOv8, ResNet50, and EfficientNet. The results are given in Table 5. For both datasets, the EfficientNet model performs best in terms of mean accuracy and standard deviation. Using this model we are able to achieve a mean accuracy of 17∘ (marked in color) on both datasets.
Finally, using EfficientNet we further study the performance of TTA for , see Table 5. In term of mean and standard deviation, NIH3T3 benefits from TTA. For U373 only the standard deviation declines when using TTA. We estimate the maximum estimation error by (mean + 3 standard deviation) for the case without & with TTA (). This results in 24.05∘ & 23.69∘ for NIH3T3 and 28.00∘ & 25.24∘ for U373, respectively. In this regard TTA is advantageous for U373. Overall, it can be concluded that TTA has a positive effect.
3.3 Comparison with previous work [9]
The major drawback of the only related work for solving SIECMD [9] is the very coarse sampling of directions (on a unit circle) in four discrete classes only, which does not allow for a more detailed directional resolution. Given the predicted class, without extra knowledge, the best possible angle output is the one in the middle of the related quadrant, e.g. if the first quadrant is predicted. This output causes an average inaccuracy relative to the (unknown) ground truth:
-
•
: if the predicted quadrant is correct.
-
•
: if the predicted quadrant is a direct neighbor of the correct quadrant.
-
•
: if the predicted quadrant is not a direct neighbor of the correct quadrant.
Here we assume equal probability of an angle within the ground truth quadrant. The maximal inaccuracy is , , and , respectively. In [9] a classification accuracy of 87.89% (NIH3T3) and 81.76% (U373) is reported. Since no error percentage for the incorrect quadrants is specified, we exemplarily use of the remainder percentage for each of the incorrect quadrants to obtain the average inaccuracy:
A comparison with Table 5 clearly shows an improved accuracy of angle estimation by our approach. Similarly, the average maximal inaccuracy can be estimated by:
A comparison with our results on maximum estimation error (see Section 3.2) shows superior performance over the previous work [9] in terms of maximal inaccuracy.
4 Conclusion
In this paper have we studied the problem of estimating the migration direction of cells based on a single image. Our solution, based on deep circular regression with special attention to cycle-sensitive methods, has achieved an average accuracy of 17∘ on two datasets. This performance represents a significant improvement over the only previous work on this problem. The outcome of this work provides foundation for the realization of applications such as those outlined in the introduction, which were previously not possible. The focus of our future work will therefore be on investigating such applications.
Acknowledgments
This work was supported by the Deutsche Forschungsgemeinschaft (DFG): CRC 1450 – 431460824 (to X.J.) and GA2268/4-1 (to M.G.).
References
- [1] Graner, F., Glazier, J.A.: Simulation of biological cell sorting using a two-dimensional extended potts model. Physical Review Letters 69, 2013–2016 (1992)
- [2] Gupta, A., Larsson, V., Matuszewski, D.J., Strömblad, S., Wählby, C.: Weakly-supervised prediction of cell migration modes in confocal microscopy images using bayesian deep learning. In: 17th IEEE International Symposium on Biomedical Imaging (ISBI). pp. 1626–1629 (2020)
- [3] He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: CVPR. pp. 770–778 (2016)
- [4] Jiang, X., Bruzewicz, D.A., Wong, A.P., Whitesides, G.M.: Directing cell migration with asymmetric micropatterns. PNAS 102, 975–978 (2005)
- [5] Lee, A.: Circular data. Wiley Interdisciplinary Reviews: Computational Statistics 2, 477–486 (2010)
- [6] Liu, Z., **, L., Chen, J., Fang, Q., Ablameyko, S., Yin, Z., Xu, Y.: A survey on applications of deep learning in microscopy image analysis. Computers in Biology and Medicine 134, 104523 (2021)
- [7] Maška, M., et al.: The cell tracking challenge: 10 years of objective benchmarking. Nature Methods 20, 1010–1020 (2023)
- [8] Mogilner, A., Keren, K.: The shape of motile cells. Current Biology 19, R762–R77 (2009)
- [9] Nishimoto, S., Tokuoka, Y., Yamada, T.G., Hiroi, N.F., Funahashi, A.: Predicting the future direction of cell movement with convolutional neural networks. PLoS ONE 14(9), e0221245 (2019)
- [10] Oza, P.R., Sharma, P., Patel, S.: Breast lesion classification from mammograms using deep neural network and test-time augmentation. Neural Computing and Applications 36(4), 2101–2117 (2024)
- [11] Pewsey, A., García-Portugués, E.: Recent advances in directional statistics. TEST 30, 1–58 (2021)
- [12] Ridley, A.J., Schwartz, M.A., Burridge, K., Firtel, R.A., Ginsberg, M.H., Borisy, G., Parsons, J.T., Horwitz, A.R.: Cell migration: integrating signals from front to back. Science 302, 1704–1709 (2003)
- [13] Tan, M., Le, Q.V.: Efficientnetv2: Smaller models and faster training. In: ICML. Proceedings of Machine Learning Research, vol. 139, pp. 10096–10106. PMLR (2021)
- [14] Ulman, V., et al.: An objective comparison of cell-tracking algorithms. Nature Methods 14(12), 1151 (2017)
- [15] Wortel, I., Textor, J.: Artistoo, a library to build, share, and explore simulations of cells and tissues in the web browser. eLife 10, e61288 (2021)
- [16] Xu, C., Wen, Z., Liu, Z., Ye, C.: Improved domain generalization for cell detection in histopathology images via test-time stain augmentation. In: MICCAI. Lecture Notes in Computer Science, vol. 13432, pp. 150–159 (2022)
- [17] Xu, J., et al.: Deep learning in cell image analysis. AAAS Intelligent Computing 2022, Article ID 9861263 (2022)
- [18] Yu, X., Wang, J., Hong, Q., Teku, R., Wang, S., Zhang, Y.: Transfer learning for medical images analyses: A survey. Neurocomputing 489, 230–254 (2022)
- [19] Zhang, X.: Cell Tracking at Low Frame Rate using Deep Learning and Bayesian Integration. Ph.D. thesis, Clemson University (2022)
- [20] Zhuang, F., Qi, Z., Duan, K., Xi, D., Zhu, Y., Zhu, H., Xiong, H., He, Q.: A comprehensive survey on transfer learning. Proceedings of the IEEE 109(1), 43–76 (2021)