Skip to main content

Thank you for visiting nature.com. You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

Advertisement

Scientific Reports
  • View all journals
  • Search
  • My Account Login
  • Content Explore content
  • About the journal
  • Publish with us
  • Sign up for alerts
  • RSS feed
  1. nature
  2. scientific reports
  3. articles
  4. article
Weakly supervised colorectal gland segmentation through self-supervised learning and attention-based pseudo-labeling
Download PDF
Download PDF
  • Article
  • Open access
  • Published: 19 January 2026

Weakly supervised colorectal gland segmentation through self-supervised learning and attention-based pseudo-labeling

  • Huer Wen1,
  • Yan Wu1,
  • DeShuang Huang2 &
  • …
  • Cong Liu3,4 

Scientific Reports , Article number:  (2026) Cite this article

  • 553 Accesses

  • Metrics details

We are providing an unedited version of this manuscript to give early access to its findings. Before final publication, the manuscript will undergo further editing. Please note there may be errors present which affect the content, and all legal disclaimers apply.

Subjects

  • Oncology
  • Pathogenesis

Abstract

Accurate gland segmentation in colorectal cancer histopathology is crucial, but the scarcity of pixel-level annotations limits robust model development. This study aims to develop a highly accurate gland segmentation method that leverages weakly labeled data, specifically image-level labels, to overcome the need for extensive pixel-level annotations. We propose a novel three-stage framework that uniquely combines self-supervised fine-tuning of the DINOv2 vision transformer, attention-based pseudo-label generation, and a boundary-aware loss function. Initially, an off-the-shelf DINOv2 encoder is fine-tuned on a large unlabeled dataset of histopathology images. This fine-tuned encoder is then integrated into a classification network equipped with an attention mechanism, which is trained using image-level labels to generate initial pseudo-labels via attention maps. These maps are refined through blending, thresholding, and Conditional Random Field (CRF) post-processing. Finally, a segmentation network, employing the same fine-tuned encoder and a lightweight decoder, is trained using these refined pseudo-labels and a boundary-aware loss. Ablation studies demonstrated the significant benefit of the fine-tuned encoder and the comprehensive post-processing steps for pseudo-label generation. Further studies confirmed the effectiveness of the boundary-aware loss in improving segmentation accuracy. Our method achieved superior performance on the GlaS dataset compared to several state-of-the-art methods, including both fully supervised and weakly supervised approaches, demonstrating higher F1-score, Object Dice, and lower Object Hausdorff distance. This approach effectively addresses the challenge of limited pixel-level annotations by utilizing more readily available image-level data, offering a promising solution for improved colorectal cancer diagnosis. The proposed framework shows potential for generalization to other histopathology image analysis tasks.

Similar content being viewed by others

Self-supervised learning for data augmentation in histopathology image segmentation

Article Open access 12 November 2025

Colorectal cancer detection with enhanced precision using a hybrid supervised and unsupervised learning approach

Article Open access 25 January 2025

Prediction of the histology of colorectal neoplasm in white light colonoscopic images using deep learning algorithms

Article Open access 05 March 2021

Data availability

