## 5 Defect Detection Using ML Techniques and Sensors
### Vision Sensor
A Bayesian classifier was developed and trained to distinguish between the different surface quality levels. The accuracy of the classier was around 90%. [PERSON] et al. [127] presented a novel methodology identifying the region of interest (ROI) in each layerwise image using deep learning convolutional neural network (DCNN). The model's input was layerwise images, and the objective was to predict process defects in L-PBF printed parts. In that case, the CAD slice for each layer represented the ground truth. Each layerwise ROI is partitioned into different subregions of interest to solve the problem of varying cross-sectional geometries. Afterward, spatial characterization is performed to provide critical information on the distribution of pixels in each ROI and ensure that the input to the DCNN is equal. The DCNN was able to classify defects with an accuracy of 92.50%. This approach emphasizes the importance of deep learning. In addition, the  
Figure 18: Input layerwise images used for ML model proposed by [PERSON] et al. [85] (1–3) post-powder recoating flash modules and (4–8) post-laser melting flash modules. ground truth obtained from CAD files makes it easy to apply and prevents postprocessing data collection. A layerwise monitoring approach to detect build failure using a DCNN was also suggested by [PERSON] et al. (2018). X-ray computed tomography was used to obtain ground truth. The results indicate that the developed DCNN algorithm can predict process defects with 85-96% accuracy and, therefore, replace expensive postprocessing measurements. Similarly, [PERSON] et al. (2019) captured images layer by layer during the L-PBF process to detect defects that might result from different volumetric energy density input to Inconel 718 powder. Automatic feature learning and fusion were achieved, and a DCNN model recognizes the defects by the accuracy of 99% compared to visual words and the histogram of oriented gradients (HoG) approach. Table 2 summarizes some of the research that integrated DSLR cameras for in situ monitoring of the L-PBF process and ML applications. Most of the research applied supervised ML models, and recently, much research has started focusing on DCNN algorithms. The input for these models is layerwise images acquired during the printing process, and in some cases, these images are captured at different light schemes. The objectives are mostly to classify defective and nondefective parts. Sometimes, the images are captured before and after laser melting, i.e., before and after the fresh powder is spread. The above analysis has shown that images taken after laser melting contain important information. Furthermore, the supervised approach using DCNN is more employed when monitoring the scanned layer and powder bed signatures; it is expected to result in the highest classification accuracy in terms of layerwise monitoring. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Camera Location** & **Specifications** & **Material** & **Part Geometry** & **ML Algorithm** & **Accuracy \%** & **Objective** & **Ref. ** \\ \hline \multirow{4}{*}{Off-axis above build chamber} & \multirow{4}{*}{1.3 megapixel 290 μm/pixel} & \multicolumn{2}{c}{Ti6 Al4V} & \multirow{4}{*}{Hamerschlag 316L} & \multirow{4}{*}{BoW (unsupervised)} & \multirow{4}{*}{50–91} & \multirow{4}{*}{50–91} \\  & & & & & & \\  & & & & & & \\  & & & & & & \\  & & & & & & \\  & & & & & & \\ \hline \multirow{4}{*}{Off-axis inside build chamber} & \multirow{4}{*}{16–65 μm/pixel} & \multicolumn{2}{c}{Ti6 Al4V} & \multirow{4}{*}{Patt Geometry} & \multirow{4}{*}{ML Algorithm} & \multirow{4}{*}{**Accuracy \%**} & \multirow{4}{*}{**Objective**} & \multirow{4}{*}{**Ref. **} \\  & & & & & & & \\  & & & & & & \\  & & & & & & \\  & & & & & & \\  & & & & & & \\ \hline \multirow{4}{*}{Off-axis inside build chamber} & \multirow{4}{*}{36.3-megapixel} & \multirow{4}{*}{Gf-1} & \multirow{4}{*}{Stepped cylinder} & \multirow{4}{*}{(supervised)} & \multirow{4}{*}{85} & \multirow{4}{*}{Detect part discontinuities by using in situ images.}