Abstract
Background
Lymph node metastasis (LNM) is an important prognostic factor but is often underdiagnosed due to limitations in conventional assessment methods. We aimed to develop a deep learning (DL) model to predict LNM status from primary gastric cancer (GC) whole-slide images.
Methods
This retrospective study included 929 patients with GC from three independent cohorts across two centers. A DL model based on Clustering-constrained Attention Multiple Instance Learning was trained and validated to predict LNM from whole-slide images of primary tumors. The ability of the model to predict occult tumor cells (OTCs) in patients initially staged as pN0 and its prognostic value in patients with GC were examined.
Results
The model demonstrated robust LNM predictive performance. Notably, it also predicted OTCs in patients initially staged as pN0. Patients staged as pN0 with OTCs had significantly worse survival outcomes than those staged as pN0 without OTCs (P = 0.003). The score generated by the model was an independent prognostic factor for patients with GC.
Conclusions
Our DL-based model enables accurate prediction of LNM and OTCs from primary GC slides, serving as a valuable tool for guiding personalized clinical strategies and as a novel biomarker for prognostic evaluation in patients with GC.

This is a preview of subscription content, access via your institution
Access options
Subscribe to this journal
Receive 24 print issues and online access
$259.00 per year
only $10.79 per issue
Buy this article
- Purchase on SpringerLink
- Instant access to the full article PDF.
USD 39.95
Prices may be subject to local taxes which are calculated during checkout





