Online Monitoring Based on Temperature Field Features and Prediction Model for Selective Laser Sintering Process

Featured Application: The researches can bring beneﬁts to those who wants to make the AM process close-loop and make the quality of parts more controllable, not only the additive manufacturing device manufacturers, but also the users of those devices. Abstract: Selective laser sintering (SLS) is an additive manufacturing technology that can work with a variety of metal materials, and has been widely employed in many applications. The establishment of a data correlation model through the analysis of temperature ﬁeld images is a recognized research method to realize the monitoring and quality control of the SLS process. In this paper, the key features of the temperature ﬁeld in the process are extracted from three levels, and the mathematical model and data structure of the key features are constructed. Feature extraction, dimensional reduction, and parameter optimization are realized based on principal component analysis (PCA) and support vector machine (SVM), and the prediction model is built and optimized. Finally, the feasibility of the proposed algorithms and model is veriﬁed by experiments. features is proposed in this The key feature data are extracted from three aspects: (1) features along with the scanning trajectory; (2) features on the single-layer powder coating; and (3) features of the three-dimensional structure. The mathematical model and data structure of key feature data are established. Based on the PCA method and SVM algorithm, a prediction model based on temperature ﬁeld images is built after feature extraction, dimension reduction, and parameter optimization. Finally, a practical experiment is carried out to verify the proposed methods. The experimental results show that the optimized prediction model has an accuracy of 88.7% and an F value of 89.3%. It should be noted that the proposed methodology is applicable not only to the SLS process but also to other powder bed fusion processes such as selective laser melting (SLM). In future work, we will continue to explore the correlation between the key features of the temperature ﬁeld and quality indexes (e.g., porosity), and a real-time analysis model for online monitoring.


Introduction
Selective laser sintering (SLS) is a powder bed-based additive manufacturing where parts are made directly from three-dimensional CAD data layer-by-layer from the fusion of powder materials [1]. SLS can be used to process a variety of metal materials, and the parts usually have good dimensional accuracy and surface quality [2]. SLS is one of the major additive manufacturing processes that have been widely adopted by industry and investigated by researchers and practitioners. However, physical, chemical, mechanical, and material metallurgical phenomena are extremely complex in the SLS process. It is difficult to develop accurate knowledge about the true state of equipment and the quality of parts during the process. Most often, the stability of the process parameters and the repeatability of the technique cannot be ensured. Therefore, the online prediction of quality issues during the SLS process is extremely challenging, if not impossible. Typically, defects are detected by destructive or non-destructive methods in the as-built parts after the building process is completed, while the causes of the defects are difficult to trace.
In the building process, the temperature field of the working area can quantitatively characterize the real-time states of the metal powder coating and melting pool in time and space, and can indirectly

Key Features of the Temperature Field
In the SLS process, the temperature field image is collected by an infrared thermal camera, which can quickly acquire temperature images in a certain area at a frequency of about 50 images per second, and yield relevant numerical values, thus providing rich data for process monitoring and quality prediction. Each image can generate a matrix of temperature values corresponding to the state of the SLS process at a certain time. In the continuous production process, thousands of images can be acquired in the SLS process of a single layer of powder coating. When processing the data of the temperature field, reference is made to the image data collected at both the current time and historically.

Definitions of Key Features
Considering the characteristics of the SLS process, the key features of the temperature field are proposed from three aspects: (1) features along the scanning trajectory; (2) features on the single-layer powder coating; and (3) features of the three-dimensional structure. Those key features, as shown in Figure 1, are extracted from the infrared images of the temperature field on the powder layers during the SLS process.
The one-dimensional features mainly include the temperature gradient and cooling rate reflecting the scanning track. The two-dimensional features mainly include the melting pool area, circularity, maximum temperature, heat-affected area information, maximum/average temperature distribution at each point, thermal diffusivity, and sputtering activity. The three-dimensional features mainly refer to the vertical temperature distribution and the three-dimensional reconstruction model based on the maximum or average temperature.

Definitions of Key Features
Considering the characteristics of the SLS process, the key features of the temperature field are proposed from three aspects: 1) features along the scanning trajectory; 2) features on the single-layer powder coating; and 3) features of the three-dimensional structure. Those key features, as shown in Figure 1, are extracted from the infrared images of the temperature field on the powder layers during the SLS process.
The one-dimensional features mainly include the temperature gradient and cooling rate reflecting the scanning track. The two-dimensional features mainly include the melting pool area, circularity, maximum temperature, heat-affected area information, maximum/average temperature distribution at each point, thermal diffusivity, and sputtering activity. The three-dimensional features mainly refer to the vertical temperature distribution and the three-dimensional reconstruction model based on the maximum or average temperature.

