# Quality Monitoring for Laser Welding Based on High-Speed Photography and Support Vector Machine
## 2 Experimental Method
### Features of the Welding Sample
Some spatters eventually fell onto the surface along the weld axis. The other reason is that knots were possibly from violent turbulence in the molten pool during welding. The second cross section belonged to region B, whose surface width was the narrowest. By calculating the data in Figure 3, the average area and height of the metal vapor plume in region B were smaller than the other two regions, and five pores were found in the corresponding cross section. This indicated that the temperature of the molten pool in section B is relatively low, and that the solidification of liquid metal became faster. When the bubbles grew to a certain size and began to float, they were more likely to stay in the solidified weld metal to form pores if the floating speed was less than that of the crystallization of the metal pool. Figure 6: The pores in the cross section of the welded seam. The captions of each image were named as \(i\)-\(j\), which meant the \(j\)-th pores in the \(i\)-th cross sections. Classification Experiment Based on the SVM Approach, Quadratic Discriminant Analysis, and Linear Discriminant Analysis  
After median filtering, support vector machine, linear discriminant analysis [27], and quadratic discriminant analysis [28] were used to build models using each feature separately. In practice, 10-fold cross-validation is widely used to test the accuracy of algorithms [17; 29], which meant the entire data set was divided into 10 equal parts, nine parts were taken as training sets and the remaining one was used as a test set. Experiments were conducted ten times, and the average result was taken as the accuracy rate of the model. The results are shown in Table 3 and Figure 7, where the features were sorted in descending order according to the accuracy rate of SVM. As shown in Table 3, the accuracy rate of SVM was significantly higher than that of quadratic discriminant analysis and linear discriminant analysis when using Feature 1, 2, 4 and 5. For Feature 3 and Feature 6, the accuracy rate of SVM was a little better and worse than the other two models, respectively. In other words, the results showed that SVM was more suitable for predicting the welding quality in the experiment. There were two possible reasons. On one hand, SVM was based on margin maximization, which ensured its advantage in generalization ability. On the other hand, as the kernel function was used, SVM could analyze and classify data not only in feature space, but also in high-dimensional space. The experimental results above showed that the accuracy rate could reach 83.04% when using SVM with Feature 1. To further improve the classification ability, two other features were chosen based upon Pearson product-moment correlation coefficient. The Pearson product-moment correlation coefficient \(r\) between two features \(x\) and \(y\) was calculated by [30]: \begin{table}
\begin{tabular}{c c c c c} \hline
**No.** & **Feature** & **SVM (\%)** & **Quadratic (\%)** & **Linear (\%)** \\ \hline
1 & area of plume & 83.04 & 64.86 & 64.86 \\
2 & height of plume & 72.77 & 52.97 & 64.86 \\
3 & horizontal coordinate of & 72.43 & 72.36 & 71.96 \\  & plume centroid & & & \\
4 & number of spatters & 71.62 & 65.81 & 66.28 \\
5 & vertical coordinate of & 68.72 & 64.46 & 63.85 \\  & plume centroid & & & \\
6 & average intensity of plume & 64.93 & 66.42 & 65.27 \\ \hline \end{tabular}
\end{table} 
Table 3: The classification results of SVM, quadratic discriminant analysis, and linear discriminant analysis. Figure 7: The classification results of various methods. \[r=\frac{\sum\limits_{i=1}^{n}{(a_{i}-\overline{a})\left(b_{i}- \overline{b}\right)}}{\sqrt{\sum\limits_{i=1}^{n}{(a_{i}-\overline{a})^{2}}\cdot \sum\limits_{i=1}^{n}{\left(b_{i}-\overline{b}\right)^{2}}}} \tag{8}\] \[\overline{a}=\frac{\sum\limits_{i=1}^{n}{a_{i}}}{n},\ \overline{b}=\frac{ \sum\limits_{i=1}^{n}{b_{i}}}{n} \tag{9}\]  
where \(n\) was the size of sample, and \(r\) was a measure of the correlation between two features. A greater absolute value of \(r\) indicated stronger correlation.