Mobile Phone Appearance Defect Detection Based on Improved YOLOv5
潘金晶 1曾成 1张晶 1耿雪娜2
扫码查看
点击上方二维码区域,可以放大扫码查看
作者信息
1. 长园视觉科技(珠海)有限公司,广东珠海 519085
2. 长春理工大学计算机科学技术学院,长春 130013
折叠
摘要
提出一种手机外观缺陷检测的改进算法YOLOv5-CBE.该算法在YOLOv5框架的基础上,在主干网络的C3模块中加入坐标注意力(coordinate attention,CA)机制,可同时考虑通道间的关系和位置信息,使模型更准确地定位并识别到目标区域.借鉴加权双向特征金字塔网络(Bidirectional feature pyramid network,BiFPN)的思想,将Neck部分的concat模块替换为多尺度特征融合结构,使不同分辨率的特征更有效地融合.使用Focal-EIoU替代原模型中的边界框回归损失函数CIoU,使回归过程更专注于高质量的预测框,提高了定位精度.在工业相机成相的手机外观缺陷数据集上进行测试,结果表明,与YOLOv5模型相比,基于Focal-EIoU的YOLOv5模型召回率(recall)和平均精度均值(mAP50)分别提升了 4.7%、1.9%;改进算法的精确率(precision)、召回率(recall)、平均精度均值(mean average precision,mAP50)均有明显提升,分别提升了 1.2%、5.6%、5.3%.
Abstract
An improved mobile phone appearance defect detection algorithm-YOLOv5-CBE is proposed.Based on the YOLOv5 framework,the algorithm adds coordinate attention(CA)mechanism in C3 module of backbone network,which can consider the relationship between channels and location information at the same time,so that the model can locate and identify the target area more accurately.According to the idea of Bidirectional feature pyramid network(BiFPN),the concat module of Neck part is replaced with multi-scale feature fusion structure,so that features of different resolutions can be fused more effectively.Focal-EIoU replaces the bounding box regression loss function CIoU in the original model,and the regression process focuses more on high-quality samples and improves positioning accuracy.The test is carried out on the data set of mobile phone appearance defects taken by industrial cameras.The results show that compared with the YOLOv5 model,the recall rate and average accuracy mean(mAP50)of YOLOv5 model based on Focal-EIoU increases by 4.7%and 1.9%respectively.The precision,recall and mean average precision(mAP50)of the improved algorithm all be improved significantly by 1.2%,5.6%and 5.3%respectively.