Aiming at the problem of defect detection in aerial insulator images under complex background, an insulator defect detection method AL-YOLOv7 (Attention Mechanism and Loss Function Based on YOLOv7) is proposed to improve YOLOv7 based on loss function and attention mechanism. Firstly, YOLOv7 network is constructed, and the dataset is preprocessed by CLAHE image enhancement method, so that the image contrast is enhanced, the features are more obvious, and the salience of defects is improved in the complex background; then three kinds of attention modules are added in front of the network layer of the neck feature fusion, to enhance the network's ability of extracting the image features under the situation of the background complexity and variability and the existence of more interfering information; the experimental The experimental results show that adding the CA attention module has the best effect; finally, the loss function is optimized, and the networks after replacing the five different loss functions are trained separately, and the experimental results show that using the Focal-EIOU loss function instead of the CIOU loss function enhances the network's ability to distinguish between difficult and easy samples, which in turn improves the network's detection performance. The average accuracy of the improved AL-YOLOv7 network model is 82.52%, which is 3.5% higher than that of the original YOLOv7 network, and effectively improves the situation of missed and wrong detection.
Jianfeng ZhengHang WuHan ZhangZhaoqi WangWeiyue Xu
Wenpei HouYing WangZhenkun WangJunhao ZhaoYinghao Liao
Bing LiMingjie XuZhongxin XieDonglian QiYunfeng Yan