Key Features from a Single Image
The temperature gradient, melting pool information and heat-affected area information is extracted from a single temperature image. The temperature gradient is a physical quantity that describes the rate of temperature change along a specific direction at a certain time on the surface of the powder layer. It mainly reflects the heat distribution of the powder layer after laser scanning.
The melting pool refers to the area where the temperature is greater than the melting point of the material. Melting pool information includes the length, width, area, and circularity. Melting pool geometry information reflects the change of heat input and absorption, which is an important monitoring index of the powder bed fusion processes.
The heat-affected area refers to the area where the temperature on the powder layer is greater than a certain value, and the information of the heat-affected area includes length, width, area and circularity. The heat-affected area has a relatively high temperature, and powder is readily agglomerated, causing the roller to push the part leading to processing failure.

Key Features from Multi-Images of the Same Powder Layer
The cooling rate, maximum temperature distribution, average temperature distribution, thermal diffusivity, and sputtering activity are extracted from multiple temperature images of the same layer. The cooling rate refers to the temperature gradient in the concept of time. If it is too high, severe nonequilibrium solidification takes place, while if it is too low, the relevant area is always in a high The temperature gradient, melting pool information and heat-affected area information is extracted from a single temperature image. The temperature gradient is a physical quantity that describes the rate of temperature change along a specific direction at a certain time on the surface of the powder layer. It mainly reflects the heat distribution of the powder layer after laser scanning.
The melting pool refers to the area where the temperature is greater than the melting point of the material. Melting pool information includes the length, width, area, and circularity. Melting pool geometry information reflects the change of heat input and absorption, which is an important monitoring index of the powder bed fusion processes.
The heat-affected area refers to the area where the temperature on the powder layer is greater than a certain value, and the information of the heat-affected area includes length, width, area and circularity. The heat-affected area has a relatively high temperature, and powder is readily agglomerated, causing the roller to push the part leading to processing failure.

Key Features from Multi-Images of the Same Powder Layer
The cooling rate, maximum temperature distribution, average temperature distribution, thermal diffusivity, and sputtering activity are extracted from multiple temperature images of the same layer. The cooling rate refers to the temperature gradient in the concept of time. If it is too high, severe non-equilibrium solidification takes place, while if it is too low, the relevant area is always in a high temperature state, leading to the agglomeration of powders. Both situations affect the quality of the molding parts.
The maximum/average temperature distribution information is formed by the processing results of all of the pixel points. The information is a comprehensive reaction of the current layer's process state, which can describe the temperature statistics of each point in the powder layer. Thermal diffusivity describes the ability of heat diffusion within an object, i.e., the ability of the temperature within the object to tend to be uniform. If the heat accumulation in the powder layer cannot be diffused, it will lead to a high temperature in a small area, and the powder will be agglomerated or burned.
Sputtering refers to the situation in which there is a rapid change of boundary conditions due to rapid energy absorption and diffusion, which leads to the presence of ejecta in the melting pool. Sputtering results in changes in the powder particles' diameter, the thickness of the local powder layer, or the thickness of the cured region. Sputtering particles falling in the uncured region cause an increase in the volume of the melting pool and a sudden change in thermal conductivity, leading to process instability.

Key Features from Multi-Images of Multi-Layers
Three-dimensional features based on two-dimensional features are extracted from multi-images of multi-layers, and the three-dimensional structure of the SLS parts is reconstructed for visualization. In addition to using average temperature distribution for temperature-based visual reconstruction, it is also possible to perform visual reconstruction based on other two-dimensional features. The reconstructed three-dimensional structure, where the temperature in a defective place is different from other places and can be distinguished based on color, is an important step in the visual display.
A set of key feature sample data can be extracted at any time during the SLS process. The key feature data of each dimension at different times can provide effective information for reflecting the temperature field change and the state of powder coating and melting pool in the molding process from different angles.

Mathematical Model of Key Features
After a sufficient number of temperature field images are acquired and the key temperature features to be extracted from the temperature field images are determined, the next step is to specify how to extract the relevant temperature features; in other words, to describe the feature extraction method by mathematical expressions.

Temperature Gradient
The maximum temperature point in the temperature image is used as the reference point for the temperature gradient, because the maximum temperature point is usually the center point of the melting pool, and the region around it is the area of focus. Taking the reference point as the center, the temperature gradient between the point and the central point is calculated by taking the point along each direction at each interval s. Suppose that the central point temperature is T 0 , and the point temperature is T vs ; then, the temperature gradient is: According to the temperature image information, a pattern boundary of a melting pool or heat-affected area is obtained. The shape of the melting pool is approximately elliptical, and the shape of the heat-affected area is approximately a long-tailed cone, as illustrated in Figure 2. According to the image, circularity is calculated by determining the length, width, area, and perimeter of the ellipse or the long-tailed cone. Circularity refers to the ratio of the area of the current measurement area to the area of a circle with the same perimeter. can be calculated using: (2) where, L is the perimeter of the current ellipse or the long-tailed cone. The measurement formula for circularity is:

