首页|改进YOLOv5s算法的带钢表面缺陷检测

改进YOLOv5s算法的带钢表面缺陷检测

扫码查看
针对带钢表面缺陷小目标检测精度低以及检测效率低等问题,提出了一种基于YOLOv5 s的带钢表面缺陷检测算法.首先,增加一个大尺度预测层,通过更丰富的位置信息提高小目标缺陷的检测效果,减少漏检和误检的问题;其次,将Shuffle Netv2轻量化骨干网络替换原来的CSPDarknet53网络结构,降低模型参数数量,加快模型推理速度;然后,在特征提取网络末端添加基于Transformer编码的C3 TR模块以及在特征融合网络中添加CA注意力机制,增强网络对缺陷的特征提取能力;最后,引入WIoU损失函数来取代GIoU,提高回归精度.实验结果表明,改进后的YOLOv5s算法在武汉某钢厂采集的带钢表面缺陷数据集上平均准确率(mAP)达到92.2%,较原始YOLOv5s提高了4.7%,检测速度FPS达到了82,具有较高检测精度.并引入公开数据集进行泛化实验,结果均有显著提升,进一步满足了对带钢表面缺陷检测的需求.
Improved YOLOv5s Strip Surface Defect Detection Method
Aiming at the issues of low accuracy and efficiency in detecting small target defects on the surface of steel strips,a novel steel strip surface defect detection algorithm based on YOLOv5s is proposed.Firstly,a large-scale prediction layer is added to enhance the detection performance of small target defects by providing richer positional information and reducing the problems of missed detection and false alarms.Secondly,the lightweight ShuffleNetv2 backbone network is employed to replace the original CSPDarknet53 network struc-ture,reducing the number of model parameters and accelerating the inference speed.Furthermore,the C3TR module based on Transformer encoding and the CA attention mechanism are added to the feature fusion network at the end of the feature extraction network to enhance the feature extraction capability for defect detection.Lastly,the WIoU loss function is introduced to replace the GIoU loss,improving the regression accuracy.The experimental results show that the average accuracy (mAP) of the improved YOLOv5s algo-rithm on the strip surface defect dataset collected by a steel mill in Wuhan reaches 92.2%,which is 4.7%higher than that of the original YOLOv5s,and the detection speed and FPS reach 82,which has high detec-tion accuracy.In addition,the public dataset was introduced for generalization experiments,and the results were significantly improved,which further met the demand for strip surface defect detection.

steel surface defectsYOLOv5sShuffle Netv2C3TR moduleCA attention mechanismWIoU loss function

王林琳、龚昭昭、梁泽启

展开 >

湖北工业大学机械工程学院,武汉 430068

钢材表面缺陷 YOLOv5 s Shuffle Netv2 C3 TR模块 CA注意力机制 WIoU损失函数

2024

组合机床与自动化加工技术
大连组合机床研究所 中国机械工程学会生产工程分会

组合机床与自动化加工技术

CSTPCD北大核心
影响因子:0.671
ISSN:1001-2265
年,卷(期):2024.(12)