Similar content being viewed by others
Data availability
The datasets used in this study are available from the corresponding author upon request. Code availability: All the codes associated with this method were implemented in Python. The source code for preprocessing and feature extraction is available at https://lunit-io.github.io/research/publications/pathology_ssl/. The source code used for training and evaluating the DL models is available at https://github.com/mahmoodlab/CLAM.
References
Sung H, Ferlay J, Siegel RL, Laversanne M, Soerjomataram I, Jemal A, et al. Global Cancer Statistics 2020: GLOBOCAN estimates of incidence and mortality worldwide for 36 cancers in 185 countries. CA Cancer J Clin. 2021;71:209–49.
Siegel RL, Miller KD, Wagle NS, Jemal A. Cancer statistics, 2023. CA Cancer J Clin. 2023;73:17–48.
Ajani JA, D’Amico TA, Bentrem DJ, Chao J, Cooke D, Corvera C, et al. Gastric cancer, Version 2.2022, NCCN Clinical Practice Guidelines in Oncology. J Natl Compr Canc Netw. 2022;20:167–92.
Shi RL, Chen Q, Ding JB, Yang Z, Pan G, Jiang D, et al. Increased number of negative lymph nodes is associated with improved survival outcome in node positive gastric cancer following radical gastrectomy. Oncotarget. 2016;7:35084–91.
Sano T, Coit DG, Kim HH, Roviello F, Kassab P, Wittekind C, et al. Proposal of a new stage grouping of gastric cancer for TNM classification: International Gastric Cancer Association staging project. Gastric Cancer. 2017;20:217–25.
de Burlet KJ, van den Hout MFCM, Putter H, Smit VTHBM, Hartgrink HH. Total number of lymph nodes in oncologic resections, is there more to be found? J Gastrointest Surg. 2015;19:943–8.
Seeruttun SR, Xu L, Wang F, Yi X, Fang C, Liu Z, et al. A homogenized approach to classify advanced gastric cancer patients with limited and adequate number of pathologically examined lymph nodes. Cancer Commun (Lond). 2019;39:32.
Arigami T, Uenosono Y, Yanagita S, Nakajo A, Ishigami S, Okumura H, et al. Clinical significance of lymph node micrometastasis in gastric cancer. Ann Surg Oncol. 2013;20:515–21.
Lee CM, Cho JM, Jang YJ, Park SS, Park SH, Kim SJ, et al. Should lymph node micrometastasis be considered in node staging for gastric cancer? the significance of lymph node micrometastasis in gastric cancer. Ann Surg Oncol. 2015;22:765–71.
Sekiguchi M, Oda I, Taniguchi H, Suzuki H, Morita S, Fukagawa T, et al. Risk stratification and predictive risk-scoring model for lymph node metastasis in early gastric cancer. J Gastroenterol. 2016;51:961–70.
Li Y, Wang D, Li Y, Liu X, Chen D, Yuan C, et al. Clinical significance of lymph node micrometastasis in pN0 gastric cancer patients. Gastroenterol Res Pract. 2021;2021:6854646.
Wang X, Yang X, Cai F, Cai M, Liu Y, Zhang L, et al. The key role of tumor budding in predicting the status of lymph node involvement in early gastric cancer patients: a clinical multicenter validation in China. Ann Surg Oncol. 2024;31:4224–35.
Kim JY, Kim CH, Lee Y, Lee JH, Chae YS. Tumour infiltrating lymphocytes are predictors of lymph node metastasis in early gastric cancers. Pathology. 2017;49:589–95.
Chen D, Chen G, Jiang W, Fu M, Liu W, Sui J, et al. Association of the collagen signature in the tumor microenvironment with lymph node metastasis in early gastric cancer. JAMA Surg. 2019;154:e185249.
Kather JN, Pearson AT, Halama N, Jäger D, Krause J, Loosen SH, et al. Deep learning can predict microsatellite instability directly from histology in gastrointestinal cancer. Nat Med. 2019;25:1054–6.
Huang B, Tian S, Zhan N, Ma J, Huang Z, Zhang C, et al. Accurate diagnosis and prognosis prediction of gastric cancer using deep learning on digital pathological images: a retrospective multicentre study. EBiomedicine. 2021;73:103631.
Zheng X, Wang R, Zhang X, Sun Y, Zhang H, Zhao Z, et al. A deep learning model and human-machine fusion for prediction of EBV-associated gastric cancer from histopathology. Nat Commun. 2022;13:2790.
Flinner N, Gretser S, Quaas A, Bankov K, Stoll A, Heckmann LE, et al. Deep learning based on hematoxylin-eosin staining outperforms immunohistochemistry in predicting molecular subtypes of gastric adenocarcinoma. J Pathol. 2022;257:218–26.
Wei Z, Zhao X, Chen J, Sun Q, Wang Z, Wang Y, et al. Deep learning-based stratification of gastric cancer patients from hematoxylin and eosin-stained whole slide images by predicting molecular features for immunotherapy response. Am J Pathol. 2023;193:1517–27.
Brockmoeller S, Echle A, Ghaffari Laleh N, Eiholm S, Malmstrøm ML, Plato Kuhlmann T, et al. Deep learning identifies inflamed fat as a risk factor for lymph node metastasis in early colorectal cancer. J Pathol. 2022;256:269–81.
Krogue JD, Azizi S, Tan F, Flament-Auvigne I, Brown T, Plass M, et al. Predicting lymph node metastasis from primary tumor histology and clinicopathologic factors in colorectal cancer using deep learning. Commun Med (Lond). 2023;3:59.
Zheng Q, Jian J, Wang J, Wang K, Fan J, Xu H, et al. Predicting lymph node metastasis status from primary muscle-invasive bladder cancer histology slides using deep learning: a retrospective multicenter study. Cancers (Basel). 2023;15:3000.
Guo Q, Qu L, Zhu J, Li H, Wu Y, Wang S, et al. Predicting lymph node metastasis from primary cervical squamous cell carcinoma based on deep learning in histopathologic images. Mod Pathol. 2023;36:100316.
Chen S, Xiang J, Wang X, Zhang J, Yang S, Yang W, et al. Deep learning-based pathology signature could reveal lymph node status and act as a novel prognostic marker across multiple cancer types. Br J Cancer. 2023;129:46–53.
Gao F, Jiang L, Guo T, Lin J, Xu W, Yuan L, et al. Deep learning-based pathological prediction of lymph node metastasis for patient with renal cell carcinoma from primary whole slide images. J Transl Med. 2024;22:568.
Muti HS, Röcken C, Behrens HM, Löffler CML, Reitsam NG, Grosser B, et al. Deep learning trained on lymph node status predicts outcome from gastric cancer histopathology: a retrospective multicentric study. Eur J Cancer. 2023;194:113335.
Guo Z, Lan J, Wang J, Hu Z, Wu Z, Quan J, et al. Prediction of lymph node metastasis in primary gastric cancer from pathological images and clinical data by multimodal multiscale deep learning. Biomed Signal Process Control. 2023;86:105336.
Zeng YJ, Zhang CD, Dai DQ. Impact of lymph node micrometastasis on gastric carcinoma prognosis: a meta-analysis. World J Gastroenterol. 2015;21:1628–35.
Mpallas KD, Lagopoulos VI, Kamparoudis AG. Prognostic significance of solitary lymphnode metastasis and micrometastasis in gastric cancer. Front Surg. 2018;5:63.
Tavares A, Wen X, Maciel J, Carneiro F, Dinis-Ribeiro M. Occult tumour cells in lymph nodes from gastric cancer patients: should isolated tumour cells also be considered?. Ann Surg Oncol. 2020;27:4204–15.
Wang X, Chen Y, Gao Y, Zhang H, Guan Z, Dong Z, et al. Predicting gastric cancer outcome from resected lymph node histopathology images using deep learning. Nat Commun. 2021;12:1637.
Huang SC, Chen CC, Lan J, Hsieh TY, Chuang HC, Chien MY, et al. Deep neural network trained on gigapixel images improves lymph node metastasis detection in clinical settings. Nat Commun. 2022;13:3347.
WHO Classification of Tumours Editorial Board. WHO classification of tumours: digestive system tumours. 5th ed. Lyon: International Agency for Research on Cancer; 2019.
Amin MB, Edge SB, Greene FL (ed.). AJCC Cancer Staging Manual. 8th ed (Springer, New York, 2017).
Jiang Y, Liang X, Han Z, Wang W, Xi S, Li T, et al. Radiographical assessment of tumour stroma and treatment outcomes using deep learning: a retrospective, multicohort study. Lancet Digit Health. 2021;3:e371–82.
Lu MY, Williamson DFK, Chen TY, Chen RJ, Barbieri M, Mahmood F. Data-efficient and weakly supervised computational pathology on whole-slide images. Nat Biomed Eng. 2021;5:555–70.
Kang M, Song H, Park S, Yoo D, Pereira S. Benchmarking self-supervised learning on diverse pathology datasets, (2023). http://arxiv.org/abs/2212.04690.
Agnes A, Biondi A, Cananzi FM, Rausei S, Reddavid R, Laterza V, et al. Ratio-based staging systems are better than the 7th and 8th editions of the TNM in stratifying the prognosis of gastric cancer patients: a multicenter retrospective study. J Surg Oncol. 2019;119:948–57.
Wang W, Yang YJ, Zhang RH, Deng JY, Sun Z, Seeruttun SR, et al. Standardizing the classification of gastric cancer patients with limited and adequate number of retrieved lymph nodes: an externally validated approach using real-world data. Mil Med Res. 2022;9:15.
Zhou Y, Zhang GJ, Wang J, Zheng KY, Fu W. Current status of lymph node micrometastasis in gastric cancer. Oncotarget. 2017;8:51963–9.
Nakajo A, Natsugoe S, Ishigami S, Matsumoto M, Nakashima S, Hokita S, et al. Detection and prediction of micrometastasis in the lymph nodes of patients with pN0 gastric cancer. Ann Surg Oncol. 2001;8:158–62.
Fukagawa T, Sasako M, Mann GB, Sano T, Katai H, Maruyama K, et al. Immunohistochemically detected micrometastases of the lymph nodes in patients with gastric carcinoma. Cancer. 2001;92:753–60.
Jeuck TLA, Wittekind C. Gastric carcinoma: stage migration by immunohistochemically detected lymph node micrometastases. Gastric Cancer. 2015;18:100–8.
Tavares A, Monteiro-Soares M, Viveiros F, Maciel Barbosa J, Dinis-Ribeiro M. Occult tumor cells in lymph nodes of patients with gastric cancer: a systematic review on their prevalence and predictive role. Oncology. 2015;89:245–54.
Wei T, Yuan X, Gao R, Johnston L, Zhou J, Wang Y, et al. Survival prediction of stomach cancer using expression data and deep learning models with histopathological images. Cancer Sci. 2023;114:690–701.
Veldhuizen GP, Röcken C, Behrens HM, Cifci D, Muti HS, Yoshikawa T, et al. Deep learning-based subtyping of gastric cancer histology predicts clinical outcome: a multi-institutional retrospective study. Gastric Cancer. 2023;26:708–20.
Zhao K, Li Z, Yao S, Wang Y, Wu X, Xu Z, et al. Artificial intelligence quantified tumour-stroma ratio is an independent predictor for overall survival in resectable colorectal cancer. EBiomedicine. 2020;61:103054.
Bokhorst JM, Ciompi F, Öztürk SK, Oguz Erdogan AS, Vieth M, Dawson H, et al. Fully automated tumor bud assessment in hematoxylin and eosin-stained whole slide images of colorectal cancer. Mod Pathol. 2023;36:100233.
Funding
This work was supported by grants from the High-level Hospital Construction Project (grant number: YKY-KF202204 to XWB; grant number: DFJHBF202108 to QLZ); Key R&D Program Projects in Guangdong Province (grant number: 2021B0101420005 to QLZ); the National Natural Science Foundation of China (grant number: 82173033 to QLZ; grant number: 82102712 to YWX); China Postdoctoral Science Foundation (grant number: 2021M690751 to YWX); and Guangdong Provincial Key Laboratory of Artificial Intelligence in Medical Image Analysis and Application (grant number: 2022B1212010011 to QLZ).
Author information
Authors and Affiliations
Contributions
HRS, TQX, JJW, XML, and QLZ conceived and designed the study. HRS, ZHL, WYH, HMW, YWX, QW, XXW, HHC, ZJC, and LL performed the research and collected the data. TQX and XML developed and validated the deep learning models. HRS and TQX wrote the first draft of the manuscript. JJW, LL, XWB, XML, and QLZ reviewed and edited the manuscript. All authors read and approved the final manuscript.
Corresponding authors
Ethics declarations
Competing interests
The authors declare no competing interests.
Ethics approval and consent to participate
This study was approved by the Research Ethics Committee of Guangdong Provincial People’s Hospital (approval number: KY-Z-2022-092-01; approval date: 05.20.2022) and the Research Ethics Committee of Nanfang Hospital of Southern Medical University (approval number: NFEC-2025-092; approval date: 03.07.2025). The study was conducted in accordance with the relevant laws and institutional guidelines and the principles outlined in the Declaration of Helsinki. The requirement for informed consent was waived due to the retrospective nature of the study.
Additional information
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Supplementary information
Rights and permissions
Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.
About this article
Cite this article
She, H., Xiang, T., Wang, J. et al. Deep learning-based prediction of lymph node metastasis and occult tumor cells in gastric cancer using histopathological images: a retrospective study. Br J Cancer (2026). https://doi.org/10.1038/s41416-026-03400-6
Received:
Revised:
Accepted:
Published:
Version of record:
DOI: https://doi.org/10.1038/s41416-026-03400-6


