## 2 PD Pattern Recognition Based on MCNN
### Training and Testing of MCNN  
In this paper, MCNN is used to identify the type of PD in the transformer. To further improve the performance of the model and avoid over-fitting, we first expand the PD data obtained, to effectively increase the number and diversity of training samples. In the output layer of the model, the SoftMax is used as the classifier, and the one-hot encoding is used to encode the categories of four types of PD. The specific steps of PD pattern recognition of transformer based on MCNN are as follows:  
1. Data acquisition. According to the data collected by the discharge experiment, the PRPD spectrum is generated, and the collected PD images are randomly divided into the training set and test set, accounting for 80% and 20% of the total samples respectively.  
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Layer Num** & **Input** & **Operator** & **Exp Size** & **Out** & **SE** & **NL** & **s** \\ \hline
1 & 2242 \(\times\) 3 & conv2d, 3 \(\times\) 3 & - & 16 & - & HS & 2 \\
2 & 1122 \(\times\) 16 & Bneck, 3 \(\times\) 3 & 16 & 16 & \(\surd\) & RE & 2 \\
3 & 562 \(\times\) 16 & Bneck, 3 \(\times\) 3 & 72 & 24 & - & RE & 2 \\
4 & 282 \(\times\) 24 & Bneck, 3 \(\times\) 3 & 88 & 24 & - & RE & 1 \\
5 & 282 \(\times\) 24 & Bneck, 5 \(\times\) 5 & 96 & 40 & \(\surd\) & HS & 2 \\
6 & 142 \(\times\) 40 & Bneck, 5 \(\times\) 5 & 240 & 40 & \(\surd\) & HS & 1 \\
7 & 142 \(\times\) 40 & Bneck, 5 \(\times\) 5 & 240 & 40 & \(\surd\) & HS & 1 \\
8 & 142 \(\times\) 40 & Bneck, 5 \(\times\) 5 & 120 & 48 & \(\surd\) & HS & 1 \\
9 & 142 \(\times\) 48 & Bneck, 5 \(\times\) 5 & 144 & 48 & \(\surd\) & HS & 1 \\
10 & 142 \(\times\) 48 & Bneck, 5 \(\times\) 5 & 288 & 96 & \(\surd\) & HS & 2 \\
11 & 72 \(\times\) 96 & Bneck, 5 \(\times\) 5 & 576 & 96 & \(\surd\) & HS & 1 \\
12 & 72 \(\times\) 96 & Bneck, 5 \(\times\) 5 & 576 & 96 & \(\surd\) & HS & 1 \\
13 & 72 \(\times\) 96 & conv2d, 1 \(\times\) 1 & - & 576 & \(\surd\) & HS & 1 \\
14 & 72 \(\times\) 576 & Pool, 7 \(\times\) 7 & - & - & - & - & 1 \\
15 & 12 \(\times\) 576 & FC, NBN & - & 1280 & - & HS & 1 \\
16 & 12 \(\times\) 1280 & FC, NBN & - & k & - & - & 1 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Core module construction of MOBILENETS.  
2. Data preprocessing. Firstly, the PRPD spectrum of PD is randomly allocated to obtain a 224 \(\times\) 224 \(\times\) 3 three-channel RGB image, and then the image is flipped randomly and converted into a floating-point tensor with a value between 0\(\sim\)1.
3. Data enhancement. The sample of the original data is expanded, including random rotation, segmentation, scaling, and other operations. To improve the generalization ability of the model, 20% of the training data is randomly selected by using data enhancement for image generation.
4. Data standardization. To establish the comparability of the data, the standardized method is used to normalize the input data.
5. Model training. The loss function used in the training process is the Cross-Entropy Loss, and the optimization algorithm adopted is the Stochastic Gradient Descent. Dropout and Batch Normalization are used to improve the training performance.
6. Model testing. The trained model is tested on the test set. The purpose of the model testing phase is to verify the generalization ability of the model, and the recognition accuracy of the model to PD data can be obtained.  
The overall flow chart of PD recognition based on the MobileNets convolution neural network designed above is shown in Figure 6.