DOI: 10.3390/electronics15122730 ISSN: 2079-9292

CNS-YOLOv8: An Improved YOLOv8-Based Defect Detection Method

Runhua Geng, Yuan Jiang, Jin Li, Kaiwen Wu, Yingjian Yang, Ziheng Li, Yaohui Chang

Steel surface defect inspection plays an essential role in maintaining product quality and production safety in industrial manufacturing. However, existing detection methods still encounter difficulties in accurately identifying tiny defects, suppressing interference from complex backgrounds, and balancing detection accuracy with computational cost. To address these challenges, this paper proposes CNS-YOLOv8, an improved defect detection model based on YOLOv8n. First, a C2f_SCConv module is introduced to enhance multi-scale feature extraction and spatial representation capability. Second, a Normalization-based Attention Module (NAM) is embedded after the high-level semantic feature layer to improve the model’s sensitivity to critical defect regions. Third, a SlimNeck structure is adopted to strengthen feature fusion while reducing computational overhead. Experimental results on the NEU-DET dataset demonstrate that CNS-YOLOv8 achieves 83.1% mAP@0.5 and 49.6% mAP@0.5:0.95, surpassing YOLOv8n by 3.9 and 1.2 percentage points, respectively. In addition, comparative experiments show that CNS-YOLOv8 outperforms Faster R-CNN and YOLOv7 in terms of mAP@0.5 while requiring substantially fewer GFLOPs. In general, the proposed method balances detection accuracy and computational efficiency effectively, highlighting its potential for real-time industrial surface defect detection.

More from our Archive