## 2 Methods
### CNN Model
During the training process of a neural network, a batch of data is extracted from the training dataset. From this batch data, a piece of data '\(x\)' is selected, which includes the input data '\(x\)' and its corresponding tag '\(y\)'. These data are then fed into the input layer of the model, and the output parameters of each layer and function of the neural network are obtained. The output of the input layer is RGB three-channel data '\(x\)'. The output of the convolution calculation or full connection layer is '\(z\)'. The batch normalization function outputs '\(N\)', which includes variance (\(\zeta\)), average value (\(u\)), translation (\(\gamma\)), and scaling (\(\beta\)). Figure 1: Schematic figure of the convolution process for ResNet-10. The activation function \(\sigma\) (relu) outputs '\(a^{l}\)'. Lastly, the output of the pooling layer is '\(p\)', and its size is '\(p\)' (where '\(n\)' is the image size, '\(f\)' is the size of the pooled kernel, and '\(s\)' is the step length of the pooled kernel). The maximum pooling layer outputs the maximum value of pixels above the image in each step of the pooling kernel, while the global average pooling layer outputs the average of all pixel values on an image. The output after the activation function and then convolution is represented by '\(z^{l}\)' in Formula (1), and the output after the pooling layer and then convolution is represented by '\(z^{l}\)' in Formula (2). \[z^{l}=W^{l}a^{l-1}, \tag{1}\]  
\[z^{l}=W^{l}p^{l-1}, \tag{2}\]  
\[N^{l}=\gamma^{l}*\frac{\left(z^{l}-u^{l}\right)}{\xi^{l}}+\beta^{l}, \tag{3}\]  
\[a^{l}=\sigma(N^{l}), \tag{4}\]  
\[p^{l}_{b}=\left(n^{l}-f\right)/s+1. \tag{5}\]  
During the training process of a model, changing the parameters in one layer can lead to a change in the distribution of the output data. This can cause instability in the distribution of the input data in the next layer, making it difficult for the parameters in that layer to adapt to the new distribution. While data preprocessing can help with the input layer's distribution, it cannot address the hidden layer's distribution. This is where batch normalization comes in. Batch normalization normalizes the data distribution at each level to a distribution with a mean of '\(u\)' and a variance of '\(\zeta\)'. To prevent the model from becoming worse after normalization, the distribution needs to be shifted by scaling '\(\beta\)' and shifting '\(\gamma\)'. When '\(\gamma\)' is equal to '\(\zeta\)' and '\(u\)' is equal to '\(\beta\)', the data are returned to its original state before normalization. Batch normalization enables higher-level inputs to remain relatively stable despite changes in lower-level parameters. This allows gradients the possibility to become more stable, which in turn enables greater learning rates to improve convergence. Additionally, by calculating the mean and variance of the same channel in a batch, all samples in the batch are associated together, preventing overfitting to some extent. It is common to place the batch normalization function before Relu in a neural network. This is because if Relu is applied first, some neurons may be deactivated during batch normalization, which can cause instability in the function and negatively impact the model's performance. Batch normalization normalizes the distribution of data back into the unsaturated region, and then the Relu activation function controls how saturated the data is. By following this order, the model can perform more effectively. First, the error backpropagation calculates loss function C based on output \(z^{l}\) and nominal value \(y\) of the neural network. Then, the delta error \(\delta^{l}\) is calculated for the output layer using categorical cross-entropy. \[\delta^{l}=\frac{\partial C}{\partial z^{l}}. \tag{6}\]  
\(\odot\) stands for dot product. The \(\delta^{l}\) value of each layer is obtained using the \(\delta^{l}\) recurrence formula between adjacent layers.