Explainable endoscopic artificial intelligence method for real-time in situ significant rectal lesion characterization: a prospective cohort study

Niall Hardy, Pol MacAonghusa, Jeffrey Dalli, Jonathan P. Epperlein, Paul Huxel, Mohammad Faraz Khan, Alice Moynihan, Sergiy Zhuk, Hanneke Joosten, David J. Nijssen, Alberto Arezzo, Jurriaan B. Tuynman, Peter Neary, Roel Hompes, Ronan A. CahillInternational Journal of Surgery 2025

Abstract

Introduction The accurate assessment of colorectal polyps, particularly those over 2 cm, is crucial for optimizing therapy[1]. Despite advancements, pre-excision evaluation methods remain inadequate[2]. Colonoscopists primarily rely on visual assessment, sometimes aided by spectral-light mucosal illumination, with a diagnostic accuracy of just 40–70%[3,4]. To improve decision-making, tissue biopsies may follow visual evaluation or precede direct excision. However, biopsies, despite offering 80% accuracy, are prone to sampling errors and misclassification[5]. Additionally, they may induce fibrosis, complicating subsequent local excision. Imaging modalities such as MRI and ultrasound fare worse, with approximately 50% accuracy, and are typically performed after colonoscopy. Consequently, many excisions are performed as “excisional biopsies.” While endoscopic excision can cure some cancers, accurate preoperative oncological assessment could guide biopsy site selection, inform the excision plane (e.g. mucosal, submucosal, or full-thickness), and determine whether radical resection is necessary. Emerging artificial intelligence (AI) tools have demonstrated potential in colorectal lesion identification but face challenges in accuracy and interpretability, particularly for large polyps. Lesions exceeding 2 cm inherently carry at least a 10% cancer risk, even when appearing benign[6]. Near-infrared (NIR) perfusion-based endoscopic assessment offers a promising alternative, identifying cancers through distinct perfusion patterns associated with beyond-mucosal invasion, angiogenesis, and stromal changes[7,8]. Leveraging advances in computer vision and machine learning (ML), we present an explainable, AI-driven system for real-time cancer discrimination during endoscopy. This system integrates mucosal region of interest (ROI) and full field-of-view (FOV) analyses, providing actionable insights for patients with significant colorectal neoplasia. Methods Study Design and Recruitment: This prospective, multicenter trial (NCT04220242) spanned three countries and enrolled patients under institutional ethical approval (references: 1/378/2092 and W21_427#21.515). Patients with rectal lesions unsuitable for endoscopic resection or suspected malignancies were included. Procedures were conducted under general anesthesia at four university teaching hospitals. NIR Imaging: At examination, lesions and adjacent mucosa were observed using a commercially available NIR imaging system (Novadaq/Stryker, Stryker) with indocyanine green (ICG, 0.25 mg/kg) administered intravenously for perfusion assessment. Visualization for ultralow lesions utilized a camera held externally and anal retractor, while higher lesions were assessed endoscopically using a transanal access port (Gelport Path, Applied Medical) with positive pressure insufflation (20 mmHg, Airseal, Conmed Medical). Operators received training to optimize video capture quality, including minimizing camera movement and gently washing lesions[9]. Data Collection and Preprocessing: Patient demographics, operative details, radiological findings, and histopathological results were recorded. Video recordings (30 fps) were annotated for at least 80 seconds of uninterrupted visualization post-ICG administration. Annotated lesions were analyzed using ML frameworks. ML Development ROI-ML Analysis: Annotated videos were processed with a fluorescence intensity (FI) tracker to extract time-fluorescence curves from selected ROIs[10]. Missing data were imputed using established techniques, and the Borderline Minority Oversampling Technique (SMOTE) addressed class imbalances. An ensemble classifier pipeline, consisting of two multi-later perceptrons with hidden layers, analyzed these curves, generating 2D probability vectors for consensus cancer classification via a hierarchical voting mechanism prioritizing sensitivity. ML-FOV Analysis: Whole-lesion fluorescence data were analysed with MATLAB® using a fluorescence tracker with the Kanade-Lucas-Tomasi algorithm for frame stabilization. Probabilities of malignancy were predicted across a 432-region (18 × 24) grid, displayed as heatmaps. Errors due to light reflections, bleeding, or instrument interference were censored, and frames with insufficient control points were excluded. Training and Testing: ROI-ML performance with 80:20 training:testing split was assessed using 5-fold cross-validation and leave-one-out validation against histopathology and radiology findings. ML-FOV analysis involved training and testing on a dataset of 55 stable videos with full lesion visibility. Performance metrics against histopathology and MRI findings included sensitivity, specificity, and accuracy (using Cohen’s Kappa Statistics rating, SPSS Statistics v27, IBM). Results Patient and Video Characteristics: A total of 100 patients with rectal lesions contributed 108 recordings (eight patients underwent a second recording when reassessed after neoadjuvant therapy, n = 4, or polyp regrowth, n = 4), of which three were excluded due to excessive camera movement, instrument interference, or missed ICG inflow. The final dataset comprised 105 recordings from 97 patients (Table 1). Eight patients provided second recordings following neoadjuvant therapy or polyp regrowth. Table 1 - Patient/rectal lesion demographics and lesion data by subgroups. Patient/rectal lesion characteristics Initial training cohort Training cohort with exclusion criteria applied Unseen test case cohort All cases meeting inclusion criteria Locally resectable cases Cohort size 80 64 25 89 49 Male gender (%) 54 (68%) 47 (73%) 18 (72%) 65 (73%) 34 (69%) Age in years: mean (SD) 68 (13) 68 (12.2) 65.5 (10) 67.6 (11.7) 67.6 (12.2) No of cancers (%) 45 (56%) 45(70%) 17 (68%) 62 (69%) 22 (45%) Mean pathology tumor size in mm (SD) 41 (23.7) 42.2 (23.7) 33.7 (16.4) 40.2 (22.4) 44 (23) Neoadjuvant treatment (%) 11 (14%) 11 (17%) 4 (16%) 15 (17%) 0 (0%) Final rectal lesion pathology Low grade dysplastic adenoma 24 (30%) 14 (22%) 6 (24%) 20 (22% 20 (41%) High grade dysplastic adenoma 7 (9%) 5 (8%) 2 (8%) 7 (8%) 7 (14%) Adenocarcinoma 45 (56%) 45 (56%) 17 (68%) 62 (70%) 22 (45%) T1 9 (11%) 9 (14%) 4 (16%) 13 (15%) 11 (23%) T2 18 (23%) 18 (28%) 7 (28%) 25 (28%) 9 (18%) T3 14 (17%) 14 (22%) 6 (24%) 20 (22%) 1 (2%) T4 4 (5%) 4 (6%) 0 (0%) 4 (5%) 1 (2%) Other (hyperplastic, juvenile) 4 (5%) 0 (0%) 0 (0%) 0 (0%) 0 (0%) ROI-ML Performance: Initial ROI-ML analyses revealed false negatives primarily in redo excisions and ultralow anorectal lesions. Retraining with exclusion of these scenarios improved performance, including cases where malignancies were missed by biopsy or remained post-neoadjuvant therapy (Table 2). Among 49 lesions suitable for local excision, ROI-ML identified cancer in 19/24 cases. Of 28 lesions assessed by MRI, ROI-ML achieved 81% accuracy compared to MRI’s 61%. Table 2 - Percentage accuracy (acc), sensitivity (sens), specificity (spec), positive and negative predictive values (PPV and NVP, respectively), and kappa inter-rater reliability coefficient (k) for the ML classifiers, excision biopsy, and MRI before excision versus the final histopathological report (k < 0.0 = poor; 0.00–0.20 = slight; 0.21–0.40 = fair; 0.41–0.60 = moderate; 0.61–0.80 = substantial; 0.81–1.00 = almost perfect). ROI: user selected region of interest method; FOV: automated full field-of-view method. Characterization method ML digital characterization Tissue biopsy characterization* Patient cohort n Acc Sens Spec PPV NPV k Acc Sens Spec PPV NPV k ROI-ML unselected patients 80 78 93 57 74 87 0.53 76 58 100 100 65 0.55 ROI-ML included patient training 64 92 96 84 93 89 0.81 79 69 100 100 62 0.59 ROI-ML Included patient unseen testing 25 80 88 63 83 72 0.53 65 23 100 100 61 0.21 ROI-ML included patients suitable for local resection 49 82 86 78 76 88 0.63 73 61 100 100 53 0.49 ML-FOV prediction in included patients 50 90 94 81 91 87 0.77 66 50 100 100 49 0.42 ML-FOV prediction in included patients suitable for local resection 32 88 94 80 84 92 0.75 60 24 100 100 54 0.22 MRI prediction Acc Sens Spec PPV NPV Kappa All cases with MRI available (n = 64/89) ≥ T1 (cancer) = not locally resectable (i.e. MRI prediction of cancer) 81 94 44 83 70 0.470 All cases with MRI (64/89) ≤ T1 = locally resectable 81 90 56 86 64 0.503 MRI of locally resectable cases (n = 28) ≥ T1 = not locally resectable 61 85 40 55 75 0.238 MRI of locally resectable cases (n = 28) ≤ T1 = locally resectable 61 67 56 53 69 0.147 *One lesion in the unseen group was deemed benign by the endoscopist at the time of initial assessment with such certainty that a pre-operative biopsy was not performed. Subsequent local excision pathology revealed T1(Sm3) cancer which was correctly identified by the ML algorithm. ML-FOV Performance: Of 55 videos with complete lesion visibility, ML-FOV achieved an accuracy of 97% in training with weighted KNN and 90% in testing, outperforming biopsies (66% accuracy) (Fig. 1 and Table 2). Among lesions deemed suitable for local excision, ML-FOV achieved 88% accuracy compared to biopsy’s 60%. False positives stemmed from light reflections, bleeding, or trauma, while a single false negative occurred in an early T1 lesion subsequently treated with local resection.Figure 1.: ML-FOV prediction heatmapping of malignant (A-C) and benign (D-F) lesions with white light image (left) followed by turbo heatmap prediction with color overlay after image stabilization, fluorescence extraction and analysis. Image C represents an example of real-time intra-operative lesional assessment at time of TAMIS. Instrumentation of lesion results in false positive assessment (E) and light reflection upon lesion showing increased malignant probability (F). >5% of the abnormal area with >55% probability of cancer (orange-red) was set as the threshold for ML-FOV prediction of cancer. Real-Time Implementation: Real-time ML-FOV analysis was performed in three cases, with full classification completed within 5 minutes. One case, initially classified as dysplastic by biopsy, was correctly identified as malignant by fluorescence-guided ML, later confirmed as T1 cancer with adverse pathological features. Discussion Our study demonstrates the efficacy of ML-driven dynamic time-fluorescence curve analysis for malignancy discrimination, achieving accuracy comparable to or exceeding traditional imaging and biopsy. A conservative threshold (>0.55) minimized false negatives, facilitating pre-excision planning and patient counseling. The ML-FOV approach, which analyzes entire lesions without requiring predefined ROIs, outperformed biopsies and offers enhanced clinical utility and could even help biopsy targeting, define excision boundaries, and guide surgical strategy. Errors in perfusion classification were associated with incomplete lesion visualization, prior excisions, and scarring, and these findings underscore the need for refinements to address tissue distortion. Interestingly, neoadjuvant therapy did not significantly impact classification accuracy. Expanding the dataset with a higher proportion of benign lesions may improve false-positive rates and enable profiling of non-adenomatous or hyperplastic lesions. While the study predominantly utilized ex vivo data, clinical validation with trial-grade software is underway. Additionally, the cancer-heavy composition may have inflated malignancy classification accuracy, emphasizing the need for balanced datasets in future studies.
BibTeX
@article{hardy2025explainable,
  author = {Niall Hardy and Pol MacAonghusa and Jeffrey Dalli and Jonathan P. Epperlein and Paul Huxel and Mohammad Faraz Khan and Alice Moynihan and Sergiy Zhuk and Hanneke Joosten and David J. Nijssen and Alberto Arezzo and Jurriaan B. Tuynman and Peter Neary and Roel Hompes and Ronan A. Cahill},
  title = {{Explainable endoscopic artificial intelligence method for real-time in situ significant rectal lesion characterization: a prospective cohort study}},
  journal = {International Journal of Surgery},
  year = {2025},
  doi = {10.1097/js9.0000000000002244},
}
Figure