谢翔,肖金球,汪俞成,等.基于改进YOLOv5s的Deep PCB缺陷检测算法研究[J]. 微电子学与计算机,2023,40(7):1-9. doi: 10.19304/J.ISSN1000-7180.2022.0635
引用本文: 谢翔,肖金球,汪俞成,等.基于改进YOLOv5s的Deep PCB缺陷检测算法研究[J]. 微电子学与计算机,2023,40(7):1-9. doi: 10.19304/J.ISSN1000-7180.2022.0635
XIE X,XIAO J Q,WANG Y C,et al. Deep PCB defect detection based on improved YOLOv5s algorithm[J]. Microelectronics & Computer,2023,40(7):1-9. doi: 10.19304/J.ISSN1000-7180.2022.0635
Citation: XIE X,XIAO J Q,WANG Y C,et al. Deep PCB defect detection based on improved YOLOv5s algorithm[J]. Microelectronics & Computer,2023,40(7):1-9. doi: 10.19304/J.ISSN1000-7180.2022.0635

基于改进YOLOv5s的Deep PCB缺陷检测算法研究

Deep PCB defect detection based on improved YOLOv5s algorithm

  • 摘要: 现有PCB缺陷检测方法的精确率较低而且模型复杂度也较高.针对这个问题,提出了基于改进YOLOv5s的Deep PCB缺陷检测算法. 该算法在颈部网络(Neck)的C3层后添加了卷积注意力模块(Convolutional Block Attention Module,CBAM),对小目标的检测建立特征映射关系,对特征图进行注意力重构,赋予了小目标更高的特征权重,提高网络对印刷电路板(Printed Circuit Board,PCB)图像中小目标的特征提取能力. 为了从根本上解决目标特征冗余的问题,实现网络的轻量化,并且确保网络检测的精确度,提出使用Ghost Conv 模块替换Conv模块,同时将 C3 模块改为 Ghost Bottleneck 模块. 使用有效交并比损失(EIOU Loss)函数代替完全交并比损失(CIOU Loss)函数,减小了预测框宽高与置信度的真实差值,减少了网络的回归损失.使用上海交通大学图像处理与模式识别研究所公开的Deep PCB数据集开展实验,结果表明本文算法相较于YOLOv5s,在IOU=0.5时,mAP提升了6.8%,速度提升了4.7 Fps,模型大小减少了2.9 M,计算量减少了2.8 G.

     

    Abstract: The existing PCB defect detection methods have low accuracy and high model complexity. To solve this problem, a Deep PCB defect detection algorithm based on improved YOLOv5s is proposed. The algorithm adds CBAM attention mechanism after C3 layer of the Neck network, establishes feature mapping relationship for small target detection, reconstructs attention on feature map, endows small targets with higher feature weight, and improves the network’s feature extraction ability for small targets in PCB. In order to fundamentally solve the problem of target feature redundancy, realize the lightweight of the network, and ensure the accuracy of network detection, it is proposed to replace the Conv module with the Ghost Conv module, and change the C3 module to the Ghost Bottleneck module. The EIOU Loss function is used to replace the CIOU Loss function, reducing the real difference between the width and height of the prediction frame and the confidence level, and reducing the regression loss of the network. Experiments are carried out using the Deep PCB dataset published by the Image Processing and Pattern Recognition Research Institute of Shanghai Jiao Tong University. The results show that compared with YOLOv5s, when IOU=0.5, the mAP of this algorithm is increased by 6.8%, the speed is increased by 4.7 Fps, the model size is decreased by 2.9 M, and the calculation amount is reduced by 2.8 G.

     

/

返回文章
返回