"Enhancing Retinal Disease Detection with the Swin Transformer: A Comprehensive Comparative Analysis. Concurrency and Computation: Practice and Experience." Source Code
Authors/Creators
- 1. Tekirdağ Namık Kemal University
Description
Release v1.0: Enhancing Retinal Disease Detection with the Swin Transformer: A Comprehensive Comparative Analysis
This release contains the source code associated with the following academic study:
Title: Enhancing Retinal Disease Detection with the Swin Transformer: A Comprehensive Comparative Analysis. Authors: Ahmet Saygılı, Ömer Mutlu Atıcı
Published in: Concurrency and Computation: Practice and Experience (2025)
DOI: https://doi.org/10.1002/cpe.70366
Project Overview
This repository includes implementations and comparisons of five deep learning models for classifying retinal images:
- CNN (Convolutional Neural Network)
- CNN + Attention (CNN Enhanced with Attention Mechanism)
- CNN + Attention + LSTM (CNN Supported with Long Short-Term Memory Layer)
- Swin Transformer (Swin-based Transformer for Image Classification)
- Vision Transformer (ViT)
Key Evaluation Metrics
- Accuracy
- Precision, Recall, F1 Score
- GPU and RAM Usage
- Training Time
- Energy Consumption
Key Findings
- Swin Transformer: Highest accuracy (92%)
- Vision Transformer (ViT): Second-highest accuracy (88%)
- CNN + Attention + LSTM: Sustainable model with good performance (86%) and low resource utilization.
Dataset
Retinal image dataset used in this study is publicly available on Kaggle:
Dataset classes:
- Normal Eye (Healthy Retina)
- Glaucoma (Optic Nerve Damage)
- Diabetic Retinopathy (Diabetes-Related Eye Disease)
- Cataract (Clouding of the Eye Lens)
Image Preprocessing Steps
- Contrast Enhancement (Histogram equalization)
- Image Resizing:
- CNN-based models: 256x256 pixels
- Transformer-based models: 512x512 pixels
- Tensor Conversion
- Normalization
Requirements
To run these scripts, ensure Python and the following libraries are installed:
pip install torch torchvision timm scikit-learn matplotlib numpy opencv-python
Usage Instructions
Each deep learning model is provided in individual .py scripts:
-
CNN model:
python CNN.py -
CNN + Attention model:
python CNN+Attention.py -
CNN + Attention + LSTM model:
python CNN+Attention+LSTM.py -
Swin Transformer and Vision Transformer (ViT):
python swin_vit.py(Specify the desired model within the script.)
Citation
If you use this code, please cite our paper as follows:
Saygılı, A. & Ömer, A. (2025). Enhancing Retinal Disease Detection with the Swin Transformer: A Comprehensive Comparative Analysis. Concurrency and Computation: Practice and Experience.
This project is licensed under the MIT License. Please see the LICENSE file for details.
Contact
For inquiries or assistance, please contact:
- [asaygili@nku.edu.tr, aticiomermutlu@gmail.com]
Full Changelog: https://github.com/asaygili/retina/commits/retina
Files
asaygili/retina-retina.zip
Files
(17.5 kB)
| Name | Size | Download all |
|---|---|---|
|
md5:5d798ca70afc7b5d184c9a453c7d0d55
|
17.5 kB | Preview Download |
Additional details
Related works
- Is supplement to
- Software: https://github.com/asaygili/retina/tree/retina (URL)
Software
- Repository URL
- https://github.com/asaygili/retina