Page 46 - MSAM-4-3
P. 46

Materials Science in Additive Manufacturing                           AI-driven defect detection in metal AM




                                                               Table 2. Number of “good” and “defects” powder bed images
                                                               (n=2638)
                                                               Classification              Number of PB images, n
                                                               Good                               1108
                                                               Defects                            1530

                                                               RAM, and using Python (version 3.10, Python Software
            Figure 1. Example of raw powder bed data. Early-stage defects example   Foundation, United  Kingdom), PyTorch (version  1.12.1,
            (left); Late-stage defects example (right)         Meta AI, United States), TensorFlow/Keras (version 2.13.0,
                                                               Google LLC, United States), OpenCV (version  4.4.0.40,
            but also  lacks real-time responsiveness. By  integrating   OpenCV.org,  United  States,  Numpy  (version  1.24.3,
            AI-based models into the process monitoring workflow, it   NumPy Developers, United States), and Matplotlib
            becomes feasible to automatically detect surface defects and   (version  3.7.5, Matplotlib Development Team, United
            pause or stop the build when necessary. Such automated   States) for model training and result visualization. All
            intervention can reduce unnecessary time and material   experiments were run in the PyCharm Community
            loss, thereby improving overall production efficiency.  Edition (version 2024.1.2, JetBrains s.r.o., Czech Republic)
              To better reflect the practical requirements of quality   with Anaconda (version  24.3.0, Anaconda, Inc., United
            monitoring in AM, this study defines two task phases,   States) to ensure dependency isolation and version control.
            aligned with the hierarchical information needs in   2.2. Image classification models
            industrial production – namely, binary defect detection
            and  spatial  localization.  In  the  first  phase,  the  model  is   ResNet and EfficientNet offer multiple versions of
            designed to rapidly process layer-wise image data from   models, making them well-suited for transfer learning.
            the EOS M290 system and determine whether the current   To balance computational efficiency with performance,
            layer contains potential defects, classifying them as “good”   this study experimented with and selected ResNet-50
            or “defects.” This phase simulates the industrial demand   and EfficientNetV2B0 and implemented task-specific
            for fast screening, aiming to identify anomalous layers   adaptations tailored to powder bed image characteristics.
            in real-time and enable timely intervention to minimize   Before training, the image data was pre-processed. First,
            material and time waste. ResNet-50 and EfficientNetV2B0   the three datasets were merged to expand the dataset. The
            are selected for comparison due to their strong trade-off   first 8 – 10 images from each print project, which appear
            between accuracy and computational efficiency. ResNet   overexposed due to high energy and platform reflection,
            improves model depth and convergence stability through   were removed, along with the last few “meaningless”
                             36
            residual connections,  while EfficientNet balances model   images from the end of the print process. This resulted
            size, computational cost, and accuracy using compound   in a total of 2,638 powder bed images. Data were then
            scaling.  In the second phase, the model is further   manually categorized into “good” and “defects” classes
                  37
            required to localize and highlight defect regions with   (Table 2). Finally, the dataset was split into training, test,
            bounding boxes, providing spatial information to support   and validation sets at a 70:15:15 ratio.
            downstream inspection or corrective actions. This phase   The default input size for the models was 224 × 224,
            addresses the industrial need for defect traceability and   while the dataset used in this experiment consisted of high-
            region-specific  analysis  while  aiming to reduce  manual   resolution 1280 × 1024 images. Directly inputting the original
            inspection workload. The Faster region-based-CNN   size would result in insufficient memory, and significantly
            (R-CNN) and YOLO Version 5 (YOLOv5; Ultralytics,   downsizing the images would risk losing critical features
            United Kingdom) models are compared in this phase. Faster   of small defect targets. Therefore, a Python script was used
            R-CNN uses a two-stage approach with a region proposal   to crop the “defects” images to retain only the defect region
            network,  offering  higher  precision  in  detecting  small  or   and 10% of the surrounding background. To improve the
            subtle defects, which benefits complex PBF-LB analysis.    model’s generalization, OpenCV was then applied for data
                                                         38
            In contrast, YOLOv5 performs single-stage detection with   augmentation, including normalization, rotation, horizontal
            faster inference and better multi-scale capability, making it   flipping, scaling, and shear transformations. Finally, all
            more suitable for real-time AM monitoring. 39,40   images were resized to 224 × 224 pixels.

              All experiments were conducted on a laptop, equipped   During transfer learning, multiple adjustments were
            with Intel Core i7-12700H, 2.30GHz CPU, and 16GB of   made  to optimize training  performance.  First,  ResNet-50


            Volume 4 Issue 3 (2025)                         4                         doi: 10.36922/MSAM025150022
   41   42   43   44   45   46   47   48   49   50   51