This introduction paper is based on the paper "Automated Defect Detection through Flaw Grading in Non-Destructive Testing Digital X-ray Radiography" published by "MDPI".

1. Overview:
- Title: Automated Defect Detection through Flaw Grading in Non-Destructive Testing Digital X-ray Radiography
- Author: Bata Hena, Gabriel Ramos, Clemente Ibarra-Castanedo, Xavier Maldague
- Year of publication: 2024
- Journal/academic society of publication: NDT
- Keywords: non-destructive testing; digital X-ray radiography; machine learning; automated defect recognition; defect grading; K-D tree
2. Abstract:
Process automation utilizes specialized technology and equipment to automate and enhance production processes, leading to higher manufacturing efficiency, higher productivity, and cost savings. The aluminum die casting industry has significantly gained from the implementation of process automation solutions in manufacturing, serving safety-critical sectors such as automotive and aerospace industries. However, this method of component fabrication is very susceptible to generating manufacturing flaws, hence necessitating adequate non-destructive testing (NDT) to ascertain the fitness for use of such components. Machine learning has taken the center stage in recent years as a tool for developing automated solutions for detecting and classifying flaws in digital X-ray radiography. These machine learning-based solutions have increasingly been developed and deployed for component inspection, to keep pace with the high production throughput in manufacturing industries. This work focuses on the development of a defect grading algorithm that assesses detected flaws to ascertain if they constitute a defect that could render a component unfit for use. Guided by ASTM 2973-15; Standard Digital Reference Images for Inspection of Aluminum and Magnesium Die Castings, a grading pipeline utilizing K-D (k-dimensional) trees was developed to effectively structure detected flaws, enabling the system to make decisions based on acceptable grading terms. This solution is dynamic in terms of its conformity to different grading criteria and offers the possibility to achieve automated decision making (Accept/Reject) in digital X-ray radiography applications.
3. Introduction:
Process automation enhances production using specialized technology, combining hardware, software, and IT to manage manufacturing, leading to increased efficiency, productivity, and savings [1]. The aluminum die casting (ADC) industry benefits significantly, achieving high throughput for components in sectors like automotive and aerospace [2]. This technique involves injecting molten aluminum into a mold, cooling, and extracting the component. However, it is prone to manufacturing flaws, requiring monitoring [3]. ADC offers advantages like lighter weight, cost-effectiveness for high volumes, high throughput, automation potential, and product consistency [4].
Undetected defects in ADC parts pose safety risks, necessitating adequate NDT inspection [5]. NDT techniques like radiography, Ultrasonic Testing, visual inspection, Infrared Thermography, Liquid Penetrant Testing, and Eddy Current Testing allow flaw detection without damaging the component [6]. Radiography is often preferred for ADC quality evaluation [7]. It uses X-rays or gamma rays to penetrate materials, examining the entire volume [8]. Sensors like digital detector arrays (DDAs) are needed to reveal the X-ray information.
Digital radiography (DR) is replacing film, converting captured X-ray photons into numerical values and then grayscale images for visual interpretation [9-12]. DR allows post-acquisition adjustments and image filtering. NDT standards (e.g., from ASME, ASTM, ISO) are crucial for ensuring reliable radiographic testing, providing guidelines on techniques, parameters, image quality, and interpretation. These standards are vital in industries like aerospace and automotive. Adherence enhances inspection consistency. NDT inspection should ideally be done by qualified inspectors (e.g., per ISO 9712) who acquire and interpret images according to standards [13]. After confirming image quality, inspectors evaluate indications to accept or reject components (Figure 1). However, human inspectors can make errors due to factors like fatigue or experience [14, 15], with visual interpretation effectiveness estimated around 80% [16].
Increasing computational power has spurred the development of automated NDT processes for 100% inspection. Artificial Intelligence (AI) is widely explored for automating flaw recognition and evaluation from NDT data, particularly in radiographic images [17]. This automation is driven by industry demand and a shortage of qualified NDT inspectors [18, 19]. While beneficial, these AI solutions must align with NDT standards for acceptance in safety-critical sectors.
4. Summary of the study:
Background of the research topic:
Aluminum die casting (ADC) components are widely used but susceptible to internal manufacturing flaws [20, 21]. High production throughputs in automated die casting make 100% inspection challenging due to time, cost, and personnel shortages. While statistical sampling is used, it's inferior to 100% inspection. Computer-based NDT, especially digital X-ray radiography, offers a path to 100% inspection. ADC components often serve critical functions where failure can have significant economic and safety consequences [22]. Ensuring the quality and integrity of these parts through effective NDT is paramount.
Status of previous research:
Automated defect recognition (ADR) using digital X-ray radiography is increasingly important for quality control in ADC. Previous studies have explored ADR algorithms. For instance, object detection methods (YOLO, RetinaNet, EfficientDet) showed promise in assisting defect identification [23]. Deep learning models like YOLOv3_EfficientNet [24] and various Convolutional Neural Networks (CNNs) [25, 26] have been applied to streamline flaw detection, demonstrating continuous refinement of architectures for better precision. However, challenges remain, including complex defect geometries, varying radiographic conditions [26], the need for extensive training data [23], and high computational requirements for advanced CNNs hindering real-time application [25]. Critically, while substantial progress exists in flaw identification and characterization [17, 28], defect grading – determining the severity and impact of detected flaws to assess fitness for use – remains an understudied field. Existing studies often treat detected discontinuities as flaws or defects without a defined grading process according to operational standards [29-31].
Purpose of the study:
This study aims to bridge the gap in ADR by developing a comprehensive flaw grading algorithm. The objectives are:
- To develop a grading algorithm that classifies detected flaws into severity levels aligned with reference standards (like ASTM E2973-15) or client specifications.
- To enhance the integration of ADR solutions in safety-critical sectors by proposing a method that moves beyond simple detection to qualified grading.
- To implement computer vision techniques that yield deterministic outcomes for improved accuracy and interpretability in the grading process.
The motivation is to provide a systematic approach, based on NDT standards (specifically ASTM E2973-15 and terminology from ASTM E1316), to evaluate detected flaws (imperfections) and determine if they constitute rejectable defects, thereby improving quality control in aluminum die casting.
Core study:
The core of this study is the development and application of a novel flaw grading methodology for digital X-ray radiography images of aluminum and magnesium die castings. This methodology succeeds the initial detection and characterization stages performed by other algorithms. It focuses specifically on grading the detected flaws based on established criteria, primarily guided by the ASTM E2973-15 standard, which provides digital reference images for different severity levels of discontinuities like Porosity, Cold Fill, Shrinkage, and Foreign Materials [27].
The study emphasizes the crucial distinction defined in ASTM E1316 between:
- Discontinuity: An interruption in the material structure.
- Flaw: A detectable imperfection or discontinuity that is not necessarily rejectable.
- Defect: One or more flaws whose characteristics (size, shape, location, etc.) violate specified acceptance criteria, making the component rejectable.
The developed algorithm takes detected and characterized flaws (provided as input, typically a segmentation mask) and assesses them against grading rules derived from the standard (or custom criteria) to determine if they constitute defects, ultimately leading to an Accept/Reject decision. The grading process considers flaw properties like area and quantity within a defined evaluation area (700 mm² as per ASTM E2973). A key component of the methodology is the use of a K-D tree data structure for efficient spatial organization and querying of detected flaws.
5. Research Methodology
Research Design:
The research designs a flaw grading algorithm intended as an independent pipeline that follows flaw detection, segmentation, and characterization steps. The input is assumed to be a segmentation mask identifying distinct flaws and their classes. The output is an Accept/Reject decision based on grading. The grading logic is based on rules derived from the ASTM E2973-15 standard, focusing on four flaw categories: Porosity, Shrinkage, Cold Fill, and Foreign Material.
Key methodological steps include:
- Input Processing: Receiving a segmented image where different flaw classes are identifiable (e.g., by color coding, as done in the study's synthetic data generation - see Figure 3, Table 1).
- Class Separation: Generating binary masks for each flaw class present in the input image.
- Flaw Property Extraction: For each class-specific binary mask, extracting properties of individual flaws (e.g., area) using image analysis libraries (
skimage.measure.regionprops
). - Spatial Indexing: Building a K-D (k-dimensional) tree using the centroids of the detected flaws for efficient spatial querying [32, 33]. This facilitates rapid retrieval of flaws within specific regions of interest (ROIs).
- ROI Management & Iteration: Employing a sliding window approach for defining ROIs (700 mm² evaluation areas). A "stride function" is used in conjunction with the K-D tree to efficiently navigate the image, moving the ROI dynamically to the next area containing flaws, thus avoiding processing empty regions.
- Grading Logic Application: Within each ROI, applying the grading rules (based on Table 2 derived from ASTM E2973 terms) by querying the K-D tree to retrieve flaws within the ROI, assessing their size (area) and quantity against the defined severity level criteria.
- Decision Aggregation & Reporting: Aggregating the grading results across all ROIs and generating a final report, potentially with visualizations (like grading maps). The overall methodology is depicted schematically in Figure 5. The K-D tree was chosen over alternatives like R-trees [34] for its balance of efficiency and complexity in the 2D spatial context of this application.
Data Collection and Analysis Methods:
To test and validate the grading pipeline, test images were synthetically generated. Real flaws (from ground truth annotations of aluminum die casting parts) of varying sizes and morphologies for the four classes (Porosity, Shrinkage, Cold Fill, Foreign Material) were extracted to form a repository. These extracted flaws were then randomly placed onto background images. Each flaw class was assigned a distinct color code (Table 1) for identification by the subsequent processing steps (Figure 4a shows generated flaws, 4b shows color-coded classification). This synthetic approach allowed for the creation of a diverse dataset with various flaw distributions.
The ASTM E2973-15 standard uses reference images (e.g., Figure 2 for Porosity). For computational application, these visual references were converted into quantitative digital metrics (grading rules) based on flaw area and quantity within a 700 mm² inspection area. A custom reference table (Table 2) defining severity grades (1 to 4) based on flaw area ranges and maximum quantities per 700 mm² was used for the study. The skimage.measure.regionprops
library was used to extract geometric properties (like area) of detected flaws (blobs) from the binary masks. The K-D tree enabled efficient analysis by organizing flaw centroids spatially.
Research Topics and Scope:
The research focuses on the automated grading of flaws detected in digital X-ray radiography images of aluminum and magnesium die castings. The scope is limited to the four categories of discontinuities defined in ASTM E2973-15: Porosity, Shrinkage, Cold Fill, and Foreign Materials. The core task is to evaluate detected flaws against criteria derived from this standard (or customizable client criteria) to determine if they constitute rejectable defects. The methodology involves processing 2D radiographic images, extracting flaw characteristics, utilizing a K-D tree for efficient spatial analysis within defined evaluation areas (700 mm²), and applying specific grading rules based on flaw size and quantity. The study develops the grading algorithm itself, assuming prior detection and classification of flaws.
6. Key Results:
Key Results:
The primary output of the developed grading pipeline is presented as a visual overlay on the input image, highlighting activated regions of interest (ROIs) where grading rules were applied (Figure 6). The results are shown separately for each flaw class (Porosity - Row a, Shrinkage - Row b, Cold Fill - Row c, Foreign Body - Row d) for clarity.
Four severity levels (Grades 1 to 4) are considered, each assigned a distinct ROI color for identification:
- Grade 1: Blue
- Grade 2: Green
- Grade 3: Orange
- Grade 4: Brown
Grading is performed based on the criteria defined in the custom reference (Table 2), applied per 700 mm² unit area on the input image. When multiple activated ROIs corresponding to different severity levels overlap, the ROI associated with the higher severity level takes precedence in the visualization. According to the reference terms used (Table 2), the presence of a Foreign Body automatically results in a Grade 4 (brown ROI) classification. Figure 6 columns show the isolated flaw class (i), the bounding boxes generated during analysis (ii), and the final highlighted grading map indicating severity levels across the evaluated areas (iii).
Figure Name List:
- Figure 1. Process flow in NDT according to ASTM E1316-22a.
- Figure 2. Grading references from ASTM 2973 with enhanced visualization of Porosity flaws; arranged in order of increasing severity, from 1 to 4.
- Figure 3. Workflow for creating input images with real flaws, each flaw color-coded to differentiate between four distinct classes.
- Figure 4. (a) shows an image with random distribution of generated flaws; (b) shows a random classification of flaws into 4 distinct color codes. Original image size is 3098 × 3097 pixels.
- Figure 5. Schematic representation of our proposed defect grading methodology.
- Figure 6. Rows (a-d) represent Porosity, Shrinkage, Cold Fill, and Foreign body; columns (i-iii) show the isolated flaw class based on the flaw class, bounding boxes, and highlighted bounding boxes. Bounding box color indicates the grade as follows: grade 1 (blue), grade 2 (green), grade 3 (orange), grade 4 (brown).
7. Conclusion:
This study re-examines defect detection in NDT by emphasizing the critical distinction between flaws and defects. It introduces a robust grading system, integrated into flaw detection algorithms, offering a detailed, reliable, and adaptable approach for identifying true defects from detected flaws in digital radiographic images of die castings. The proposed method decouples the evaluation process (as outlined in ASTM E1316), focusing specifically on grading relevant flaws against established NDT standards (like ASTM E2973-15) to make informed Accept/Reject decisions.
The grading pipeline enhances inspection efficiency and accuracy, providing a pathway for fully automated decision-making and quality control. Integrating this method into existing NDT workflows can significantly reduce inspection time and costs while maintaining or improving accuracy and reliability. It underscores the importance of adhering to operational NDT standards, ensuring only flaws compromising component fitness for use are classified as defects. This solution represents a significant advancement, offering a versatile tool for various industries. Future research directions include upgrading the algorithm for 3D/volumetric applications (e.g., computed tomography) and incorporating machine learning techniques to further refine grading criteria for enhanced accuracy and applicability.
8. References:
- [1] Hahn, J.; Bequette, B.W. Process Automation. In Springer Handbook of Automation; Nof, S.Y., Ed.; Springer International Publishing: Cham, Switzerland, 2023; pp. 585–600. ISBN 978-3-030-96729-1.
- [2] Perzyk, M.; Dybowski, B.; Kozłowski, J. Introducing Advanced Data Analytics in Perspective of Industry 4.0 in a Die Casting Foundry. Arch. Foundry Eng. 2019, 19, 53-57. [CrossRef]
- [3] Fiorese, E.; Bonollo, F.; Timelli, G.; Arnberg, L.; Gariboldi, E. New Classification of Defects and Imperfections for Aluminum Alloy Castings. Int. J. Met. 2015, 9, 55-66. [CrossRef]
- [4] Sigworth, G. Aluminum Casting Alloys and Casting Processes. In Aluminum Science and Technology; ASM International: Almere, The Netherlands, 2018; ISBN 978-1-62708-207-5.
- [5] Ferguson, M.; Ak, R.; Lee, Y.-T.T.; Law, K.H. Detection and Segmentation of Manufacturing Defects with Convolutional Neural Networks and Transfer Learning. arXiv 2018, arXiv:1808.02518. [CrossRef] [PubMed]
- [6] Silva, M.I.; Malitckii, E.; Santos, T.G.; Vilaça, P. Review of Conventional and Advanced Non-Destructive Testing Techniques for Detection and Characterization of Small-Scale Defects. Prog. Mater. Sci. 2023, 138, 101155. [CrossRef]
- [7] Wilczek, A.; Długosz, P.; Hebda, M. Porosity Characterization of Aluminium Castings by Using Particular Non-Destructive Techniques. J. Nondestruct. Eval. 2015, 34, 26. [CrossRef]
- [8] Dwivedi, S.K.; Vishwakarma, M.; Soni, P.A. Advances and Researches on Non Destructive Testing: A Review. Mater. Today Proc. 2018, 5, 3690-3698. [CrossRef]
- [9] Körner, M.; Weber, C.H.; Wirth, S.; Pfeifer, K.-J.; Reiser, M.F.; Treitl, M. Advances in Digital Radiography: Physical Principles and System Overview. Radiographics 2007, 27, 675-686. [CrossRef]
- [10] de Carvalho, A.A.; Suita, R.C.d.S.B.; Silva, R.R.d.; Rebello, J.M.A. Evaluation of the Relevant Features of Welding Defects in Radiographic Inspection. Mat. Res. 2003, 6, 427-432. [CrossRef]
- [11] Aryan, P.; Sampath, S.; Sohn, H. An Overview of Non-Destructive Testing Methods for Integrated Circuit Packaging Inspection. Sensors 2018, 18, 1981. [CrossRef]
- [12] Wang, B.; Zhong, S.; Lee, T.-L.; Fancey, K.S.; Mi, J. Non-Destructive Testing and Evaluation of Composite Materials/Structures: A State-of-the-Art Review. Adv. Mech. Eng. 2020, 12, 168781402091376. [CrossRef]
- [13] Ulus, Ö.; Davarcı, F.E.; Gültekin, E.E. Non-Destructive Testing Methods Commonly Used in Aviation. Int. J. Aeronaut. Astronaut. 2024, 5, 10-22. [CrossRef]
- [14] Dobrzański, L.A.; Krupinski, M.; Sokolowski, J.H. Computer Aided Classification of Flaws Occurred during Casting of Aluminum. J. Mater. Process. Technol. 2005, 167, 456–462. [CrossRef]
- [15] Wu, B.; Zhou, J.; Ji, X.; Yin, Y.; Shen, X. Research on Approaches for Computer Aided Detection of Casting Defects in X-Ray Images with Feature Engineering and Machine Learning. Procedia Manuf. 2019, 37, 394-401. [CrossRef]
- [16] Hou, W.; Zhang, D.; Wei, Y.; Guo, J.; Zhang, X. Review on Computer Aided Weld Defect Detection from Radiography Images. Appl. Sci. 2020, 10, 1878. [CrossRef]
- [17] Yu, H.; Li, X.; Song, K.; Shang, E.; Liu, H.; Yan, Y. Adaptive Depth and Receptive Field Selection Network for Defect Semantic Segmentation on Castings X-Rays. NDT E Int. 2020, 116, 102345. [CrossRef]
- [18] Vrana, J.; Singh, R. NDE 4.0—A Design Thinking Perspective. J. Nondestruct. Eval. 2021, 40, 8. [CrossRef]
- [19] Dobmann, G. Quo Vadis NDT?-A Forecast of the Future. BNiD 2020, 5, 6-17. [CrossRef]
- [20] Min, C.; Yi, W.; Jigui, Z.; Jiang, F.; Jianjun, M. Simulation and Optimization of Casting Process for Aluminum Alloy Special-Shaped Parts. J. Phys. Conf. Ser. 2021, 1986, 012018. [CrossRef]
- [21] Samuel, A.M.; Samuel, E.; Songmene, V.; Samuel, F.H. A Review on Porosity Formation in Aluminum-Based Alloys. Materials 2023, 16, 2047. [CrossRef]
- [22] Itamura, M.; Anzai, K.; Hirata, N.; Akahoshi, N.; Maeda, T.; Tanazawa, H.; Furuya, Y.; Fukuoka, S.; Yamamoto, N. Development of Aluminum Die Casting Products with High Accuracy as Well as Superior Die-to-Casting Transcriptional Capability by Using Semi-Solid Method. In Proceedings of the Semi-Solid Processing of Alloys and Composites XII; Trans Tech Publications Ltd.: Stafa-Zurich, Switzerland, 2013; Volume 192, pp. 447-453.
- [23] Mery, D. Aluminum Casting Inspection Using Deep Object Detection Methods and Simulated Ellipsoidal Defects. Mach. Vis. Appl. 2021, 32, 72. [CrossRef]
- [24] Xue, L.; Hei, J.; Wang, Y.; Li, Q.; Lu, Y.; Liu, W. A High Efficiency Deep Learning Method for the X-Ray Image Defect Detection of Casting Parts. Meas. Sci. Technol. 2022, 33, 095015. [CrossRef]
- [25] Hu, C.; Wang, Y. An Efficient Convolutional Neural Network Model Based on Object-Level Attention Mechanism for Casting Defect Detection on Radiography Images. IEEE Trans. Ind. Electron. 2020, 67, 10922–10930. [CrossRef]
- [26] Tang, J.; Liu, S.; Zhao, D.; Tang, L.; Zou, W.; Zheng, B. An Algorithm for Real-Time Aluminum Profile Surface Defects Detection Based on Lightweight Network Structure. Metals 2023, 13, 507. [CrossRef]
- [27] Mizgan, H.; Ganea, M. Optimization of Aluminium Die-Casting Process through Predictive Maintenance and Parameter Traceability Systems. IOP Conf. Ser. Mater. Sci. Eng. 2022, 1256, 012028. [CrossRef]
- [28] Zhang, J.; Guo, Z.; Jiao, T.; Wang, M. Defect Detection of Aluminum Alloy Wheels in Radiography Images Using Adaptive Threshold and Morphological Reconstruction. Appl. Sci. 2018, 8, 2365. [CrossRef]
- [29] Mery, D.; Filbert, D. Automated Flaw Detection in Aluminum Castings Based on the Tracking of Potential Defects in a Radioscopic Image Sequence. IEEE Trans. Robot. Automat. 2002, 18, 890–901. [CrossRef]
- [30] Koshti, A.M. Using Requirements on Merit Ratios for Assessing Reliability of NDE Flaw Detection in Multi-Hit Detection in Digital Radiography. In Proceedings of the Health Monitoring of Structural and Biological Systems XV; Fromme, P., Su, Z., Eds.; SPIE: St Bellingham, WA, USA, 2021; Volume 11593, p. 115932K.
- [31] Yahaghi, E.; Mirzapour, M.; Movafeghi, A.; Rokrok, B. Interlaced Bilateral Filtering and Wavelet Thresholding for Flaw Detection in the Radiography of Weldments. Eur. Phys. J. Plus 2020, 135, 42. [CrossRef]
- [32] Friedman, J.H.; Bentley, J.L.; Finkel, R.A. An Algorithm for Finding Best Matches in Logarithmic Expected Time. ACM Trans. Math. Softw. 1977, 3, 209-226. [CrossRef]
- [33] Bentley, J.L. Multidimensional Binary Search Trees Used for Associative Searching. Commun. ACM 1975, 18, 509-517. [CrossRef]
- [34] Guttman, A. R-Trees: A Dynamic Index Structure for Spatial Searching. In Proceedings of the ACM SIGMOD Conference, Boston, MA, USA, 18-21 June 1984.
9. Copyright:
- This material is a paper by "[Bata Hena, Gabriel Ramos, Clemente Ibarra-Castanedo, Xavier Maldague]". Based on "[Automated Defect Detection through Flaw Grading in Non-Destructive Testing Digital X-ray Radiography]".
- Source of the paper: [https://doi.org/10.3390/ndt2040023]
This material is summarized based on the above paper, and unauthorized use for commercial purposes is prohibited.
Copyright © 2025 CASTMAN. All rights reserved.