# A GIS Partial Discharge Defect Identification Method Based on YOLOv5
## 3 GIS Defect PD Pattern Recognition Based on YOLOv5 Algorithm  
### YOLOv5 Detection Algorithm  
YOLO series algorithm is a typical deep image recognition algorithm based on deep learning neural network, which has higher detection accuracy and needs less detection time compared with SSD and R-CNN target detection algorithms. Currently, the YOLO algorithm has been widely used in the field of transmission line image target detection in power systems. The YOLO algorithm was originally proposed by [PERSON] [12] and  
Figure 3: PRPD maps of grayness. (**a**) normal, (**b**) insulating void defects, (**c**) free metal particle defects, (**d**) metal tip defects, (**e**) floating electrode defects.  
others as a one-target detection algorithm. It transforms the target detection problem into a regression problem by dividing the picture into a grid and predicting the target by the grid. Subsequently, [PERSON] et al. [13] improved the YOLO algorithm and proposed the YOLOv2 algorithm, which uses Darknet-19 as a feature extraction network and improves the recall of the algorithm by introducing an anchor frame mechanism. In 2018, [PERSON] et al. [14] again improved the YOLOv2 algorithm by proposing the YOLOv3 algorithm, which changed the feature extraction network to Darknet-53 greatly improving the target detection efficiency and accuracy. YOLOv4 algorithm is a new target detection algorithm proposed by [PERSON] et al. [15] in 2020. The backbone of the algorithm's CSPDarknet53 is obtained by combining cross stage partial network (CSPNet) with Darknet53, while adding pyramid pooling structure (SPP) combined with path aggregation network (PANet) to form YOLOv4 feature extraction network, which has a huge improvement in accuracy compared to YOLOv3.  
YOLOv5 algorithm, as a representative of single-stage detection algorithm, has the advantages of simple procedures, small amount of code, fast detection speed, and high detection accuracy, has become the preferred option of target detection algorithm. The network structure of YOLOv5 is shown in Figure 4. YOLOv5 continues to use the CSP structure compared to YOLOv4, and adds the CSP structure to the backbone and Neck to enhance the feature fusion capability of the network. The backbone part of YOLOv5 uses the Focus network structure to perform slicing operations on the feature maps, allowing the input channels to be expanded by a factor of four, reducing the computational effort of the algorithm and increasing the computational speed. In the previous YOLO series, each real frame corresponds to one positive sample at training time, each real frame is predicted by only one prior frame at training time. However, in YOLOv5, in order to speed up the training efficiency of the model, the number of positive samples is increased, and each real frame can be predicted by multiple prior frames during training. Unlike previous versions of the YOLO series, YOLOv5 is available in four configurations: YOLOv5s, YOLOv5m, YOLOv5l, and YOLOv5x [16]. The main variations of these four structures are achieved by adjusting the depth multiplier and the width multiplier by setting different numbers of residual components in each cross stage partial networks (CSPN) to obtain networks of different depths, and setting different numbers of convolution kernels in the focusing structure and each CSPN to obtain networks of different widths. Table 1 shows the parameters of the YOLOv5 series network structure.  
Figure 4: Flow chart of primary diagnosis based on deep forest.  
In this paper, YOLOv5m is selected as the target detection network for GIS partial discharge defects. YOLOv5m has a deeper network depth and larger network width than YOLOv5s, which increases the computational time but also increases the relative computational accuracy. Since GIS partial discharge defect map has no complex background to affect the detection effect, the use of YOLOv5m network can be well adapted to the construction of GIS partial discharge defect detection model.