## 4 Parameter Optimization for CNN  
### CNN Structure Optimization  
The modeling capabilities of convolutional neural networks depend on the effects of their depth and width. In theory, any non-linear data distribution can be fitted as long as the model is deep enough and wide enough. However, for a simpler classification problem, blindly expanding the network model will not only cause a surge in feature mapping, but also lead to serious over-fitting. In order to optimize the width of the model, 10 neural network models with different widths were constructed. The 10 models have the same structural form, consisting of four convolution layers immediately followed by pooling layer and two fully connected layers. However, the widths of the respective convolution layers were different, and the number of filters in each convolution layer was as shown in Figure 9. In the legend, '04-08-12-16' indicates that the number of filters in the four convolution layers was 4, 8, 12 and 16, respectively. Figure 8: The kurtosis map of the vibration signal after being decomposed via derived wavelet frames (DWFs), where “CoCC” means the combination of cutting conditions and “TWS” means the tool wear state. In this study, we used the cross entropy as the loss function, and adapted the Adam optimizer. Cross entropy is an efficient objective function for combinatorial and continuous optimization and is now widely used to train neural networks for classification [53; 54]. Experimental studies have shown that the cross entropy loss function has significant, practical advantages over squared-error [55]. A series of advantages of the Adam optimization algorithm have been widely recognized, such as straightforward to implement, high computationally efficiency, low memory space requirements and invariant to diagonal rescaling of the gradients. Moreover, the adaptability of Adam optimizer is powerful, and there is typically little requirement to hyperparameters tuning [56]. A ten-fold crossover experiment was performed using 2-D dataset #1 with a fixed 150 epoch. Figure 9 shows the validation accuracy convergence graph for each model's typical training process. Figure 10 shows the average test accuracy and average time consumption per epoch for each model's ten-fold crossover experiment. It can be seen from Figure 9 that as the width increased, the learning speed and convergence stability of the model increased. At the same time, however, the computational complexity of the model also rose rapidly. It can be seen from Figure 10 that the duration of the single-epoch training was increasing. Considering the modeling ability and calculation speed of the model, the 12-16-20-24 structure was selected in this paper. The size of the input sample and the structure of the model determine the size of the feature vector output by the flatten layer. The number of sample categories determines the number of neurons in the last fully connected layer. In the random dropout layer, increasing the dropout rate may increase the robustness of the model, or it may cause the model to be unstable and difficult to converge. For the first fully connected layer, increasing neurons can improve the learning ability and may also exacerbate overfitting. Therefore, this paper explored the different combinations of these two parameters, and the results are shown in Figure 11.  
Figure 10: Training results of neural network models with different structures. Figure 9: Validation accuracy convergence curves of different structural neural network models. Figure 11a shows the average test accuracy of the ten-fold crossover experiment. Under the premise of a dropout rate, the accuracy increased with the increase of the neurons in the fully connected layer, especially when the dropout rate was high. When the number of neurons was fixed, the dropout rate had no obvious effect on the accuracy. Conversely, there was a significant drop in accuracy when there were fewer neurons. Figure 11b shows the average test loss value.