Cooling Rate
The cooling rate is calculated by using two adjacent temperature images. The image acquisition interval of the infrared thermal imager is t 0 . The temperature of the same pixel in different images is and . The cooling rate of a fixed pixel point on the temperature images of the powder layer can be expressed as: (4)

Max/Average Temperature
The max/average temperature distribution needs to be calculated using all of the temperature images taken by an infrared thermal imager during the fusion of a layer. If the infrared thermal imager takes N temperature images in the printing process of a certain layer, there are N temperature values for a fixed pixel point: 0 , 1 ,..., N . If the maximum temperature distribution is obtained, the characteristic value of the pixel point is: If the average temperature distribution is desired, the characteristic value of this pixel point is:

Thermal Diffusivity
According to the thermal diffusion model, thermal diffusivity can be obtained as follows: where t is the time variable, (t) is the temperature at time t, P is the scanning power, is the scanning rate, d is the scanning interval, is the specific heat capacity, is the material density,  According to the image, circularity is calculated by determining the length, width, area, and perimeter of the ellipse or the long-tailed cone. Circularity refers to the ratio of the area S mea of the current measurement area to the area S circ of a circle with the same perimeter. S circ can be calculated using: where, L is the perimeter of the current ellipse or the long-tailed cone. The measurement formula for circularity is:

Cooling Rate
The cooling rate is calculated by using two adjacent temperature images. The image acquisition interval of the infrared thermal imager is t 0 . The temperature of the same pixel in different images is T pre and T next The cooling rate of a fixed pixel point on the temperature images of the powder layer can be expressed as:

Max/Average Temperature
The max/average temperature distribution needs to be calculated using all of the temperature images taken by an infrared thermal imager during the fusion of a layer. If the infrared thermal imager takes N temperature images in the printing process of a certain layer, there are N temperature values for a fixed pixel point: T 0 , T 1 , . . . , T N . If the maximum temperature distribution is obtained, the characteristic value of the pixel point is: If the average temperature distribution is desired, the characteristic value of this pixel point is:

Thermal Diffusivity
According to the thermal diffusion model, thermal diffusivity can be obtained as follows: where t is the time variable, T(t) is the temperature at time t, P is the scanning power, V is the scanning rate, d is the scanning interval, c p is the specific heat capacity, ρ is the material density, and ϕ is the material absorption rate.

Sputtering Activity
To quantify the sputtering activity, the sputtering particles in each position of the powder layer are counted as a sputtering activity characteristic value in the position during the printing process.

Data Structure of Key Features
Based on the above definition of key features and the mathematical model, the data structure of key features is constructed and displayed based on the sample part with dimensions of 80 mm × 30 mm × 12 mm, as shown in Figure 3. To quantify the sputtering activity, the sputtering particles in each position of the powder layer are counted as a sputtering activity characteristic value in the position during the printing process.

Data Structure of Key Features
Based on the above definition of key features and the mathematical model, the data structure of key features is constructed and displayed based on the sample part with dimensions of 80 mm × 30 mm × 12 mm, as shown in Figure 3. The room temperature is 20 degrees Celsius. The layer thickness is set to 0.3 mm, and 40 layers are printed throughout the process. The infrared thermal imager will collect 1000 images during the sintering process of one single layer, and there will be a total of 40,000 temperature images.
The temperature images are exported as temperature matrixes, and the value of each cell in the matrix represents the temperature of the corresponding location on the image as well as the powder coating. According to the discussion in the previous section, the program based on MATLAB (2016a, MathWorks, Natick, MA, USA) scripts is programmed to process 40,000 temperature distribution images, and the processing results are stored in the key temperature feature database. A total of 40 layers are printed in the experiment. Based on 1000 thermal images taken during the printing process of a certain layer as an example, the temperature value matrix is processed by using the key temperature feature extraction and structured method described in the third section. If extracting information from a single temperature image, a total of 1000 sets of data can be obtained, and the processing result is shown in Figure 4a. The matrix has a total of 1000 columns, and each column is the processing result of a temperature image that can be divided into three parts: temperature gradient, melting pool information, and heat-affected area information. Taking the 1000 temperature images as a group, the cooling rate, max/average temperature distribution, thermal diffusivity, and sputtering activity can be extracted from the group data. Figure 4b is an extraction result of the maximum temperature distribution. The room temperature is 20 degrees Celsius. The layer thickness is set to 0.3 mm, and 40 layers are printed throughout the process. The infrared thermal imager will collect 1000 images during the sintering process of one single layer, and there will be a total of 40,000 temperature images.
The temperature images are exported as temperature matrixes, and the value of each cell in the matrix represents the temperature of the corresponding location on the image as well as the powder coating. According to the discussion in the previous section, the program based on MATLAB (2016a, MathWorks, Natick, MA, USA) scripts is programmed to process 40,000 temperature distribution images, and the processing results are stored in the key temperature feature database. A total of 40 layers are printed in the experiment. Based on 1000 thermal images taken during the printing process of a certain layer as an example, the temperature value matrix is processed by using the key temperature feature extraction and structured method described in the third section. If extracting information from a single temperature image, a total of 1000 sets of data can be obtained, and the processing result is shown in Figure 4a. The matrix has a total of 1000 columns, and each column is the processing result of a temperature image that can be divided into three parts: temperature gradient, melting pool information, and heat-affected area information. Taking the 1000 temperature images as a group, the cooling rate, max/average temperature distribution, thermal diffusivity, and sputtering The feature extraction of temperature images can not only retain and excavate the potential information, they can also reduce the data quantity, which is beneficial to the storage of data and improves the computation speed of the algorithm.

