## 3 Proposed System
### Optic Disc (OD) Localization Module  
This module aims to localize the Optic Disc and obtain its coordinates to use in the next module for calculating the macula area. To conduct the experiments, the DRIVE [35] and Messidor datasets were selected under the supervision of ophthalmologists.  
In this case, we define RetinaNet as a model due to its strong performance in detecting small objects and capability for accurate object localization with high precision and recall rates [36]. RetinaNet achieves this by utilizing a feature pyramid network (FPN) due to its ability to provide multi-scale feature representation, enhance localization accuracy, improve  
\begin{table}
\begin{tabular}{c c c c} \hline \hline \multirow{2}{*}{**Hyperparameter**} & **ConvUNeXt-Original** & \multirow{2}{*}{**ConvUNeXt-CE**} & **ConvUNeXt-CIELAB** \\ \hline Learning rate & \(1\times 10^{-4}\) & \(1\times 10^{-3}\) & \(1\times 10^{-3}\) \\ Weight decay & \(5\times 10^{-5}\) & \(5\times 10^{-4}\) & \(5\times 10^{-4}\) \\ Epochs & 100 & 100 & 100 \\ Loss function & Combination of Cross-Entropy and Dice loss & \\ Optimizer & AdamW & \\ Batch size & 2 & \\ Data augmentations & Random resize, random crop, horizontal and vertical flip & \\ \hline \hline \end{tabular}
\end{table}
Table 3: Hyperparameters used to train three ConvUNeXts according to three treatments of input images.  
efficiency, adapt to object scales, and capture contextual information. By leveraging the hierarchical structure of the pyramid-shaped network, object detectors like RetinaNet can achieve high accuracy and robust performance in detecting objects of varying sizes and complexities, as well as a Focal Loss function that introduces a modulating factor to the cross-entropy loss given by (4).  
\[FL(p_{t})=-(1-p_{t})^{\gamma}\log(p_{t}) \tag{4}\]  
where \(p_{t}\) is the probability of the ground truth class, which is the output of the classification model for the true class label, \((1-p_{t})^{\gamma}\) is the Modulating factor that down-weights the loss for well-classified examples (where \(p_{t}>0.5\)) and amplifies the loss for hard, misclassified examples (where \(p_{t}\leq 0.5\)) and \(\gamma\) is the focusing parameter that controls the modulating term. When \(\gamma=0\), the Focal Loss reduces to the standard cross-entropy loss.  
The Focal Loss function is crucial in object detection tasks due to its ability to address class imbalance, focus on hard examples, improve learning dynamics, enhance object localization, and provide flexibility for better generalization. By incorporating this function, object detectors like RetinaNet can achieve higher accuracy, robustness, and efficiency in detecting objects in challenging real-world scenarios. These characteristics make RetinaNet suitable for applications where accurate object localization is essential, and it is also suitable for real-time applications.  
For the training phase, we used DRIVE, split into training and test sets with 32 and 8 images, respectively. The hyperparameters used to train the model were: a learning rate of \(1\times 10^{-4}\), batch size of 4, 8 steps, and 50 epochs with a backbone of resnet50 using pre-trained weights on the CoCo dataset [37].  
After the detection of OD, the center of OD and diameter of OD (DD) are calculated as follows.  
\[COD_{x}=BB_{xmin}+\frac{\left(BB_{xmax}-BB_{xmin}\right)}{2} \tag{5}\]  
\[COD_{y}=BB_{ymin}+\frac{\left(BB_{ymax}-BB_{ymin}\right)}{2} \tag{6}\]  
where \(\left(COD_{x},COD_{y}\right)\) is the coordinate of the center of OD, \(\left(BB_{xmin},BB_{ymin}\right)\) and \(\left(BB_{xmax},BB_{ymax}\right)\) are coordinates of the lower-left and upper-right of the bounding box obtained by RetinaNet.5  
The OD diameter (DD) was calculated according to (7), using \(BB_{xmin}\) and \(BB_{xmax}\):  
\[DD=BB_{xmax}-BB_{xmin} \tag{7}\]