Improved YOLOv7-tiny Lightweight Algorithm for Insulator Defect Detection
In view of problems of low detection speed,high network complexity,and difficulty in accurately detecting small target defects in current insulator defect detection methods,a lightweight insulator defect detection model called P-YOLOv7-tiny is proposed.Firstly,lightweight processing is made on the Efficient Layer Aggregation Network(ELAN)module of the backbone network,and the P-ELAN module is designed to reduce the model parameters and improve the detection speed.Secondly,the Coordinate Attention(CA)mechanism is fused with CSPSPP to design the CA-CSPSPPS module,which allows the model to focus more on insulator defect features and improve the detection accuracy of defects.Finally,the localization loss function(WIoUv3 Loss)is used to calculate the loss,allocating smaller gradient gains to low-quality anchor boxes to reduce harmful gradients and improve the model's localization performance.Experimental results show that P-YOLOv7-tiny can quickly and accurately detect defects,with an mAP@0.5 of 98.3%and a recall rate of 95.3%.The model has 3.1 M parameters and a computational cost of 7.0 GFLOPs.Compared to the original YOLOv7-tiny model,the model parameters are reduced by 48.3%,the computational cost is reduced by 46.9%,and the recall rate is improved by 1.2%.The proposed model is suitable for deploying to edge equipment to detect insulator defects in real time.