This introduction paper is based on the paper "Casting Microstructure Inspection Using Computer Vision: Dendrite Spacing in Aluminum Alloys" published by "Metals".

1. Overview:
- Title: Casting Microstructure Inspection Using Computer Vision: Dendrite Spacing in Aluminum Alloys
- Author: Filip Nikolić, Ivan Štajduhar, Marko Čanađija
- Year of publication: 2021
- Journal/academic society of publication: Metals
- Keywords: secondary dendrite arm spacing; convolutional neural network; casting microstructure inspection; deep learning; aluminum alloys
2. Abstract:
This paper investigates the determination of secondary dendrite arm spacing (SDAS) using convolutional neural networks (CNNs). The aim was to build a Deep Learning (DL) model for SDAS prediction that has industrially acceptable prediction accuracy. The model was trained on images of polished samples of high-pressure die-cast alloy EN AC 46000 AlSi9Cu3(Fe), the gravity die cast alloy EN AC 51400 AlMg5(Si) and the alloy cast as ingots EN AC 42000 AlSi7Mg. Color images were converted to grayscale to reduce the number of training parameters. It is shown that a relatively simple CNN structure can predict various SDAS values with very high accuracy, with a R² value of 91.5%. Additionally, the performance of the model is tested with materials not used during training; gravity die-cast EN AC 42200 AlSi7Mg0.6 alloy and EN AC 43400 AlSi10Mg(Fe) and EN AC 47100 Si12Cu1(Fe) high-pressure die-cast alloys. In this task, CNN performed slightly worse, but still within industrially acceptable standards. Consequently, CNN models can be used to determine SDAS values with industrially acceptable predictive accuracy.
3. Introduction:
The size of dendrites and the secondary dendrite arm spacing (SDAS) are known to strongly depend on the solidification rate and chemical composition of aluminum alloys. SDAS has shown relationships with mechanical properties like ultimate tensile strength (UTS) and elongation (E), and potentially hardness, although its effect on yield strength (YS) is less clear. Determining the SDAS value is therefore useful for inferring material properties. Traditionally, SDAS measurement is a manual process. Automating this process using artificial intelligence (AI), specifically deep learning (DL) methods like convolutional neural networks (CNNs), could offer significant advantages, leveraging the large amounts of image data generated during quality control via Light Optical Microscopy (LOM).
4. Summary of the study:
Background of the research topic:
SDAS is an important microstructural feature in cast aluminum alloys, influenced by solidification conditions and composition, and correlated with mechanical properties. Standard SDAS determination relies on manual measurements from microscope images, which is time-consuming and potentially subjective. Automating this process is desirable for efficiency and consistency in quality control.
Status of previous research:
AI, machine learning (ML), and DL have been applied in materials science for predicting properties (e.g., YS, UTS, fatigue strength) from composition, processing parameters, or microstructure, and for tasks like defect detection and microstructure classification. Some studies used Artificial Neural Networks (ANNs) to predict SDAS based on processing parameters or simulation results. However, literature determining SDAS directly from microstructure images using DL methods was lacking. CNNs have shown superior performance compared to shallow learning or traditional image analysis methods for various material science image-based tasks.
Purpose of the study:
The study aimed to develop and evaluate a Deep Learning (DL) model, specifically a Convolutional Neural Network (CNN), capable of predicting SDAS values directly from grayscale microstructure images of aluminum alloys with industrially acceptable accuracy. The goal was to create a fully automated method, avoiding manual hyperparameter tuning.
Core study:
The core of the study involved:
- Creating a dataset of 200x200 pixel grayscale images from polished samples of three aluminum alloys (EN AC 46000 AlSi9Cu3(Fe), EN AC 51400 AlMg5(Si), EN AC 42000 AlSi7Mg) cast using different methods (HPDC, gravity die-casting, ingot casting).
- Determining corresponding scaled SDAS (S) values for these images, derived from manual measurements at various magnifications. Images included typical casting defects to enhance model robustness.
- Designing and training a CNN model to predict the S value from an input image.
- Evaluating the trained model's performance (using R² score, prediction deviation, and error) on a test set of images from the training materials.
- Further testing the model's generalization capability on images from three different aluminum alloys not used during training (EN AC 42200 AlSi7Mg0.6, EN AC 43400 AlSi10Mg(Fe), EN AC 47100 AlSi12Cu1(Fe)).
5. Research Methodology
Research Design:
The research employed a quantitative, computer vision-based approach using deep learning. A supervised learning strategy was used, where a CNN regression model was trained to map input microstructure images to a continuous output variable representing the scaled SDAS (S). The model's predictive accuracy was evaluated on both seen and unseen alloy types.
Data Collection and Analysis Methods:
- Data Collection: Samples of six aluminum alloys (EN AC 46000, EN AC 51400, EN AC 42000, EN AC 42200, EN AC 43400, EN AC 47100) were prepared by standard metallographic polishing. Images were captured using an Olympus BX51 optical microscope with an XC30 digital camera at various magnifications (5x, 10x, 20x, 40x, 50x). Physical SDAS was measured manually at 5x magnification following "Method E" [33]. Scaled SDAS values (S) for training/testing were derived for different magnifications using Equation (1) and average measurements (Table 1, Table 2). Original large images were split and resized to 200x200 pixels (Figure 5). Color images were converted to grayscale. The dataset included images with defects like porosity, scratches, blurriness, varying contrast, and externally consolidated crystals (ECS) (Figure 4). The dataset was split into training (60%), validation (20%), and test (20%) sets.
- Data Analysis Methods: A CNN architecture was designed consisting of three 2D convolutional blocks (each with Conv2D, ReLU activation, batch normalization, max-pooling) followed by a flattening layer, a fully connected layer (64 neurons with ReLU and batch normalization), and a single linear output neuron for regression (Figure 6). The Adam optimizer (learning rate 0.0005) was used. The model was implemented and trained using the Keras library. Performance was assessed using the R² score on the test set and by calculating the average prediction deviation and prediction error for specific alloys and magnifications on separate test images (Tables 3, 4).
Research Topics and Scope:
The research focused on predicting secondary dendrite arm spacing (SDAS) in cast aluminum alloys using convolutional neural networks directly from 2D microstructure images. The scope included several common Al-Si and Al-Mg alloys produced by high-pressure die casting (HPDC), gravity die casting, and ingot casting. The study investigated the model's accuracy on materials included in the training set and its ability to generalize to materials not seen during training.
6. Key Results:
Key Results:
- A relatively simple CNN architecture successfully predicted SDAS values from grayscale microstructure images with high accuracy, achieving an R² score of 91.5% on the test set derived from training materials.
- The model demonstrated very good accuracy on materials used during training, with an average prediction error of only 2.15% at 10x magnification (Table 3).
- When tested on materials not used during training, the model's performance was slightly reduced but remained within industrially acceptable limits, with an average prediction error of 7.2% at the highest available magnifications for those alloys (Table 4).
- Prediction accuracy generally improved with higher image magnification, as finer details of the dendrites become clearer. Magnifications of 10x or higher are recommended for better results.
- The inclusion of images with common defects during training likely contributed to the model's robustness for potential industrial application.
- The DL approach allows for fully automated SDAS determination without manual tuning of image processing parameters for each SDAS value.
- The results suggest that CNN models are a viable tool for automated SDAS assessment in aluminum castings, with potential applications in quality control and potentially linking microstructure images to mechanical properties.







