To address the problems of complex background, different sizes and easy to miss and mis-detect in the detection of surface defects in hot-rolled strip, an improved YOLOv5l-based method for detecting surface defects in hot-rolled strip is proposed. Firstly, by adding the SimAM attention mechanism module to the aggregation network, the important information is focused with high weights to improve the recall rate of the original algorithm; secondly, by replacing all C3 modules in the YOLOv5l structure with C2F, a richer gradient of information flow is obtained to improve the accuracy rate of the original algorithm. The experimental results show that the average detection accuracy using the improved YOLOv5l improves by 5.3% and the accuracy rate by 8.3% compared to the original network, resulting in higher detection accuracy and lower error and miss detection rates, meeting the requirements of hot-rolled strip steel inspection in industrial manufacturing.