针对目前焊缝缺陷数据集少,检测环境恶劣,人为识别困难等问题,提出了一种改进的YOLOv7-tiny算法.由于检测物体缺陷形状不规则,采用可变形卷积能够学习到更加丰富的特征信息和感知到物体的细节信息,增强了模型的表达能力和泛化能力;为了在提高焊缝缺陷检测速度的同时,不降低准确率,满足工厂实时性的要求,提出了一种融合轻量化卷积和注意力机制的ELAN-PCS 网络结构;为了解决中小目标检测困难,很容易出现漏检的情况,引入了通道注意力机制.实验结果表明,与原 YOLOv7-tiny 相比,改进模型在大型铸件焊缝缺陷数据集上 mAP(0.5)提升1.8%、mAP(0.5~0.95)提升6.8%,模型参数量下降1.9 M.
Improved YOLOv7-tiny Lightweight Large Casting Weld Defect Detection
An improved YOLOv7-tiny algorithm is proposed to solve the problems of few weld defect data sets,poor detection environment and difficult artificial recognition.Due to the irregular shape of the detec-ted object defect,the deformable convolution can learn more abundant feature information and perceive the detail information of the object,which enhances the expression ability and generalization ability of the mod-el.In order to improve the detection speed of weld defects without reducing the accuracy and meet the real-time requirements of the factory,an ELAN-PCS network structure combining lightweight convolution and attention mechanism is proposed.In order to solve the difficulty of small and medium target detection,it is easy to miss detection,and the channel attention mechanism is introduced.The experimental results show that compared with the original YOLOv7-tiny,the improved model increases mAP(0.5)by 1.8%and mAP(0.5~0.95)by 6.8%on the large-scale casting weld defect dataset,and the number of model pa-rameters decreases by 1.9 M.