## 3 Results
### Image Analysis for Classification Challenge
#### 3.1.4. Acceleration of the Overall Pipeline  
In metallographic analysis, as explained before, certain operations, such as carbide detection and segmentation, are computationally intensive and time-consuming. Executing these tasks when it is not needed, particularly when carbides are absent, can result in unnecessary resource consumption. To mitigate this inefficiency, a lightweight classification model was developed and tested to avoid consumption when there is an absence of carbides. This enables the pipeline to bypass heavy segmentation and analysis steps when they are not required, optimizing computational efficiency without compromising result quality. The classification models were tested across three types of image inputs, as follows: raw (RGB), grayscale, and thresholded. Interestingly, thresholded images obtained slightly higher accuracy for all architectures. This is likely because thresholding improves contrast, making feature extraction easier. Nevertheless, the marginal gain did not justify the preprocessing cost for achieving a thresholded image. Consequently, raw images were selected as the standard input to preserve speed and avoid extra computation. The detailed results are shown in Table 3, while Table 4 breaks down model confidence and prediction errors on raw image data only. Although DenseNet121 does not achieve the highest accuracy, its low error rate, low number of low-confidence predictions, and other factors, make it the most practical and balanced model for real-time integration into the pipeline. Explaining the results in more detail, among the evaluated models, DenseNet121 consistently demonstrated the most balanced and robust performance across all image types. It achieved its highest accuracy of 97% when using thresholded images. Nevertheless, \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Model** & **‘Carbide’ Error** & **‘No Carbide’ Error** & **Probability \textless{} 80\%** \\ \hline MobileNetV2 & 56 & 3 & 32 \\ \hline ResNet50 & 0 & 489 & 108 \\ \hline InceptionV3 & 108 & 0 & 152 \\ \hline DenseNet121 & 18 & 0 & 30 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Model comparison on raw image data (598 images, 108 with carbides). The probability below 85% reflects the confidence level. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Model** & **Image Type** & **Accuracy \%** & **Loss** \\ \hline DenseNet121 & Raw & 95 & 0.04 \\ \hline DenseNet121 & Gray & 96 & 0.04 \\ \hline DenseNet121 & Threshold & 97 & 0.05 \\ \hline InceptionV3 & Raw & 81 & 0.08 \\ \hline InceptionV3 & Gray & 82 & 0.07 \\ \hline InceptionV3 & Threshold & 82 & 0.07 \\ \hline MobileNetV2 & Raw & 89 & 0.06 \\ \hline MobileNetV2 & Gray & 87 & 0.07 \\ \hline MobileNetV2 & Threshold & 93 & 0.05 \\ \hline ResNet50 & Raw & 94 & 0.05 \\ \hline ResNet50 & Gray & 93 & 0.05 \\ \hline ResNet50 & Threshold & 97 & 0.03 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Model-based probability estimation for ‘carbide analysis’. the difference in performance with raw images was minimal (95% accuracy and 0.04 loss). Combined with its low number of low-confidence predictions (only 30 instances below 80% confidence) and minimal error rate (18 misclassifications on carbide-positive samples, none on negative), this justified its selection for integration in the real-time pipeline. ResNet50 performed well, reaching a 97% accuracy and the lowest loss (0.03) when working with thresholded images. In contrast, its performance on raw data revealed a substantial number of low-confidence predictions (108 below 80%), and an extremely unbalanced error distribution, misclassifying all 489 carbide-negative samples. This indicates a potential issue that may compromise its reliability for confident decision-making in practical applications. MobileNetV2 also achieved good overall results. Nonetheless, when evaluated on raw images, the accuracy dropped to 89% with an increase in misclassifications (56 errors in the carbide class) and a moderate number of low-confidence predictions (32 below 80%).