| With the increasing demand for electricity,in order to ensure the operation safety of the power grid,whether insulators have faults is the focus of line inspection work.Therefore,how to efficiently and quickly detect the defects of insulators is a topic worthy of research.Considering the real-time nature of insulator defect detection,this article uses the lightweight YOLOv4-tiny as the basic model,but there are still the following problems:(1)Lack of data sets containing a large number of insulator defect images affects the robustness of the training model;(2)The imbalance in the number of positive and negative samples and incomplete candidate frame removal lead to difficulty in model fitting and low detection efficiency;(3)Inadequate feature extraction in backbone networks and incomplete feature fusion between different scales lead to a high rate of missed and erroneous detection of models.In response to the above issues,this article proposes the following solutions:(1)Construct an insulator defect image dataset.First,insulator defects are segmented from the image,followed by image fusion with normal insulators,and then a dataset containing 3000 insulator defect images is formed using image preprocessing and image enhancement methods.(2)A defect detection model based on improved weighted loss function and an adaptive threshold is proposed.Aiming at the model fitting problem caused by the uneven number of positive and negative samples for small targets,this paper replaces the binary cross entropy loss function in classification loss with Focal Loss and uses weighted summation classification,location,and confidence loss as the final loss function to improve the algorithm performance.In addition,non-maximum suppression adaptive thresholds are designed to optimize the selection of overlapping target frames in the case of dense insulators and improve the detection accuracy of the algorithm.The experimental results on a self-built insulator defect detection dataset show that the proposed detection model m AP is 91.41%,which is 1.94% higher than the YOLOv4-tiny original model.(3)An improved defect detection model based on attention mechanism and feature fusion is proposed.Firstly,this algorithm introduces an external multi-head attention mechanism to solve the problem of weak feature extraction ability of small targets in backbone networks;In addition,by improving the feature pyramid structure,the fusion of deep and shallow feature maps is enriched,and the expression ability of model features is optimized.The experimental results on a self-built dataset show that the improved model has a 4.29% improvement in m AP and a 10.06% improvement in Recall for defect locations compared to the YOLOv4-tiny model,effectively improving the detection accuracy and significantly improving the occurrence of missed and false detections.In summary,the method proposed in this paper can be used as a reliable tool for insulator defect detection in transmission lines.It provides reliable theoretical support for the intelligent development of patrol inspection equipment and has good application value for ensuring the safety of power grid operation. |