## 3 Materials and Methods
### Proposed Methodology
#### 3.2.1 Data Preprocessing  
Data preprocessing is an important step to ensure the quality of the images before they are analyzed by the model. In this study, we applied two main preprocessing approaches, including data augmentation and filtering. Data augmentation is a technique that prevents overfitting by increasing the number of samples in a dataset [20], especially beneficial for small datasets [21].  
Our aim is to utilize data augmentation techniques to enhance the quality and alignment of images and their corresponding masks. This work applied various augmentation methods and evaluated their impact on the image quality and mask alignment. We used rotations, flips, and brightness adjustments for data augmentation. Rotations and flips help the model handle different image orientations, while brightness adjustments enhance its adaptability to varying lighting conditions in retinal images. These techniques collectively  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Dataset**} & \multirow{2}{*}{**Segmentation/Classification**} & \multicolumn{2}{c}{**Number of Images**} & \multirow{2}{*}{**Total**} \\ \cline{3-4} \cline{5-5}  & & **Glaucoma** & & \\ \hline ORIGA [16] & Both & 168 & 482 & 650 \\ HRF [17] & Classification & 15 & 15 & 30 \\ RIM-ONE DL [18] & Both & 172 & 313 & 485 \\ REFUGE [19] & Segmentation & 40 & 360 & 400 \\ \hline \hline \end{tabular}
\end{table}
Table 1: The datasets utilized in our study.  
bolster the model's robustness by simulating real-world scenarios and mitigating overfitting. Data imbalance can bias the model towards the majority class, affecting performance. This issue is addressed using under-sampling, which reduces the majority class samples to match the minority class. Table 2 presents the data used in the segmentation phase.  
The dataset is enhanced by horizontal flips and rotations of images resized to 128 \(\times\) 128 from the ORIGA, REFUGE-TS, and RIM-ONE DL datasets. This resizing step ensures consistency in the dimensions of the images and masks, preparing them for subsequent processing. An augmentation pipeline defined using the Albumentations library [22], to augment images and masks for image segmentation. Techniques like random rotations, brightness/contrast adjustments, and horizontal flips were applied to ORIGA and REFUGE datasets, as well as ORIGA and RIM-ONE DL datasets. The augmented images and masks were saved for further processing. Table 3 shows the data counts before and after augmentation and the techniques used.  
A denoising process was also implemented to enhance diagnostic accuracy by removing noise from images. Noise can degrade image quality and obscure critical details, leading to incorrect diagnoses [20]. The Gaussian and median filters were tested on RGB  
Figure 1: Proposed framework of the system.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**Dataset**} & \multicolumn{2}{c}{**No. of Images/Masks**} & \multicolumn{2}{c}{**Balanced Dataset**} & \multirow{2}{*}{**Total**} \\ \cline{2-2} \cline{4-5}  & **Glaucoma** & **Normal** & **Glaucoma** & **Normal** & \\ \hline ORIGA and REFUGE-TS & 208 & 842 & 208 & 208 & 416 \\ \hline ORIGA and RIM-ONE DL & 340 & 795 & 340 & 340 & 680 \\ \hline \hline \end{tabular}
\end{table}
Table 2: The total quantity of data used in the segmentation phase.  
and grayscale images, including the green channel. The filters were evaluated using the peak signal-to-noise ratio (PSNR), and the best one was selected based on the results. The goal was to enhance image quality for further analysis.