- Aims
Systematic visualization of anatomical landmarks is critical to prevent "blind spots" during esophagogastroduodenoscopy (EGD), which are a primary cause of missed upper gastrointestinal cancers. Standardized documentation serves as a secondary but essential tool for quality assurance. We aimed to develop a deep learning approach for the automated classification of 28 anatomicalAims
Systematic visualization of anatomical landmarks is critical to prevent "blind spots" during esophagogastroduodenoscopy (EGD), which are a primary cause of missed upper gastrointestinal cancers. Standardized documentation serves as a secondary but essential tool for quality assurance. We aimed to develop a deep learning approach for the automated classification of 28 anatomical categories, including a 22-segment mapping of the stomach based on the Japanese Systemic Stomach Screening (SSS) protocol. The primary goal was to provide a technical foundation for real-time monitoring of mucosal coverage to ensure examination completeness. Primary outcomes were macro F1-score and overall accuracy for this 28-class classification task.
Methods
We used a multi-center dataset of 9.012 endoscopic images from 1.553 patients, merging the public GastroHUN database (5.202 images; 385 patients) [1] and an internal dataset (3.810 images; 1.168 patients) from a European tertiary referral centre (Augsburg, Germany). All images were obtained during routine EGD using Olympus endoscopes and anonymized prior to analysis. Each image was labelled at image level into one of 28 anatomical classes: oropharynx, esophagus, esophagogastric junction, duodenal bulb, second part of the duodenum, papilla and 22 gastric segments based on the SSS classification using a consensus-based multi-annotator process (n=4). A trained and supervised specialist annotated additional data from Augsburg. To handle this complexity, we employed a Vision Transformer (ViT-L/14) foundation model pre-trained via DINO-v2. Instead of full-parameter fine-tuning, which risks overfitting on medical datasets, we implemented Low-Rank Adaptation (LoRA) [2]. By targeting only the Q- and V-projection layers in the final six transformer blocks, we reduced the trainable parameters to 312.000 (0.36% of the total model). Evaluation was performed using a strict patient-wise 5-fold cross-validation.
Results
The model achieved a mean macro F1-score of 0.88±0.01 and an overall accuracy of 0.88±0.01. Beyond robustly identifying major regions like the esophagus and duodenum, the model showed high precision in the more challenging differentiation of fine-grained SSS segments. The use of LoRA enabled stable training and strong generalization across the combined international and local datasets ([Abb. 1]).
Conclusions
Integrating transformer-based foundation models with LoRA-based fine-tuning allows for highly accurate UGIT anatomical mapping. An F1-score of 0.88 across 28 classes suggests that this approach is robust enough for automated documentation and real-time quality monitoring. Future work will focus on expanding the multi-center data volume and implementing expert consensus-labeling across all subsets to fürther refine model reliability, alongside developing a real-time visualization tool that provides an intuitive overview of the explored segments. To our knowledge, this is among the first studies to leverage a public endoscopy dataset together with institutional data for upper GI anatomical site classification.…

