Steel surface defect detection is very important in actual production.In order to accurately detect defects,this paper de-signs a steel surface defect detection model based on improved YOLOv7.Firstly,the Ghost module is introduced into the back-bone network structure to enhance the ability of the model to extract features and identify small features while reducing the num-ber of model parameters.Secondly,the attention mechanism is embedded in the pooling module.Finally,the loss function is im-proved by introducing EIOU,so as to better optimize the YOLOv7 network model,which can better deal with the imbalance of samples,so as to achieve better optimization similarity.Experimental results show that,compared with the original model,the mAP of the proposed model increases by 4.2%to 76.9%.The model can meet the needs of accurate detection and identification of steel surface defects.