The GlaS dataset and IMP-CRS-2024 dataset are publicly available from the MICCAI 2015 Gland Segmentation Challenge (https://warwick.ac.uk/fac/cross_fac/tia/data/glascontest/) and IMP Diagnostics and INESC TEC (https://open-datasets.inesctec.pt/NQ3sxFMZ/), respectively.

Code availability

To ensure reproducibility and to support future research, the implementation code has been made publicly available on Zenodo at https://zenodo.org/records/17677517.

References

  1. Bray, F. et al. Global cancer statistics 2022: Globocan estimates of incidence and mortality worldwide for 36 cancers in 185 countries. CA: a cancer journal for clinicians 74, 229–263, https://doi.org/10.3322/caac.21834 (2024).

  2. Bokhorst, J.-M. et al. Deep learning for multi-class semantic segmentation enables colorectal cancer detection and classification in digital pathology images. Scientific Reports 13, 8398. https://doi.org/10.1038/s41598-023-35491-z (2023).

    Google Scholar 

  3. Song, A. H. et al. Artificial intelligence for digital and computational pathology. Nature Reviews Bioengineering 1, 930–949. https://doi.org/10.1038/s44222-023-00096-8 (2021).

    Google Scholar 

  4. Bilal, M., Nimir, M., Snead, D., Taylor, G. S. & Rajpoot, N. Role of ai and digital pathology for colorectal immuno-oncology. British journal of cancer 128, 3–11. https://doi.org/10.1038/s41416-022-01986-1 (2023).

    Google Scholar 

  5. Davri, A. et al. Deep learning on histopathological images for colorectal cancer diagnosis: A systematic review. Diagnostics 12, https://doi.org/10.3390/diagnostics12040837 (2022).

  6. Ronneberger, O., Fischer, P. & Brox, T. U-net: Convolutional networks for biomedical image segmentation. Medical Image Computing and Computer-Assisted Intervention - MICCAI 2015, 234–241 (2015).

    Google Scholar 

  7. Chen, H., Qi, X., Yu, L. & Heng, P.-A. Dcan: Deep contour-aware networks for accurate gland segmentation. 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR) 2487–2496, https://doi.org/10.1109/CVPR.2016.273 (2016).

  8. Xu, Y. et al. Gland instance segmentation using deep multichannel neural networks. IEEE Transactions on Biomedical Engineering 64, 2901–2912. https://doi.org/10.1109/TBME.2017.2686418 (2017).

    Google Scholar 

  9. Graham, S. et al. Mild-net: Minimal information loss dilated network for gland instance segmentation in colon histology images. Medical Image Analysis 52, 199–211. https://doi.org/10.1016/j.media.2018.12.001 (2019).

    Google Scholar 

  10. Zhang, S. et al. Venet: Variational energy network for gland segmentation of pathological images and early gastric cancer diagnosis of whole slide images. Computer Methods and Programs in Biomedicine 250, 108178. https://doi.org/10.1016/j.cmpb.2024.108178 (2024).

    Google Scholar 

  11. Sun, M., Wang, J., Gong, Q. & Huang, W. Enhancing gland segmentation in colon histology images using an instance-aware diffusion model. Computers in Biology and Medicine 166, 107527. https://doi.org/10.1016/j.compbiomed.2023.107527 (2023).

    Google Scholar 

  12. Zhou, B., Khosla, A., Lapedriza, A., Oliva, A. & Torralba, A. Learning deep features for discriminative localization. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2921–2929 (2016).

  13. Ahn, J. & Kwak, S. Learning pixel-level semantic affinity with image-level supervision for weakly supervised semantic segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 4981–4990 (2018).

  14. Ahn, J., Cho, S. & Kwak, S. Weakly supervised learning of instance segmentation with inter-pixel relations. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2209–2218 (2019).

  15. Jo, S. & Yu, I.-J. Puzzle-cam: Improved localization via matching partial and full features. arXiv preprint arXiv:2101.11253 (2021).

  16. Lee, J., Kim, E. & Yoon, S. Anti-adversarially manipulated attributions for weakly and semi-supervised semantic segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 4071–4080 (2021).

  17. Ru, L., Zhan, Y., Yu, B. & Du, B. Learning affinity from attention: End-to-end weakly-supervised semantic segmentation with transformers. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (2022).

  18. Zhang, B. et al. Contain: A contrastive approach for object-level weakly supervised semantic segmentation. arXiv preprint (2023).

  19. Xu, G. et al. Camel: A weakly supervised learning framework for histopathology image segmentation. 2019 IEEE/CVF International Conference on Computer Vision (ICCV) 10681–10690, https://doi.org/10.1109/ICCV.2019.01078 (2019).

  20. Chang, Y.-T. et al. Weakly-supervised semantic segmentation via sub-category exploration. CVPR 8991–9000, https://doi.org/10.48550/arXiv.2008.01183 (2020).

  21. Li, Y., Yu, Y., Zou, Y., Xiang, T. & Li, X. Online easy example mining for weakly-supervised gland segmentation from histology images. Medical Image Computing and Computer Assisted Intervention - MICCAI 2022, 578–587 (2022).

    Google Scholar 

  22. Song, J., Yun, S., Yoon, S., Kim, J. & Lee, S. Ep-sam: Weakly supervised histopathology segmentation via enhanced prompt with segment anything. ArXiv arXiv:abs/2410.13621 (2024).

  23. He, K. et al. Masked autoencoders are scalable vision learners (2021). arXiv:2111.06377.

  24. Caron, M. et al. Emerging properties in self-supervised vision transformers. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV) (2021).

  25. Zhou, J. et al. ibot: Image BERT pre-training with online tokenizer. arXiv preprint arXiv:2111.07832 (2021).

  26. Chen, R. J. et al. Towards a general-purpose foundation model for computational pathology. Nature Medicine (2024).

  27. Zimmermann, E. et al. Virchow: A foundation model for pathology. arXiv preprint (2024).

  28. Xu, H. et al. Whole-slide foundation model for digital pathology. Nature Medicine (2024).

  29. Filiot, A. et al. Scaling self-supervised learning for histopathology with masked image modeling. arXiv preprint (2024).

  30. Bioptimus. H-optimus-0: An open-source foundation model for pathology. arXiv preprint arXiv:2411.08950 (2024).

  31. Gui, J. et al. Dinov2: Learning robust visual features without supervision. arXiv preprint (2023).

  32. Ilse, M., Tomczak, J. M. & Welling, M. Attention-based deep multiple instance learning. In Proceedings of the 35th International Conference on Machine Learning (ICML), vol. 80, 2127–2136 (PMLR, 2018).

  33. Krähenbühl, P. & Koltun, V. Efficient inference in fully connected CRFs with Gaussian edge potentials. In Advances in Neural Information Processing Systems (NeurIPS) (2011).

  34. Kervadec, H. et al. Boundary loss for highly unbalanced segmentation. In Medical Imaging with Deep Learning (MIDL) (2019).

  35. Oliveira, S. P. et al. Cad systems for colorectal cancer from wsi are still not ready for clinical acceptance. Scientific Reports 11, 1–15. https://doi.org/10.1038/s41598-021-93746-z (2021).

    Google Scholar 

  36. Neto, P. C. et al. imil4path: A semi-supervised interpretable approach for colorectal whole-slide images. Cancers 14, 2489 (2022).

    Google Scholar 

  37. Neto, P. C. et al. An interpretable machine learning system for colorectal cancer diagnosis from pathology slides. npj Precision Oncology 8, 56, https://doi.org/10.1038/s41698-024-00539-4 (2024).

  38. Sirinukunwattana, K. et al. Gland segmentation in colon histology images: The glas challenge contest. Medical Image Analysis 35, 489–502. https://doi.org/10.1016/j.media.2016.08.008 (2017).

    Google Scholar 

  39. Macenko, M. et al. A method for normalizing histology slides for quantitative analysis. 2009 IEEE International Symposium on Biomedical Imaging: From Nano to Macro 1107–1110, https://doi.org/10.1109/ISBI.2009.5193250 (2009).

  40. Paszke, A., Gross, S., Massa, F., Lerer, A. & Chintala, S. Pytorch: An imperative style, high-performance deep learning library. ArXiv https://doi.org/10.48550/arXiv.1912.01703 (2019).

  41. Pinckaers, H. & Litjens, G. J. S. Neural ordinary differential equations for semantic segmentation of individual colon glands. ArXiv arXiv:abs/1910.10470 (2019).

