




















摘" 要: 為了更有效地識別鋼材表面的細小和復雜缺陷,提出一種改進YOLOv8的鋼材表面缺陷檢測算法。首先,在原模型的Neck部分引入空間和通道重構卷積SCConv模塊,提高模型對小尺度目標缺陷的識別能力;其次,將CA注意力機制模塊融合到原始的Backbone中,使模型能夠更好地關注目標缺陷的特征信息;接著,采用高效層聚合網絡(RepGFPN)模塊作為頸部網絡,充分融合不同尺度的特征,提高特征融合能力;最后,引入輕量級上采樣算子CARAFE,進一步提升模型的檢測效果。實驗結果顯示,在公開的NEU?DET數據集上,改進后模型的平均精度均值(mAP)達到了81.1%,相較于原始YOLOv8模型,mAP提高了2.7%,精確率提升了3.9%。與此同時,在GC10?DET數據集上的實驗也表明改進模型具有良好的魯棒性,證明了所提算法能夠有效地完成鋼材表面缺陷的檢測任務。
關鍵詞: 鋼材表面缺陷; 缺陷檢測; YOLOv8算法; 坐標注意力機制; 高效層聚合網絡; 識別能力
中圖分類號: TN911.73?34; TP391.41" " " " " " "文獻標識碼: A" " " " " " " " " " "文章編號: 1004?373X(2025)04?0173?08
Improved YOLOv8 steel surface defect detection algorithm
XU Lianrong, LIANG Shaohua
(School of Computer Science, Yangtze University, Jingzhou 434023, China)
Abstract: In order to more effectively identify the fine and complex defects on the steel surface, an improved YOLOv8 steel surface defect detection algorithm is proposed. The spatial and channel reconstruction convolution SCConv (spatial and channel recon?struction convolution) module is introduced into the Neck part of the original model to improve the model's ability to identify the defects of small?scale target. The CA attention mechanism module is integrated into the original Backbone, so as to make the model can better pay attention to the feature information of the target defect. The high?efficiency layer aggregation network (RepGFPN) module is used as the neck network to fully integrate features of different scales and improve the feature fusion ability. The lightweight upsampling operator CARAFE (content?aware reassembly of features) is introduced to further improve the detection effect of the model. The experimental results show that the average precision (mAP) of the improved model can reach 81.1% on the public NEU?DET dataset, which is 2.7% higher than that of the original YOLOv8 model, and the accuracy is increased by 3.9%. The experiments on the GC10?DET dataset also show that the improved model has good robustness, which proves that the proposed algorithm can effectively complete the detection task of steel surface defects.
Keywords: steel surface defect; defect detection; YOLOv8 algorithm; coordinate attention mechanism; high?efficiency layer aggregation network (RepGFPN); recognition ability
0" 引" 言
鋼材作為一種重要的金屬材料,在機械制造、航空航天等眾多領域中扮演著不可或缺的角色。然而,在實際生產加工過程中,受到原料質量、設備性能及生產工藝等多方面因素的影響,鋼材表面易出現開裂、斑塊等各類缺陷,這些表面缺陷不僅損害了鋼材的外觀質量,還會大幅降低其抗壓性、耐磨性,進而縮短使用壽命。因此,進行有效的鋼材表面缺陷檢測至關重要。
傳統的缺陷檢測方法,如漏磁檢測法[1]、渦流檢測法、人工視覺檢測等,普遍存在效率低下、精度不高、實施難度大等問題?!?br>