Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2025 Jul 1;15(1):20655.
doi: 10.1038/s41598-025-07561-x.

Transformer attention fusion for fine grained medical image classification

Affiliations

Transformer attention fusion for fine grained medical image classification

Danyal Badar et al. Sci Rep. .

Abstract

Fine-grained visual classification is fundamental for medical image applications because it detects minor lesions. Diabetic retinopathy (DR) is a preventable cause of blindness, which requires exact and timely diagnosis to prevent vision damage. The challenges automated DR classification systems face include irregular lesions, uneven distributions between image classes, and inconsistent image quality that reduces diagnostic accuracy during early detection stages. Our solution to these problems includes MSCAS-Net (Multi-Scale Cross and Self-Attention Network), which uses the Swin Transformer as the backbone. It extracts features at three different resolutions (12 × 12, 24 × 24, 48 × 48), allowing it to detect subtle local features and global elements. This model uses self-attention mechanics to improve spatial connections between single scales and cross-attention to automatically match feature patterns across multiple scales, thereby developing a comprehensive information structure. The model becomes better at detecting significant lesions because of its dual mechanism, which focuses on both attention points. MSCAS-Net displays the best performance on APTOS and DDR and IDRID benchmarks by reaching accuracy levels of 93.8%, 89.80% and 86.70%, respectively. Through its algorithm, the model solves problems with imbalanced datasets and inconsistent image quality without needing data augmentation because it learns stable features. MSCAS-Net demonstrates a breakthrough in automated DR diagnostics since it combines high diagnostic precision with interpretable abilities to become an efficient AI-powered clinical decision support system. The presented research demonstrates how fine-grained visual classification methods benefit detecting and treating DR during its early stages.

Keywords: Attention mechanism; Deep learning; Diabetic retinopathy classification; Fine-grained visual classification; Medical images; Multi-scale feature extraction.

PubMed Disclaimer

Conflict of interest statement

Declarations. Competing interests: The authors declare no competing interests.

Figures

Fig. 1
Fig. 1
MSCAS-Net (multi-scale cross and self-attention network) architecture.
Fig. 2
Fig. 2
Self-attention block.
Fig. 3
Fig. 3
Cross attention block.
Fig. 4
Fig. 4
Training and validation accuracy curves for APTOS dataset.
Fig. 5
Fig. 5
Training and validation loss curves for APTOS dataset.
Fig. 6
Fig. 6
Training and validation accuracy curves for DDR dataset.
Fig. 7
Fig. 7
Training and validation loss curves for DDR dataset.
Fig. 8
Fig. 8
Training and validation accuracy curves for IDRID dataset.
Fig. 9
Fig. 9
Training and validation loss curves for IDRID dataset.
Fig. 10
Fig. 10
A visual example of heatmaps generated using this model on three datasets (a) APTOS (b) DDR and (c) IDRID.

Similar articles

References

    1. Salud, O. M. d.l. Organización Mundial de la Salud. https://www.who.int/es/news-room/fact-sheets/detail/diabetes.
    1. Hegde, A. & Sumana, K. R. Comparative study of diabetic retinopathy detection using machine learning techniques. Int. J. Res. Appl. Sci. Eng. Technol. (2022).
    1. Wan, S., Liang, Y. & Zhang, Y. Deep convolutional neural networks for diabetic retinopathy detection by image classification. Computers Electr. Eng.72, 274–282 (2018).
    1. Abbas, Q. et al. HDR-EfficientNet: a classification of hypertensive and diabetic retinopathy using optimize Efficientnet architecture. Diagnostics13(20), 3236 (2023). - PMC - PubMed
    1. Harithalakshmi, K., Rajan, R. & Nadheera, K. EfficientNet-based diabetic retinopathy classification using data augmentation. In 2023 9th International Conference on Smart Computing and Communications (ICSCC). (IEEE, 2023).

MeSH terms

LinkOut - more resources