Self-Refining Segment Anything Model for Nuclei Segmentation as Contrastive Learning Approach to Label-Efficient Pathological Imaging
Abstract
1. Introduction
- We propose a self-evolving pseudo-labeling strategy using EMA, enabling the model to refine its own learning targets and overcome the noise inherent in initial zero-shot labels.
- We introduce an instance-aware contrastive learning module that utilizes point prompts as reliable spatial anchors, providing essential latent-space supervision even when foreground pseudo-labels are missing or filtered out.
- We design a hierarchical pseudo-label refinement mechanism that differentiates between prompt-based adaptation and prompt-free segmentation targets to recover reliable pixels from previously ignored regions, significantly enhancing training efficiency and data utilization.
- We demonstrate the superior generalizability and robustness of our framework through extensive experiments on multiple histological datasets and various Vision Transformer backbones.
2. Materials and Methods
2.1. Overall Architecture
2.2. Prompt-Based Domain Adaptation
2.3. Prompt-Free Instance Segmentation
2.4. Hierarchical Pseudo-Label Refinement
2.5. Datasets and Implementation Details
- CPM17 [26]: This dataset consists of 64 H&E stained images from the 2017 Computational Precision Medicine challenge. It contains 7570 annotated nuclear boundaries with image sizes between and pixels. We utilized the standard split of 32 images for training and 32 images for testing.
- MoNuSeg [27]: This multi-organ dataset includes 30 H&E images ( pixels) from 7 human organs. It contains 21,623 annotated nuclei. We followed the standard protocol by splitting the dataset into 16 training and 14 testing images.
- CoNSeP [9]: This dataset consists of 41 colorectal adenocarcinoma images of pixels. Following the original protocol, we used 27 images for training and 14 for testing. This dataset is particularly challenging due to dense cell clusters and diverse nuclear morphologies.
3. Results
3.1. Quantitative Evaluation on Public Datasets
3.2. Qualitative Analysis
3.3. Ablation Study
4. Discussion
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Kumar, N.; Verma, R.; Sharma, S.; Bhargava, S.; Vahadane, A.; Sethi, A. A dataset and a technique for generalized nuclear segmentation for computational pathology. IEEE Trans. Med. Imaging 2017, 36, 1550–1560. [Google Scholar] [CrossRef] [PubMed]
- Alsubaie, N.; Sirinukunwattana, K.; Raza, S.E.A.; Snead, D.; Rajpoot, N. A bottom-up approach for tumour differentiation in whole slide images of lung adenocarcinoma. In Proceedings of the Medical Imaging 2018: Digital Pathology; SPIE: Bellingham, WA, USA, 2018; Volume 10581, pp. 104–113. [Google Scholar]
- Lu, C.; Romo-Bucheli, D.; Wang, X.; Janowczyk, A.; Ganesan, S.; Gilmore, H.; Rimm, D.; Madabhushi, A. Nuclear shape and orientation features from H&E images predict survival in early-stage estrogen receptor-positive breast cancers. Lab. Investig. 2018, 98, 1438–1448. [Google Scholar] [PubMed]
- Luo, J.; Huang, P.; He, P.; Wei, B.; Guo, X.; Xiao, H.; Sun, Y.; Tian, S.; Zhou, M.; Feng, P. DCA-DAFFNet: An end-to-end network with deformable fusion attention and deep adaptive feature fusion for laryngeal tumor grading from histopathology images. IEEE Trans. Instrum. Meas. 2023, 72, 5031115. [Google Scholar] [CrossRef]
- Li, C.; Huang, P.; Qin, J.; Luo, X. Knowledge-driven multiple instance learning with hierarchical cluster-incorporated aware filtering for larynx pathological grading. IEEE J. Biomed. Health Inform. 2025, 30, 2973–2985. [Google Scholar] [CrossRef]
- Huang, P.; He, P.; Tian, S.; Ma, M.; Feng, P.; Xiao, H.; Mercaldo, F.; Santone, A.; Qin, J. A ViT-AMC network with adaptive model fusion and multiobjective optimization for interpretable laryngeal tumor grading from histopathological images. IEEE Trans. Med. Imaging 2022, 42, 15–28. [Google Scholar] [CrossRef]
- Huang, P.; Li, C.; He, P.; Xiao, H.; Ping, Y.; Feng, P.; Tian, S.; Chen, H.; Mercaldo, F.; Santone, A.; et al. MamlFormer: Priori-experience guiding transformer network via manifold adversarial multi-modal learning for laryngeal histopathological grading. Inf. Fusion 2024, 108, 102333. [Google Scholar] [CrossRef]
- Hörst, F.; Rempe, M.; Heine, L.; Seibold, C.; Keyl, J.; Baldini, G.; Ugurel, S.; Siveke, J.; Grünwald, B.; Egger, J.; et al. Cellvit: Vision transformers for precise cell segmentation and classification. arXiv 2023, arXiv:2306.15350. [Google Scholar] [CrossRef]
- Graham, S.; Vu, Q.D.; Raza, S.E.A.; Azam, A.; Tsang, Y.W.; Kwak, J.T.; Rajpoot, N. Hover-net: Simultaneous segmentation and classification of nuclei in multi-tissue histology images. Med. Image Anal. 2019, 58, 101563. [Google Scholar] [CrossRef]
- Namgung, H.; Nam, S.; Kim, S.; Park, S.H. MC-NuSeg: Multi-Contour Aware Nuclei Instance Segmentation with Segment Anything Model. In Proceedings of the International Conference on Information Processing in Medical Imaging; Springer: Cham, Switzerland, 2025; pp. 283–296. [Google Scholar]
- Luna, M.; Chikontwe, P.; Park, S.H. Enhanced nuclei segmentation and classification via category descriptors in the SAM model. Bioengineering 2024, 11, 294. [Google Scholar] [CrossRef]
- Luna, M.; Chikontwe, P.; Nam, S.; Park, S.H. Attention guided multi-scale cluster refinement with extended field of view for amodal nuclei segmentation. Comput. Biol. Med. 2024, 170, 108015. [Google Scholar] [CrossRef]
- Luna, M.; Kwon, M.; Park, S.H. Precise separation of adjacent nuclei using a Siamese neural network. In Proceedings of the International Conference on Medical Image Computing and Computer-Assisted Intervention; Springer: Berlin/Heidelberg, Germany, 2019; pp. 577–585. [Google Scholar]
- Lal, S.; Das, D.; Alabhya, K.; Kanfade, A.; Kumar, A.; Kini, J. NucleiSegNet: Robust deep learning architecture for the nuclei segmentation of liver cancer histopathology images. Comput. Biol. Med. 2021, 128, 104075. [Google Scholar] [CrossRef]
- Qu, H.; Wu, P.; Huang, Q.; Yi, J.; Riedlinger, G.M.; De, S.; Metaxas, D.N. Weakly supervised deep nuclei segmentation using points annotation in histopathology images. In Proceedings of the International Conference on Medical Imaging with Deep Learning; PMLR: Cambridge, MA, USA, 2019; pp. 390–400. [Google Scholar]
- Qu, H.; Yi, J.; Huang, Q.; Wu, P.; Metaxas, D. Nuclei segmentation using mixed points and masks selected from uncertainty. In Proceedings of the 2020 IEEE 17th International Symposium on Biomedical Imaging (ISBI); IEEE: Piscataway, NJ, USA, 2020; pp. 973–976. [Google Scholar]
- Tian, K.; Zhang, J.; Shen, H.; Yan, K.; Dong, P.; Yao, J.; Che, S.; Luo, P.; Han, X. Weakly-supervised nucleus segmentation based on point annotations: A coarse-to-fine self-stimulated learning strategy. In Proceedings of the Medical Image Computing and Computer Assisted Intervention–MICCAI 2020: 23rd International Conference, Lima, Peru, 4–8 October 2020; Proceedings, Part V 23; Springer: Berlin/Heidelberg, Germany, 2020; pp. 299–308. [Google Scholar]
- Yoo, I.; Yoo, D.; Paeng, K. Pseudoedgenet: Nuclei segmentation only with point annotations. In Proceedings of the Medical Image Computing and Computer Assisted Intervention–MICCAI 2019: 22nd International Conference, Shenzhen, China, 13–17 October 2019; Proceedings, Part I 22; Springer: Berlin/Heidelberg, Germany, 2019; pp. 731–739. [Google Scholar]
- Lloyd, S. Least squares quantization in PCM. IEEE Trans. Inf. Theory 1982, 28, 129–137. [Google Scholar] [CrossRef]
- Kirillov, A.; Mintun, E.; Ravi, N.; Mao, H.; Rolland, C.; Gustafson, L.; Xiao, T.; Whitehead, S.; Berg, A.C.; Lo, W.Y.; et al. Segment anything. arXiv 2023, arXiv:2304.02643. [Google Scholar]
- Deng, R.; Cui, C.; Liu, Q.; Yao, T.; Remedios, L.W.; Bao, S.; Landman, B.A.; Wheless, L.E.; Coburn, L.A.; Wilson, K.T.; et al. Segment anything model (sam) for digital pathology: Assess zero-shot segmentation on whole slide imaging. arXiv 2023, arXiv:2304.04155. [Google Scholar] [CrossRef]
- Zhang, J.; Ma, K.; Kapse, S.; Saltz, J.; Vakalopoulou, M.; Prasanna, P.; Samaras, D. Sam-path: A segment anything model for semantic segmentation in digital pathology. In Proceedings of the International Conference on Medical Image Computing and Computer-Assisted Intervention; Springer: Berlin/Heidelberg, Germany, 2023; pp. 161–170. [Google Scholar]
- Zhang, Y.; Shen, Z.; Jiao, R. Segment anything model for medical image segmentation: Current applications and future directions. Comput. Biol. Med. 2024, 171, 108238. [Google Scholar] [CrossRef]
- Ma, J.; He, Y.; Li, F.; Han, L.; You, C.; Wang, B. Segment anything in medical images. Nat. Commun. 2024, 15, 654. [Google Scholar] [CrossRef]
- Nam, S.; Namgung, H.; Jeong, J.; Luna, M.; Kim, S.; Chikontwe, P.; Park, S.H. Instasam: Instance-aware segment any nuclei model with point annotations. In Proceedings of the International Conference on Medical Image Computing and Computer-Assisted Intervention; Springer: Berlin/Heidelberg, Germany, 2024; pp. 232–242. [Google Scholar]
- Vu, Q.D.; Graham, S.; Kurc, T.; To, M.N.N.; Shaban, M.; Qaiser, T.; Koohbanani, N.A.; Khurram, S.A.; Kalpathy-Cramer, J.; Zhao, T.; et al. Methods for segmentation and classification of digital microscopy tissue images. Front. Bioeng. Biotechnol. 2019, 7, 53. [Google Scholar] [CrossRef]
- Kumar, N.; Verma, R.; Anand, D.; Zhou, Y.; Onder, O.F.; Tsougenis, E.; Chen, H.; Heng, P.A.; Li, J.; Hu, Z.; et al. A multi-organ nucleus segmentation challenge. IEEE Trans. Med. Imaging 2019, 39, 1380–1391. [Google Scholar] [CrossRef]
- Chen, T.; Zhu, L.; Deng, C.; Cao, R.; Wang, Y.; Zhang, S.; Li, Z.; Sun, L.; Zang, Y.; Mao, P. Sam-adapter: Adapting segment anything in underperformed scenes. In Proceedings of the IEEE/CVF International Conference on Computer Vision; IEEE: New York, NY, USA, 2023; pp. 3367–3375. [Google Scholar]
- Loshchilov, I.; Hutter, F. Decoupled weight decay regularization. arXiv 2017, arXiv:1711.05101. [Google Scholar]
- Loshchilov, I.; Hutter, F. Sgdr: Stochastic gradient descent with warm restarts. arXiv 2016, arXiv:1608.03983. [Google Scholar]
- Liu, W.; He, Q.; He, X. Weakly Supervised Nuclei Segmentation Via Instance Learning. In Proceedings of the 2022 IEEE 19th International Symposium on Biomedical Imaging (ISBI); IEEE: New York, NY, USA, 2022; pp. 1–5. [Google Scholar]
- Nam, S.; Jeong, J.; Luna, M.; Chikontwe, P.; Park, S.H. PROnet: Point Refinement Using Shape-Guided Offset Map for Nuclei Instance Segmentation. In Proceedings of the International Conference on Medical Image Computing and Computer-Assisted Intervention; Springer: Berlin/Heidelberg, Germany, 2023; pp. 528–538. [Google Scholar]
- Cui, C.; Deng, R.; Liu, Q.; Yao, T.; Bao, S.; Remedios, L.W.; Tang, Y.; Huo, Y. All-in-sam: From weak annotation to pixel-wise nuclei segmentation with prompt-based finetuning. arXiv 2023, arXiv:2307.00290. [Google Scholar] [CrossRef]



