Comparison of ResNet-50 and DenseNet-121 Architectures in Classifying Diabetic Retinopathy
Abstract
Introduction: Diabetic Retinopathy (DR) is a vision-threatening complication of diabetes that requires early and accurate diagnosis. Deep learning offers promising solutions for automating DR classification from retinal images. This study compares the performance of two convolutional neural network (CNN) architectures—ResNet-50 and DenseNet-121—for classifying DR severity levels. Methods: A dataset of 2,000 pre-processed and augmented retinal images was used, categorized into four classes: normal, mild, moderate, and severe. Both models were trained using two approaches: standard train-test split and Stratified K-Fold Cross Validation (k=5). Data augmentation techniques such as flipping, rotation, zooming, and translation were applied to enhance model generalization. The models were trained using the Adam optimizer with a learning rate of 0.001, dropout of 0.2, and learning rate adjustment via ReduceLROnPlateau. Performance was evaluated using accuracy, precision, recall, and F1-score. Results: ResNet-50 outperformed DenseNet-121 across all evaluation metrics. Without K-Fold, ResNet-50 achieved 84% accuracy compared to DenseNet-121’s 80%; with K-Fold, ResNet-50 scored 83% and DenseNet-121 81%. ResNet-50 also demonstrated better balance in class-wise classification, with higher recall and F1-score, especially for moderate and severe DR classes. Confusion matrices confirmed fewer misclassifications with ResNet-50. Conclusions: ResNet-50 provides superior accuracy and robustness in classifying DR severity levels compared to DenseNet-121. While K-Fold Cross Validation enhances model stability, it slightly reduces overall accuracy. These findings support the use of ResNet-50 in developing reliable deep learning-based screening tools for early DR detection in clinical practice
Downloads
References
Y. Miao and S. Tang, “Classification of Diabetic Retinopathy Based on Multiscale Hybrid Attention Mechanism and Residual Algorithm,” Wirel. Commun. Mob. Comput., vol. 2022, 2022, doi: 10.1155/2022/5441366.
Y. Huang, L. Lin, P. Cheng, J. Lyu, R. Tam, and X. Tang, “Identifying the Key Components in ResNet-50 for Diabetic Retinopathy Grading from Fundus Images: A Systematic Investigation,” Diagnostics, vol. 13, no. 10, 2023, doi: 10.3390/diagnostics13101664.
A. Mustapha, L. Mohamed, H. Hamid, and K. Ali, “Diabetic Retinopathy Classification Using ResNet50 and VGG-16 Pretrained Networks,” Int. J. Comput. Eng. Data Sci., vol. 1, no. 1, pp. 2737–8543, 2021.
M. Saini and S. Susan, “Diabetic retinopathy screening using deep learning for multi-class imbalanced datasets,” Comput. Biol. Med., vol. 149, no. August, 2022, doi: 10.1016/j.compbiomed.2022.105989.
S. C. Pravin, S. P. K. Sabapathy, S. Selvakumar, S. Jayaraman, and S. V. Subramani, “An Efficient DenseNet for Diabetic Retinopathy Screening,” Int. J. Eng. Technol. Innov., vol. 13, no. 2, pp. 125–136, 2023, doi: 10.46604/IJETI.2023.10045.
Dewi Widyawati and Amaliah Faradibah, “Comparison Analysis of Classification Model Performance in Lung Cancer Prediction Using Decision Tree, Naive Bayes, and Support Vector Machine,” Indones. J. Data Sci., vol. 4, no. 2, pp. 80–89, 2023, doi: 10.56705/ijodas.v4i2.76.
A. Sai Bharadwaj Reddy and D. Sujitha Juliet, “Transfer learning with RESNET-50 for malaria cell-image classification,” Proc. 2019 IEEE Int. Conf. Commun. Signal Process. ICCSP 2019, no. August, pp. 945–949, 2019, doi: 10.1109/ICCSP.2019.8697909.
S. Qummar et al., “A Deep Learning Ensemble Approach for Diabetic Retinopathy Detection,” IEEE Access, vol. 7, pp. 150530–150539, 2019, doi: 10.1109/ACCESS.2019.2947484.
C. L. Lin and K. C. Wu, “Development of revised ResNet-50 for diabetic retinopathy detection,” BMC Bioinformatics, vol. 24, no. 1, pp. 1–18, 2023, doi: 10.1186/s12859-023-05293-1.
S. R. Syed and M. A. Saleem Durai, “A diagnosis model for detection and classification of diabetic retinopathy using deep learning,” Netw. Model. Anal. Heal. Informatics Bioinforma., vol. 12, no. 1, pp. 1–18, 2023, doi: 10.1007/s13721-023-00432-3.
M. M. Farag, M. Fouad, and A. T. Abdel-Hamid, “Automatic Severity Classification of Diabetic Retinopathy Based on DenseNet and Convolutional Block Attention Module,” IEEE Access, vol. 10, no. Ml, pp. 38299–38308, 2022, doi: 10.1109/ACCESS.2022.3165193.
K. Ahnaf Alavee et al., “Enhancing Early Detection of Diabetic Retinopathy Through the Integration of Deep Learning Models and Explainable Artificial Intelligence,” IEEE Access, vol. 12, no. May, pp. 73950–73969, 2024, doi: 10.1109/ACCESS.2024.3405570.
S. Almas et al., “Visual impairment prevention by early detection of diabetic retinopathy based on stacked auto-encoder,” Sci. Rep., vol. 15, no. 1, p. 2554, 2025, doi: 10.1038/s41598-025-85752-2.
O. F. Gurcan, O. F. Beyca, and O. Dogan, “A comprehensive study of machine learning methods on diabetic retinopathy classification,” Int. J. Comput. Intell. Syst., vol. 14, no. 1, pp. 1132–1141, 2021, doi: 10.2991/IJCIS.D.210316.001.
V. Dong, D. D. Sevgi, S. S. Kar, S. K. Srivastava, J. P. Ehlers, and A. Madabhushi, “Evaluating the utility of deep learning for predicting therapeutic response in diabetic eye disease,” Front. Ophthalmol., vol. 2, no. August, pp. 1–13, 2022, doi: 10.3389/fopht.2022.852107.
S. S. Mondal, N. Mandal, K. K. Singh, A. Singh, and I. Izonin, “EDLDR: An Ensemble Deep Learning Technique for Detection and Classification of Diabetic Retinopathy,” Diagnostics, vol. 13, no. 1, pp. 1–14, 2023, doi: 10.3390/diagnostics13010124.
S. Tummala, V. S. G. Thadikemalla, S. Kadry, M. Sharaf, and H. T. Rauf, “EfficientNetV2 Based Ensemble Model for Quality Estimation of Diabetic Retinopathy Images from DeepDRiD,” Diagnostics, vol. 13, no. 4, 2023, doi: 10.3390/diagnostics13040622.
A. E. Minarno et al., “Classification of Diabetic Retinopathy Disease Using Convolutional Neural Network,” Int. J. Informatics Vis., vol. 6, no. 1, pp. 12–18, 2022.
B. T. Chicho and A. B. Sallow, “A Comprehensive Survey of Deep Learning Models Based on Keras Framework,” J. Soft Comput. Data Min., vol. 2, no. 2, pp. 49–62, 2021, doi: 10.30880/jscdm.2021.02.02.005.
B. O. Olorunfemi et al., “Efficient diagnosis of diabetes mellitus using an improved ensemble method,” Sci. Rep., vol. 15, no. 1, p. 3235, 2025, doi: 10.1038/s41598-025-87767-1.
I. P. W. Prasetia and I Made Gede Sunarya, “Image Classification of Balinese Seasoning Base Genep Based on Deep Learning,” J. Nas. Pendidik. Tek. Inform., vol. 13, no. 1, 2024, doi: 10.23887/janapati.v13i1.67967.
I. P. B. G. Prasetyo Raharja, I. M. Suwija Putra, and T. Le, “Kekarangan Balinese Carving Classification Using Gabor Convolutional Neural Network,” Lontar Komput. J. Ilm. Teknol. Inf., vol. 13, no. 1, p. 1, 2022, doi: 10.24843/lkjiti.2022.v13.i01.p01.
I. G. Putra, M. Yusadara, N. Made, R. Masita, I. G. Bintang, and A. Budaya, “Performance Comparison of KNN and CNN in Classifying Balinese Gangsa Instrument Tones,” vol. 8, no. 4, pp. 2233–2241, 2024.
A. Bilal, G. Sun, Y. Li, S. Mazhar, and A. Q. Khan, “Diabetic Retinopathy Detection and Classification Using Mixed Models for a Disease Grading Database,” IEEE Access, vol. 9, pp. 23544–23553, 2021, doi: 10.1109/ACCESS.2021.3056186.
P. N. Chen, C. C. Lee, C. M. Liang, S. I. Pao, K. H. Huang, and K. F. Lin, “General deep learning model for detecting diabetic retinopathy,” BMC Bioinformatics, vol. 22, pp. 1–14, 2021, doi: 10.1186/s12859-021-04005-x.