Download references

Acknowledgements

This work was supported by Natural Science Foundation of Shanghai under grant number 25ZR1401273.

Author information

Authors and Affiliations

  1. School of Computer Science and Technology, Tongji University, Shanghai, 200092, China

    Huer Wen & Yan Wu

  2. Eastern Institute of Technology, Ningbo, 315200, China

    DeShuang Huang

  3. Faculty of Business Information, Shanghai Business School, Shanghai, 201499, China

    Cong Liu

  4. Center of Medical Physics, Nanjing Medical University, Changzhou, Jiangsu, 213003, China

    Cong Liu

Authors
  1. Huer Wen
    View author publications

    Search author on:PubMed Google Scholar

  2. Yan Wu
    View author publications

    Search author on:PubMed Google Scholar

  3. DeShuang Huang
    View author publications

    Search author on:PubMed Google Scholar

  4. Cong Liu
    View author publications

    Search author on:PubMed Google Scholar

Contributions

H.W. and Y.W. conceived the experiment(s), H.W. conducted the experiment(s), D.H. and C.L. analysed the results. All authors reviewed the manuscript.

Corresponding author

Correspondence to Yan Wu.

Ethics declarations

Competing interests

The authors declare no competing interests.

Ethical Statement

This study utilized publicly available and de-identified datasets (GlaS, IMP-CRS-2024, CRAG). Ethical review and approval were not required for the use of these pre-existing datasets.

