## 1 Introduction  
Casting production is one of the oldest and most essential manufacturing processes in the metallurgical industry. In fact, it enables the production of large-scale and complex metallic components by pouring molten metal into molds, where, later, it solidifies into predetermined geometries. This process remains indispensable across multiple sectors, including automotive, energy, construction, and aerospace, due to its flexibility, cost-effectiveness, and capacity for producing both high-volume and high-performance parts [1]. According to the World Foundry Organization (WFO), global casting production exceeded 112 million metric tons in 2022, which corroborates its central role in the global manufacturing ecosystem [2]. The relevance of the foundry process goes beyond its industrial ubiquity. In fact, a considerable proportion of cast components is integrated into larger and more sophisticated mechanical systems, serving not only to create their basic structural elements but also to improve their functional behavior. In sectors such as aerospace, railways, or automotive, a single faulty cast part can compromise entire systems, leading to failures with severe safety,operational, and economic consequences [3]. In this way, this fact makes the mechanical reliability and metallurgical integrity of a casting the main objective in ensuring its behavior. Ensuring the quality of cast parts depends heavily on their internal microstructure, which is influenced by alloy composition, the cooling rate, and the presence of undesirable phases or inclusions. For this reason, metallographic analysis has become a fundamental tool in casting quality control. Working with metallographic images extracted by microscopy allows for the characterization of metallic microstructures. In fact, this analysis provides information on key features such as the ferrite/perlite matrix, graphite morphology, and the presence of carbides. It is particularly critical in nodular cast iron, where mechanical properties are directly linked to the nodularity, size, and distribution of graphite particles. Metallographic evaluation is traditionally based on standards such as UNE-EN-ISO 945-1, 945-2, and 945-4 [4; 5; 6], which guide the classification of microstructural features through comparison with reference charts and micrographs. However, this procedure is largely manual and depends on expert interpretation, which introduces significant variability and limits reproducibility [7]. Furthermore, factors such as evaluator fatigue, perceptual bias, and subjective judgment often lead to inconsistencies, reducing the reliability of the analysis and increasing the risk of ignoring defects. Attempting to avoid these limitations, software tools such as ImageJ [8], AmGuss [9], and microscope-integrated systems [10] have been developed to assist users in quantitative image analysis. Although these systems automate certain aspects of image measurement, they are still based on rule-based algorithms and thresholding methods that lack adaptability and do not incorporate contextual understanding. In addition, they are often inadequate in complex or heterogeneous microstructures and still require significant human oversight. In recent years, deep learning (DL) has emerged as an innovative approach in the field of computer vision (CV). In contrast to classical image processing methods, DL models learn hierarchical and abstract representations from data, enabling robust recognition of patterns even in noisy or complex environments. DL applications in microscopy have shown notable successes in fields such as oncology [11], wood anatomy [12], and metallurgical imaging [7; 13; 14]. In the context of cast iron, DL has been applied to segment microstructural phases [15], estimating modularity percentages, and even correlating graphite morphology with mechanical properties [16]. These approaches offer a promising alternative to traditional methods, improving precision, reproducibility, and scalability.