# OD-XAI: Explainable AI-Based Semantic Object Detection for Autonomous Vehicles
## 4 The Proposed Approach
### Preprocessing
#### 6.1.2 Accuracy Score

Similar to IOU, the accuracy score is determined by a pixel-wise comparison of ground truth and anticipated segmentation maps. A single accuracy score is computed for the output predictions instead of separate class-wise scores. Due to the singleness of the accuracy score, there could be bias of a certain class in its final result. Moreover, we cannot determine the model's reliability in providing segmentation maps for all class labels individually. The accuracy score is mathematically represented as below. \[\text{Accuracy Score}=\frac{\sum\limits_{i=1}^{d}TP_{i}}{\sum\limits_{i=1}^{d }TP_{i}+FP_{i}+FN_{i}} \tag{9}\]

\(d\) = Number of classes. IOU may be determined for overall prediction maps as well as for each class label. Hence, it is more dependable and a superior evaluation metric than the accuracy score for assessing the model in this scenario. The accuracy score brings in the skewness of all the projected classes, whereas the IOU for a given class is determined using the true positives of that class only. Some classes could have a higher say when it comes to determining the total accuracy, making it less reliable. Abetter accuracy score does not necessarily imply correct forecasts of all classes; however, a good individual class-wise IOU score does reflect accurate predictions. Now that the evaluation metrics have been discussed, the results of the trained semantic segmentation models can be seen as follows. Table 8 shows the mean IOU scores calculated on the train and test set. ResNet-18 performed better than the other mentioned architectures. We will also see the class-wise IOU scores of the above models. Table 9 shows the class-wise IOU values for all of the proposed models. It can be observed that the individual class IOU scores within the same model are almost equal and have very little differences. This implies that there is no partiality in the prediction of labels in any of the above-trained models. Table 10 displays the comparisons of the model accuracy. A side-by-side comparison of IOU values in Table 8 and accuracy scores in Table 10 indicate considerable differences for each model. The IOU values were observed to be smaller than the accuracy scores, which implies that accuracy does bring in the bias of all classes. Hence, the IOU measure is a superior assessment metric as it offers the exact total values. Figure 16 shows the results of the segmentation detection of each model. These outputs can be compared with the ground truth images to visualize the merits of each model. ResNet-18 seems to work best here, producing sharper boundaries on the road's edges compared to scattered road boundaries in ResNet-50 and SegNet. It is important to note that the above segmentation maps were produced considering only the road masks (road class) obtained from predictions, i.e., overlapping original images with the class-road predictions. The inference time analyses of all segmentation models are shown in Figure 17. ResNet-18, depicted in the graph by the blue line, has an average inference time of roughly 0.3 s. In comparison, ResNet-50 has a mean inference time of 0.6 s. SegNet, on the other hand, requires a longer time to build segmentation maps for a single image, roughly 4.0 s. This result also demonstrates the ResNet-18 model's superiority in terms of the prediction time when compared to the other models. One of the most significant parameters for AVs is the forecast time as a slight delay in decision-making by the AV system could have catastrophic consequences. \begin{table}
\begin{tabular}{c c c c} \hline \hline  & **ResNet-18** & **ResNet-50** & **SegNet** \\ \hline Train Accuracy & 0.9761 & 0.9281 & 0.9655 \\ \hline Test Accuracy & 0.9786 & 0.9318 & 0.9630 \\ \hline \hline \end{tabular}
\end{table} 
Table 10: Train and test set accuracies of the proposed models.