作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2025, Vol. 51 ›› Issue (7): 152-160. doi: 10.19678/j.issn.1000-3428.0069283

• 人工智能与模式识别 • 上一篇    下一篇

基于改进的YOLOv8算法的钢材缺陷检测

彭菊红1, 张弛1, 高谦1, 张光明1, 谈栋华1, 赵明俊2,*()   

  1. 1. 湖北大学人工智能学院, 湖北 武汉 430062
    2. 湖北大学计算机与信息工程学院, 湖北 武汉 430062
  • 收稿日期:2024-01-22 出版日期:2025-07-15 发布日期:2024-06-11
  • 通讯作者: 赵明俊

Steel Defect Detection Based on Improved YOLOv8 Algorithm

PENG Juhong1, ZHANG Chi1, GAO Qian1, ZHANG Guangming1, TAN Donghua1, ZHAO Mingjun2,*()   

  1. 1. School of Artificial Intelligence, Hubei University, Wuhan 430062, Hubei, China
    2. School of Computer and Information Engineering, Hubei University, Wuhan 430062, Hubei, China
  • Received:2024-01-22 Online:2025-07-15 Published:2024-06-11
  • Contact: ZHAO Mingjun

摘要:

在工业场景下钢材表面缺陷检测技术存在检测精度低、收敛速度慢等问题。为此, 提出一种改进的YOLOv8算法YOLOv8n-MDC。首先, 在骨干网络中加入多尺度交叉融合网络(MCN), 通过在特征层之间建立更紧密的连接, 促进信息的均匀传递, 减少跨层特征融合时的语义信息损失, 从而增强模型对钢材缺陷的感知能力; 其次, 在模块中引入可变形卷积, 自适应地改变卷积核的形状与位置, 从而更灵活地捕捉不规则缺陷的边缘特征, 减少信息丢失, 提升检测的准确性; 最后, 加入坐标注意力(CA)机制, 将位置信息嵌入到通道中, 解决了位置信息丢失的问题, 使模型能够更精确地感知缺陷的位置及其形态特征, 从而提升检测的精度和稳定性。在NEU-DET数据集上的实验结果表明, YOLOv8n-MDC算法的mAP@0.5达到了81.0%, 相比原基准网络提升了4.2百分点, 该算法收敛速度较快、精度较高, 更能满足实际工业生产的要求。

关键词: 多尺度交叉融合网络, YOLOv8网络, 坐标注意力机制, 钢材缺陷检测, 可变形卷积

Abstract:

Steel surface defect detection technology in industrial scenarios is hindered by low detection accuracy and slow convergence speed. To address these issues, this study presents an improved YOLOv8 algorithm, namely a YOLOv8n-MDC. First, a Multi-scale Cross-fusion Network (MCN) is added to the backbone network. Establishing closer connections between the feature layers promotes uniform information transmission and reduces semantic information loss during cross-layer feature fusion, thereby enhancing the ability of the model to perceive steel defects. Second, deformable convolution is introduced in the module to adaptively change the shape and position of the convolution kernel, enabling a more flexible capture of the edge features of irregular defects, reducing information loss, and improving detection accuracy. Finally, a Coordinate Attention (CA) mechanism is added to embed position information into channel attention, solving the problem of position information loss and enabling the model to perceive the position and morphological features of defects, thereby enhancing detection precision and stability. Experimental results on the NEU-DET dataset show that the YOLOv8n-MDC algorithm achieves mAP@0.5 of 81.0%, which is 4.2 percentage points higher than that of the original baseline network. The algorithm has a faster convergence speed and higher accuracy; therefore, it meets the requirements of practical industrial production.

Key words: Multi-scale Cross-fusion Network(MCN), YOLOv8 network, Coordinate Attention (CA) mechanism, steel defect detection, deformable convolution