## 2 Methods
### Model Development
This layer has five neurons, representing the five classes of DR severity, and outputs the probabilities of the input image belonging to each class. The complete model, therefore, alternates layers of convolution and max pooling for feature extraction, followed by a flattening operation and dense layers for classificationbased on these features. In total, the model has 3,991,605 trainable parameters and no non-trainable parameters, which are explained in Figure 7 and Table 2.  
This study was conducted to experimentally build and compare three distinct models to identify the one with superior performance. While all three models share the same architecture, their primary difference lies in the type of input data they handle: the first model uses grayscale image data, the second uses normal color image data, and the third employs normal color image data but with fewer epochs during training. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Layer (Type)** & **Input Shape** & **Output Shape** & **Param** \\ \hline InputLayer & (None, 180, 180, 3) & (None, 180, 180, 3) & 0 \\ \hline Conv2D & (None, 180, 180, 3) & (None, 180, 180, 16) & 448 \\ \hline Conv2D & (None, 180, 180, 16) & (None, 180, 180, 16) & 2320 \\ \hline MaxPooling2D & (None, 180, 180, 16) & (None, 90, 90, 16) & 0 \\ \hline Conv2D & (None, 90, 90, 16) & (None, 90, 90, 32) & 4640 \\ \hline MaxPooling2D & (None, 90, 90, 32) & (None, 45, 45, 32) & 0 \\ \hline Conv2D & (None, 45, 45, 32) & (None, 45, 45, 64) & 18,496 \\ \hline MaxPooling2D & (None, 45, 45, 64) & (None, 22, 22, 64) & 0 \\ \hline Flatten & (None, 22, 22, 64) & (None, 30,976) & 0 \\ \hline Dense & (None, 30,976) & (None, 128) & 3,965,056 \\ \hline Dropout & (None, 128) & (None, 128) & 0 \\ \hline Dense & (None, 128) & (None, 5) & 645 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Architecture of the main model. Figure 7: Workflow of model training 1, 2, and 3. Model 1 (Grayscale Image Data): This model was trained for 200 epochs using grayscale image data. Subsequently, the same model was retrained with data augmentation applied to the original dataset for another 200 epochs. Finally, the background was removed from the same dataset, and the training continued the initial model for 10 more epochs. The resulting model and its experimental results comprise Model 1. Model 2 (Normal Image Data): This model was constructed similarly to Model 1, but normal color image data was used instead of grayscale images. The model was first trained for 200 epochs, then retrained with augmented data for another 200 epochs. Subsequently, the background was removed from the same dataset, and the training continued the initial model for 10 additional epochs. The resulting model and its experimental results comprise Model 2. Model 3 (Normal Image Data with Fewer Epochs): Again, the procedure was similar to Models 1 and 2, but this model was trained for fewer epochs. The model was first trained for 40 epochs, then retrained with augmented data for another 40 epochs. After the background was removed from the same dataset, the training continued the initial model for an additional 10 epochs. The resulting model and its experimental results comprise Model 3. Upon completion of training the three models, we performed a comparative analysis to evaluate their performance based on specific metrics such as validation accuracy and loss values. Further details and results from this comparison can be seen in Figure 7.  
Please note that while all models have been trained and tested with the same number of epochs for fairness, the number of epochs was reduced in Model 3 to investigate the impact of fewer training iterations on model performance. Furthermore, the variation in data preprocessing techniques (grayscale conversion and background removal) provides a more comprehensive understanding of their effect on the model's performance for DR diagnosis.