Predicting laser powder bed fusion defects through in-process monitoring data and machine learning

(cid:1) Local porosity was accurately predicted with multi-layer in-situ optical tomography monitoring images. (cid:1) Defects in a layer can be caused by improper parameters or anomalies in current layer or subsequent layers. (cid:1) Defects in one layer can be eliminated by proper parameters in the following layers.


Introduction
Additive manufacturing (AM) offers unparalleled design freedom enabling the development of functionality-orientated new designs [1,2].AM, and in particular metal AM, has significant potential for the development of products with high added value and with high level of customization, such as lightweight aerospace components and patient-specific medical implants.
Among the various metal AM technologies, the laser powder bed fusion (L-PBF) process is one of the most established technologies and is well suited to produce products with strict requirements on mechanical properties and intricate structures.During the L-PBF process, a thin layer of powder is spread onto a flat build plate and a focused laser beam is directed onto the process area to fuse the metal powder.Once a layer of laser exposure finishes, the build plate lowers itself by a certain height (layer thickness) and the next layer of laser exposure commences.This process is iterated many times to construct a 3D object layer by layer.The L-PBF process is a highly non-equilibrium process [3,4].Strict requirements are posed on the process repeatability and reliability on the L-PBF process when the products are intended for critical applications such as aerospace components where high fatigue life is in demand [5,6].Currently the quality control and validation of metal AM parts relies heavily on time-consuming and expensive ex-situ tests.These may include relevant mechanical testing of a statistically significant number of samples, destructive metallographic examination of part cross-sections, and non-destructive testing such as X-ray computed tomography (XCT) for inspection of parts' interior defects.Meanwhile, in-situ monitoring systems and accompanying analytics techniques are being developed to provide alternative or complementary quality control routes.One of the aims of in-situ monitoring is to identify critical events occurring during the L-PBF process by detecting deviations in the monitored signals that appears to exceed specific control limits.To achieve this, empirical models need to be built to correlate the various monitored deviations with the resulting defects (type, size, and spatial distribution) appearing in a produced part.The layerby-layer nature of the L-PBF process makes it possible to build a feedback control loop where in reaction to certain deviations in the signals monitored when producing a series of layers, the machine is triggered to change the process conditions of future layers in order to mitigate the defects in a timely manner [7].
Different sensors, e.g., acoustic sensors [8,9], high resolution optical camera [10][11][12], high speed camera [13], infrared thermography [14][15][16], infrared (IR) camera [17], optical tomography [18][19][20][21], synchrotron X-ray [22,23], etc., can be applied for the monitoring of the L-PBF process.These sensors reveal diverse phenomena of the powder bed and melt pool: e.g., powder bed surface topography (before and after exposure), spattering, balling, pore formation, cracking, and deformation.However, acquiring sensor data is only the first step to feedback loop.Depending on the complexity of the problem and on the number of variables, various machine learning (classification, regression, and clustering) models, e.g., convolutional neural network (CNN), support vector machine (SVM), multi-layer perception (MLP) have been used to mine the complex relationship between process parameters, monitoring data and defect formation.Many review papers about PBF online monitoring [24][25][26][27] and processing PBF data with machine learning [28][29][30] have been made available.However, most published work has been limited to the detection of abnormality in a single layer with the assumption that abnormality in a single layer has strong correlation with the final defects.But correlating monitored data with part defects is challenging due to the fact that a selfhealing phenomena may occur during the remelting of the 3-4 previously exposed layers [31].
This paper demonstrates research work performed on the prediction of defects (porosity) occurring in additive manufacturing using in-situ optical tomography (OT) monitoring images and machine learning.It was performed in a preparation for the next challenging-step that is L-PBF online parameters feedback loop control.Fig. 1 shows the workflow of this work.Through-process data, i.e., CAD, processing parameters, online monitoring data (OT images) and post-processing characterization data (X-ray CT), was registered first.A Machine learning (ML) model was then constructed to gain insights on the defect formation.The well-trained machine learning model can precisely predict the porosity in each layer using multiple layers OT data.The model demonstrated optimal processing windows (zero or near zero porosity), that defects in a layer may be caused by abnormal processing in the layer or/ and several layers above it and that defects in one layer can be healed by processing in the following layers.

