## 5 Conclusions  
In this paper, we proposed a deep metric learning-based model to segment cell nuclei from images. The model was designed by customising two deep network models--the DenseNet and ResNet architectures. Adjustments in the learning strategy were made in order to use the metric embeddings, by which either contrastive loss or triplet loss with semi-hard negative mining can be selected.  
One of our aims was to explore how the developed model is able to generalise across a wide range of tissue morphologies due to intra- and internuclear variations, where the overlap of cells is a common phenomenon, as well taking into account the differences in staining protocols and imaging procedures. During the experimental investigation, we observed a 3.12% increase in the average value of Dice similarity coefficients using deep metric learning as compared with no metric learning; with the largest gain of 22.31% being observed for H&E-stained images when the ResNet-104 model was embedded with triplet loss with semi-hard negative mining. In fact, the ResNet-68 architecture demonstrated the poorest performance, while metric embeddings in the DenseNet architecture increased the variation in the performance over different cross-validation folds compared to no metric learning.  
There is a good reason why including metric learning boosts the accuracy of deep learning methods, i.e., metric learning gives an additional flexibility allowing the model to learn better representations. Predetermined loss functions alone (dice loss, cross-entropy, etc.) may not be optimal for a given problem, while enabling the possibility to learn better distance metrics provides the possibility of better data embeddings, which results in higher accuracy. In this paper, the pixels selected for metric learning were chosen randomly. However, this strategy could be possibly improved using some heuristic selection procedures, such as choosing poorly embedded pixels or selecting only a fraction of a nucleus from the sample pixels. This shall be investigated in more detail in the near future. Given the fact that images in most biomedical applications have very high variability, and that large quantities of images for most problems are not available, metric learning may provide a chance for higher accuracies with smaller samples of images. As such, we believe that our research contributes to future studies in the field of biomedical science.  
The code developed during this study is available at [[http://www.mdpi.com/2076-3417/10/2/615/sl](http://www.mdpi.com/2076-3417/10/2/615/sl)]([http://www.mdpi.com/2076-3417/10/2/615/sl](http://www.mdpi.com/2076-3417/10/2/615/sl)).  
Conceptualisation, A.P.-T. and K.S.; Methodology, A.P.-T., K.S. and T.I.I.; Software T.I., Validation, A.P.-T. and T.I.; Visualisation, A.P.-T. and K.S.; All authors assisted in writing and improving the paper. All authors have read and agreed to the published version of the manuscript.  
This research was funded by project \"R&D of Cell Nucleus Detection Model Based on Artificial Intelligence\", Kaunas University of Technology, grant number PP-91G/19.  
The authors declare no conflict of interest.  
The following abbreviations are used in this manuscript:  
AUC Area under the ROC curve  
CNN Convolutional Neural Network  
DenseNet Dense Convolutional Network  
ResNet Residual Neural Network  
ROC Receiver Operating Characteristics