## 5 Defect Detection Using ML Techniques and Sensors
### Acoustic Emission
Figure 15: (**a**) An example of a fragment of an AE signal and the typical (**b**) spectrogram corresponding to the relative energies of the narrow frequency bands, localized in the time–frequency domain [120]. [PERSON] et al. (2021) tested structure-borne AE signals; a piezoceramic sensor was fixed under the build plate to monitor the L-PBF process. In total, 54 cubes were used for the experiment, and different density levels were obtained by changing the laser power, scan speed, and hatch speed. Three different part complexities were used to check if the AE signals will be affected by parts geometry, as illustrated in Figure 16. Short Fourier transform was applied to the raw AE data, and a spectrogram was obtained for each layer and specimen. The background noise was subtracted from all the spectrograms. Three different classes based on the number of specimens were identified. A multilayer perceptron (MLP), a typical ANN, was used to classify the AE signals. The input layer consisted of 12 million input neurons, two hidden layers with 64 and 32 neurons each, and a bottleneck strategy. The third and final layer consisted of three output neurons for the three different density classes. Sigmoid activation function was used for individual neurons and SoftMax for the output layer. Each training was set up for 100 epochs with early stopping based on the validation loss after each epoch. The classification accuracy of the proposed method resulted in classification accuracy between 76-86%; much lower prediction accuracy was achieved for complicated shapes. [PERSON] et al. (2018) fixed a WS\(\alpha\) AE sensor under the build plate to detect the structure-borne signals to monitor the L-PBF process of 316L. Three density levels were defined according to the internal defects: low-, medium-, and high-quality levels. The AE signals were collected, and an FFT was performed to transform them into the frequency domain. First, a K-means clustering was used to label the FFT signals, then a DBN with five layers was used to train 85% of the labeled data, and 15% were left for testing. The classification accuracy was between 70-91%. In a later publication ([PERSON] et al., 2021), the author tested the AE monitoring of H13 tool steel for three different intentional conditions minimum defects, cracks only, and porosities and cracks. These conditions were obtained by changing only the laser power. Three different ML techniques were used to classify the data and detect the defects. First, a hierarchical K-means clustering was employed for labeling the data, followed by a supervised deep learning neural network (DBN) to match acoustic signal with defect type. Second, a principal component analysis (PCA) was used to reduce the dimensionality of the dataset. A Gaussian mixture model (GMM) was employed to enable fast defect detection suitable for online monitoring. Third, a variational autoencoder (VAE) approach was used to obtain a general signal feature that could be an input for the classifier. The developed VAE classifier successfully detected trends in 316L samples without the need for training and can serve as a general ML model to detect L-PBF defects for different materials  
Table 1 summarizes the key findings in the literature to date on applying AE sensors for L-PBF process monitoring. One of the main factors considered when using AE sensors for L-PBF monitoring is the AE sensor-like type and position in the build chamber. In addition, factors related to the print itself, such as materials, coupon shapes, and parameters, were chosen for testing. All these combined with the ML algorithm define the time and accuracy of the decision-making. It is important to note that most articles changed laser scan speed, and only a few changed the laser power. The accuracy of the ML model, defined as the ratio between accurate predictions and all predictions, is reported. It can be observed that the accuracy ratio varies with the change of ML model and the experiment tested in each case.