| With the continuous promotion and application of new technologies such as artificial intelligence and deep learning,the steel surface defect detection technology further develops in the direction of intelligence,automation and digitalization,and the steel surface defect detection technology based on deep learning is gradually becoming one of the hot spots for research.In this thesis,we combine the critical problems of steel surface defects and use YOLOv5 as the base model for optimization and improvement based on deep learning technology,aiming to improve the accuracy and efficiency of steel surface defect detection.Two publicly available steel datasets(NEU-DET,GC10-DET)are used to verify the effectiveness of the improved model for steel surface defect detection,and the public typical target dataset PASCAL VOC2012 is used to verify the generalization ability of the model.The main findings of this thesis are as follows.Multilayer fusion network combining residual and attention mechanism: To address the problems of insufficient feature extraction ability,restricted model perceptual field and insufficient feature fusion of the original YOLOv5 model,a multilayer fusion detection algorithm combining residual and attention mechanism is proposed.The method constructs a SPP_Res feature pyramid structure with residual edges to accelerate the training speed of the model and enhance its feature extraction capability;incorporates a multi-headed attention mechanism(C3_MHSA),which optimizes the network structure,focuses on the global perceptual field,and extracts richer target features;introduces a multilayer feature fusion mechanism to further fuse shallow and deep features,taking into account more location,semantic and detail information to improve the detection accuracy of the network for steel surface defects.The experimental results show that the improved YOLOv5 network model has good detection performance,with mAP reaching 74.1% on the NEU-DET dataset,which is3.4% higher than the original YOLOv5 network,4.0% higher than YOLOX,8.6% higher than YOLOv3,and 23.4% higher than the SSD algorithm.The detection speed is better than other mainstream algorithms,and it can detect steel surface defects quickly and accurately while keeping the original detection speed largely unchanged.Lightweight network incorporating Swin Transformer and decoupling head: The multilayer fusion network combining residuals and attention mechanism has not been able to improve the speed and reduce the number of model parameters,despite the improvement in detection accuracy.To address this problem,a lightweight network model(SGD-YOLOv5)incorporating Swin Transformer and decoupling headers is proposed,which promotes global and local information interaction and enhances feature extraction capability by introducing Swin Transformer module to replace the C3 module combined with the backbone network part;adopting the lightweight network GhostNet The decoupled head structure separates the classification and regression tasks,which greatly accelerates the convergence speed of the model and improves the detection effect.The experimental results show that the new model achieves 70.9% mAP on GC10-DET dataset,which is 1.6% higher mAP,28.3% less parameters,and 16.6 FPS faster detection speed compared with the original YOLOv5 network model,achieving higher accuracy,faster speed,and lighter detection of steel surface defects. |