## 5 Defect Detection Using ML Techniques and Sensors
### Vision Sensor
\\  & & & & & & \\  & & & & & & \\  & & & & & & \\  & & & & & & \\  & & & & & & \\ \hline \multirow{4}{*}{Off-axis Inside chamber} & \multirow{4}{*}{36.3-megapixel} & \multirow{4}{*}{Inconel 625} & \multirow{4}{*}{Cube samples with 80 mm side} & \multirow{4}{*}{(supervised)} & \multirow{4}{*}{89} & \multirow{4}{*}{Classify different meltpool conditions influenced by the formation of pores and cracks} \\  & & & & & & & \\  & & & & & & \\  & & & & & & \\  & & & & & & \\  & & & & & & \\  & & & & & & \\  & & & & & & \\  & & & & & & \\  & & & & & & \\  & & & & & & \\  & & & & & \\  & & & & & & \\  & & & & & \\  & & & & & \\  & & & & & \\  &The morphological changes in meltpool geometry were monitored by applying a supervised ML algorithm described by [PERSON] et al. [101]. Four meltpool categories were defined: desirable, balling, under-melting, and keyholing porosity for Inconel 718 parts. The supervised ML algorithm used in this work was bag of words (BoW), often applied to computer vision problems. The training data and input of the ML model consists of frames of data captured by the high-speed camera during the experiment; the ground truth labels are the only human interaction in the process. The objective of the model was to classify meltpool related to keyholing porosity and balling instability. Another supervised approach, a linear regression model, was suggested by [PERSON] et al. [86] to understand the effect of process parameters on the spatter formation at different energy density levels by applying a logistic regression model. Three different conditions were tested: under-melting, regular, and over-melting. The logistic regression (LR) model was chosen because it can consider the ordinal nature of the dependent variable. Three LR models were compared; the first considered only laser heat zone, the second model considered laser heat zone and spatter descriptors, and the third model only considered the spatter descriptors. It was noted that models that included spatter descriptor information have better goodness of fit and fewer misclassification errors. Meltpool and spatter monitoring are usually monitored by high-speed cameras and high resolution; when the camera is mounted coaxially, it is easier to track all the melpools during a single build plate. The only constraint would be the high amount of data and the storage capacity. Feature reduction using principal component analysis (PCA) is often used with images collected in situ during the L-PBF due to the large amount of data collected. For example, [PERSON] et al. [130] compared two classifiers, CNN and PCA-SVM. The main objective was to use the meltpool, plume, and spatter images to classify three different conditions in melt tracks: balling, continuous, and over-melting. The original image, as well as the extracted regions of interest, are shown in Figure 20. Various features were extracted to help with the classification models, for example, meltpool histogram features, plume intensity, plume orientation, mean spatter area, mean spatter velocity, and other features. CNN resulted in better classification accuracy of 92% compared to PCA-SVM methods. Convolution neural networks (CNN) were investigated by [PERSON] et al. [131] to predict the continuity of L-PBF tracks. The input of the ML model was meltpool images acquired at different positions while printing, as illustrated in Figure 21. The melt tracks thickness was changed by changing the process parameters of the L-PBF process. Ex situ height maps analysis is used to obtain ground truth. For each track, the main objective is to measure the mean and standard deviation of track width and classify the continuity of the track. The proposed algorithm was able to classify track continuity with relatively high accuracy of 93%. Figure 19: CNN network suggested by [PERSON] et al. [125]. [PERSON] et al. [132] proposed using convolutional autoencoders (CAE) neural networks to process the meltpool images for anomaly detection, as shown in Figure 22 The proposed framework contains three main components.