## 4 Experiment and Results
### Results
#### 4.3.2 Stage 2: Surface Pixel Defect Mapping  
Figure 12 illustrates the results of the faster R-CNN object detection model for detecting six different types of defects. The NMS threshold was set at 0.5, and only bounding boxes with a confidence score over 0.7 were displayed. Each pair of images includes a left column showing the ground truth bounding box labels and a right column displaying the model's predictions. Labels (a) to (f) denote the defect types as follows: crazing, inclusion, patches, pitted surface, rolled-in scale, and scratches. For (a), the difference in pixel appearance between defect and normal conditions is minimal, making it the most challenging prediction. The results also reveal that the model detected the least stable bounding box coordinates for this type, suggesting difficulty in distinguishing this defect. In the case of (b), the model identified defects that were not originally labeled, indicating that the original data might have been inaccurately labeled yet showing the model's ability to detect even subtle defects. For the other defect types, the model displayed stable detection performance, especially for types (c) and (f), where it accurately identified multiple objects, showcasing strong detection capabilities across various defect scenarios. In the surface pixel defect mapping process, the performance of faster R-CNN combined with various backbone networks was assessed using precision, recall, AP, and mAP. Table 5 summarizes the defect detection performance of faster R-CNN based on three different backbone networks: VGG-16, Inception-V2, and ResNet-50. This table presents the AP values for each defect type, and the last column shows the mAP for each model. According to the results, Inception-V2 exhibited slightly higher AP values for patches and pitted surface defects. However, ResNet-50 achieved the highest AP across most classes and had the highest mAP, particularly excelling in detecting rolled-in scale and scratch defects, outperforming other backbone networks. The ResNet-50-based model recorded a peak mAP of 0.766, establishing it as the most reliable backbone network for defect detection. Based on the results presented in Table 6, a comprehensive comparison of faster R-CNN, SSD, and YOLOv4 on the NEU-DET dataset is conducted, with a focus on detection performance (mAP), speed (FPS), and computational complexity (GFLOPs). The analysis highlights the trade-offs between accuracy and efficiency across the different stages of models. The one-stage models, SSD and YOLOv4, exhibit relatively higher processing speeds and lower computational costs compared to the two-stage model, faster R-CNN. Figure 11: Confusion matrices for different models for classification. ResNet-50, ResNet-101, ResNet-152 as following order of (**a–c**). Figure 10: Training and validation loss curves of defect detection model3. However, their detection performance is significantly inferior. This trade-off between speed and accuracy is often a key factor in choosing models for real-time applications. Faster R-CNN is better suited for such tasks where the accuracy of the bounding box determines the segmentation, as it excels in accurately identifying and localizing objects. This capability is particularly important in scenarios requiring detailed analysis of object boundaries, where even slight inaccuracies in bounding box placement could lead to significant performance degradation. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline \multirow{2}{*}{**Backbone**} & \multicolumn{6}{c}{**Average Precision**} \\ \cline{2-9}  & **Crazing** & **Inclusion** & **Patches** & **Pitted Surface** & **Rolledled-In Scale** & **Scratches** & **mAP** \\ \hline VGG-16 & 0.6392 & 0.8043 & 0.7793 & 0.7242 & 0.6556 & 0.7041 & 0.7178 \\ Inception-V2 & 0.6041 & 0.767 & 0.874 & 0.7524 & 0.7147 & 0.6822 & 0.7324 \\ ResNet-50 & 0.6528 & 0.8208 & 0.8723 & 0.7409 & 0.768 & 0.7448 & 0.7666 \\ \hline \hline \end{tabular}
\end{table}