Author Login Chief Editor Login Reviewer Login Editor Login Remote Office

Computer Engineering ›› 2025, Vol. 51 ›› Issue (6): 338-348. doi: 10.19678/j.issn.1000-3428.0069285

• Development Research and Engineering Application • Previous Articles     Next Articles

Metal Surface Defect Detection Method Based on TCM-YOLO Network

ZHAO Xiaohu1,2, XIE Lixun1,2,*(), MU Dengcong1,2, ZHANG Yue1,2   

  1. 1. School of Information and Control Engineering, China University of Mining and Technology, Xuzhou 221008, Jiangsu, China
    2. National and Local Joint Engineering Laboratory of Internet Application Technology on Mine (China University of Mining and Technology), Xuzhou 221008, Jiangsu, China
  • Received:2024-01-23 Online:2025-06-15 Published:2025-06-05
  • Contact: XIE Lixun

基于TCM-YOLO网络的金属表面缺陷检测方法

赵小虎1,2, 谢礼逊1,2,*(), 慕灯聪1,2, 张悦1,2   

  1. 1. 中国矿业大学信息与控制工程学院, 江苏 徐州 221008
    2. 矿山互联网应用技术国家地方联合工程实验室(中国矿业大学), 江苏 徐州 221008
  • 通讯作者: 谢礼逊

Abstract:

Surface defect detection in metal production and manufacturing suffers from problems of low detection accuracy and slow processing speed. To address these problems, this study proposes a metal defect detection method based on an improved You Only Look Once version 8 (YOLOv8) network (TCM-YOLO). This method enhances the coordinate attention mechanism to the Three-Channel Coordinate Attention (TCCA) mechanism and combines it with a second version of the deformable convolutional network, i.e., the Three-channel Deformable Convolution Network (TDCN), thereby enhancing the feature extraction ability of the network. In the feature fusion network, a bidirectional feature pyramid and Dynamic Snake Convolution (DSC) are combined to improve the missed detection rate in steel strip defect detection, and to improve the retention of tiny texture and complex defect structure information. The Minimum Point Distance Intersection over Union (MPDIoU) loss function is used to replace the original loss function to accelerate the convergence speed and improve regression accuracy. Finally, a global attention mechanism is embedded to continuously capture important information regarding the global shape of the defect. Experimental results show that the average accuracy of the TCM-YOLO algorithm on the steel strip defects dataset of Northeastern University is 81.8%, which is 7.4 percentage points higher than that of the original YOLOv8 algorithm, and the accuracy reaches 78.3%, which is 8.9 percentage points higher than that of the original model. The detection speed of the algorithm reaches 61.73 frame/s. On the Tianchi aluminum profile defect dataset, the average accuracy is 4.1 percentage points higher than that of the original YOLOv8 algorithm and 8.7 percentage points higher than that of the original model. The results show that the TCM-YOLO algorithm has high detection accuracy and fast detection speed, which improves the detection capability for metal surfaces.

Key words: defect detection, object detection, YOLOv8 algorithm, attention mechanism, loss function

摘要:

针对金属生产制造中表面缺陷检测环节存在检测准确率低、处理速度慢等问题, 提出一种基于改进YOLOv8网络的金属缺陷检测方法(TCM-YOLO)。该方法改进坐标注意力机制为三通道坐标注意力机制(TCCA), 并与第2版可变形卷积网络相结合改进为三通道可变形卷积网络(TDCN), 增强网络的特征提取能力。在特征融合网络中采用双向特征金字塔与动态蛇形卷积(DSC)相结合的方法, 改善网络对于带钢缺陷检测的漏检率, 更好地保留缺陷微小纹理和复杂结构的信息。采用最小点距离交并比(MPDIoU)损失函数替换原来的损失函数加快收敛速度和获得更准确的回归结果, 最后嵌入全局注意力机制, 以不断地捕获缺陷全局形态的重要信息。实验结果表明, TCM-YOLO方法在东北大学带钢缺陷数据集上的平均精度达到了81.8%, 相比于原始的YOLOv8算法提高了7.4百分点, 精确率达到了78.3%, 相比于原模型提升了8.9百分点, 算法检测速度达到61.73帧/s, 在天池铝型材缺陷的数据集上平均精度相比于原始的YOLOv8算法提高了4.1百分点, 精确率相比于原模型提升了8.7百分点。结果表明了TCM-YOLO算法具有检测精度高、检测速度快的特点, 能更好地满足金属表面实际检测需求。

关键词: 缺陷检测, 目标检测, YOLOv8算法, 注意力机制, 损失函数