Diabetic Retinopathy (DR) is a vision-threatening complication of diabetes that requires early and accurate diagnosis. This project introduces a novel Residual Network (ResNet)-based classification model with a custom Balanced Softmax Loss function to improve performance on imbalanced medical datasets. Enhancements include the integration of Squeeze-and-Excitation blocks, learnable wavelet filters, and multi-head attention to boost feature discrimination. The model was evaluated using the APTOS 2019 dataset and achieved strong results in both 5-class and 4-class DR classification tasks. Interpretability was ensured using XAI tools like Grad-CAM, SHAP, and LIME. A web interface was developed for real-time diagnosis.
This project demonstrates how advanced network architecture and loss customization can significantly improve DR classification. The integration of attention mechanisms and XAI tools makes the model both powerful and interpretable, offering practical support to ophthalmologists in clinical settings.
The model's performance is constrained by the limited diversity of the dataset and may not generalize well to other populations or imaging devices. Additionally, training deep architectures with balanced loss increases training complexity and time.
Future improvements will involve training with multi-institutional datasets, including other eye conditions such as glaucoma or AMD. The integration of ensemble learning and semi-supervised approaches may further boost classification robustness and generalization.