Abstract:To address the problem of low detection accuracy due to complex target-background interactions and insufficient feature processing capability of existing algorithms in steel surface defect detection, an improved detection algorithm YOLO11n-SRA was proposed. Firstly, the SHSA attention mechanism was introduced to replace the PSA attention mechanism in the C2PSA module in order to improve the detection efficiency and accuracy of small targets. Secondly, in the neck network, the RCM module was embedded into the C3k2 module, utilizing its context capturing and feature enhancement capabilities to improve multi-scale detection performance. Thirdly, the ATFL loss function was introduced to effectively alleviate the imbalance between the target and background in defect images in order to enhance the stability of the model training process. Finally, experimental verification was conducted on the NEU-DET and GC10-DET datasets. The contrast experiment and generalization experiment results show that compared to the YOLO11n algorithm, YOLO11n-SRA achieves a 3.4 and 1.6 increase(in percent) in mAP, respectively, 45.8 and 20.6 frame/s increase in FPS, respectively, and 5.1 and 4 increase in percent in recall rate, respectively, with no change in parameter count or computational cost.The improved algorithm strikes a good balance between detection accuracy and efficiency, which provides reference for its improvement and practical deployment.