首页|基于改进YOLOv7的轻量级钢材缺陷检测

基于改进YOLOv7的轻量级钢材缺陷检测

扫码查看
为了降低模型的计算成本,提高钢材缺陷检测的准确度,基于YOLOv7框架,提出了一种轻量级钢材缺陷检测方法.设计了一种可变形卷积DCN,将主干网络中的传统卷积模块和ELAN模块替换为可变形卷积,将主干特征提取网络与可变形卷积融合,在降低模型的参数量和计算量的同时提高了多尺度缺陷目标的检测精度.在重构的主干特征提取网络中引入CA注意力机制,提高其在复杂环境中提取钢材缺陷关键特征的定位能力.针对提取特征时钢材表面小缺陷特征信息丢失严重的问题,引入浅层加权特征融合网络SFPN,以深层特征图作为输出,同时有效利用浅层特征信息,提高小缺陷的识别准确率.在NEU-DET数据集上做消融和对比实验,结果表明,该方法相较于YOLOv7,在IoU设置为0.5时mAP提升了8.5%,相较于YOLOv7系列中检测精度更高的YOLOv7-W6算法,在模型参数约为其1/3的情况下,mAP值提高2.6%,检测速度提升了2.5倍,很好地平衡了算法的精度和速度.
A Lightweight Steel Defect Detection Method Based on YOLOv7
In order to reduce the computational cost of the model and improve the accuracy of steel defect detection,a lightweight steel defect detection method is proposed based on the YOLOv7 framework.A de-formable convolutional DCN is designed,which replaces the traditional convolution module and ELAN module in the backbone network with deformable convolution,and fuses the backbone feature extraction network with the deformable convolution,which improves the detection accuracy of multi-scale defect tar-gets while reducing the number of parameters and calculations of the model.Secondly,the CA attention mechanism was introduced into the reconstructed backbone feature extraction network to improve its posi-tioning ability to extract the key features of steel defects in complex environments.Finally,in order to solve the problem of serious loss of feature information of small defects on the steel surface during feature extrac-tion,the shallow weighted feature fusion network SFPN was introduced,which took the deep feature map as the output,and effectively used the shallow feature information to improve the identification accuracy of small defects.Ablation and comparison experiments on the NEU-DET dataset show that compared with YOLOv7,the mAP is increased by 8.5% when the IoU is set to 0.5,and compared with the YOLOv7-W6 algorithm with higher detection accuracy in the YOLOv7 series,the mAP is increased by 2.6% and the de-tection speed has been increased by 2.5 times when the model parameters are about 1/3,it is a good bal-ance between the accuracy and speed of the algorithm.

steel defect detectionlightweightdeformable convolutionattention mechanismmultiscaleSFPN

秦宇、张雷

展开 >

江苏理工学院电气信息工程学院,常州 213001

钢材缺陷检测 轻量级 可变形卷积 注意力机制 多尺度 SFPN

2024

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

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

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