## 4 Results and Discussion
### Machine Learning Models
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Defect Type** & **Bagged Trees** & **Neural Network** & **SVM** \\ \hline D1 & High accuracy (96.2\% TPR), some minor errors & Good accuracy (95.2\% TPR), slight misclassification (4.8\% FDR) & Excellent accuracy (100\% TPR) \\ D2 & Moderate performance (90.3\% TPR) & Good accuracy (92.2\% TPR) & Low precision (84.0\% TPR), high misclassification (16.0\% FDR) \\ D3 & High accuracy (95.0\% TPR) & Excellent accuracy (97.4\% TPR) & Good accuracy (94.3\% TPR) \\ D4 & High accuracy (96.1\% TPR) & Good accuracy (95.9\% TPR) & Excellent accuracy (100\% TPR) \\ D5 & Excellent accuracy (97.2\% TPR) & Excellent accuracy (97.2\% TPR) & Excellent accuracy (100\% TPR) \\ D6 & High accuracy (93.8\% TPR) & Moderate accuracy (91.0\% TPR), some errors (9.0\% FDR) & Excellent accuracy (100\% TPR) \\ \hline \hline \end{tabular}  
* The grey colour highlights the model that best predicts each defect type.  
\end{table} 
Table 3: The best models for particular types of defects. The ROC curve analysis for the three models (Figure 6) demonstrates their robust performance, although with some variation between different classes. The BT model (Figure 6a) exhibits exemplary classification capabilities, with AUC values ranging from 0.9691 for D1 to 1.0 for D5, signifying near-flawless performance for most classes. Furthermore, D6 shows an exceptional degree of performance, with an AUC value of 0.9994, indicating that the model is capable of almost perfectly distinguishing between positive and negative instances. However, the AUC for D1, although still high at 0.9691, exhibits a marginally elevated false positive rate compared to the other classes, thus identifying a potential avenue for improvement. For classes D2, D3, and D4, the model maintains an AUC value greater than 0.98, indicating a robust and reliable classification across the board. Figure 6: ROC and AUC analyses for the developed models. (**a**) BT model; (**b**) NN model; (c) SVM model. The NN model (Figure 6b) also demonstrates robust performance, although the variability across the classes is more pronounced in comparison to the bagged trees model. The AUC values range from 0.9392 for D1 to 0.9984 for D5, indicating that, while the model performs well, there is a higher rate of false positives for certain classes, particularly D1 and D4. Regarding D5 and D6, the model demonstrates a near-perfect classification, as evidenced by the AUC values of 0.9984 and 0.9816, respectively. This indicates a high degree of discriminatory power for these classes. However, the somewhat diminished AUC values for D1 (0.9392) and D4 (0.9479) indicate that the model faces greater challenges with these classes. The model's overall performance remains robust; however, further tuning could prove beneficial, particularly for classes presenting a higher rate of misclassification. The SVM model (Figure 6c) demonstrates the most consistent and high performance across all classes, with AUC values ranging from 0.9937 for D4 to a perfect 1.0 for D5. This indicates a near-flawless performance, particularly for classes D5 and D6, where the AUC values reach 1.0 and 0.9991, respectively. Even for classes such as D1, D2, and D3, where the AUC values are 0.9956, 0.9989, and 0.9969, the model performs exceptionally well, consistently maintaining a very high true positive rate while minimising false positives. The slightly lower AUC for D4 (0.9937) is nevertheless still excellent, indicating that the model only struggles marginally with this class. The above results for all three models demonstrate robust classification capabilities, with AUC values consistently exceeding 0.93 in all classes. The SVM is the most robust and reliable model, demonstrating near-perfect performance across all classes. Furthermore, the Bagged Trees model also performs exceptionally well, particularly for certain classes such as D5 and D6. However, while the NN model is strong overall, it shows more variability and a slightly higher rate of false positives, particularly for D1 and D4.