## Materials and Methods
### Classic Machine-Learning Methods  
All the models were created with the Computer Vision Tool- box and MATLAB Classification Learner app by performing the method of \"bag of features\" for image classification [26; 27; 28]. This technique is adapted to computer vision from the world of natural language processing, which creates a \"vocabulary\" of visual words as descriptors of representative features of each image category. To select ML classifiers and considering that they are sensitive to the hyper-parameters, different possibilities were considered. In Appendix A, the different models and presets experimented are established, indicating the corresponding hyperparameters. This information is offered for both resolutions considered here, i.e., 224 \(\times\) 224 px and 520 \(\times\) 514 px. Then, six different ML classifiers and/or presets were selected among the most relevant in the literature to create the classification models considering the most accurate of them, Table 3. In all cases, the bag of features was fixed to 400 elements, since it was determined, after preliminary tests with different numbers, that 400 features led to a good balance between time performance and accuracy. When this number was increased or decreased, no significant advantages were found. The image dataset was split into two subsets, one for training with 840 images (70%) and another with 360 images for testing. For each image, key points are selected, and feature extraction was performed. The detection method used was Speeded-Up Robust Features (SURF) [29] due to the optimum efficiency and computing speed for this extractor. Then, for all the datasets, a bag of feature objects, i.e., visual words, was created. Since the number of features is a configurable parameter, the authors set it to 400 for the experiments Some of these representative points or visual words are shown in random samples in Figure 4.  
Only 10 keypoints are marked in the figures, and they correspond to the most relevant features as indicated in Figure 5b. The relevance of the points is marked from 1 to 10, with being 1 the strongest keypoint. As it is well-known, the zones represented by the keypoints are the most representative that allow the microstructures to be identified, and they always include parts of different microconstituents together, for which the size of the points are of different diameter, independently of their relevance. \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & \multicolumn{2}{c}{**224 \(\times\) 224 px**} & \multicolumn{2}{c}{**520 \(\times\) 514 px**} \\ \hline
**Model** & **Validation** & **Test** & **Validation** & **Test** \\ \hline Ensemble & 70.1 & 39.1 & 87 & 36.4 \\ Decision Tree & 65.3 & 36.8 & 67.5 & 31.9 \\ SVM & 79.3 & 34.1 & 86.8 & 40.8 \\ Naive Bayes & 72.7 & 35.4 & 79.5 & 46.1 \\ KNN & 62.8 & 38.9 & 82.4 & 40.8 \\ Logistic Regression Kernel & 80.6 & 34.7 & 89 & 45.3 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Accuracy (%) in classic ML models. Figure 4: A selection of the 10 strongest keypoints in steel samples annealing (**a**), quenching (**b**) and tempering (**c**). 1 is the strongest keypoint and 10 the weakest. Figure 5: Histograms for visual word occurrence corresponding to the images of the different heat treatments. (**a**) Original histogram representations. (**b**) Histograms sorted from the strongest to the weakest feature. Once a bag of visual words is created, it is necessary to form a vector with the count of the visual occurrences of the 400 features in each image. This produces a histogram that becomes a new and reduced representation of an image as is shown in Figure 5 for the microstructures corresponding to every heat treatment. This is the basis for training a classifier--that is, an image encoded into a feature vector. In Figure 5b are the same histograms but sorted according to features of relevance, from the highest to the smallest. According to Figure 5b, it can be established that the number of features without meaning is 23 for quenching and 13 for quenching-tempering treatments.