| Method | CPM17 | MoNuSeg | CoNSeP | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Shift 0 | Shift 8 | Shift 0 | Shift 8 | Shift 0 | Shift 8 | |||||||
| Dice | AJI | Dice | AJI | Dice | AJI | Dice | AJI | Dice | AJI | Dice | AJI | |
| MIDL [15] | 75.0 | 55.5 | 72.2 | 49.9 | 70.1 | 44.9 | 66.9 | 41.8 | – | – | – | – |
| Mixed Anno [16] | 75.3 | 53.2 | 73.1 | 49.9 | 73.3 | 51.6 | 66.9 | 41.8 | – | – | – | – |
| SPN + IEN [31] | 74.3 | 54.3 | 69.4 | 46.8 | 74.0 | 53.4 | 65.6 | 39.4 | – | – | – | – |
| PROnet [32] | 78.7 | 62.7 | 77.0 | 60.2 | 75.0 | 55.5 | 72.5 | 50.9 | 62.1 | 41.4 | 58.3 | 35.8 |
| All-in-SAM [33] | 80.7 | 64.2 | – | – | 73.8 | 50.2 | – | – | – | – | – | – |
| InstaSAM [25] | 83.9 | 69.5 | 82.4 | 67.2 | 77.2 | 57.4 | 73.3 | 52.6 | 66.7 | 40.5 | 64.8 | 37.2 |
| Proposed | 82.9 | 68.0 | 82.0 | 65.6 | 77.6 | 57.6 | 76.1 | 54.1 | 71.4 | 45.3 | 67.3 | 41.0 |
| Method | CPM17 | MoNuSeg | ||
|---|---|---|---|---|
| Dice | AJI | Dice | AJI | |
| InstaSAM [25] (Baseline) | 79.20 | 63.49 | 73.85 | 51.39 |
| EMA + Consensus Filtering | 80.04 | 64.18 | 74.51 | 52.69 |
| EMA + Consensus + Loss (Proposed) | 80.38 | 65.15 | 75.22 | 53.53 |
| Strategy | CPM17 | MoNuSeg | CoNSeP | |||
|---|---|---|---|---|---|---|
| Dice | AJI | Dice | AJI | Dice | AJI | |
| Constant () | 80.88 | 65.60 | 73.85 | 51.39 | 56.32 | 28.55 |
| Exponential () | 81.24 | 65.69 | 73.04 | 51.19 | 62.19 | 34.97 |
| Step-wise (50/50 split) | 81.78 | 66.11 | 73.92 | 52.27 | 59.82 | 32.68 |
| Linear (Proposed) | 80.38 | 65.15 | 75.22 | 53.53 | 61.04 | 37.70 |
| Backbone | Method | Dice | AJI | Peak VRAM (MB) |
|---|---|---|---|---|
| ViT-B | Baseline | 54.44 | 27.68 | 77.12 |
| Proposed (Ours) | 61.04 | 37.70 | 89.56 | |
| ViT-L | Baseline | 61.67 | 34.30 | 137.98 |
| Proposed (Ours) | 67.60 | 41.92 | 150.67 | |
| ViT-H | Baseline | 66.70 | 40.48 | 184.62 |
| Proposed (Ours) | 71.44 | 45.30 | 197.21 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Nam, S.; Park, S.H. Self-Refining Segment Anything Model for Nuclei Segmentation as Contrastive Learning Approach to Label-Efficient Pathological Imaging. Diagnostics 2026, 16, 1370. https://doi.org/10.3390/diagnostics16091370
Nam S, Park SH. Self-Refining Segment Anything Model for Nuclei Segmentation as Contrastive Learning Approach to Label-Efficient Pathological Imaging. Diagnostics. 2026; 16(9):1370. https://doi.org/10.3390/diagnostics16091370
Chicago/Turabian StyleNam, Siwoo, and Sang Hyun Park. 2026. "Self-Refining Segment Anything Model for Nuclei Segmentation as Contrastive Learning Approach to Label-Efficient Pathological Imaging" Diagnostics 16, no. 9: 1370. https://doi.org/10.3390/diagnostics16091370
APA StyleNam, S., & Park, S. H. (2026). Self-Refining Segment Anything Model for Nuclei Segmentation as Contrastive Learning Approach to Label-Efficient Pathological Imaging. Diagnostics, 16(9), 1370. https://doi.org/10.3390/diagnostics16091370