Additional information

Publisher’s note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License, which permits any non-commercial use, sharing, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if you modified the licensed material. You do not have permission under this licence to share adapted material derived from this article or parts of it. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Wen, H., Wu, Y., Huang, D. et al. Weakly supervised colorectal gland segmentation through self-supervised learning and attention-based pseudo-labeling. Sci Rep (2026). https://doi.org/10.1038/s41598-026-36256-0

Download citation

  • Received: 01 June 2025

  • Accepted: 12 January 2026

  • Published: 19 January 2026

  • DOI: https://doi.org/10.1038/s41598-026-36256-0

Share this article

Anyone you share the following link with will be able to read this content:

Sorry, a shareable link is not currently available for this article.

Provided by the Springer Nature SharedIt content-sharing initiative

Download PDF

Advertisement

Explore content

  • Research articles
  • News & Comment
  • Collections
  • Subjects
  • Follow us on Facebook
  • Follow us on Twitter
  • Sign up for alerts
  • RSS feed

About the journal

  • About Scientific Reports
  • Contact
  • Journal policies
  • Guide to referees
  • Calls for Papers
  • Editor's Choice
  • Journal highlights
  • Open Access Fees and Funding

Publish with us

  • For authors
  • Language editing services
  • Open access funding
  • Submit manuscript

Search

Advanced search

Quick links

  • Explore articles by subject
  • Find a job
  • Guide to authors
  • Editorial policies

Scientific Reports (Sci Rep)

ISSN 2045-2322 (online)

nature.com sitemap

About Nature Portfolio

  • About us
  • Press releases
  • Press office
  • Contact us

Discover content

  • Journals A-Z
  • Articles by subject
  • protocols.io
  • Nature Index

Publishing policies

  • Nature portfolio policies
  • Open access

Author & Researcher services

  • Reprints & permissions
  • Research data
  • Language editing
  • Scientific editing
  • Nature Masterclasses
  • Research Solutions

Libraries & institutions

  • Librarian service & tools
  • Librarian portal
  • Open research
  • Recommend to library

Advertising & partnerships

  • Advertising
  • Partnerships & Services
  • Media kits
  • Branded content

Professional development

  • Nature Awards
  • Nature Careers
  • Nature Conferences

Regional websites

  • Nature Africa
  • Nature China
  • Nature India
  • Nature Japan
  • Nature Middle East
  • Privacy Policy
  • Use of cookies
  • Legal notice
  • Accessibility statement
  • Terms & Conditions
  • Your US state privacy rights
Springer Nature

© 2026 Springer Nature Limited

Nature Briefing

Sign up for the Nature Briefing newsletter — what matters in science, free to your inbox daily.

Get the most important science stories of the day, free in your inbox. Sign up for Nature Briefing