# Prediction of Manufacturing Quality of Holes Based on a BP Neural Network
## 4 Training and Verification Experiment of BP Neural Network Model
### Results Calculation  
According to the rounding principle, the error of the fitting results was as shown in Figure 8.  
\begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline
**Input** & **Feed** & **Spindle** & **Drilling** & **CFRP** & **Al** & **CFRP** & **Al** & **Cushion** \\
**Vector** & **Rate** & **Speed** & **Diameter** & **(3 mm)** & **(2 mm)** & **(3 mm)** & **(2 mm)** & **Plate** \\
**(mm/r)** & **(r/min)** & **(mm)** & **(Y1, N0)** & **(Y1, N0)** & **(Y1, N0)** & **(Y1, N0)** & **(Y1, N0)** & **(Y1, N0)** \\ \hline Level I & 0.007 & 3000 & 3.26 & 0/1 & 0/1 & 0/1 & 0/1 & 0/1 \\ Level II & 0.02 & 5000 & 4.81 & 0/1 & 0/1 & 0/1 & 0/1 & 0/1 \\ Level III & 0.04 & 7000 & 7.92 & 0/1 & 0/1 & 0/1 & 0/1 & 0/1 \\ \hline \hline \end{tabular}
\end{table}
Table 4: Input vector level.  
Figure 7: Training diagram: (**a**) process; (**b**) mean square error; (**c**) regression fitting.  
In Figure 8, * represents that the expected value is equivalent to the actual experimental result, and \({}^{\circ}\) represents that the predicted value is equivalent to the theoretical value. The fit between the expected value of the tearing number and the predicted value was good and most samples were almost coincident. The magnitude of training sample fitting error was \(10^{-2}\)-\(10^{-5}\), and a small number of samples had an error of \(10^{-1}\). Within the magnitude, the maximum error was 0.78, which appeared in sample No. 24.  
The process parameters of CFRP/Al/CFRP were predicted by the BP neural network model. The process parameters included the feed rate (0.04 mm/r), spindle speed (3000 r/min, 5000 r/min, 7000 r/min), drilling diameter (3.26 mm, 4.81 mm, 7.92 mm), and the ABS cushion plate with thickness of 3 mm. The predicted number of defective holes was consistent with the number of actual defects in 20 samples obtained from the test. The data are shown in Table 5.  
It can be seen from Table 5 that the maximal error of prediction was 4, which appeared in tests No. 159 and No. 160. The minimum error of prediction was at least 0, which appeared in tests No. 158 and No. 161. It is known from the data in Figure 9 and Table 5 that the prediction results were consistent with the trend of the experimental results. However, the error of some separate samples was larger in the prediction results. The prediction model was based on the training samples, but the process parameters of tests No. 153-No. 161 did not exist in the training samples, and the prediction model was still based on the training samples during the prediction process, which caused a larger error. However, this error can be reduced by increasing the number of training samples. The same principle can also be used to predict the optimized hole-making processes for CFRP/Al, Al/CFRP, and Al/CFRP/Al.  
Figure 8: The fitting result diagram of training samples.  
\begin{table}
\begin{tabular}{l c c c c c c c c c c} \hline \hline \multirow{2}{*}{
\begin{tabular}{c} **Test** \\ **No.** \\ **No.** \\ **(mm/r)** \\ \end{tabular} } & **Feed** & **Spindle** & **Drilling** & **CFRP** & **Al** & **CFRP** & **Cushion** & **Actual** & **Prediction** & **Absolute** \\  & **Rate** & **Speed** & **Diameter** & **(3 mm)** & **(2 mm)** & **(3 mm)** & **Plate** & **Number** & **Number** & **Value of** \\  & **(mm/r)** & **(r/min)** & **(mm)** & **(Y1, N0)** & **(Y1, N0)** & **(Y1, N0)** & **(Y1, N0)** & **(Y1, N0)** & **of Defects** & **of Defects** & **Error** \\ \hline
153 & 0.04 & 3000 & 3.26 & 1 & 1 & 1 & 1 &  
As shown in Figure 9, the prediction curve of the number of defective holes was similar to the trend of the experimental curve, but the prediction errors of samples No. 159 and No. 160 were larger.