Copyright: ©Author(s) 2026.
World J Gastroenterol. Aug 28, 2026; 32(32): 120382
Published online Aug 28, 2026. doi: 10.3748/wjg.120382
Published online Aug 28, 2026. doi: 10.3748/wjg.120382
Figure 1 Overall workflow of the multiscale two-stage convolutional neural network model for automatic recognition of gastric mucosal tumour-infiltrating lymphocytes and prognostic analysis.
This workflow shows four core stages of automated tumour-infiltrating lymphocyte (TIL) analysis and prognostic evaluation in gastric mucosal biopsy images. A: A total of 320 whole slide images (WSIs) from three centres were divided into training and in dependent test sets (7:3); B: WSIs underwent regions of interest extraction, Ruifrok-Johnston colour deconvolution (to eliminate staining heterogeneity) and 299 pixel × 299 pixel patch generation; C: A two-stage convolutional neural network (CNN) was constructed-a gastric CNN (based on pretrained Inception-ResNet-v2) for lesion segmentation/grading and a gastric artificial intelligence-TIL (G-AI-TIL) with three multiscale branches (10 × /20 × /40 ×) and attention fusion for TIL enumeration; D: The G-AI-TIL index was calculated to analyse its correlation with lesion grade; Kaplan-Meier and Cox regression verified its prognostic value in early gastric cancer, and a prognostic nomogram was constructed. WSI: Whole slide image; ROI: Region of interest; H/E: Hematoxylin and eosin; CNN: Convolutional neural network; CAG: Chronic atrophic gastritis; IM: Intestinal metaplasia; HGIN: High-grade intraepithelial neoplasia; EGC: Early gastric cancer; TIL: Tumor-infiltrating lymphocytes; G-AI-TIL: Gastric artificial intelligence-based tumor-infiltrating lymphocytes.
Figure 2 Schematic workflow and multiscale convolutional neural network architecture for tumour-infiltrating lymphocyte recognition in gastric mucosa.
The pipeline consists of four primary stages: (1) Dataset preparation: The study cohort was divided into a training set and an independent test set; (2) Image preprocessing: Original hematoxylin and eosin images were decomposed into 2-channel (H and E) components via color deconvolution to resolve channel dimension mismatch and enhance staining robustness; (3) Model core: A multiscale convolutional neural network architecture featuring parallel branches and attention mechanisms was employed to extract multi-resolution features; and (4) Output and visualization: The model generates attention heatmaps that precisely highlight tumour-infiltrating lymphocyte nuclear regions (red) while effectively suppressing interference from background structures such as goblet cells. H/E: Hematoxylin and eosin.
Figure 3 Performance evaluation of the gastric tumour-infiltrating lymphocyte-convolutional neural network model for tumour-infiltrating lymphocyte recognition.
Model performance was evaluated on 31104 test set patches. A: The receiver operating characteristic curve shows excellent discriminative ability for tumour-infiltrating lymphocyte (TILs)/non-TILs; B: The confusion matrix reveals 100.0% specificity (no false positives) and 98.7% sensitivity (1.3% miss rate); C: The scatter plot shows a strong positive correlation (Pearson r = 0.93, P < 0.001) between the gastric artificial intelligence-based TIL and the pathologist-manual TIL density, confirming quantitative consistency; D: The bar chart shows that the model outperforms the manual evaluation in terms of accuracy (99.2% vs 86.3%) and kappa coefficient (0.98 vs 0.72, P < 0.001), indicating that the interobserver variability is reduced. ROC: Receiver operating characteristic; AUC: Area under the curve; TIL: Tumour-infiltrating lymphocyte; CNN: Convolutional neural network; G-AI-TIL: Gastric artificial intelligence-based tumor-infiltrating lymphocytes.
Figure 4 Model interpretability analysis and immunohistochemistry validation of tumour-infiltrating lymphocyte recognition.
Representative images (scale bar = 50 μm) of chronic atrophic gastritis, intestinal metaplasia, high-grade intraepithelial neoplasia and early gastric cancer compared with original hematoxylin and eosin staining, pathologists’ double-blind manual annotation, artificial intelligence (AI) attention heatmaps and CD3/CD8 immunohistochemistry (IHC) validation. Red regions in heatmaps indicate the model’s focus on tumour-infiltrating lymphocyte (TIL) nuclear regions, avoiding interference from goblet cells (IM). AI-recognized epithelial TIL regions show 100% positive concordance with CD3/CD8 IHC staining (black arrows), confirming that there are no false positives. The attention regions of the model are highly consistent with the manual annotations (IoU = 0.89; Dice coefficient = 0.94). CAG: Chronic atrophic gastritis; IM: Intestinal metaplasia; HGIN: High-grade intraepithelial neoplasia; EGC: Early gastric cancer; IHC: Immunohistochemistry; AI: Artificial intelligence; H/E: Hematoxylin and eosin.
Figure 5 Ablation experiment results of the gastric tumour-infiltrating lymphocyte-convolutional neural network model.
A: Compared with equal weight fusion, dynamic learning weight fusion achieves higher accuracy (99.2% vs 96.5%) and kappa (0.98 vs 0.89, P < 0.001), with better intestinal metaplasia tumour-infiltrating lymphocyte recognition (98.6% vs 94.2%); B: 2-channel haematoxylin/eosin input outperforms 3-channel red green blue input in terms of accuracy (99.2% vs 94.7%), specificity (100.0% vs 92.3%) and sensitivity (98.7% vs 95.1%, P < 0.001), eliminating staining batch interference and improving multicentre sample robustness. H/E: Haematoxylin/eosin; RGB: Red green blue.
Figure 6 Correlations between the gastric artificial intelligence-based tumor-infiltrating lymphocytes and pathological grade of gastric mucosal lesions.
The box plot shows the gastric artificial intelligence-based tumor-infiltrating lymphocytes (G-AI-TIL) distribution across the four lesion types (24 cases each) in the test set, with the x-axis ordered by increasing malignancy [chronic atrophic gastritis (CAG)→intestinal metaplasia (IM)→high-grade intraepithelial neoplasia (HGIN)→early gastric cancer (EGC)]. The results of the Kruskal-Wallis test and the Tukey post hoc test confirmed a stepwise increase in the median G-AI-TIL: CAG (5.3%) < IM (8.7%, P < 0.01) < HGIN (15.2%, P < 0.001) < EGC (28.5%, P < 0.001). The G-AI-TIL is positively correlated with lesion malignancy and serves as a quantitative index for grading gastric mucosal lesions. CAG: Chronic atrophic gastritis; IM: Intestinal metaplasia; HGIN: High-grade intraepithelial neoplasia; EGC: Early gastric cancer; G-AI-TIL: Gastric artificial intelligence-based tumor-infiltrating lymphocytes.
Figure 7 Prognostic value of the gastric artificial intelligence-based tumor-infiltrating lymphocytes index in early gastric cancer.
A and B: Kaplan-Meier curves for disease-free survival and overall survival (OS) stratified by the median gastric artificial intelligence-based tumor-infiltrating lymphocytes (G-AI-TIL) cut-off of 28.5% (log-rank test). The high G-AI-TIL group exhibited significantly better survival outcomes; C: Forest plot of multivariate Cox regression analysis for OS, identifying high G-AI-TIL ( ≥ 28.5%) as an independent protective factor alongside risk factors such as age and submucosal invasion; D: A prognostic nomogram predicting 3- and 5-year OS probabilities by integrating G-AI-TIL, age, and invasion depth, with matching calibration curves demonstrating high accuracy (C-index = 0.81). EGC: Early gastric cancer; HR: Hazard ratio; CI: Confidence interval; G-AI-TIL: Gastric artificial intelligence-based tumor-infiltrating lymphocytes.
- Citation: Fan Y, Wang SN, Jiang B, Li YY, Zhu CY, Liao XH, Zhang FS, Wang YK. Automatic recognition of tumour-infiltrating lymphocytes in pathological biopsy images of the gastric mucosa. World J Gastroenterol 2026; 32(32): 120382
- URL: https://www.wjgnet.com/1007-9327/full/v32/i32/120382.htm
- DOI: https://dx.doi.org/10.3748/wjg.120382