# A Visual Fault Detection Algorithm of Substation Equipment Based on Improved YOLOv5
## 1 Introduction
[37] introduced the Path Aggregation Network (PANet) into YOLOv4 to enhance insulator defect detection and used focal loss as the loss function. [PERSON] et al. [38] improved the YOLOv3 model to enhance the detection accuracy of power equipment infrared images with similar ripple patterns. They introduced the Cross-Stage Partial module, which integrates the pathway aggregation network into the feature pyramid structure of the original model. [PERSON] et al. [38] proposed the model compression algorithm ED-YOLO, which achieves obstacle avoidance in power line inspections with high accuracy and fast recognition speed. The logistic regression-based object detection algorithm solves detection as a regression problem, simplifying the training process and improving detection speed [39]. It is a practical solution for performing object detection tasks that meet the real-time requirements of power recognition scenarios, especially in edge computing applications. Currently, deep neural networks face challenges in object detection, particularly in complex scenarios like power systems, industrial equipment, and outdoor environments. The distinction between the target and its surroundings is not significant. The original model struggles to differentiate pixels and detect distant targets that cannot be approached closely. Factors such as outdoor weather make it difficult to effectively capture the target for detection. Issues include poor robustness, weak ability to detect small targets in noisy environments, and ineffective target recognition. There is a need for a method applicable in substation scenarios to identify target image features and enhance model capabilities. In the early stage, we investigated the latest works of the YOLO series, YOLOv5, YOLOv7, and YOLOv8. Compared to YOLOv5, YOLOv7 added Spatial Pyramid Pooling (SSP) module and Spatial Attention Module (SAM) modules. However, compared to YOLOv5, v7 has slightly slower detection speed and requires more training time but has higher accuracy. YOLOv8 is larger than the YOLOv5 model and has relatively slowertraining speed. Although it is similar to the comparison between YOLOv7 and v5 in terms of accuracy, for detection speed and deployment scenarios, such as inspection tasks, autonomous driving, intelligent video surveillance, etc., YOLOv5 is more suitable for fast detection scenes. YOLOv5 is a deep learning-based object detection model that operates in real time and with high efficiency. It offers advantages such as fast training speed, high detection accuracy, and adaptability to various datasets. Figure 1 illustrates the process of reading image and video data through input. The backbone network employs convolution operations to extract features from the input image. The neck section further extracts features by utilizing multiple layers of convolutional operations and merging feature maps from different levels. Ultimately, three feature maps of varying scales are produced as output. The output component converts these feature maps into object detection results, which include target positions and class information. Compared to traditional object detection algorithms, the YOLO-series algorithms are highly efficient, fast, and scalable. Among the YOLO-series algorithms, YOLOv5 stands out for its high stability, wide range of applications, and utilization of multiple resources. This paper presents improvements to the YOLOv5 algorithm without significantly increasing its parameter size compared to the original version. In light of the issues faced by current defect detection models, such as susceptibility to external environmental interference, inadequate recognition performance for devices of varying scales in real power scenarios, and incomplete feature extraction, this paper presents the following contributions: (1) Incorporating a variable convolution module into YOLOv5's backbone network to enhance the capture of finer details in the feature map.