A Lightweight Steel Defect Detection Method Based on YOLOv7
In order to reduce the computational cost of the model and improve the accuracy of steel defect detection,a lightweight steel defect detection method is proposed based on the YOLOv7 framework.A de-formable convolutional DCN is designed,which replaces the traditional convolution module and ELAN module in the backbone network with deformable convolution,and fuses the backbone feature extraction network with the deformable convolution,which improves the detection accuracy of multi-scale defect tar-gets while reducing the number of parameters and calculations of the model.Secondly,the CA attention mechanism was introduced into the reconstructed backbone feature extraction network to improve its posi-tioning ability to extract the key features of steel defects in complex environments.Finally,in order to solve the problem of serious loss of feature information of small defects on the steel surface during feature extrac-tion,the shallow weighted feature fusion network SFPN was introduced,which took the deep feature map as the output,and effectively used the shallow feature information to improve the identification accuracy of small defects.Ablation and comparison experiments on the NEU-DET dataset show that compared with YOLOv7,the mAP is increased by 8.5% when the IoU is set to 0.5,and compared with the YOLOv7-W6 algorithm with higher detection accuracy in the YOLOv7 series,the mAP is increased by 2.6% and the de-tection speed has been increased by 2.5 times when the model parameters are about 1/3,it is a good bal-ance between the accuracy and speed of the algorithm.