>> English >> Current Issue >> CONTENTS >> 正文
Study on steel surface defect detection algorithm based on improved YOLOv7
Time: 2026-04-28 Counts:

DENG C, ZHAO Y K, HU L L, et al.Study on steel surface defect detection algorithm based on improved YOLOv7[J].Journal of Henan Polytechnic University(Natural Science) ,2026,45(3):21-29.

doi:10.16186/j.cnki.1673-9787.2023100021

Received:2025/05/10

Revised:2025/08/18

Published:2026/04/28

Study on steel surface defect detection algorithm based on improved YOLOv7

Deng Chao, Zhao Yongkun, Hu Lanlan, Sun Junling, Wang Weidong

School of Physics and Electronic Information Engineering, Henan Polytechnic University, Jiaozuo 454003, Henan, China

Abstract: Objectives To improve the detection ability of steel surface defects in industry, a steel surface defect detection algorithm based on improved YOLOv7 was proposed.  Methods Aiming at the problem that the original model of YOLOv7 was not good at detecting small target defects,the SPPCSPC module in the original feature fusion network was combined with the BiFormer attention mechanism was combined with the SPPCSPC module in the original feature fusion network, the dynamic query aware attention was introduced, the ability of the network to capture long-distance context dependencies was enhanced, the ability of the network to extract features was improved. An effective loss calculation method NWD for small targets was introduced to avoid the sensitivity of IoU caused by the discrete change of the bounding box, the detection accuracy was improved by improving the number of positive samples corresponding to small targets. The ability of the model to detect the defects of small targets was emphasized by the above two improvement strategies, when used at the same time, the detection effect of the model for medium target defects and large target defects would be affected. In order to better detect defect targets of different sizes on steel surfaces, the lightweight up-sampling operator CARAFE was introduced to increase the up-sampling field of view. At the same time, the adaptive kernel was dynamically generated according to different instances, the ability of the network to detect objects of different sizes was balanced, the overall detection effect of the model was improved to the best.  Results On the GC10-DET dataset, compared with the original YOLOv7 algorithm, the improved algorithm proposed in this paper increased mAP@0.5 by 3.1%, mAP@0.50.95 by 5.3%, the precision by 6.6%, and the recall rate by 5.5%, which also hasd good real-time performance.  Conclusions Compared with the mainstream target detection algorithm and advanced steel surface defect detection algorithm, the improved algorithm proposed in this paper has d better comprehensive advantages, and could realize efficient steel surface defect detection.

Key words:steel surface defect detection;BiFormer attention mechanism;NWD;CARAFE

Lastest