A Method for Detecting Steel Surface Defects in Complex Backgrounds Based on STC-YOLOv8
Due to the small size of surface defects on the steel and the complexity of the background,traditional detection methods often encounter issues of missed detections and false positives in such scenarios,resulting in low detection accuracy and slow efficiency.This paper proposed an improved method based on the YOLOv8n,referred to as STC-YOLOv8,aimed at improving the accuracy of steel surface defect detection without increasing the time cost.First,the convolutional layers of the backbone network were replaced with SAConv,leveraging its global perspective and large receptive field characteristics to enhance the model's ability to extract features from small targets.Second,the original model's upsampling method was replaced with the CARAFE,which dynamically adjusted the interpolation position to improve the model's ability to extract edge features and similar features.Additionally,a multi-branch re-parameterization module was introduced in the detection head to further enhance the model's feature extraction capability.Finally,considering the small size of the target samples and the difficulty in extracting some target information,a transfer learning strategy was employed to enhance the model's generalization and stability.The experimental results showed that the improved STC-YOLOv8 model achieved a mAP@0.5 of 82.4%on the augmented NEU-DET dataset,which was 3.8%higher than that of the original YOLOv8n model.On the GC10-DET dataset,it achieved an mAP@0.5 of 66%,which was an improvement of 2.9%,demonstrating the effec-tiveness and stability of the proposed method and its capability to meet the practical requirements of steel surface defect detection.