## 2 Methods
### Model Development  
In this study, we implemented and analyzed three main deep learning models for diagnosing the severity of diabetic retinopathy (DR) from retinal images. The models share the same architecture, employing convolutional neural networks (CNNs), a well-established method for image-based machine learning tasks. Training in this research was meticulously set up to ensure the integrity and reliability of the results. The training was executed with a batch size of 128 images, with each image resized to a uniform 180 \(\times\) 180 pixels. To ensure robust model training and validation, the dataset was split into two parts: 80% for training and 20% for validation. Importantly, this division was conducted before the execution of any image transformations or preprocessing steps to avoid the risk of data leakage. Data leakage, where the model obtains access to information it should not during training, is a common issue in machine learning, which could lead to overly optimistic performance estimates. In this study, ensuring the strict separation of training and validation data means that the model never sees the validation data during its training, eliminating any chance of obtaining prior answers. Moreover, this study adopted a compact model design to expedite the training process given the computational resources at hand. Utilizing a smaller model not only facilitated rapid training but also allowed for the effective management of resources. This strategy made it possible to conduct extensive experiments without overtaxing the available computational capacity. The resultant model, despite its size, was robust and capable of accurately diagnosing diabetic retinopathy from image data, highlighting the feasibility and efficiency of smaller model architectures for tasks of this nature. The model architecture was built using several layers, each tailored to a specific task, optimizing the network for image feature extraction and classification. Input Layer: This layer ingests preprocessed images ready for the model. Conv2D Layers: The first two layers in the architecture are 2D convolutional layers, each with 16 filters. These layers use learned filters to conduct convolution operations on the input data, aiming to capture local features within the image such as edges and corners. Max Pooling Layer: Following the Conv2D layers is a max pooling layer, which reduces the spatial dimensions of the input by selecting the maximum value in each window defined along the features axis. More Conv2D and Max Pooling Layers: The architecture continues with an alternating pattern of Conv2D and MaxPooling2D layers. The number of filters in these layers progressively increases (from 16 to 32 and then to 64), each time reducing the spatial dimensions. Flatten Layer: The 2D matrix produced by the preceding layer is transformed into a 1D vector by a flatten layer, preparing it for input to the subsequent dense layers. Dense Layers: The flattened output is then passed to a fully connected layer with 128 neurons, which performs classification based on the features extracted by the previous layers. Dropout Layer (0.5): Following the dense layer is a dropout layer with a dropout rate of 0.5. This means that during each training update, 50% of the neurons are randomly set to zero. We chose a dropout probability of 0.5 because it is widely recognized as an optimal value for preventing overfitting without significantly under-training the model. A dropout rate of 0.5 provides a balance between retaining sufficient network capacity for learning and introducing enough regularization to improve generalization. Compared to lower dropout rates (e.g., 0.1 or 0.2), a 0.5 rate introduces more noise during training, which helps the model avoid becoming too reliant on any particular set of neurons, thus enhancing its ability to generalize to new, unseen data [31]. Output Layer: The final layer in the architecture is another dense layer, serving as the output layer of the model.