## 3 Results
### Azure Custom Vision and NIA Results
Unlike other domains, such as \"General\", which provides broad and nonspecific classification, or \"Food\" and \"Retail\", which are specialized for food and commercial products, \"Landmarks\" has proven to be suitable for detecting complex surface details. The decision to integrate the model using the Landmarks domain for defect identification in cast pieces is based on the results from Figure 9. This presents the comparative analysis of the evaluation metrics for the four domains. The performances of these domains are reported against standard metrics: _Accuracy_, _Precision_, _Recall_, and _F\({}_{1}\)-Score_. These values were calculated on an unseen dataset during the training phase, using 715 images. These images contain cast pieces. From the analysis of these values, we observed that Landmarks achieved the best results in terms of _Precision_, with a value of 99.44%. Compared to the other domains, Landmarks offered the best trade-off between defect identification and error reduction. This led us to the conclusion that Landmarks is the ideal choice for defect detection in cast pieces. The choice of this domain allowed for the customization of the model to meet the specific requirements of the casting process. Figure 10 presents the employed project configuration, highlighting the chosen \"Landmarks\" domain. The authors emphasize a difference between the theoretical metrics displayed in the Azure Custom Vision service's graphical interface (Figure 8) and the real metrics generated by the images unseen by the model. Figure 9 presents tests on unseen images, increasing confidence in the Landmark domain's choice. By using a separate dataset for testing, the results shown are more reflective of the model's actual performance in real-world scenarios. After training, the model was tested using 262 unseen images of casts and 453 unseen images of defect casts, and the resulting confusion matrix is shown in Figure 11. By analyzing the 715 unseen images, the service classified 253 as ok out of 262 ok (TP), and 9 as nok out of 262 ok (FN). From the nok class, the service classified 449 out of 453 as nok (TN), while 4 were classified as nok (FP). Afterward, the accuracy was calculated, yielding a value of 98.18%, a _Precision_ of 98.44%, a _Recall_ of 96.56%, and an _F\({}_{1}\)-Score_ of 97.50%. These values demonstrate that the model is excellent at defect detection. Figure 12 illustrates an ok labeled cast in Figure 12a (ok) and a defect cast in Figure 12b (nok). The subtle variations between these classes, such as minor imperfections or structural changes, are challenging for the model to distinguish effectively. Despite minor differences between the characteristics of the ok and nok classes, the model efficiently classifies them. Figure 9: Comparative evaluation of domain performance for defect detection in cast pieces. Because we are capturing consecutive frames that show the component in different positions and orientations, the probability values returned by the Azure Custom Vision Ser  
Figure 11: Confusion matrix of NIA. Figure 12: Cast with subtle features challenges the defect detection model: (**a**) Cast example without defect; (**b**) Cast with defect (the defects are marked with red circles) [64]. Figure 10: Azure Custom Vision setup for cast defect detection model. vice exhibit slight variations for each frame. This is due to the changing visual perspective, which affects how the service interprets and analyzes the images. Figure 13 presents the results of the Azure Custom Vision for a defective cast. By applying the NIA, which aggregates these probabilities, we obtain the following defect probabilities for each frame: 79.8%, 79.6%, 80.2%, 80.1%, and 80.9%. These percentages represent the likelihood of defective components in each respective frame. Specifically, the cast probabilities are 20.1%, 20.3%, 19.7%, 19.8%, and 19% for each frame.