LPBF experiment
The L-PBF experiment was conducted on an EOS M290 machine equipped with a 400 W Yb fiber continuous laser beam with a wavelength of 1060 -1100 nm.The nominal beam diameter is 100 lm.The build capacity of an EOS M290 machine is 250 mm Â 250 mm Â 250 mm.A gas atomized IN718 powder supplied by Höganäs Germany GmbH was used as the feedstock material.The powder has a particle size between 15 lm and 45 lm.A specific sample design (see Fig. 2) was used to investigate the influence of processing parameters on the formation of defects and to facilitate post process X-ray CT scanning.The specimens are cylindrically shaped with a diameter of 3.5 mm and a height of 15 mm.Within each cylinder there are four disc-shaped sub-regions with a diameter of 3 mm and varied thicknesses (0.2, 0.4, 0.8, 1.2 mm).The sub-regions in specimens S2, S3, S4 and S5 were assigned with different processing parameters (Laser power P, laser scan speed V and hatch distance Hd) specifically selected to provoke the formation of varying defects (see Table 1) while the sub-regions in specimen S1 were assigned the default proprietary parameters (P 0 , V 0 and Hd 0 ) provided by the machine manufacturer (EOS) as a reference.The layer thicknesses (Th) for all samples were kept at 40 lm.The volumetric energy density (VED = P/V•Hd•Th, J/mm 3 ) are listed in Table 1.

EOSTATE exposure OT monitoring images and 3D reconstruction
The EOS M290 machine used in our study equipped four types of on-line process monitoring systems: EOSTATE system records various system specific parameters e.g., flow, laser power, temperature, etc.; EOSTATE PowderBed records image of powder bed after re-coating and after exposure; EOSTATE MeltPool sampled melt emission at 400-900 nm; EOSTATE Exposure OT integrated melt emission at 900 nm.The principles of OT technique are simple [18][19][20]: an optical sCMOS (scientific complementary metaloxide semiconductor) camera with high lateral resolution is exploited to captures thermal radiation signal of the top layer during the laser PBF melting and solidification process.A near infrared band-pass filter (narrow band with center 900 nm and half width 25 nm) is used to separates thermal radiation from the other emissions e.g., plasma emissions and back reflected laser light (1060 nm).Instead of high-speed image capture or any kind of fast following of the laser trace, here a simple long-time exposure is used.After the melting and solidification of a layer is completed one long-time exposure image is stored as grey images.A thermal stabilized camera system provides a quantitative evaluation of the      be collected.For computational efficiency, these OT images were compressed from a 32-bit to an 8-bit format.Grey values areas corresponding to locations where the samples were placed were then extracted and stacked together to reconstruct 3D structures: 3D OT grid models.Python library Pyvista was used for visualizing 3D model.Fig. 3 shows a group of the cropped OT images (for ease of observation the grey values of the pixels are shown in pseudo colors) and the cross-sections of the resulting reconstructed 3D OT grids.The grids were then aligned with the original coordinates of the CAD model (original CAD is selected as reference for all rebuilt meshes and grids in this study), to facilitate the extraction, via grey values, of the recorded melt pool radiation intensity at a given (x, y, z) co-ordinates.

CT inspection and image processing
The five manufactured samples were characterized by X-ray CT for defect distribution analyses.The custom-developed X-ray CT system in METAS consisting of a 190 kV micro-focus X-ray tube (XWT-190-TCNF, X-ray WorX) and a 4 k*4k digital X-ray detector (XRD 1611 CP3, Perkin Elmer).The reconstruction and resampling of X-ray CT images were performed via VG-studio Max software, including beam hardening correction.The voxel size used in this work was 0.003*0.003*0.04mm (layer thickness direction).
The X-ray CT images were segmented using multi-Otsu algorithm and 3D mesh models for cylinder contours and pores were rebuilt with marching cubes algorithm using Python library Skimage.As shown in Fig. 4, for each sample the CT images were processed to extract samples' contours and internal pores and ultimately to rebuild two 3D meshes, one reconstructing the sample outer surface and one reconstructing in 3D the internal pores.