Figure Name List:
- Figure 1. SDAS definition: the distance between two secondary dendrites.
- Figure 2. The procedure of deriving different S values using different magnifications on the microscope: (a) 5× magnification image; (b) 10× magnification image. The scale bar corresponds to S value.
- Figure 3. 200 × 200 pixel images used for training, their derived S values and alloy.
- Figure 4. Images of different types of defects used for the training: (a,b)—air and shrinkage porosity defects; (c,d)—scratches; (e)—blurred image; (c,f,g,i)—different brightness and contrast of the image; (g,h)—ECS (some images are purportedly of lower quality).
- Figure 5. Schematic representation of dataset generation: the original image was first split into 70 images with a pixel resolution of 208 × 211, which were then resized to 200 × 200 pixel.
- Figure 6. The CNN architecture used for estimating SDAS directly from microstructure image patches.
- Figure 7. Images of materials used during the training: The images were split into 200 × 200 pixel images following the procedure in Figure 5 and used for the prediction task.
- Figure 8. Images of materials that were not used during the training: The images were split into 200 × 200 pixel images following the procedure in Figure 5 and used for the prediction task.
7. Conclusion:
The study confirms that SDAS in aluminum alloys can be determined directly from microstructure image data using a DL methodology based on CNNs. The developed model showed excellent performance on materials it was trained on, especially at higher magnifications. While performance slightly decreased for materials not seen during training, it remained potentially useful for industrial applications, although caution is advised. The method's key advantage is its potential for full automation, eliminating the need for manual hyperparameter tuning associated with some traditional image analysis techniques. This approach has potential applications within Industry 4.0 for automated quality control and could potentially be extended to predict mechanical properties directly from microstructure images, provided the link between SDAS/microstructure and properties is further analyzed and incorporated.
8. References:
- [1] Vandersluis, E.; Ravindran, C. Relationships between solidification parameters in A319 aluminum alloy. J. Mater. Eng. Perform. 2018, 27, 1109–1121. [CrossRef]
- [2] Vandersluis, E.; Ravindran, C. Influence of solidification rate on the microstructure, mechanical properties, and thermal conductivity of cast A319 Al alloy. J. Mater. Sci. 2019, 54, 4325–4339. [CrossRef]
- [3] Djurdjevič, M.; Grzinčič, M. The effect of major alloying elements on the size of the secondary dendrite arm spacing in the as-cast Al-Si-Cu alloys. Arch. Foundry Eng. 2012, 12, 19–24. [CrossRef]
- [4] Brusethaug, S.; Langsrud, Y. Aluminum properties, a model for calculating mechanical properties in AlSiMgFe-foundry alloys. Metall. Sci. Tecnol. 2000, 18, 3–7.
- [5] Shabestari, S.; Shahri, F. Influence of modification, solidification conditions and heat treatment on the microstructure and mechanical properties of A356 aluminum alloy. J. Mater. Sci. 2004, 39, 2023–2032. [CrossRef]
- [6] Kabir, M.S.; Ashrafi, A.; Minhaj, T.I.; Islam, M.M. Effect of foundry variables on the casting quality of as-cast LM25 aluminium alloy. Int. J. Eng. Adv. Technol. 2014, 3, 115–120.
- [7] Seifeddine, S.; Wessen, M.; Svensson, I. Use of simulation to predict microstructure and mechanical properties in an as-cast aluminium cylinder head comparison-with experiments. Metall. Sci. Tecnol. 2006, 24, 7.
- [8] Morri, A. Empirical models of mechanical behaviour of Al-Si-Mg cast alloys for high performance engine applications. Metall. Sci. Technol. 2010, 28, 25–32.
- [9] Grosselle, F.; Timelli, G.; Bonollo, F.; Della Corte, E. Correlation between microstructure and mechanical properties of Al-Si cast alloys. La Metallurgia Italiana 2009, 27, 25–32.
- [10] Qi, M.; Li, J.; Kang, Y. Correlation between segregation behavior and wall thickness in a rheological high pressure die-casting AC46000 aluminum alloy. J. Mater. Res. Technol. 2019, 8, 3565–3579. [CrossRef]
- [11] Singh, S.; Bhadeshia, H.; MacKay, D.; Carey, H.; Martin, I. Neural network analysis of steel plate processing. Ironmak. Steelmak. 1998, 25, 355–365.
- [12] Hancheng, Q.; Bocai, X.; Shangzheng, L.; Fagen, W. Fuzzy neural network modeling of material properties. J. Mater. Process. Technol. 2002, 122, 196–200. [CrossRef]
- [13] Agrawal, A.; Deshpande, P.D.; Cecen, A.; Basavarsu, G.P.; Choudhary, A.N.; Kalidindi, S.R. Exploration of data science techniques to predict fatigue strength of steel from composition and processing parameters. Integr. Mater. Manuf. Innov. 2014, 3, 8. [CrossRef]
- [14] Liu, R.; Kumar, A.; Chen, Z.; Agrawal, A.; Sundararaghavan, V.; Choudhary, A. A predictive machine learning approach for microstructure optimization and materials design. Sci. Rep. 2015, 5, 11551. [CrossRef]
- [15] Yang, X.W.; Zhu, J.C.; Nong, Z.S.; Dong, H.; Lai, Z.H.; Ying, L.; Liu, F.W. Prediction of mechanical properties of A357 alloy using artificial neural network. Trans. Nonferrous Met. Soc. China 2013, 23, 788–795. [CrossRef]
- [16] Santos, I.; Nieves, J.; Penya, Y.K.; Bringas, P.G. Machine-learning-based mechanical properties prediction in foundry production. In Proceedings of the 2009 ICCAS-SICE, Fukuoka City, Japan, 18–21 August 2009; pp. 4536–4541.
- [17] Liao, H.; Zhao, B.; Suo, X.; Wang, Q. Prediction models for macro shrinkage of aluminum alloys based on machine learning algorithms. Mater. Today Commun. 2019, 21, 100715. [CrossRef]
- [18] Agrawal, A.; Choudhary, A. Deep materials informatics: Applications of deep learning in materials science. MRS Commun. 2019, 9, 779–792. [CrossRef]
- [19] Herriott, C.; Spear, A.D. Predicting microstructure-dependent mechanical properties in additively manufactured metals with machine-and deep-learning methods. Comput. Mater. Sci. 2020, 175, 109599. [CrossRef]
- [20] Ferguson, M.K.; Ronay, A.; Lee, Y.T.T.; Law, K.H. Detection and segmentation of manufacturing defects with convolutional neural networks and transfer learning. Smart Sustain. Manuf. Syst. 2018, 2, 1–42. [CrossRef]
- [21] Hanumantha Rao, D.; Tagore, G.; Ranga Janardhana, G. Evolution of Artificial Neural Network (ANN) model for predicting secondary dendrite arm spacing in aluminium alloy casting. J. Braz. Soc. Mech. Sci. Eng. 2010, 32, 276–281. [CrossRef]
- [22] Wei, J.; Chu, X.; Sun, X.Y.; Xu, K.; Deng, H.X.; Chen, J.; Wei, Z.; Lei, M. Machine learning in materials science. InfoMat 2019, 1, 338–358. [CrossRef]
- [23] Azimi, S.M.; Britz, D.; Engstler, M.; Fritz, M.; Mücklich, F. Advanced steel microstructural classification by deep learning methods. Sci. Rep. 2018, 8, 2128. [CrossRef]
- [24] Li, X.; Zhang, Y.; Zhao, H.; Burkhart, C.; Brinson, L.C.; Chen, W. A transfer learning approach for microstructure reconstruction and structure-property predictions. Sci. Rep. 2018, 8, 13461. [CrossRef]
- [25] Mery, D. Aluminum Casting Inspection Using Deep Learning: A Method Based on Convolutional Neural Networks. J. Nondestruct. Eval. 2020, 39, 12. [CrossRef]
- [26] DeCost, B.L.; Lei, B.; Francis, T.; Holm, E.A. High throughput quantitative metallography for complex microstructures using deep learning: A case study in ultrahigh carbon steel. arXiv 2018, arXiv:1805.08693.
- [27] Chowdhury, A.; Kautz, E.; Yener, B.; Lewis, D. Image driven machine learning methods for microstructure recognition. Comput. Mater. Sci. 2016, 123, 176–187. [CrossRef]
- [28] Exl, L.; Fischbacher, J.; Kovacs, A.; Oezelt, H.; Gusenbauer, M.; Yokota, K.; Shoji, T.; Hrkac, G.; Schrefl, T. Magnetic microstructure machine learning analysis. J. Phys. Mater. 2018, 2, 014001. [CrossRef]
- [29] Yucel, B.; Yucel, S.; Ray, A.; Duprez, L.; Kalidindi, S.R. Mining the Correlations Between Optical Micrographs and Mechanical Properties of Cold-Rolled HSLA Steels Using Machine Learning Approaches. Integr. Mater. Manuf. Innov. 2020, 9, 240–256. [CrossRef]
- [30] Pokuri, B.S.S.; Ghosal, S.; Kokate, A.; Sarkar, S.; Ganapathysubramanian, B. Interpretable deep learning for guided microstructure-property explorations in photovoltaics. NPJ Comput. Mater. 2019, 5, 95. [CrossRef]
- [31] DeCost, B.L.; Holm, E.A. A computer vision approach for automated analysis and classification of microstructural image data. Comput. Mater. Sci. 2015, 110, 126–133. [CrossRef]
- [32] DIN EN 1706: Aluminium und Aluminiumlegierungen-Gussstücke-Chemische Zusammensetzung und mechanische Eigenschaften; Beuth: Berlin, Germany, 1998.
- [33] Vandersluis, E.; Ravindran, C. Comparison of measurement methods for secondary dendrite arm spacing. Metallogr. Microstruct. Anal. 2017, 6, 89–94. [CrossRef]
- [34] Nikolic, F.; Štajduhar, I.; Čanađija, M. Aluminum microstructure inspection using deep learning: A convolutional neural network approach toward secondary dendrite arm spacing determination. In 4th Edition of My First Conference; University of Rijeka, Faculty of Engineering: Rijeka, Croatia, 2020.
- [35] Alexander Mordvintsev, A.K.R. Image Processing in OpenCV. 2013. Available online: https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_imgproc/py_table_of_contents_imgproc/py_table_of_contents_imgproc.html (accessed on 5 September 2020).
9. Copyright:
- This material is a paper by "Filip Nikolić, Ivan Štajduhar, Marko Čanađija". Based on "Casting Microstructure Inspection Using Computer Vision: Dendrite Spacing in Aluminum Alloys".
- Source of the paper: https://doi.org/10.3390/met11050756
This material is summarized based on the above paper, and unauthorized use for commercial purposes is prohibited.
Copyright © 2025 CASTMAN. All rights reserved.