# A GIS Partial Discharge Defect Identification Method Based on YOLOv5
## 4 GIS Partial Discharge Defect Detection Algorithm
### Model Training and Testing Effects
#### 4.2.2 Comparison of Training Methods  
In this paper, different combinations of three training techniques of Mosaic data enhancement, cosine annealing decay, and smoothing labels, are used in the detection of GIS partial  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Learning Step**} & \multicolumn{4}{c}{**Model Parameter**} \\ \cline{2-5}  & **Training Sample** & **Batch-Size** & **Learning Rate** & **Epoch** \\ \hline Freeze & 3435 & 16 & \(1\times 10^{-3}\) & 50 \\ Unfreeze & 3435 & 8 & \(1\times 10^{-4}\) & 50 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Parameters for model training.  
\begin{table}
\begin{tabular}{c c} \hline \hline \multicolumn{1}{c}{**Project**} & \multicolumn{1}{c}{**Environment**} \\ \hline Operating System & Windows10 (\(\times\)64) \\ CPU & Intel Xeon E5-2678 v3 \\ GPU(MB) & NVIDIA GeForce GTX3080 Ti (16 G) \\ RAM & 64 G \\ Python & 3.9.1 \\ CUDA & 11.1 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Experimental environment configuration.  
Figure 9: Sample markers of PD defects maps. (**a**) metal tip defects (**b**) insulating void defects, (**c**) floating electrode defects. (**d**) free metal particle defects.  
discharge defects. According to the ratio of test set to validation set 9:1, 3435 samples were selected as the training set and 425 samples as the validation set to compare and analyze the model detection effect and detection efficiency under different training methods.  
From Table 4, it can be seen that the best training results are obtained when both cosine annealing decay and label smoothing are used [29]. When the Mosaic data enhancement technique is used, a significant decrease in the mAP values of the training results can be seen. This is because Mosaic data enhancement increases the complexity of model training. The GIS partial discharge defect map background is relatively homogeneous and the defect features are relatively obvious, which makes the Mosaic data enhancement technique have a negative impact in GIS model prediction. Therefore, the optimal detection model can be obtained by using the technique of training with a combination of cosine annealing decay and label smoothing in the GIS partial discharge defect detection model training. The Loss decline curves for each Epoch during training and validation is shown in Figure 10. In 100 training rounds, the training loss values tend to decrease with the overall course of iterations. The loss values level off in the last few Epochs and the model gets the optimal weights. Using this model to detect the defects of GIS partial discharge, the mAP value can reach 95.87%.  
By analyzing the effects of the detection environment and training techniques of the YOLOv5 algorithm on the testing effect of the GIS partial discharge defect detection model, the GIS partial discharge detection model under the optimal parameter settings was finally obtained. The partial discharge defects are detected using the test set obtained from the GIS partial discharge defect simulation experiments, and the detection results are shown in Figure 11. It can be seen that the YOLOv5 model proposed in this paper can effectively detect and identify the GIS partial discharge defect category. The time of partial discharge and the defect type of partial discharge can be clearly obtained through the detection results.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**Group**} & \multicolumn{4}{c}{**Training Methods**} & \multirow{2}{*}{**mAP/\%**} & \multirow{2}{*}{**FPS**} \\ \cline{2-2} \cline{5-6}  & **Mosaic** & **Cos** & **Label-s** & & \\ \hline
1 & \(\times\) & \(\times\) & \(\times\) & 94.28 & 25.36 \\
2 & \(\times\) & ✓ & \(\times\) & 95.07 & 27.46 \\
3 & \(\times\) & ✓ & ✓ & 95.89 & 28.89 \\
4 & ✓ & ✓ & ✓ & 91.73 & 26.53 \\ \hline \hline \end{tabular}
\end{table}
Table 4: Comparison of training methods.  
Figure 10: Loss curves for model training and validation.