Principle of the Prediction Model
During the SLS process, equipment aging, environmental humidity, temperature, and other factors will lead to a difference between the actual value of the process parameters and the set value; fluctuations of the actual value will affect the fusion quality of parts. The essence of quality prediction based on the key feature data of the temperature field is to build a correlation model between the key feature data and the actual values of the SLS process parameters based on many data samples. Furthermore, whether the actual value of a process parameter exceeds the allowable range is determined by monitoring the change of the temperature field, and an alarm is given in time to avoid the waste of materials and time. In this section, the principle of a quality prediction model is described. First, the raw data of key features obtained by an infrared thermal imager are extracted and preprocessed. Then, the PCA method is used to reduce the dimension of features. Finally, the actual value discrimination model of process parameters is established based on a support vector machine (SVM).

Feature Extraction
The key features of the temperature field mainly include the temperature gradient, temperature distribution, melting pool information, and cooling rate. For the specific SLS process, the number of feature values depends on the pixel size of the analyzed temperature field images. Taking 40 × 80 images as an example, the key extracted features of the temperature field include:  The feature extraction of temperature images can not only retain and excavate the potential information, they can also reduce the data quantity, which is beneficial to the storage of data and improves the computation speed of the algorithm.

Principle of the Prediction Model
During the SLS process, equipment aging, environmental humidity, temperature, and other factors will lead to a difference between the actual value of the process parameters and the set value; fluctuations of the actual value will affect the fusion quality of parts. The essence of quality prediction based on the key feature data of the temperature field is to build a correlation model between the key feature data and the actual values of the SLS process parameters based on many data samples. Furthermore, whether the actual value of a process parameter exceeds the allowable range is determined by monitoring the change of the temperature field, and an alarm is given in time to avoid the waste of materials and time. In this section, the principle of a quality prediction model is described. First, the raw data of key features obtained by an infrared thermal imager are extracted and preprocessed. Then, the PCA method is used to reduce the dimension of features. Finally, the actual value discrimination model of process parameters is established based on a support vector machine (SVM).

Feature Extraction
The key features of the temperature field mainly include the temperature gradient, temperature distribution, melting pool information, and cooling rate. For the specific SLS process, the number of feature values depends on the pixel size of the analyzed temperature field images. Taking 40 × 80 images as an example, the key extracted features of the temperature field include: Set three temperature thresholds to record the number of pixel points higher than the threshold.

4.
Cooling rate: each pixel point has a cooling rate of 40 × 80 = 3200 values.

5.
Record the time at which a pixel exceeds the temperature threshold: a total of 3 × 40 × 80 = 9600 values. 6.
Record the maximum temperature of the current layer, the length, width, area, and average temperature of the melting pool, the x and y coordinates of the maximum temperature pixel and the current layer number, with a total of eight values.
Therefore, according to images with a size of 40 × 80, the key features of the temperature field have a total of 13,331 values.

Dimension Reduction
Since the dimension of the feature vector obtained after feature extraction is large (the feature vector has 13,331 dimensions when the image size is 40 × 80), it is not conducive to the establishment of a machine learning model. Therefore, the dimension of the original feature vector is reduced by PCA.
PCA is a statistical method that transforms a set of possible correlation variables into a set of linear uncorrelated variables through orthogonal transformation; the covariance matrix of the original variables is converted into a diagonal matrix. After PCA, a decrease in the feature's quantity can greatly reduce the complexity of the analysis, and more information can be obtained based on fewer features.
There is a certain correlation between the key features of the temperature field in the SLS process. In the original key feature vector, each variable has a specific meaning. After orthogonal transformation, the original feature vector is transformed into a new vector whose components are not related to each other, and that lose the original special meaning. However, from the perspective of information, the new vector retains most of the valuable information contained in the original key feature vector. The importance of each component in the new vector is calculated. Taking the feature vector of 13,331 dimensions extracted based on an image with the size of 40 × 80 as an example, the importance of each component after transformation is shown in Table 1. As shown in Table 1, the importance of the first three components reaches 80%. To retain more information, we use the feature vector of the first seven features after dimension reduction, the importance of which reaches 90% of the original vector.

