Abstract
BACKGROUND: With growing insights into the tumor immune microenvironment, tumor-infiltrating lymphocytes (TILs) have emerged as key indicators of anti-tumor immunity. Numerous studies highlight their prognostic value in gastric cancer (GC). However, manual or semi-quantitative TIL assessment is time-consuming and poorly reproducible. METHODS: A total of 388 patients with gastric adenocarcinoma were randomly stratified into training and validation cohorts based on TNM stage. QuPath was used to establish an automated workflow for identifying tumor cells, TILs, and other stromal cells in brightfield hematoxylin-eosin (H&E)-stained tissue microarrays (TMAs). TIL-related variables were derived from these classifications. Prognostic significance was assessed using Kaplan-Meier analysis, log-rank tests, and univariable and multivariable Cox proportional hazards models. A nomogram incorporating age, T stage, lymph node metastasis and the proportion of TILs among all cells (pTILs) was built to predict 1- and 3-year overall survival (OS). RESULTS: Higher levels of TILs were associated with improved OS in both cohorts. Multivariate analysis confirmed that pTILs was an important prognostic factor for OS. The nomogram effectively predicted 1-year and 3-year OS. Notably, the nomogram-based risk stratification demonstrated better discriminative ability than TNM stage in distinguishing between low- and middle-risk patients. CONCLUSIONS: This study established a quantitative workflow for TIL assessment in GC. Integrating TIL-related parameters with clinical characteristics enhances risk stratification and may improve individualized prognosis prediction. SUPPLEMENTARY INFORMATION: The online version contains supplementary material available at 10.1186/s12885-025-15421-0.