## 4 Results
### Localizaion Network  
The new localization network is a Mask R-CNN network that uses the cropped images from stage 1 as well as the original images in the REFUGE training set to train a more sophisticated localization network. Here both original and cropped images are resized to \(512\times 512\) with 0 padding to preserve the aspect ratio. We use the same network architecture that is used in stages 1, and 2 with the following modification: (1) replace the RPN anchor scales 128 and 512 with 8 and 16 to accommodate for different ONH sizes from original and cropped images. (2) The mask loss weight (\(W5\) in Equation (1)) and the bounding box loss (\(W4\)) are set to 2.0, but the remaining weights are set to 1.0. (Equation (3)). All the layers of the network are updated during the training, not just layers below C3 in the backbone. Table 2 shows the results of the segmentation average accuracy for disc/cup Dice scores and vertical cup-to-disc ratio. Except for the REFUGE validation set, the disc Dice score is higher in stage 1 when the whole image is used for segmentation. This could be due to a broader context for segmentation and the fact that the optic disc is visually different from the background in most of the images, and it is easier to identify from the whole image. We can see from the table also that using the cropped images yielded a better cup Dice scores. Experiment 2, where the loss weights are equal, gave better results in REFUGE validation and test set but did not generalize to the other three datasets, namely MESSIDOR, Magrabi Male, and Magrabi Female. When it comes to the most crucial part for the diagnosis, i.e., vCDR, you can see that experiment 3, where we have different weights for the loss function, yielded the best result across the datasets. Table 3 shows the localization accuracy using the network from stage 1 and the proposed new localization network. The ONH is considered detected according to the criteria discussed in the materials and methods section if the IoU \(>\) 0.6, for either the optic disc or optic cup. If both optic disc and optic cup are detected, the optic disc bounding box is used to do the cropping. As shown by the data, the proposed localization network performed better across the datasets. As far as we know, there is no benchmark training on REFUGE and testing on Magrabi and MESSIDOR datasets for segmentation; hence the comparison will be made with the top three performers on the REFUGE challenge [15] on the REFUGE test dataset for the segmentation purpose. For the localization, we will compare it with the localizing method used in [24], which has localization scores for Magrabi and MESSIDOR datasets. \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & & **Stage 1** & & **Stage 2** \\ \hline
**Dataset** & **Measure** & **Exp1** & **Exp2** & **Exp3** \\ \hline \multirow{3}{*}{REFUGE Training} & Disc Dice & 0.9802 & 0.9634 & 0.9705 \\  & Cup Dice & 0.9776 & 0.9237 & 0.9358 \\  & vCDR error & 0.0137 & 0.0281 & 0.0263 \\ \hline \multirow{3}{*}{REFUGE Validation} & Disc Dice & 0.9425 & 0.9489 & 0.9426 \\  & Cup Dice & 0.8225 & 0.8643 & 0.8531 \\  & vCDR error & 0.0815 & 0.0466 & 0.0410 \\ \hline \multirow{3}{*}{REFUGE Test} & Disc Dice & 0.9504 & 0.9477 & 0.9334 \\  & Cup Dice & 0.7883 & 0.8546 & 0.8302 \\  & vCDR error & 0.0979 & 0.0425 & 0.0430 \\ \hline \multirow{3}{*}{MESSIDOR} & Disc Dice & 0.9001 & 0.8852 & 0.8133 \\  & Cup Dice & 0.4174 & 0.7069 & 0.71  
Figure 8 shows examples of the detected masks in stage 1 and stage 2 compared to the ground truth mask. Figure 8a demonstrates how the output of the second stage is closer to the ground truth while the output of the first stage looks deformed and is missing a big chunk of the optic disc. Figure 8b shows an example of missing the entire optic cup and most of the optic disc in the output of the first stage network whereas the second stage output provides a good segmentation result for both the optic cup and the optic disc.