Prediction Based on Support Vector Machine (SVM)
In the SLS process, a seven-dimensional vector is obtained after the feature extraction and dimension reduction of each temperature image. There is a correlation between the key features of the temperature field at a certain time, and the actual value of the process parameters at the current time. Therefore, the actual value of the process parameters can be estimated based on the obtained seven-dimensional vector, and the quality of the SLS parts can be predicted. The premise is to establish a correlation model between the seven-dimensional vector and the actual value of the process parameters based on a large quantity of training samples.
Since the process parameters are continuous quantities, to simplify the problem, in this paper, the process parameters are discretized and set to two categories as "out of range" and "appropriate".
However, based on the SVM, a classifier is constructed, and many data samples are generated by the SLS simulation model to train the classifier. Finally, the actual value classification prediction model of the process parameters is constructed.
Assume that there are linear separable samples (x i , y i ), i = 1,2, 3, . . . , where x is n-dimensional data and y is assumed to be a binary classification whose value is plus/minus one. The optimal classification hyperplane means that the hyperplane can not only separate two kinds of samples correctly-that is, make the training error zero-it can also maximize the classification interval. In d-dimensional space, the linear discriminant function is g(X) = ω + b, and the hyperplane equation is ωX + b = 0. In the formula, ω is an n-dimensional vector representing the hyperplane's normal, and b is a constant representing a classification threshold. To properly classify all of the samples, the following formula should be satisfied: If the sample is linearly inseparable, there will be some samples that will never meet the above conditions. To balance these classification errors, a relaxation variable is introduced into the constraints. The formula becomes: When 0 < ξ i < 1, sample points are classified correctly. When ξ i ≥ 1, the point X i is incorrectly classified. To solve this problem, a penalty factor is added, and a penalty term C ∑ l i=1 ξ i is added to the objective function. The optimization problem can be expressed as: ∑ l i=1 ξ i represents the upper section of the wrongly classified samples' quantity in the sample set that is used to measure the deviation of sample data from ideal partitioning conditions. C is a penalty factor to control the punishment of the wrongly classified data. When the penalty factor value is small, the classification interval is large, and good generalization performance can be obtained. The above formula can be solved by applying the Lagrangian function to its dual form.
For a nonlinear problem, it can be transformed into the linear data of a high-dimensional space by mapping, and then, linearly separable problems can be solved in a transformed space. According to the correlative functional theories, if the function satisfies Mercer's condition, it corresponds to the inner product of a transformed space, which is called a kernel function K = X i , X j . At present, the commonly used kernel functions include the following: polynomial kernel function, Gaussian kernel function, and sigmoid kernel function.
To prevent the algorithm from being affected by the range of data values resulting in undesired results, the Gaussian kernel function is used in this paper. The Gaussian kernel function, which can map the original data to the infinite dimensional space, has better operation results. It can be expressed as:

