Researchers have developed a hybrid deep learning framework that combines two established neural network architectures with an attention mechanism and a specialised loss function to classify gastrointestinal endoscopic images more accurately. The study, published in Scientific Reports, addresses two persistent obstacles in automated endoscopy analysis: visual similarity between disease classes and imbalance in the number of images available per class.
The framework merges ResNet50 and VGG16, two widely used convolutional neural network architectures, into a single feature-level hybrid model. Each architecture was first individually optimised with a Coordinate Attention (CoordAttention) mechanism, which helps the network focus on the most informative spatial regions of an image before the two feature streams are concatenated. The combined model was then trained with focal loss, a loss function that emphasises difficult and underrepresented samples and thereby mitigates the effects of class imbalance without requiring any synthetic data generation.
Experiments on the 22-class GastroVision dataset showed that the hybrid model with CoordAttention achieved a macro F1-score of 0.718, a micro F1-score of 0.897, and a Matthews correlation coefficient of 0.886, outperforming both the baseline and the compared state-of-the-art models. For comparison, the same hybrid model without CoordAttention, still trained with focal loss, reached a macro F1-score of 0.657, a micro F1-score of 0.835, and an MCC of 0.816. The gap between these results indicates that the attention mechanism contributed substantially to the model’s ability to distinguish visually similar classes, while focal loss addressed the imbalance problem.
The authors note that their approach applied only standard data augmentation, uniformly across the dataset, and used no specific class-balancing strategy to artificially even out class distributions. Because no synthetic technique was used to handle imbalance, the researchers suggest the framework may be applicable to datasets with different class distributions. Gastrointestinal diseases remain a major global health challenge requiring timely and accurate diagnosis, and deep learning has shown promise in endoscopic image analysis, but class imbalance and visual similarity among classes have continued to degrade prediction performance. The team concludes that the proposed framework is a useful approach for jointly addressing both problems in GI endoscopy image classification.
Subject of Research: A hybrid deep learning framework with Coordinate Attention and focal loss for classifying gastrointestinal endoscopic images
Article Title: A hybrid CoordAttention model with focal loss for handling visual similarity in gastrointestinal endoscopic images
Article References: Akram, S., Zafar, B., Hanif, M. K., & Khan, M. M. (2026). A hybrid CoordAttention model with focal loss for handling visual similarity in gastrointestinal endoscopic images. Scientific Reports. https://doi.org/10.1038/s41598-026-77341-8
Image Credits: AI Generated
DOI: 10.1038/s41598-026-77341-8
Keywords: deep learning, gastrointestinal endoscopy, image classification, CoordAttention, focal loss, class imbalance, ResNet50, VGG16, GastroVision dataset, Scientific Reports, hybrid, model
Cite Scienmag News
Blake Davidson. (October 28, 2026). Hybrid attention model with focal loss improves GI endoscopy image classification. Scienmag. https://scienmag.com/hybrid-attention-model-with-focal-loss-improves-gi-endoscopy-image-classification/
Blake Davidson. "Hybrid attention model with focal loss improves GI endoscopy image classification." Scienmag, 28 October 2026, https://scienmag.com/hybrid-attention-model-with-focal-loss-improves-gi-endoscopy-image-classification/. Accessed 30 October 2026.
Blake Davidson. "Hybrid attention model with focal loss improves GI endoscopy image classification." Scienmag. October 28, 2026. https://scienmag.com/hybrid-attention-model-with-focal-loss-improves-gi-endoscopy-image-classification/








