## 2 Related Work
The features were then reduced using principal component analysis (PCA) and fed to an ensemble machine learning classifier, composed of AdaBoost and Random Forest for final classification. [PERSON] et al. [35] combined three commonly used DR datasets (Messidor-2, IDRiD, and APTOS) to create a merged dataset. With preprocessing, they presented a lightweight CNN architecture for the classification. Although the model outperformed some of the existing architectures, it consumed over 35 million trainable parameters. [PERSON] [36] presented a method that uses spectral-temporal, spatial, and textural data to detect retinopathy of prematurity (ROP) in fundus images. To capture texture features, it first performs a Gabor wavelet (GW) conversion, after which the data are ready for three already-trained convolutional neural networks (CNNs). The approach uses discrete wavelet transform (DWT) to combine the data after fine-tuning and feature extraction from these CNNs, and then uses machine learning classifiers, like SVM, LDA, and ESD for ROP diagnosis, to guarantee reliable findings. Image preprocessing plays a crucial role in determining the performance of a deep learning algorithm, especially in image classification [37]. The majority of the systems, however, neglect this crucial step. Nonetheless, [PERSON] [38] leveraged an artificial bee colony algorithm to segment the lesion regions of retinal images. The segmented mask is then employed to enhance the image quality, specifically focusing on the fundus region. Subsequently, a seven-layer CNN architecture is developed to classify the DR images. This method achieves a remarkable accuracy of 99.66% in classifying five stages of DR. Many researchers have segmented some regions of the retinal images and only leveraged the segmented image for classification. [PERSON] et al. [39] employed U-Net to segment the red lesions in the image. The segmented binary image was then passed to a custom CNN architecture for the final classification. [PERSON] et al. [40] proposed a two-stage DR detection system that first segmented the blood vessels and optic disk employing U-Net. In the second stage, they integrated Inception-V3 for classification. [PERSON] et al. [8] used U-Net to segment and delete the blood vessels and the optic disk. The segmented regions were then removed from the original image and the green channel of the RGB image was enhanced. Finally, the preprocessed image was passed through a shallow CNN architecture, where the final classification layer, typically composed of a neural network with the softmax activation function, was replaced with a support vector machine (SVM) classifier. Nonetheless, the segmentation-based techniques required more resources since the system needed to hold two models (the segmentation model and the classification model). Recently, vision transformers have gained attention in a variety of disease classifications. [PERSON] et al. [41] employed a vision transformer for DR classification. The fine-tuned vision transformer accommodated a residual attention unit at its encoder to enhance the performance. [PERSON] et al. [42] employed Swin Transformer with transfer learning to classify DR images from the Messidor dataset. With extensive hyperparameter tuning, the model achieved 90% accuracy. [PERSON] et al. [43] also leveraged the Swin Transformer to classify DR images. Regarding binary class classification, the model achieved 97% accuracy. According to the studies discussed in this section, Table 1 presents a brief overview of the methods, results, and their limitations. The majority of research works have three dominant problems. The issues include low classification performance, high computational complexity, and less diversity in the dataset. Among the three prime issues, this paper addresses the first two, presenting a lightweight DR classifier with high performance. Moreover, we evaluated the proposed model against recent literature using different evaluation metrics on the APTOS and IDRiD datasets.