Parameters Optimization
In the process of constructing a classifier model based on SVM, we need to optimize the gamma parameters in the penalty factor C and Gaussian kernel function, and use the meshing search method to determine their values. The basic principle of meshing search is to make C and gamma divide the mesh in a certain range and then traverse all of the points in the mesh to obtain the values. According to a specific combination of C and gamma, the relevant measurement values are calculated and compared, and the optimal combination of parameters is selected as the final parameters.
To train and optimize the parameters of the classifier, a simulation model is established by using ANSYS to generate the training data. As shown in Figure 5, the process prints a total of one layer and 10 lines. Each line will produce 80 groups of temperature data, so a total of 800 temperature field images will be obtained in the simulation process.
In the SLS process, the laser power imposes thermal load on the surface of the powder layer in the form of heat flux, and the spot energy is usually following Gaussian distribution. Due to the reduced thickness of the powder layer, the finite element model uses the two-dimensional (2D) moving Gaussian heat source to simulate the energy input of the laser beam.
where R is the laser spot radius, that is, the heat flux density reduced to the heat flux of the center of the spot 1 e 2 distance from the center of the spot; A is the absorbance of the powder for the laser (wavelength 1064 nm), and the value is 0.77; and r is the distance from the surface of the powder layer to the center of the spot: Solid-liquid conversion exists in the heating process, and liquid-solid conversion exists in the cooling process. The latent heat of phase change is the heat absorbed or released in the process of phase transformation, which has an important influence on the distribution of the temperature field. The enthalpy can be expressed as: where ρ is the density of the material, and c is the specific heat of the material. 10 lines. Each line will produce 80 groups of temperature data, so a total of 800 temperature field images will be obtained in the simulation process.
In the SLS process, the laser power imposes thermal load on the surface of the powder layer in the form of heat flux, and the spot energy is usually following Gaussian distribution. Due to the reduced thickness of the powder layer, the finite element model uses the two-dimensional (2D) moving Gaussian heat source to simulate the energy input of the laser beam.
where R is the laser spot radius, that is, the heat flux density reduced to the heat flux of the center of the spot 1 2 distance from the center of the spot; A is the absorbance of the powder for the laser (wavelength 1064 nm), and the value is 0.77; and r is the distance from the surface of the powder layer to the center of the spot: Solid-liquid conversion exists in the heating process, and liquid-solid conversion exists in the cooling process. The latent heat of phase change is the heat absorbed or released in the process of phase transformation, which has an important influence on the distribution of the temperature field. The enthalpy can be expressed as: Where is the density of the material, and is the specific heat of the material. The key feature of the temperature field is automatically extracted into a feature 799 × 13331 matrix by using a MATLAB script. Each row of the matrix represents the processing result of one temperature image. Since the cooling rate requires the temperature gap of two adjacent images to be divided by the time interval of the obtained images, it is impossible to calculate the cooling rate of the first image so that 799 feature vectors are ultimately obtained. Changing the laser power in the simulation model of the SLS process, the simulation is carried out at 80 W, 100 W, and 120 W, so that 2397 groups of labeled sample data are obtained. It is assumed that in the SLS process, good quality parts with a label of "appropriate" can be obtained when the power is 100 W. The quality of the molding parts cannot meet the production quality requirements when the power deviates from 100 W, and the label of the molding parts is "out of range". The key feature of the temperature field is automatically extracted into a feature 799 × 13331 matrix by using a MATLAB script. Each row of the matrix represents the processing result of one temperature image. Since the cooling rate requires the temperature gap of two adjacent images to be divided by the time interval of the obtained images, it is impossible to calculate the cooling rate of the first image so that 799 feature vectors are ultimately obtained. Changing the laser power in the simulation model of the SLS process, the simulation is carried out at 80 W, 100 W, and 120 W, so that 2397 groups of labeled sample data are obtained. It is assumed that in the SLS process, good quality parts with a label of "appropriate" can be obtained when the power is 100 W. The quality of the molding parts cannot meet the production quality requirements when the power deviates from 100 W, and the label of the molding parts is "out of range".
In the experiment, 2397 groups of sample data are divided into a training set and test set. The values of C and gamma are set to range from 10 −10 to 10 10 , and each change is 10-fold. For each group of parameters, the training set is used to establish the SVM model for predicting the actual value of the laser power based on the values of the temperature field features, and then, the test set is used to verify and calculate the accuracy and F value.
Determining whether the transient process state is abnormal is a two-category problem, i.e., dividing an instance into positive or negative. For a two-category problem, there are four cases ( Table 2). True Positive (TP) represents the correct number in prediction and reality. False Negative (FN) represents a missing report, that is, the number of correct matches that are not found. False Positive (FP) refers to a false alarm, i.e., the given match is incorrect. True Negative (TN) represents the number when both reality and prediction are errors. Based on the confusion matrix, it is easy to obtain the evaluation indexes of the two classification algorithms, such as precision, recall, F value, and accuracy. Accuracy is the most common evaluation index, which is the number of correct samples divided by the number of all of the samples. The higher the accuracy, the better the algorithm, which is a very intuitive evaluation index. Nevertheless, sometimes, high accuracy does not mean that an algorithm is good. When the operation set is a deviation class, it will appear that the accuracy is high, but the model is not good. Therefore, it is not feasible to use only accuracy. Accuracy is defined as follows: Precision (P) and recall (R) are also two metrics that are widely used in statistical theory to evaluate the quality of results. They are defined as follows: To evaluate the merits and demerits of different algorithms, the concept of the F value is proposed based on accuracy and recall. The F value considers the P value and the R value synthetically, and when it is high, the algorithm is effective. The F value is defined as follows: In the data used in this experiment, positive samples account for one-third of the data, while negative samples account for two-thirds of the data. The data set has a certain level of deviation, which also makes the F value an important metric.
The top 20 sets of parameter values with the best metrics are shown in Table 3. When the gamma is fixed at 0.1, with the change of C, the variation of metrics is shown in Figure 6.
Appl. Sci. 2018 When the gamma is fixed at 0.1, with the change of C, the variation of metrics is shown in Figure 6. As can be seen from the figure, when gamma = 0.1, with the continuous increase in C, both the F value and accuracy have a trend that is first constant, followed by an increase and then a reduction. When C is small, the penalty factor is small. This happens when the penalty term is multiplied by the penalty factor equal to approximately 0, i.e., the penalty factor has little effect on the result of the algorithm model because the value is too small, which also explains why the F value and accuracy are almost constant, even if the penalty factor of the first half is constantly increased. The numerical value of the whole graph shows an initial increase followed by a decrease, indicating that a larger parameter is not better. When the parameter value increases to a certain value, the prediction effect will be reduced. As can be seen from the figure, the initial accuracy is only about 70%, which is merely the proportion of negative samples in the data set. Through verification of the actual value, it is found that when the penalty factor is small, the model will predict all of the samples in the validation set as negative, so the initial accuracy will be maintained at 70%. This also proves that the algorithm has no fault tolerance rate because there is little penalty for the error term in the beginning, i.e., no error is allowed in the training set so that the hyperplane spacing of SVM is very small, resulting in the As can be seen from the figure, when gamma = 0.1, with the continuous increase in C, both the F value and accuracy have a trend that is first constant, followed by an increase and then a reduction. When C is small, the penalty factor is small. This happens when the penalty term is multiplied by the penalty factor equal to approximately 0, i.e., the penalty factor has little effect on the result of the algorithm model because the value is too small, which also explains why the F value and accuracy are almost constant, even if the penalty factor of the first half is constantly increased. The numerical value of the whole graph shows an initial increase followed by a decrease, indicating that a larger parameter is not better. When the parameter value increases to a certain value, the prediction effect will be reduced. As can be seen from the figure, the initial accuracy is only about 70%, which is merely the proportion of negative samples in the data set. Through verification of the actual value, it is found that when the penalty factor is small, the model will predict all of the samples in the validation set as negative, so the initial accuracy will be maintained at 70%. This also proves that the algorithm has no fault tolerance rate because there is little penalty for the error term in the beginning, i.e., no error is allowed in the training set so that the hyperplane spacing of SVM is very small, resulting in the algorithm prediction results being negative. With the increasing effect of penalty factors, the penalty of error samples increases. By adjusting the proportion of penalty factors to each feature of the model, the prediction accuracy increases. Finally, when the penalty is large enough to blindly pursue the generalization ability, the fault tolerance rate in the training set will be very high and the hyperplane spacing will be very large, so that the validation set will be more prone to error classification, which will lead to a slight decrease in the metrics.
When C = 10, the variation of the metrics with gamma is shown in Figure 7. As can be seen, with the increase in gamma, the metrics also show a tendency to increase first and then decrease. When gamma is very small, the value of the Gaussian kernel function is equal to about 0. Now, SVM has a kernel function whose value is constant zero. The SVM algorithm gives negative prediction results for all of the data, so the initial F value is zero; accuracy is 70% (about equal to the proportion of negative values in the data set). With the increase in gamma, the Gaussian kernel function starts to play a role, which is equivalent to mapping the original data into an infinite dimensional space. However, when the metric increases to a certain value, there will be a reduction. This can be mainly attributed to the over-fitting phenomenon, as the gamma value becomes too large. The phenomenon has a good effect on the training set, but is difficult to generalize to the validation set. Therefore, the metrics increase first and then decrease.
Finally, the parameters of the classifier model are determined as follows: gamma = 0.1, C = 10.
Appl. Sci. 2018, 8, x 13 of 16 spacing will be very large, so that the validation set will be more prone to error classification, which will lead to a slight decrease in the metrics. When C = 10, the variation of the metrics with gamma is shown in Figure 7. As can be seen, with the increase in gamma, the metrics also show a tendency to increase first and then decrease. When gamma is very small, the value of the Gaussian kernel function is equal to about 0. Now, SVM has a kernel function whose value is constant zero. The SVM algorithm gives negative prediction results for all of the data, so the initial F value is zero; accuracy is 70% (about equal to the proportion of negative values in the data set). With the increase in gamma, the Gaussian kernel function starts to play a role, which is equivalent to mapping the original data into an infinite dimensional space. However, when the metric increases to a certain value, there will be a reduction. This can be mainly attributed to the over-fitting phenomenon, as the gamma value becomes too large. The phenomenon has a good effect on the training set, but is difficult to generalize to the validation set. Therefore, the metrics increase first and then decrease.
Finally, the parameters of the classifier model are determined as follows: gamma = 0.1, C = 10.

