## 2 Materials and Methods
### Image Typology Classification to Identify Specific Workflow
#### 2.1.2 Detection of Etching Status  
As detailed in Section 1, the preparation of metallographic samples depends on the specific objective of the analysis. This study considers two distinct types of specimens (Figure 3 illustrates these two types of images). The first type comprises non-etched ones. These are polished samples where microstructural evaluation is conducted directly on the polished surface, without the application of chemical reagents. In this case, key morphological features, such as modularity, graphite distribution, and element shape, are reviewed under optical microscopy. The second type involves etched specimens, in which a chemical etchant is applied to the surface in order to reveal internal microstructural characteristics. This process includes the identification of metallurgical phases (for instance, ferrite and perlite), grain boundaries, and potential segregation, which are essential for more detailed material characterization.  
Regarding the distinct analytical procedures required for each image type, it is essential to accurately classify the images in order to apply the appropriate feature extraction methods. For that purpose, the classification task was carried out. The model learning phase was conducted by creating a subset of the previously described dataset (for more information, please see the description at the beginning of this section). Specifically, we used 1240 non-etched and 603 etched images. Then, for the classification between both types of specimens, we evaluated several DL learning architectures, as detailed below.  
* DenseNet121 [37]. This is a deep CNN architecture known for its dense connections between layers. Instead of traditional CNNs, where each layer connects only to the  
Figure 3: Example of etched images. The identification of whether the metallographic sample has undergone etching is required.  
next, DenseNet connects each layer to every other layer in a feed-forward manner. This architecture has demonstrated strong performance in medical image classification [38].
* InceptionV3 [39]. This is a deep CNN architecture designed for image classification using Inception modules with factorized convolutions to reduce computational costs while maintaining accuracy. This type of network is widely applied in large-scale image classification tasks [40].
* MobileNetV2 [41]. This is a lightweight network designed for efficient mobile and embedded vision applications, employing inverted residuals and linear bottlenecks. MobileNetV2 is effectively used in resource-constrained environments [42].
* ResNet50 [33]. This is a CNN with 50 layers that uses skip connections to mitigate vanishing gradients, enabling the training of very deep networks. It has been successfully applied in numerous classification domains, including materials science imaging [43].  
With the aim of evaluating the performance of the applied classification models, this process focuses on distinguishing between etched and non-etched samples. For each category, the models were measured in terms of classification errors, confusion between classes, and prediction confidence.  
In addition, to enhance the reliability of the classification outputs, a probability-based thresholding strategy was implemented. Specifically, predictions with a softmax confidence score below 85% were labeled as low confidence and treated as ambiguous. This threshold is motivated by prior research that emphasizes the degradation in classification reliability for predictions with confidence scores under this value [44,45].