Mesh registration and dataset assembling
The rebuilt 3D contour mesh was registered to the original CAD model using coherent point drift (CPD) algorithm [32] (see the supplementary material for more details).The 3D pores mesh was reg-  Data points for machine learning can be readily extracted from the registered OT grids and the corresponding registered pore meshes.Cuboids of equal length and width were used as the basic sampling unit.To reduce the interpolation errors, the lengths and widths of the sampling cuboids were set to be multiples of OT image pixel size (0.125 mm), and the heights were set to be mul- tiples of the layer thickness (0.04 mm).Moving sampling cuboid in the X-Y plane by multiples of 0.125 mm or in the Z direction by multiples of 0.04 mm yields a new sampling cuboid.Given that the pore formation at a certain build height (layer) is affected by the processing conditions in adjacent layers above and below it, the sampling cuboid heights of the OT grid were set to contains multiple layers in the Z direction, all layers being numbered as described in Fig. 5.The label (Y) of machine learning model was the average porosity at layer 0 of the sampling cuboid, calculated based on the registered pore mesh.And the features (X) of machine learning model were the average and maximum OT grey values in all layers of the sampling cuboid.

Machine learning model decision tree, random forest, and feature importance
Machine learning models were used to correlate features and labels in the dataset.Tree-based machine learning models are a family of non-parametric supervised methods which are widely used in materials science due to their good interpretability [33].Random forest is an example of bagged tree ensembles.A decision tree looks like an upside-down tree, with the first decision rule at the top and following decision rules spreading out below.In a decision tree, every decision rule (e.g., ''If A > B. ..") that produces the greatest decrease in impurity index occurs at a decision node, with the rule creating branches leading to new nodes.A branch without a decision rule at the end is called a leaf.Decision tree regression model attempts to find a decision rule that produces the greatest decrease in mean squared error (MSE) at a node.One benefit of tree-based models is their interpretability.They can be used to evaluate the relative importance of each feature based on the impurity reduction determined by every single feature.Python library Sklearn was used for machine learning.9/10 dataset (randomly selected from the whole dataset) was used for training, and the remaining 1/10 dataset were kept unseen by model in training to test the generalization performance (prediction accuracy on unseen dataset) of the trained model.The default hyperparameters (e.g., number of estimators = 100) for random forest model of Sklearn library were used.

Datasets briefing
Fig. 6 shows the OT grey value distribution in the 5 cylinders with chambers S1-S5 (see the left inset) and the OT grey value distribution in the 5 infill discs (see the lower part of Fig. 6).The right inset shows the good linear relation between VED and OT grey value (data from the 5 infill discs).Large OT grey value indicates high heat input (VED).An OT image represents heat distribution of each layer.The OT grey values vary in a sample which indicates the energy input for different areas were not so uniform as we expected, though the process parameters (e.g., laser power, scanning speed, hatch distance, etc.) were kept constant in printing.The 5 discs were printed with different process parameters (see Table 1).Thus, their mean OT grey value and distribution are different.
Fig. 7 shows the OT grey value distribution in the machine learning dataset using sampling unit of 0.125 mm(X) Â 0.125 mm (Y) Â 0.56 mm(Z) cuboid.Minor differences exist in the statistical results when using different size sampling cuboids.The grey value of OT image ranges from 0 to 255, and the porosity varies from 0 to 0.15.The dataset size (the number of sampling cuboids) assembled from the 5 cylinders samples and 5 discs is in the range of 10 5 -10 6 (e.g., 240,540 samples when 1.125 mm Â 1.125 mm Â 0.56 mm sampling cuboid was used).

Pores characteristics
Fig. 8 shows the typical pores in sample S1-S5.Pores are marked with different colors for easy observation.The statistical results of equivalent diameters, aspect ratios, and total pores area are also shown in the figures.Fig. 9 shows the statistical results of aspect ratio (the ratio of width to height of bounding rectangle of the object) and equivalent diameter (the diameter of a circle with an equal aggregate sectional area) of pores in 5 samples.Several pore formation mechanisms in PBF have been proposed, such as blowhole pores (or residual gas holes), lack of fusion pores and the keyhole pores [34].Pore formation mechanisms can be estimated according to the processing parameters as well as to the morpholo- gies and size of pores [35].Very few tiny pores (blowhole pores) were found in sample S1 which was built with the EOS proprietary parameters (medium VED).A lot of big pores with irregular polygon cross section (lack of fusion pores caused by low VED) were found in sample S2 and S3.Many big pores with near circle cross section (keyhole pores caused by high VED and instability in the molten pools) were found in sample S4 and S5.
Fig. 10 shows the locations and distributions of pores in S1-S5.The tiny pores (residual gas pores) appearing in sample S1 and its infill Disc1 are randomly distributed, suggesting a relatively stable process.The lack of fusion pores appearing in the infill regions of S2 and S3, i.e., Disc2 and Disc3 are more irregular with varying shapes and damages reach a depth of 1-2 layers below the infill.And the keyhole pores of near spherical shapes distributed in the infills areas of S4 and S5 (i.e., Disc4 and Disc5) create further damage below the infill, reaching a depth of around 0.4 to 0.5 mm (i.e., 10-12 layers).This demonstrates that the pores formation in a layer are significantly influenced by the parameters used in subsequent layers.This is further highlighted when looking at the total pores sectional area variations in each layer (Fig. 11), in particular for S4 and S5 where large porous areas appear bellow infill regions.At the same time, less pores were found in the top parts of the infill regions than layers below (about 2 layers for Disc2 and Disc3 and about 5 layers for Disc4 and Disc5).It indicates pores in the top layers were partially eliminated or healed through changing processing parameters in following layers.

Correlating OT images with resulting porosity
To realize feedback loop defect control, it is essential to quantitatively correlate in-process monitoring data (OT images) with defects metrics (e.g., local porosity).Examples of Layer-wise OT images together with their corresponding CT images are shown in Figs. 12 and  Fig. 12 shows OT and CT images of S3 from z = 8.12 mm to z = 8.24 mm.The five consecutive layers from z = 8.04 mm to 8.20 mm were applied with abnormal exposure parameters (very low VED).Layers of z = 8.24 mm and above were applied with normal exposure parameters (medium VED).Obvious lack-of-fusion pores were found in layer of z = 8.04 mm to 8.12 mm.However, fewer lack-of-fusion pores were found in layer of z = 8.16 mm, and no pores were found in layer of z = 8.20 mm.It indicates most  lack-of-fusion pores in layers of z = 8.16 mm and z = 8.20 mm were healed by suitable exposure parameters in subsequent layers.
Fig. 13 shows OT and CT images of S5 at z = 7.64 mm and z = 8.16 mm.(see supplementary material for the complete list of images from z = 7.52 mm to z = 8.28 mm).The layer z = 7.64 mm was applied with optimized exposure parameters and no pores (or only very few blowhole pores) is expected to be found, but a lot of keyhole pores were found in the layer.In contrast, the layer of z = 8.16 mm was applied with abnormal parameters (very large VED), but no defects were found in the layer.
These experiment results highlight the challenges of predicting defects using in-process monitoring data: lack-of-fusion pores can be healed by following layers; the root cause of keyhole pores can be 0.5 mm above the pores; OT grey values (an indicator of the actual local energy input) vary in space and with time (when mean = 90, std > 20 is common).Thus, relying only on the detection of abnormality on a single layer is not sufficient to conclude accurately on the occurrence of defects in the final part.Thus, it is essential to combine information from many consecutive layers to predict defects.

Machine learning
The features extracted from the OT images of multiple consecutive layers (more than ten layers) were used to predict porosity at layer 0. Fig. 14 shows the testing accuracy dependence on sectional area and height of sampling cuboid.The model testing accuracy increases with the height of sampling cuboid, for the defects in a layer come from the interactions of multiple neighbour layers: the remelting effect and the keyhole effect from exposure of subsequent layers.The model testing accuracy increases with the sectional area of sampling cuboid can be attributed to some uncertain factors in pores formation: e.g., the instability of keyhole, the dynamical interaction of powder particle with laser.These factors follow statistical laws, thus increasing sampling area is good for model accuracy.Our model cannot predict the exact location of a pore.Instead, the average porosity of a small area (e.g., 1 mm*1mm) can be predicted accurately (e.g., Pearson correlation coefficient R > 0.95).The Fig. 14 (b-c) also show average OT grey value (average heat input) of a layer is better feature than the maximum OT grey value (maximum heat input) in predicting local porosity.
Random forest model has good interpretability which can tell us which features (layers) are most important in porosity prediction.Fig. 15 (b) shows features of 1 st layer, 0 th layer and 2 nd layer are the most important in predicting lack of fusion pores.Fig. 15 (c) shows features of 10 th layer are the most important in predicting keyhole pores.In general, if we want to predict the porosity of 0 th layer, we need information from À1 st layer (the layer below 0th layer) to 10th layer (layers above 0 th layer).
Fig. 16(a) shows the predicted processing window (assume the average OT grey value in each layer is a constant), no porosity will form when average OT grey value in the range of 70 to 105 (corresponding EOS proprietary parameters used for Disc-1 etc., refer to Table 1 and Fig. 6).The processing window consistent with the OT grey value distribution in S1 which printed with EOS's proprietary parameters (see the insert of Fig. 6).Pores of different types will occur when average OT grey value outside the window.
Fig. 16(b) is the porosity prediction of the 0th layer assuming abnormalities occurs in one layer or several layers.When the average OT grey value of the À1 st layer (the layer below 0 th layer) vary from 30 to 255 and the OT values of other layers keep 80 unchanged, the porosity in the 0 th layer keeps zero unchanged, which means pore defects are caused by 0 th layer and above, the marginal influence from layers below it can be ignored.When abnormalities (e.g., OT < 65) occur in the À1 st and 0 th layer, the lack

Conclusions
In this work, original part CAD, in-situ real-time monitoring data (layer-by-layer optical tomography images) and post-build X-ray CT data are preprocessed and fused.Through visualization and machine learning model, the correlations between the processing parameters and the porosity of the laser powder bed fusion manufactured In718 alloy were studied.The following conclusions can be drawn: (1) Applying large VED (volume energy density) to a layer causes keyhole pores in the layers below it (damage depth can be 0.4-0.5 mm); small VED only causes lack of fusion pores in current layer; medium (suitable) VED does not cause pores and can heals some lack of fusion pores in the layers below it.(2) In-process optical tomography images indicate the process stability and deviations which may lead to defects.Process deviations do not obligatory lead to defects or defects may be healed by following layers.So, to predict pores formation in a layer, OT images of current layer and many (e.g., 10-15 layers) subsequent layers are needed.

Fig. 3 .
Fig. 3. OT images (in pseudo colors) for a sample in a build and the rebuilt 3D OT grid.Heat distribution of each layer can be seen in OT images.Red indicates high energy input, and blue indicates low energy input.

Fig. 6 .
Fig. 6.The OT grey value distribution in samples.
13 (see supplementary material for more information), in which white line represents sample boundary (inner circle indicates disc area, outer circle indicates cylinder area), and red areas in CT images represent pores.The grey values of OT image are represented by pseudo-colors.

Fig. 12 .
Fig. 12. Fusion of part CAD, OT, and CT (shown layer-by-layer) for S3 from z = 8.12 mm to z = 8.24 mm.White line represents sample boundary, and red areas in CT images represent pores.

Fig. 13 .
Fig. 13.Fusion of part CAD, OT, and CT (shown layer-by-layer) for S5 at z = 7.64 mm and z = 8.16 mm.White line represents sample boundary, and red areas in CT images represent pores.

Fig. 14 .
Fig. 14.(a) Testing accuracy (Pearson correlation coefficient of predicted porosity and ground truth) vs sampling cuboid area and height (b) testing accuracy vs sampling cuboid height (layer number) (c) testing accuracy vs sampling cuboid sectional area.Testing accuracies using different feature engineering (maximum OT grey values and average OT grey values) was compared.

( 3 )
Due to some uncertain factors in pores formation, our machine learning model can only predict the statistical average porosity in a small area (about 1 mm 2 ).(4) Our machine learning model can precisely predict local porosity with multiple layers OT data.It can indicate the optimal processing window and predict defects formation and healing phenomena caused by anomalies in the current layer or the subsequent layers.The work laid the basis for the next step powder bed fusion on-line feedback loop control.CRediT authorship contribution statement Shuo Feng: Conceptualization, Data curation, Formal analysis, Writing -original draft.Zhuoer Chen: Conceptualization, Writing -review & editing.Benjamin Bircher: Data curation, Methodol-ogy.Ze Ji: Conceptualization, Methodology.Lars Nyborg: Funding acquisition, Project administration.Samuel Bigot: Funding acquisition, Project administration, Writing -review & editing.

Table 1
Processing parameters.