Abstract
Tumor-infiltrating lymphocytes (TILs) are established prognostic biomarkers in high-grade breast cancer, yet traditional manual assessment suffers from inter-observer variability, subjective interpretation, and limited scalability. We propose a novel artificial intelligence-based framework for automated TIL quantification that integrates foundation-model embeddings, graph-based spatial attention, and uncertainty calibration to improve generalizability and clinical reliability. The multi-stage pipeline incorporates advanced preprocessing, colour normalisation, multi-scale feature extraction using dilated residual networks, and hybrid detection-segmentation via YOLO and U-Net for accurate lymphocyte detection. Clinical validation was conducted on a multi-institutional dataset comprising 2847 cases from BINO Hospital and two independent external cohorts: TCGA-BRCA (1020 slides) and Camelyon17 (500 slides). The framework achieved 94.7% accuracy and AUC = 0.92 internally, with robust external performance (92.1% / 0.895 and 91.3% / 0.882), demonstrating effective cross-scanner and cross-staining adaptability. Blinded multi-reader analysis involving expert pathologists showed strong concordance (Pearson’s r = 0.879), and a prospective deployment-style pilot achieved real-time processing in 2.3 min per slide, reducing assessment time by 87% compared to manual scoring. Prognostic evaluation using Kaplan-Meier survival analysis revealed a significant correlation between AI-derived TIL density and disease-free survival (HR = 0.642, p < 0.001), thereby enhancing clinical decision support for risk stratification and treatment planning. Comparative benchmarking against TILScout, CommunEng-TIL, DeepTILs, and QuPath demonstrates superior accuracy, computational efficiency, and clinical robustness. This framework provides standardised, reproducible, and high-throughput TIL quantification, addressing the limitations of manual evaluation and establishing a scalable solution for precision oncology in diverse pathology settings. SUPPLEMENTARY INFORMATION: The online version contains supplementary material available at 10.1007/s12672-025-04185-5.