Case Study
To verify the feasibility of the proposed prediction model for SLS, experiments are carried out on a SLS machine, and the used material is coated in sand.
The equipment and experimental scene are shown in Figure 8. Three pairs of parts were printed independently with different laser powers. The first pair was printed at a power of 35 W, the second was printed at a power of at 40 W, and the third was printed at a power of at 45 W. During the sintering process of each part, about 40,000 images of the temperature field were produced by the infrared thermal imager. Therefore, there were 80,000 images for each level of laser power.
The used infrared camera is "VarioCAM hr research 480" produced by InfraTec. The camera and its software can measure the surface temperature of the targets in the image area, based on the thermal radiation of those targets. Generally, the thermal radiances are various when referring to different kinds of materials; even for the same material, the thermal radiance will be variable while the temperature of the material changing.
The infrared camera simplified this issue by providing a setup option of the thermal radiances

Case Study
To verify the feasibility of the proposed prediction model for SLS, experiments are carried out on a SLS machine, and the used material is coated in sand.
The equipment and experimental scene are shown in Figure 8. Three pairs of parts were printed independently with different laser powers. The first pair was printed at a power of 35 W, the second was printed at a power of at 40 W, and the third was printed at a power of at 45 W. During the sintering process of each part, about 40,000 images of the temperature field were produced by the infrared thermal imager. Therefore, there were 80,000 images for each level of laser power.
The used infrared camera is "VarioCAM hr research 480" produced by InfraTec. The camera and its software can measure the surface temperature of the targets in the image area, based on the thermal radiation of those targets. Generally, the thermal radiances are various when referring to different kinds of materials; even for the same material, the thermal radiance will be variable while the temperature of the material changing.
The infrared camera simplified this issue by providing a setup option of the thermal radiances of the target material. In this experiment, we set the thermal radiance of coated sand to be 0.95, which is based on the suggestions from material professionals and some of the literature. Assuming the temperature of the target area is 400 • C, then the energy captured by the camera will be 380 • C; as result of the setup of the thermal radiance, the final temperature shown on the interface of the software will be 400 • C again, which is calculated by 380/0.95.
Actually, the measurement uncertainty exists in any measurement system. The measured temperature values given out by the infrared camera may still not be the real temperatures of the target area. However, the measurement bias will not influence the analysis based on the proposed method, which focuses on the difference between temperatures at different times, instead of the actual values of them. Actually, the measurement uncertainty exists in any measurement system. The measured temperature values given out by the infrared camera may still not be the real temperatures of the target area. However, the measurement bias will not influence the analysis based on the proposed method, which focuses on the difference between temperatures at different times, instead of the actual values of them. As illustrated, the key features of the temperature field are extracted from those images, and their values are expressed by matrixes. Then, all 240,000 matrixes are divided into three groups: the training group, validation group, and test group, as shown in Figure 9. X X X X X X X Y X 1 X 2 X 3 X 4 X 5 X 6 X 7 Y As illustrated, the key features of the temperature field are extracted from those images, and their values are expressed by matrixes. Then, all 240,000 matrixes are divided into three groups: the training group, validation group, and test group, as shown in Figure 9.

