# Prediction and Analysis of the Surface Roughness in CNC End Milling Using Neural Networks
## 3 Results and Analysis
### Parameter Analysis of BPNN  
The back propagation neural network is a multi-layer feedforward network with learning ability. It is a method to train the artificial neural network, including at least three \begin{table}
\begin{tabular}{c c c c c c c} \hline  & **SS** & **DF** & **MS** & **F** & \(p\)**-Value** & **Critical Value** & **Con (\%)** \\ \hline \(SS_{B}\) & 115.6564 & \(1\) & 115.6564 & 256.6285 & \(<\)0.0001 & 3.932438 & 71\% \\ \(SS_{w}\) & 46.87036 & 104 & 0.450677 & & & \\ \(SS_{T}\) & 162.5268 & 105 & & & & \\ \hline \end{tabular}
\end{table} 
Table 10: ANOVA results for the milling pitch. \begin{table}
\begin{tabular}{c c c c c c c c} \hline  & **SS** & **DF** & **MS** & **F** & \(p\)**-Value** & **Critical Value** & **Con (\%)** \\ \hline \(SS_{B}\) & 59.3598 & \(1\) & 59.3598 & 112.0691 & \(<\)0.0001 & 3.932438 & 51.86\% \\ \(SS_{w}\) & 55.08584 & 104 & 0.529672 & & & & \\ \(SS_{T}\) & 114.4456 & 105 & & & & \\ \hline \end{tabular}
\end{table} 
Table 7: ANOVA results for the cutting depth. \begin{table}
\begin{tabular}{c c c c c c c} \hline  & **SS** & **DF** & **MS** & **F** & \(p\)**-Value** & **Critical Value** & **Con (\%)** \\ \hline \(SS_{B}\) & 7.66 \(\times\) 10\({}^{8}\) & \(1\) & 7.66 \(\times\) 10\({}^{8}\) & 357.9129 & \(<\)0.0001 & 3.932438 & 77.48\% \\ \(SS_{w}\) & 2.22 \(\times\) 10\({}^{8}\) & 104 & 2,138,970 & & & & \\ \(SS_{T}\) & 9.88 \(\times\) 10\({}^{8}\) & 105 & & & & \\ \hline \end{tabular}
\end{table} 
Table 8: ANOVA results for the spindle speed. \begin{table}
\begin{tabular}{c c c c c c c} \hline  & **SS** & **DF** & **MS** & **F** & \(p\)**-Value** & **Critical Value** & **Con (\%)** \\ \hline \(SS_{B}\) & 4.19 \(\times\) 10\({}^{8}\) & \(1\) & 4.19 \(\times\) 10\({}^{8}\) & 1247.14 & \(<\)0.0001 & 3.932438 & 92.3\% \\ \(SS_{w}\) & 3.49 \(\times\) 10\({}^{7}\) & 104 & 336,357.5 & & & & \\ \(SS_{T}\) & 4.54 \(\times\) 10\({}^{8}\) & 105 & & & & \\ \hline \end{tabular}
\end{table} 
Table 9: ANOVA results for the feed. layers (input layer, hidden layer, and output layer). Its learning is a kind of supervised learning. The training data and the target output data were input into the neural network, and the weights were adjusted repeatedly by using the gradient steepest descent method to minimize the error between the neural network output and the actual value. Next, we will introduce the theory and mathematical derivation of back propagation neural networks. When the learning rate is too small, it can avoid network vibration. However, this phenomenon leads to slow convergence, which results in a slow learning rate. If the learning rate is too large, the target value can be approached faster. However, too much correction can result in network vibration, or even lead to network weight value divergence. The inertia factor is the change from the previous weighted value to the next weighted value. Typically, the value is between 0 and 1. The weights should be moved in the same direction. In this study, a three-layer BPNN was proposed (Figure 7). The input layer had four neurons, including the feed, spindle speed, cutting depth, and milling spacing. According to the experiment, the hidden layer was divided into 20 and 30 neurons. The following experiment was conducted to analyze the number of hidden layer neurons. One neuron in the output layer was surface roughness. The target value of each training data back propagation neural network (\(T_{n}\)) and back propagation neural network output prediction (\(Y_{n}\)), calculation error, and RMSE were calculated between two calculations. The RMSE is the square root of MSE and denotes the accuracy of the prediction and the degree of deviation between the predicted and target values. The smaller the value is, the higher the accuracy is. The RMSE is calculated as follows:  
\[\text{RMSE}=\sqrt{\frac{1}{N}\sum_{n}^{N}\left(\ T_{n}-Y_{n}\right)^{2}} \tag{13}\]  
where \(N\) is the total number of data. Figure 7: Proposed BPNN architecture.