Copyright (c) 2025 Indonesian Journal of Data and Science

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
License and Copyright Agreement
By submitting a manuscript to the Indonesian Journal of Data and Science (IJODAS), the author(s) confirm and agree to the following:
- All co-authors have given their consent to enter into this agreement.
- The submitted manuscript has not been formally published elsewhere, except as an abstract, thesis, or in the context of a lecture, review, or overlay journal.
- The manuscript is not currently under review or consideration by another journal or publisher.
- All authors have approved the manuscript and its submission to IJODAS, and where applicable, have received institutional approval (tacit or explicit) from affiliated organizations.
- The authors have secured appropriate permissions to reproduce any third-party material included in the manuscript that may be under copyright.
- The authors agree to abide by the licensing and copyright terms outlined below.
Copyright Policy
Authors who publish in IJODAS retain the copyright to their work and grant the journal the right of first publication. The published work is simultaneously licensed under a Creative Commons Attribution-NonCommercial 4.0 International License (CC BY-NC 4.0) , which permits others to share and adapt the work for non-commercial purposes, with proper attribution to the authors and the initial publication in this journal.
Reuse and Distribution
- Authors may enter into separate, additional contractual arrangements for non-exclusive distribution of the journal-published version of the article (e.g., institutional repositories, book chapters), provided there is proper acknowledgment of its initial publication in IJODAS.
- Prior to and during the submission process, we encourage authors to archive preprints and accepted versions of their work on personal websites or institutional repositories. This method supports scholarly communication, visibility, and early citation.
For more details on the terms of the Creative Commons license used by IJODAS, please visit the official license page.