Infrared camera
Using the PCA algorithm, the high-dimensional features of the temperature field are reduced to seven features, and the values are represented by an array with seven cells. Some arrays are produced by the SLS process with 35-W and 40-W laser power and are called negative samples; other arrays are produced by the process with 45-W laser power, and they are called positive samples.
Set Y = 1 for positive samples and Y = -1 for negative samples; then, an SVM model can be built to determine the hyperplane function, which can divide all the arrays into two categories. Finally, for any value of the array, the SVM model can tell us the actual laser power of the process that produces the array; the laser power can be predicted in process based on the key feature values of the temperature field.
Based on the matrixes of the training group, an initial SVM model is built based on the data set of X training and Y training ; then, the validation group is used to optimize the parameters (gamma and C), using the meshing search method described in Section 4. In this experiment, the optimal value of gamma is 0.1, and the optimal value of C is 10.
Finally, the test group is used to verify the optimized model: the dataset of X testing is input to the established SVM model, and the data set of Y predict is given for each feature array; the evaluating algorithm discussed in Section 4 is run based on Y predict and Y testing , with the result showing that the accuracy of laser power prediction is 88.7%, and the F value is 89.3%. As illustrated, the key features of the temperature field are extracted from those images, and their values are expressed by matrixes. Then, all 240,000 matrixes are divided into three groups: the training group, validation group, and test group, as shown in Figure 9.  Features matrixes of temperature field PCA PCA PCA X 1 X 2 X 3 X 4 X 5 X 6 X 7 Y X 1 X 2 X 3 X 4 X 5 X 6 X 7 Y X 1 X 2 X 3 X 4 X 5 X 6 X 7 Y SVM Parameters optimization Testing

Conclusions
In the additive manufacturing processes of powder bed fusion, the temperature of the work space is determined by and reflects the actual values of process parameters, which will result in different quality. To predict the quality of parts based on the temperature field information in SLS, the concept of the temperature field's key features is proposed in this paper. The key feature data are extracted from three aspects: (1) features along with the scanning trajectory; (2) features on the single-layer powder coating; and (3) features of the three-dimensional structure. The mathematical model and data structure of key feature data are established. Based on the PCA method and SVM algorithm, a prediction model based on temperature field images is built after feature extraction, dimension reduction, and parameter optimization. Finally, a practical experiment is carried out to verify the proposed methods. The experimental results show that the optimized prediction model has an accuracy of 88.7% and an F value of 89.3%. It should be noted that the proposed methodology is applicable not only to the SLS process but also to other powder bed fusion processes such as selective laser melting (SLM). In future work, we will continue to explore the correlation between the key features of the temperature field and quality indexes (e.g., porosity), and a real-time analysis model for online monitoring.