Abstract
Highlights
An innovative approach for porosity assessment of Additive Manufacturing (AM) components is proposed, integrating Deep Learning (DL) with ultrasonic coda waves.
The integration of feature-rich ultrasonic coda waves with the strong feature extraction of DL enables highly accurate porosity evaluation for AM components.
What are the main findings?
Ultrasonic coda waves can propagate fully inside the AM components and exhibit high sensitivity to changes in the AM components’ porosity.
The introduction of a Multi-head Attention Mechanism (MAM) effectively improves the porosity assessment accuracy of the proposed coda-CNN-MAM network.
What are the implications of the main findings?
Nondestructive Evaluation (NDE) of porosity in AM components is achieved using ultrasonic coda waves.
The integration of coda waves with DL provides a highly accurate framework for assessing porosity in AM components.
Abstract
The porosity of additive manufacturing components significantly impacts their mechanical properties, thereby limiting their widespread application in engineering. Current porosity assessment predominantly relies on destructive testing, underscoring the urgent need for accurate in situ non-destructive testing methods. In this paper, we propose a novel deep learning-assisted non-destructive testing method for porosity assessment in additive manufacturing components. Our approach leverages the high sensitivity of ultrasonic coda waves to minute internal material changes, combined with the powerful feature extraction capability of deep learning. Experimental results demonstrate that ultrasonic coda waves are sensitive to porosity variations in additive manufacturing components. Due to the porosity of additive manufacturing components involves multi-dimensional micro-structural features, conventional parameters such as the correlation coefficient and relative velocity change cannot establish an effective mapping relationship, despite their variation with porosity, thus precluding accurate inversion. To address this challenge, we propose a coda–convolutional neural network–multi-head attention mechanism network. Ultrasonic coda waves can fully interact with pores inside additive manufacturing components, and their signals are rich in porosity-related features. The introduction of deep learning significantly enhances the ability to extract such features. The trained network achieves high-precision porosity prediction with an accuracy of 98%. Our proposed approach reveals the complementary integration of ultrasonic coda waves and deep learning methods: the former provides high sensitivity to porosity changes, while the latter addresses the limitations of difficult extraction of relevant features and unclear complex mapping relationships. This collaborative framework establishes a new solution for high-precision non-destructive testing of additive manufacturing components.
Keywords: additive manufacturing (AM), porosity, ultrasonic coda wave, non-destructive evaluation (NDE), deep learning (DL)
1. Introduction
Additive Manufacturing (AM) technology, especially metal AM technology, such as Selective Laser Melting (SLM), has found increasingly widespread application in high-end manufacturing sectors, including aerospace, biomedicine, and automotive manufacturing. The core strengths of this technology lie in one-piece forming for complex geometries, high material utilization rates, and rapid customization capabilities [1,2]. However, the intense physical and chemical reactions during AM processing often lead to melt pool instability and powder splashing [3,4], inevitably introducing internal defects such as pores and incomplete fusion [5,6]. These tiny pores, which are prone to inducing stress concentration, will markedly degrade the fatigue strength, fracture toughness, and dynamic mechanical properties of AM components, directly endangering the service safety and operational reliability of the entire structure [7,8,9]. Therefore, accurate assessment of porosity in AM components is not only a technical prerequisite for guaranteeing the performance of AM components and meeting the demands of harsh service conditions, but also a pivotal enabler for advancing AM technology from a manufacturable stage to a reliable one.
Leveraging its nondestructive characteristic, high efficiency, and excellent adaptability to various materials and complex geometries, Ultrasonic Testing (UT) holds significant promise for porosity assessment in AM components [10,11,12,13]. Huang et al. [14] assessed the printing quality of 316L AM components based on the attenuation and wave velocity of ultrasonic waves. Specifically, Their experiments confirmed a distinct positive correlation of attenuation with porosity and a negative correlation of velocity with porosity. This finding provides a new method for the Non-Destructive Evaluation (NDE) of the print quality of AM components. Zhang et al. [15] also employed ultrasonic waves to assess the porosity of AM components. They established a relationship between porosity and both ultrasonic attenuation and wave velocity across different frequencies. The observed trends aligned with prior findings, offering valuable guidance for frequency selection in the UT of AM component porosity. Nevertheless, conventional ultrasonic testing techniques continue to face bottlenecks: the sizes of pores (typically on the micrometer scale) [5] typically present in AM components are frequently 1–2 orders of magnitude smaller than the half wavelength of the applied ultrasonic wave (typically on the millimeter scale) [14,15], which in turn directly constrains the accuracy and sensitivity of quantitative porosity assessment for AM components.
When ultrasonic waves propagate in heterogeneous media, they undergo multiple scattering, resulting in the generation of coda waves. Unlike direct waves, coda waves travel significantly longer paths and can fully interact with the internal structure of the assessed component, thus including a rich trove of information about the material’s microstructure and mechanical properties. Consequently, coda waves exhibit high sensitivity to subtle structural alterations, facilitating accurate assessments of mechanical performance [16,17,18]. Snider et al. [19] pioneered Coda Wave Interferometry (CWI), demonstrating its efficacy in detecting structural state changes, pattern recognition, and defect diagnosis. Building on this, this method has been widely adopted to assess subtle changes in components. Wuttke et al. [20] employed CWI to assess the wave velocity variations caused by small perturbations in soils, such as stress and void ratio, and their experimental results highlighted the significant potential of CWI for time-lapse monitoring of soils. In addition, Martino et al. [21] conducted an investigation into the impact of pore characteristics in volcanic rocks on ultrasonic wave propagation. Specifically, their findings revealed that pore size, shape, volume fraction, and spatial distribution exert a measurable influence on the amplitude and phase of coda waves. The aforementioned research demonstrates the high sensitivity of coda waves to pores, indicating their considerable potential for porosity assessment. However, the specific application of coda waves for quantifying porosity in AM components remains largely unexplored.
Conventionally, coda wave analysis relies on established algorithms such as the stretching method [22] and Moving Window Cross-Correlation (MWCC) [23]. While these techniques are widely used, the high sensitivity of coda waves to material properties also renders them susceptible to environmental noise. Consequently, when processed with such conventional methods, noise interference can significantly compromise assessment accuracy. Given its powerful feature extraction capabilities, Deep Learning (DL) presents a promising avenue to overcome this limitation [24,25,26]. Currently, there is a growing trend of integrating DL with UT to enhance detection accuracy. Wen et al. [27] integrated Electromagnetic Acoustic Resonance (EMAR) with a One-Dimensional Convolutional Neural Network (1D-CNN) to achieve accurate non-contact characterization of material hardness. This method demonstrated high predictive accuracy, with the introduced DL framework successfully overcoming the critical challenge of low Signal-to-Noise Ratio (SNR) in conventional EMAR detection. Shin et al. [28] developed an anomaly detection model for early damage identification in concrete structures affected by the Alkali-Silica Reaction (ASR) by integrating coda waves with DL, achieving high-precision detection. These studies collectively confirm DL’s powerful capability in extracting critical damage-related features from complex UT signals, thereby strongly supporting the feasibility of combining DL with coda waves for porosity assessment in AM components.
In this paper, we propose a novel method for assessing the porosity of AM components by integrating DL with the ultrasonic coda wave. Firstly, we investigate the interaction between ultrasound coda waves and porosity of AM components, using correlation coefficients and relative velocity changes to characterize the coda wave variations. The research results indicate that ultrasonic coda wave is indeed sensitive to changes in porosity within AM components. However, the porosity of AM components is characterized by multi-dimensional micro-structural features, and it is difficult to establish a linear mapping relationship with a single parameter, rendering high-precision inversion unachievable through conventional methods. To overcome this challenge, we propose a Coda-CNN-Multi-head Attention Mechanism (MAM) network, which combines the powerful feature extraction capability of DL with the characteristic of the coda wave containing multiple porosity-related features. By comparing separately with the assessment results of the CNN trained only on coda wave signals and the proposed network trained only on the primary wave signals, the significant effectiveness and prominent advantages of the proposed network in the porosity evaluation of AM components are verified. This work establishes a new framework for porosity assessment in AM components, demonstrating the potential of combining DL with ultrasonic coda wave in NDE.
2. Theoretical Considerations
Ultrasonic guided waves offer several advantages for Non-Destructive Testing (NDT), including long propagation distances, high detection efficiency, sensitivity to internal defects, and the capability to inspect components with complex geometries. These characteristics collectively make them well-suited for the assessment of AM components. For an isotropic thin plate, as shown in Figure 1, a spatial Cartesian coordinate system is established. The governing partial differential equation for the displacement of any material point within the plate is given by [29]:
| (1) |
where i and j are taken as 1, 2, 3, respectively, and fi and ui represent the internal force and displacement component, respectively. ρ is the density of the material, and λ and μ are the Lamé constants. To separate the propagation characteristics of longitudinal (dilatational) and transverse (shear) waves, the displacement field is decomposed into a scalar potential ∇ (x1, x3) (governing longitudinal waves) and a vector potential ∇ × (x1, x3) (governing transverse waves). Substituting the above potential decomposition into Equation (1), we derive the wave equations for longitudinal and transverse waves in the plate:
| (2) |
| (3) |
where cL and cT represent the longitudinal and transverse wave velocities in the plate, respectively. The solutions to Equations (2) and (3) involve combinations of sine and cosine functions. By applying the free-stress boundary conditions at the plate’s upper and lower surfaces and using the separation of variables method, we obtain the characteristic equations for symmetric and anti-symmetric guided wave modes (Lamb wave modes) [29]:
| (4) |
| (5) |
where h is the plate thickness, k is the wavenumber, p2 = ω2/cL2 − k2, and q2 = ω2/cT2 − k2. The above equations allow for the calculation and analysis of guided wave propagation characteristics within the plate. As previously noted, AM components inherently contain pores. Li et al. [30] have demonstrated that ultrasonic propagation characteristics can be altered even by interactions with defects smaller than half the wavelength. Consequently, when ultrasonic waves travel through these AM components, the inherent pores inevitably modify the original ultrasonic wavefield and propagation characteristics, giving rise to coda waves. As illustrated in Figure 1, the propagation path of the coda wave is significantly longer than that of the primary wave. This extended path enables more comprehensive interaction with the internal structure of the component, thereby making the coda wave more sensitive to subtle internal changes within the component.
Figure 1.
Schematic diagram of ultrasonic guided wave propagation and coda wave generation under the action of pores in AM components.
A currently prevalent technique for coda wave analysis is CWI. The principle of CWI can be described by the path superposition theory, which states that the wavefield at any given point can be represented as the superposition of waves propagating along all possible paths, as follows [31]:
| (6) |
where u(t) denotes the wavefield recorded at a specific location, while Sp(t) represents the set of all possible wave propagation paths within the component. Thus, the wavefield can be understood as the superposition of waves that have traveled along all possible scattering paths. These paths give rise to the primary wave, which arrives first, followed by singly scattered waves, and finally the coda waves, which result from multiple scattering within the component. Consider a wave that has traveled a distance l along a path P. In the presence of a slight perturbation between the transmitter and receiver, the resultant variation in the wavefield is formulated as follows [31]:
| (7) |
| (8) |
According to Equation (8), a slight perturbation manifests as a phase shift in the received signals, directly translating to a change in their Time-of-Flight (TOF). This establishes the variation in time difference as a sensitive measure of minor perturbations within the component.
3. Experimental Setup and Results
To examine how porosity influences the propagation characteristics of guided waves and the generation of coda waves, several TC4 AM components were fabricated via SLM on an EOS M290 system. All specimens were fabricated using identical equipment and a single batch of powder to mitigate the influence of printing equipment variability and powder discrepancies on specimen properties. Table 1 outlines the chemical composition of the TC4 powder employed. The key printing parameters were set as follows: the laser spot size was 100 μm, the laser scanning velocity was 1900 mm/s, the layer thickness was 0.03 mm, and the hatching distance was 0.13 mm. In addition, the stripe scanning strategy was employed during printing, with a 67° rotation of the laser scanning direction between adjacent layers. By adjusting the laser power from 150 W to 350 W, AM components with varying porosity levels, which were designated as Specimen A through Specimen F, were fabricated. Each specimen was manufactured with final dimensions of 200 mm in length, 50 mm in width, and 3 mm in thickness. To mitigate deformation and residual stress in AM components, annealing heat treatment (800 °C for 2 h, furnace cooling) was conducted on the specimens prior to their cutting from the substrate.
Table 1.
Chemical composition of TC4 particles (wt. %).
| Al | V | Fe | O | C | N | Ti |
|---|---|---|---|---|---|---|
| 6.32 | 4.02 | 0.21 | 0.11 | 0.05 | 0.03 | Remain |
The porosity of each AM component was determined using Archimedes’ principle, a widely recognized method for determining the relative density of AM components [32]. Prior to measurement, all specimens were first subjected to vacuum drying at 80 °C for 8 h to eliminate potential interference from residual moisture. For each specimen, ten independent density measurements were performed by fully immersing the specimen in water without contact with the container walls. The dense TC4 alloy exhibited a density of 4.43 g/cm3, and based on this reference value and these measurement results, the porosity and corresponding error bars of each specimen were calculated. As shown in Figure 2, the porosity of AM components exhibits a non-monotonic, V-shaped trend with increasing laser power, which initially decreases before reaching a minimum and then increases. This behavior arises from two distinct mechanisms. At low laser power, insufficient energy leads to incomplete melting of the powder, leading to the formation of keyholes [33]. Conversely, at excessively high laser power, the intense energy input causes violent melt pool dynamics, trapping protective gas and forming gas pores [34]. Taking the specimens fabricated with the printing parameters of Specimen A and Specimen F as examples, their metallographic plots are presented in Figure 3. It can be observed that the internal porosity of AM components exhibits significant differences under different printing parameters, and this result is highly consistent with the porosity measured by the Archimedes’ principle. In addition, the morphological characteristics of pores inside AM components also show distinct differences under different energy input conditions. It should be noted that although the specimens used for metallographic characterization were fabricated with exactly the same printing parameters as Specimen A and Specimen F, they were not subjected to annealing treatment. Both keyholes and gas pores affect guided wave propagation by inducing scattering, which in turn generates coda waves. Given that parameter optimization for new AM materials is often a lengthy and costly process, a suitable NDE method for high-precision porosity assessment is essential.
Figure 2.
The relationship between laser power and the porosity of AM components.
Figure 3.
The metallographic images of AM components with different printing parameters: (a) Specimen A printing parameters and (b) Specimen F printing parameters.
The experimental setup for assessing the porosity of AM components using ultrasonic guided waves is illustrated in Figure 4. Taking into account the wavelength, mode characteristics, and corresponding excitation method of ultrasonic guided waves, we have selected the A0 mode at 0.5 MHz as the primary wave. A RITEC-SNAP RAM 5000 system was used as the signal generator, and longitudinal wave transducers (Olympus A413S-SB center frequency: 0.5 MHz, Olympus, Tokyo, Japan) were employed for the excitation and reception of guided waves. The high-viscosity coupling agent (Olympus SWC-2, Olympus, Tokyo, Japan.) was employed to ensure acoustic coupling among the ultrasonic transducer and specimens. Furthermore, all assessed specimens were polished to guarantee uniformity in geometric dimensions and mitigate the interference of surface roughness on coda waves. During each assessment, the distance between the excitation and reception transducers was strictly controlled at 60 mm. The excitation signal is a 5-cysles Hanning window modulation signal, and the received signals were captured and displayed using a digital oscilloscope (Tekronix MSO44, Tektronix, Beaverton, OR, USA). To enhance the SNR, the received signals were amplified with a gain of 60 dB. Furthermore, each assessment signal represents the average of 128 independent data acquisitions. This approach effectively suppresses random noise and instantaneous coupling variability, thereby significantly enhancing the SNR and measurement repeatability.
Figure 4.
Experimental setup.
Taking Specimen E as an example, Figure 5 illustrates typical assessment signals. The primary wave in Figure 5a yields a group velocity of 3157 m/s from TOF calculation, differing marginally by 0.76% from the theoretical value 3133 m/s. However, the primary wave is not suitable for porosity assessment, as the minute internal pores in AM components cause negligible perturbation to its propagation. Figure 5b displays the coda wave in the received assessment signal. The characteristics of this coda wave align with prior findings in coda wave analysis. With increasing TOF, the coda wave amplitude exhibits a valley-like trend, rising initially before gradually decaying. The initial amplitude increase is caused by the constructive interference of waves generated by internal scattering. However, with increasing TOF, the ultrasonic waves traverse longer paths, leading to greater energy attenuation from material damping and scattering, which ultimately dominates and causes the amplitude to decay.
Figure 5.
Typical ultrasonic guided wave received signals for porosity assessment in AM components: (a) the primary wave; (b) the coda wave.
Figure 6 displays the coda wave assessment signals for AM specimens with varying porosity levels. The acquisition areas of these signals were not fixed, so as to ensure that the acquired signals could reflect the intrinsic porosity characteristics of each specimen rather than locally accidental structural features. The observable morphological changes in the coda wave indicate that it contains information relevant to porosity. This is because variations in internal pores alter the wavefield and propagation paths of ultrasonic guided waves. To analyze these signals, the waveform stretching method was employed. Due to the lowest porosity of Specimen D, the assessment signal of this specimen is used as the benchmark. The coda waves from other specimens were stretched or compressed, and then the correlation coefficient between each processed waveform and the reference was calculated. The maximum value of this coefficient corresponds to the stretching factor, , which represents the relative velocity change (dv/v) of the coda wave. The correlation coefficient Rk(), which quantifies the similarity between the two coda waves, is defined as follows [31]:
| (9) |
where u(t) denotes the reference coda wave set, u′(t) is the coda wave from other assessed components after stretching or compression, and T is the duration of the entire coda wave. In addition, the relative velocity change is calculated as follows [31]:
| (10) |
where l1 and l2 denote the starting and ending positions of the selected time window, and ts denotes the time delay. The subsequent solution of the equation is given by:
| (11) |
Figure 6.
Ultrasonic coda wave assessment signals obtained from AM components with different porosity levels.
The correlation coefficients and relative velocity changes in the assessment signals for AM components with different porosity levels were calculated using Equations (10) and (11), and the results are presented in Figure 7. To avoid interference from local structural features on the assessment results, multiple independent and distinct detection positions were selected on each specimen. As mentioned previously, only the detection position was adjusted for each assessment, while all other detection conditions were kept consistent. Multiple sets of coda wave signals were collected to ensure that the spatial diversity of porosity characteristics could be captured. Based on the data collected above, correlation coefficients, relative velocity changes, and corresponding error bars (the Standard Deviation, SD) were calculated. One-way Analysis of Variance (ANOVA) was performed separately on these two calculated parameters, and the outcomes revealed that both p-values are less than 0.001. This result indicates that the porosity of AM components exerts a highly statistically significant effect on the correlation coefficient and relative velocity change of coda waves. Although these two parameters are sensitive to changes in the coda wave, they exhibit no clear linear relationship with the porosity of the AM component. This complexity arises because the porosity in AM components is characterized by multi-dimensional micro-structural features, such as the number, size, and spatial distribution of pores. The mismatch between these complex input dimensions and the single-target feature (porosity) makes it difficult to establish a direct linear relationship using individual parameters. Consequently, accurately assessing porosity with traditional coda wave analysis methods remains challenging.
Figure 7.
Relationship between porosity of AM components and characteristics of coda waves: (a) the correlation coefficient; (b) the relative velocity change.
4. Porosity Evaluation by Integration of DL with Coda Waves
4.1. Proposed Coda-CNN-MAM Network
As demonstrated in the analysis results of the previous section, traditional coda wave analysis methods struggle to establish an effective mapping relationship with the porosity of AM components, thereby hindering the accurate evaluation of porosity. To address this limitation, we introduce the deep learning and propose a Coda-CNN-MAM network. Specifically, this network is designed to extract porosity-relevant features from coda wave signals, enabling precise porosity evaluation for AM components. The network architecture is illustrated in Figure 8. By leveraging the powerful feature extraction capability of CNN, the proposed model performs end-to-end learning and hierarchically extracts abstract features, from shallow to deep representations, directly from the raw coda wave signals [35]. CNN has been widely used in NDT. Junges et al. [36] combined Structural Health Monitoring (SHM) with DL to reduce the impact of Environmental and Operational Conditions (EOCs) on the performance of damage diagnosis methods, while mitigating the interference of temperature variations on ultrasonic guided wave-based SHM. Deng et al. [37] utilized CNN to analyze the ultrasonic evaluation signals of composite materials, and ultimately achieved accurate visualization of the location and characteristics of defects in composite material plates. The above research demonstrates the potential of CNN in processing ultrasonic assessment signals. However, unlike the processing of the primary wave signals in the aforementioned CNN applications, coda waves contain a large amount of physical information, including the ultrasonic scattered field, as well as the distribution characteristics of pores in the AM component. Such information typically exhibits complex long-range dependencies in the signal sequence. Nevertheless, the CNN is limited by the structural characteristics of its local receptive field, making it difficult to effectively capture such global contextual information, becoming a key bottleneck in its processing of coda wave signals [38]. Therefore, to effectively capture and integrate these deep-level features, we introduced a MAM module. The MAM deploys multiple independent attention heads in parallel, enabling the model to learn diverse dependencies within signals from different representation subspaces [39]. Each attention head independently calculates the correlation weights between different time positions, thereby capturing features dominated by different physical mechanisms, such as pore distribution in AM components and ultrasonic scattered field. This mechanism effectively enhances the modeling ability of long-range signal dependencies, thereby improving the feature resolution ability of the model in complex coda wave analysis and providing a more powerful decision-making algorithm for inverting material micro structures from ultrasonic coda waves.
Figure 8.
Schematic of the Coda-CNN-MAM network used for porosity assessment of AM components.
The architecture of the proposed Coda-CNN-MAM network is illustrated in Figure 8. The CNN component mainly consists of three primary modules: convolutional layers, pooling layers, and fully connected layers. As the core module of the CNN, convolutional layers extract features from input data through convolutional kernels. The model incorporates three convolutional layers, containing 32, 64, and 128 kernels of size 1 × 3, respectively. Each convolutional layer is followed by a pooling layer with a window size of 1 × 4, adopting a max-pooling strategy to achieve dimensionality reduction of feature maps while retaining key salient features. The extracted features are subsequently integrated and transformed through fully connected layers. To enhance the network’s nonlinear modeling capability, all neurons use the Rectified Linear Unit (ReLU) as the activation function, ensuring the network can effectively capture the complex non-monotonic mapping relationship between input coda signals and porosity. Furthermore, a dropout layer is incorporated to mitigate overfitting, reduce the sensitivity of the network to small changes in the input data, and improve the network’s robustness. The core function of the Dropout layer is to break the co-adaptation relationships between neurons by randomly deactivating some neurons, thereby reducing the model’s over-reliance on local noise and idiosyncratic features in the training data (such as non-core features like accidental coupling noise at a specific detection position). This forces the model to learn more general and robust core patterns, ultimately enhancing its generalization ability and alleviating overfitting. As demonstrated by numerous studies [40,41], the introduction of this layer can effectively reduce the overfitting phenomenon.
To further boost the network’s capacity to model global correlations among features, the MAM is incorporated prior to the fully connected layer. The core essence of this mechanism lies in capturing the multivariate correlation relationships of input sequences in different feature subspaces [42]. This is achieved by computing multiple independent attention heads in parallel, and ultimately concatenating the outputs of all attention heads to form a more comprehensive global contextual representation. This representation can robustly capture global contextual information and serve as a powerful complement to the local features extracted by convolutional layers.
Specifically, the operation of MAM can be decomposed into four major steps: linear projection, head splitting, parallel scaled dot-product attention, and output concatenation [42]. Among these, linear projection involves applying three sets of independent learnable linear transformations to the input Query (Q), Key (K), and Value (V) vectors, respectively, mapping them from the original model dimension to the target dimension of attention heads. This not only completes dimensional adaptation for the subsequent head splitting but also injects differentiated feature representations through linear transformations. In the proposed Coda-CNN-MAM model, eight attention heads are adopted. The projected vectors were evenly split according to this number, and scaled dot-product attention was calculated independently for each split sub-vector to reveal the dependencies among multi-dimensional distinct features within different subspaces. Finally, the outputs of all attention heads were concatenated, and a final attention-based feature was obtained through a learnable linear transformation. The above operations not only enhance the model’s parallel computing capability but also enable the model to capture key features in the input information from different perspectives and dimensions, significantly improving the model’s feature expression capability and learning efficiency.
Herein, the distinct features mentioned above refer to those in coda wave signals with significant discriminability and strong correlation with porosity. Pores of different microstructural features uniquely alter the propagation paths and characteristics of coda waves, and this specific interaction allows coda waves to effectively assess AM component porosity. However, conventional analysis methods cannot accurately extract such porosity-correlated coda wave features, which is the core reason for introducing DL in this study.
The configuration and hyperparameters of the proposed Coda-CNN-MAM network architecture plays a pivotal role in enhancing the performance of DL networks. In this study, the Adam (Adaptive Moment Estimation) optimizer was employed to iteratively adjust and identify an optimal set of hyperparameters for the Coda-CNN-MAM network. The learning rate was initialized at 0.01 and further refined using the gradient descent algorithm. To evaluate model performance during training, the cross-entropy loss was adopted as the loss metrics. To ensure sufficient data availability, a total of 600 assessment signals were collected, with 100 signals acquired from each specimen. The distance between the transmitter and receiver was consistently maintained at 60 mm, while the assessment region was not kept constant during detection so as to capture the spatial diversity of porosity characteristics. Prior to input into the Coda-CNN-MAM network, the primary waves in the assessment signals were eliminated. The complete dataset was randomly split into training and testing sets at a ratio of 7:3. The training set was used for model estimation and architectural optimization, and the testing set was reserved for evaluating the final network performance. To establish an effective nonlinear mapping between the processed coda signals and porosity, parameters including convolutional kernels, weights, and biases were iteratively optimized with the objective of minimizing the cross-entropy loss, thereby enhancing prediction accuracy. All computations were performed on a workstation equipped with 512 GB of RAM, an Intel Xeon Gold 6230 R CPU, and an NVIDIA GeForce RTX 3080 Ti GPU (NVIDIA, Santa Clara, CA, USA).
4.2. Prediction Results and Discussions
The processed coda wave assessment signals were trained using the proposed Coda-CNN-MAM network. Figure 9 illustrates the loss and classification accuracy on the test set throughout the training process. The loss on the test set demonstrates a steady decline and eventually stabilizes, indicating good model convergence and effective mitigation of overfitting or underfitting. Concurrently, the test accuracy consistently improves and plateaus at a high level, affirming the network’s robust capability in capturing and learning porosity-related features from the coda wave signals. The classification accuracy of the network reached 97.8%, and the final classification result is shown in Figure 9b, demonstrating its ability to distinguish the coda wave signals of AM components with different porosity levels. This classification confusion matrix visually represents the classification performance of the model across six porosity levels. The rows correspond to the ground-truth porosity labels of the specimens, while the columns indicate the predicted porosity labels by the model. Each cell displays the count of signals classified into the corresponding category and their respective percentage, with the numerical values and color intensity collectively reflecting the distribution of classification results. The color bar on the right, represented by a gradient of blue, indicates the number of signals in each cell, with darker shades indicating a greater number of signals in that category. The misclassification rate remained remarkably low across all specimens, peaking at only 3.6%. These high-precision classification outcomes indicate that the proposed network can effectively excavate the deep-seated features related to component porosity in coda wave signals, enabling efficient and accurate porosity assessment of AM components. In addition, as assessment was performed at multiple distinct locations across each specimen, these results further demonstrate that the model learned porosity-related features consistent across the specimen, rather than random coupling noise or systematic perturbations. The above results further confirm that the model exhibits excellent generalization ability. Varying the detection positions allows for capturing the spatial diversity of porosity characteristics, preventing the model from merely fitting the signal features of local positions. In terms of network structure design, the introduction of the dropout layer reduces sensitivity to minor variations in input and mitigates the risk of overfitting. More crucially, the integration of the MAM compensates for CNN’s insufficiency in global feature extraction, enabling it to capture the global contextual features related to porosity in coda wave signals. These measures have effectively improved the model’s generalization ability, ensuring that the model learns universal features associated with porosity rather than random coupling noise or systematic perturbations.
Figure 9.
The training process and results of the proposed Coda-CNN-MAM network: (a) curve of loss and accuracy vs. epoch; (b) classification confusion matrix under different porosity levels.
To more comprehensively and robustly evaluate the model performance, we conducted stratified k-fold cross-validation. Specifically, the dataset corresponding to each porosity category were randomly partitioned into 5 equal folds, and each fold was sequentially used as the test set while the remaining folds served as the training set in a cyclic manner. The cross-validation results show that the model achieved an average classification accuracy of 97.3% ± 0.8% across the 5 test folds, with consistent recognition performance observed across all categories. These findings further confirm that the proposed Coda-CNN-MAM network exhibits excellent classification robustness and generalization capability under varying data distributions.
To validate the effectiveness of the proposed Coda-CNN-MAM network, comparative experiments were conducted: one employing a standalone CNN for the coda wave signals, and another training the proposed network only using the primary wave signals. The performance of the standalone CNN trained using the coda wave signals was first evaluated. Figure 10a shows the loss and classification accuracy during its training process, while the final classification results are presented in Figure 10b. The classification results indicate that while the standalone CNN achieves some level of classification accuracy (90.6%), its performance is substantially inferior to the proposed Coda-CNN-MAM network (97.8%), representing a notable decrease of 7.2%. Furthermore, the CNN exhibited a significantly higher misclassification rate, exceeding 12.1% in certain porosity levels, which stands in sharp contrast to the maximum rate of 3.6% for the proposed network. The performance gap primarily stems from the standalone CNN’s reliance on convolution operations, which excel at extracting local features but struggle to capture the deep global correlations within the coda wave signals that are indicative of AM component porosity. In contrast, the Coda-CNN-MAM network overcomes this limitation by integrating the MAM, enabling a more comprehensive and accurate feature extraction process. The advantage of MAM lies in its ability to effectively capture the long-range contextual correlation of coda wave signals, which is difficult to achieve with the traditional CNN. In addition, its multi-head design avoids over-reliance on single-scale feature correlation, thereby enhancing the robustness of porosity feature extraction. On the downside, MAM marginally increases the computational cost of the network, resulting in a 9.56% increase in training time. Coda wave signals generated via multiple scattering and reflection within AM components exhibit strong non-local correlations, such that porosity-related features are not confined to a specific segment of the coda wave signal. Consequently, MAM delivers superior performance in this context. The comparative results validate the effectiveness and marked superiority of the proposed DL network for the porosity assessment of AM components.
Figure 10.
The training process and results of the CNN trained on the coda wave signals: (a) curve of loss and accuracy vs. epoch; (b) classification confusion matrix under different porosity levels.
Further analysis was conducted on the performance of the proposed Coda-CNN-MAM network trained exclusively on the primary wave signals. The loss and classification accuracy curves of the test set during network training are illustrated in Figure 11a, and alongside those of the aforementioned models, these results collectively indicate that the model in this study is not significantly affected by overfitting. The losses of both the training set and the test set decreased steadily and converged to a stable level, with no typical characteristics of overfitting such as a rebound in the test set loss or a significant widening of the loss gap between the training set and the test set. A series of measures, ranging from data collection to the targeted design of the model structure, have effectively mitigated the risk of significant overfitting of the model with a limited dataset. The final classification results are presented in Figure 11b, which indicates that the classification accuracy of the Coda-CNN-MAM network decreased significantly to 81.1% when relying solely on primary wave signals. This represents a notable drop of 16.7% compared to the 97.8% accuracy achieved when trained on coda wave signals. Meanwhile, the misclassification rate of specimens increased substantially, with the rate reaching 28.6% in certain porosity levels, which far exceeded the maximum 3.6% rate observed in coda wave signal training results. This discrepancy arises from the fundamental differences in the wave propagation characteristics. The primary wave propagates over a shorter path within the AM component, thereby capturing only limited information and making it difficult to reveal deep features related to porosity. In contrast, the coda wave undergoes multiple scattering and reflections, integrating structural information from various locations. This process imbues the coda wave with richer porosity-related features, making it more compatible with the feature extraction logic of the Coda-CNN-MAM model.
Figure 11.
The training process and results of the proposed Coda-CNN-MAM network trained exclusively on the primary wave signals: (a) curve of loss and accuracy vs. epoch; (b) classification confusion matrix under different porosity levels.
Based on the above analysis, the performance of the Coda-CNN-MAM model proposed in this study is attributed to the synergistic effect of physical mechanisms and network architecture. The physical characteristics of ultrasonic coda waves form the core foundation underpinning the model’s performance. Propagating through AM components via multiple scattering and reflection, coda waves can fully interact with pores and thus carry multi-dimensional microstructural features associated with porosity. This physical characteristic endows the coda wave signals with relatively strong feature discriminability, which also serves as an important prerequisite for the model to accurately extract porosity-related features. In addition, tailored to this input characteristic of coda wave signals, an adaptive network architecture was designed, whose core advantage lies in the synergistic effect formed by the local feature extraction capability of the CNN and the global contextual modeling capability of the MAM. Collectively, these findings validate the effectiveness of the Coda-CNN-MAM architecture, laying a robust methodological foundation for high-precision non-destructive porosity assessment of AM components.
4.3. Limitations and Future Work
Although the proposed Coda-CNN-MAM network demonstrates high accuracy in porosity assessment for AM components, several limitations should be acknowledged, which also indicate directions for future research.
First, the current study was confined to TC4 alloy and the specimens fabricated by SLM. Different AM materials (e.g., AlSi10Mg, 316L stainless steel) and AM processes (e.g., Electron Beam Melting, EBM) induce distinct pore characteristics and ultrasonic wave propagation characteristics, which could affect the model’s generalization. Future work will validate the model on diverse materials and processes, and adopt transfer learning to fine-tune the pre-trained network with small-sample data, thereby reducing the demand for large-scale labeled datasets.
Second, the current study was conducted under controlled laboratory conditions. In industrial scenarios, temperature fluctuations, surface roughness variations, and dynamic coupling stability may distort coda wave signals. These factors were not fully considered in the current experiments, limiting the model’s direct applicability in on-site monitoring. Subsequent research will integrate environmental compensation mechanisms to enhance the model’s robustness in complex industrial environments.
5. Conclusions
In this paper, we proposed a new NDE method for assessing porosity in AM components using a DL-assisted ultrasonic technique. Recognizing the high sensitivity of ultrasonic coda waves to micro internal alterations, we utilized this ability to assess the porosity of AM components. Since the porosity in AM components is characterized by multi-dimensional micro-structural features, the traditional coda wave analysis methods struggle to establish a linear relationship between coda wave and porosity. To address this, we introduced a Coda-CNN-MAM network, which capitalizes on the capability of DL in feature extraction and decoupling of complex nonlinear mappings. The network effectively combines the rich porosity-related information carried by coda waves, the local feature extraction ability of CNN, and the global contextual modeling capacity of the MAM module, achieving high-precision porosity assessment with an accuracy of up to 97.8%. By comparing separately with the assessment results of the CNN trained only on coda wave signals and the proposed network trained only on the primary wave signals, the significant effectiveness and prominent advantages of the proposed network in the porosity assessment of AM components are verified. This work establishes an NDE framework that integrates ultrasonic coda waves with advanced DL architectures, offering an accurate and efficient solution for porosity assessment in AM components.
Author Contributions
Conceptualization, X.C. and F.W.; methodology, X.Y.; validation, X.Y. and X.C.; formal analysis, X.Y.; investigation, X.C.; resources, F.W.; data curation, X.Y.; writing—original draft preparation, X.Y.; writing—review and editing, F.W.; visualization, X.C.; supervision, F.W. All authors have read and agreed to the published version of the manuscript.
Institutional Review Board Statement
Not applicable.
Informed Consent Statement
Not applicable.
Data Availability Statement
Data are contained within the article.
Conflicts of Interest
The authors declare that the re-search was con-ducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.
Funding Statement
This research received no external funding.
Footnotes
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
References
- 1.Martin J.H., Yahata B.D., Hundley J.M., Mayer J.A., Schaedler T.A., Pollock T.M. 3D printing of high-strength aluminium alloys. Nature. 2017;549:365–369. doi: 10.1038/nature23894. [DOI] [PubMed] [Google Scholar]
- 2.Kelly B.E., Bhattacharya I., Heidari H., Shusteff M., Spadaccini C.M., Taylor H.K. Volumetric additive manufacturing via tomographic reconstruction. Science. 2019;363:1075. doi: 10.1126/science.aau7114. [DOI] [PubMed] [Google Scholar]
- 3.Lee K.H., Yun G.J. A novel heat source model for analysis of melt Pool evolution in selective laser melting process. Addit. Manuf. 2020;36:101497. doi: 10.1016/j.addma.2020.101497. [DOI] [Google Scholar]
- 4.Qiu C.L., Panwisawas C., Ward M., Basoalto H.C., Brooks J.W., Attallah M.M. On the role of melt flow into the surface structure and porosity development during selective laser melting. Acta Mater. 2015;96:72–79. doi: 10.1016/j.actamat.2015.06.004. [DOI] [Google Scholar]
- 5.Pang J.F., Huang L.M., Liu H.L., Yi X. Melt pool dynamics and pore formation in selective laser melting: Mechanisms and microstructural insights. Mater. Des. 2025;254:114043. doi: 10.1016/j.matdes.2025.114043. [DOI] [Google Scholar]
- 6.Wang J.C., Zhu R., Liu Y.J., Zhang L.C. Understanding melt pool characteristics in laser powder bed fusion: An overview of single- and multi-track melt pools for process optimization. Adv. Powder Mater. 2023;2:100137. doi: 10.1016/j.apmate.2023.100137. [DOI] [Google Scholar]
- 7.Kumar P., Jayaraj R., Suryawanshi J., Satwik U.R., McKinnell J., Ramamurty U. Fatigue strength of additively manufactured 316L austenitic stainless steel. Acta Mater. 2020;199:225–239. doi: 10.1016/j.actamat.2020.08.033. [DOI] [Google Scholar]
- 8.Qian G.A., Jian Z.M., Qian Y.J., Pan X.N., Ma X.F., Hong Y.S. Very-high-cycle fatigue behavior of AlSi10Mg manufactured by selective laser melting: Effect of build orientation and mean stress. Int. J. Fatigue. 2020;138:105696. doi: 10.1016/j.ijfatigue.2020.105696. [DOI] [Google Scholar]
- 9.Awd M., Siddique S., Johannsen J., Emmelmann C., Walther F. Very high-cycle fatigue properties and microstructural damage mechanisms of selective laser melted AlSi10Mg alloy. Int. J. Fatigue. 2020;124:55–69. doi: 10.1016/j.ijfatigue.2019.02.040. [DOI] [Google Scholar]
- 10.van Herpt K., Bajgholi M.E., Underhill P.R., Mandache C., Krause T.W. Enhanced near-surface flaw detection in additively manufactured metal Ti-5Al-5V-5Mo-3Cr using the total focusing method. Sensors. 2025;25:6425. doi: 10.3390/s25206425. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 11.Cook O.J., Huang N., Smithson R.L.W., Kube C.M., Beese A.M., Argüelles A.P. Uncovering microstructural heterogeneities in binder jet printed SS316L through ultrasonic testing and X-ray computed tomography. Mater. Charact. 2023;197:112697. doi: 10.1016/j.matchar.2023.112697. [DOI] [Google Scholar]
- 12.Park S.H., Eo D.R., Cho J.W., Jhang K.Y. Nondestructive evaluation of micro-oxide inclusions in additively manufactured metal parts using nonlinear ultrasonic technique. J. Mater. Process. Technol. 2021;298:117281. doi: 10.1016/j.jmatprotec.2021.117281. [DOI] [Google Scholar]
- 13.Yuan X.Y., Li W.B., Deng M.X. Non-contact characterization of material anisotropy of additive manufacturing components by electromagnetic acoustic resonance technique. Meas. Sci. Technol. 2024;35:026001. doi: 10.1088/1361-6501/ad0707. [DOI] [Google Scholar]
- 14.Huang N., Cook O.J., Smithson R.L.W., Kube C.M., Argüelles A.P., Beese A.M. Use of ultrasound to identify microstructure-property relationships in 316 stainless steel fabricated with binder jet additive manufacturing. Addit. Manuf. 2022;51:102591. doi: 10.1016/j.addma.2021.102591. [DOI] [Google Scholar]
- 15.Zhang C.H., Chen B., Li H.M., Liu X., Zhou G.J., Gou G.Q. Propagation characteristics of ultrasonic in SLM manufactured AlSi10Mg. Ultrasonics. 2023;135:107134. doi: 10.1016/j.ultras.2023.107134. [DOI] [PubMed] [Google Scholar]
- 16.He J.J., Gao C.J., Wang X., Yang J.S., Tian Q., Guan X.F. Average grain size evaluation using scattering-induced attenuation of coda waves. Ultrasonics. 2024;141:107334. doi: 10.1016/j.ultras.2024.107334. [DOI] [PubMed] [Google Scholar]
- 17.Li Z.Q., Jiao J.P., Zheng X.F., Hao X.J., He C.F., Wu B. Nondestructive evaluation of debonding in composites using air-coupled coda wave analysis and local defect resonance techniques. Smart Mater. Struct. 2024;33:095028. doi: 10.1088/1361-665X/ad6cba. [DOI] [Google Scholar]
- 18.Liu S.K., Ma B., Ma Z.G., Sun J.B., Wang Q., Liu K.L. Evaluation of the compressional damage evolution of ancient fired clay bricks using coda wave analysis. J. Build. Eng. 2022;49:104071. doi: 10.1016/j.jobe.2022.104071. [DOI] [Google Scholar]
- 19.Snieder R., Grêt A., Douma H., Scales J. Coda wave interferometry for estimating nonlinear behavior in seismic velocity. Science. 2002;295:2253–2255. doi: 10.1126/science.1070015. [DOI] [PubMed] [Google Scholar]
- 20.Wuttke F., Asslan M., Schanz T. Time-lapse monitoring of fabric changes in granular materials by coda wave interferometry. Geotech. Test. J. 2011;35:353–362. doi: 10.1520/GTJ103546. [DOI] [Google Scholar]
- 21.Martino M., Siena L., Tisato N. Pore space topology controls ultrasonic waveforms in dry volcanic rocks. Geophys. Res. Lett. 2022;49:100310. doi: 10.1029/2022GL100310. [DOI] [Google Scholar]
- 22.Zeng S.Y., Tu J.Z., Malone C., Zhu J.Y., Li X.B. Calculation of relative velocity change of coherent waves using improved stretching technique. Ultrasonics. 2024;158:107824. doi: 10.1016/j.ultras.2025.107824. [DOI] [PubMed] [Google Scholar]
- 23.Yuan C.C., Bryan J., Denolle M. Numerical comparison of time-, frequency- and wavelet-domain methods for coda wave interferometry. Geophys. J. Int. 2021;226:828–846. doi: 10.1093/gji/ggab140. [DOI] [Google Scholar]
- 24.Liu L.S., Wu P., Xiang Y.X., Xuan F.Z. Autonomous characterization of grain size distribution using nonlinear Lamb waves based on deep learning. J. Acoust. Soc. Am. 2022;152:1913–1921. doi: 10.1121/10.0014289. [DOI] [PubMed] [Google Scholar]
- 25.Xu H.M., Liu L.S., Xu J.C., Xiang Y.X., Xuan F.Z. Deep learning enables nonlinear Lamb waves for precise location of fatigue crack. Struct. Health Monit. 2023;23:77–93. doi: 10.1177/14759217231167076. [DOI] [Google Scholar]
- 26.Liao Y.L., Qing X.L., Wang Y.H., Zhang F.H. Damage localization for composite structure using guided wave signals with Gramian angular field image coding and convolutional neural networks. Compos. Struct. 2023;312:116871. doi: 10.1016/j.compstruct.2023.116871. [DOI] [Google Scholar]
- 27.Wen J.S., Deng M.X., Li W.B. Non-contact characterization of material hardness by deep learning-assisted electromagnetic acoustic resonance method. Appl. Phys. Lett. 2025;126:174102. doi: 10.1063/5.0265254. [DOI] [Google Scholar]
- 28.Shin T., Sun H.B., Zhu J.Y., Zhang Y. Nondestructive damage detection of concrete with Alkali-Silica reactions using coda wave and anomaly detection. IEEE Sens. J. 2022;22:6124–6135. doi: 10.1109/JSEN.2022.3149721. [DOI] [Google Scholar]
- 29.Rose J. Ultrasonic Waves in Solid Media. Cambridge University Press; New York, NY, USA: 2013. [Google Scholar]
- 30.Li W.B., Xiao J., Deng M.X. Micro-defect imaging with an improved resolution using nonlinear ultrasonic Lamb waves. J. Appl. Phys. 2022;131:185101. doi: 10.1063/5.0087619. [DOI] [Google Scholar]
- 31.Snieder R. The theory of coda wave interferometry. Pure Appl. Geophys. 2006;163:455–473. doi: 10.1007/s00024-005-0026-6. [DOI] [Google Scholar]
- 32.Spierings A., Schneider M., Eggenberger R. Comparison of density measurement techniques for additive manufactured metallic parts. Rapid Prototyp. J. 2011;17:380–386. doi: 10.1108/13552541111156504. [DOI] [Google Scholar]
- 33.Le K.Q., Tang C., Wong C.H. On the study of keyhole-mode melting in selective laser melting process. Int. J. Therm. Sci. 2019;145:105992. doi: 10.1016/j.ijthermalsci.2019.105992. [DOI] [Google Scholar]
- 34.Polasi R., Sinha S., Haddad M., Wolff S.J., Mukherjee T. Hierarchical importance of physical factors causing gas porosity in powder bed fusion additive manufacturing. Sci. Technol. Weld. Joi. 2025;30:389–398. doi: 10.1177/13621718251375231. [DOI] [Google Scholar]
- 35.Liao Y.L., Wang Y.H., Zeng X.P., Wu M.H., Qing X.L. Multiscale 1-DCNN for damage localization and quantification using guided waves with novel data fusion technique and new self-attention module. IEEE Trans. Ind. Inform. 2024;20:492–502. doi: 10.1109/TII.2023.3268442. [DOI] [Google Scholar]
- 36.Junges R., Lomazzi L., Miele L., Giglio M., Cadini F. Mitigating the impact of temperature variations on ultrasonic guided wave-based structural health monitoring through variational autoencoders. Sensors. 2024;24:1494. doi: 10.3390/s24051494. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 37.Deng F., Zhang X.R., Yu N., Zhao L. An Improved RAPID Imaging Method of Defects in Composite Plate Based on Feature Identification by Machine Learning. Sensors. 2022;22:8413. doi: 10.3390/s22218413. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 38.Wang L., Yi S.C., Yu Y., Gao C., Samali B. Automated ultrasonic-based diagnosis of concrete compressive damage amidst temperature variations utilizing deep learning. Mech. Syst. Sig. Proc. 2024;221:111719. doi: 10.1016/j.ymssp.2024.111719. [DOI] [Google Scholar]
- 39.Guo M.H., Liu Z.N., Mu T.J., Hu S.M. Beyond Self-Attention: External Attention Using Two Linear Layers for Visual Tasks. IEEE Trans. Pattern. Anal. Mach. Intell. 2023;45:5436–5447. doi: 10.1109/TPAMI.2022.3211006. [DOI] [PubMed] [Google Scholar]
- 40.Srivastava N., Hinton G., Krizhevsky A., Sutskever I., Salakhutdinov R. Dropout: A simple way to prevent neural networks from overfitting. J. Mach. Learn. Res. 2014;15:1929–1958. [Google Scholar]
- 41.Xu R.X., Luo F.L., Zhang Z.Y., Tan C.Q., Chang B.B., Huang S.F., Huang F. Raise a child in large language model: Towards effective and generalizable fine-tuning; Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing (EMNLP 2021); Punta Cana, Dominican Republic. 7–11 November 2021; pp. 9514–9528. [Google Scholar]
- 42.Vaswani A., Shazeer N., Parmar N., Uszkoreit J., Jones L., Gomez A., Kaiser L., Polosukhin I. Attention is all you need; Proceedings of the 31st International Conference on Neural Information Processing Systems 2017; Long Beach, CA, USA. 4–9 December 2017; pp. 6000–6010. [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Data Availability Statement
Data are contained within the article.











