江汉大学学报(自然科学版) ›› 2022, Vol. 50 ›› Issue (1): 87-96.doi: 10.16389/j.cnki.cn42-1737/n.2022.01.012

• 计算机科学与技术 • 上一篇    

基于改进Faster RCNN的印刷电路板瑕疵检测算法

陈学仕,苏通,漆为民*   

  1. 江汉大学 人工智能学院,湖北 武汉 430056
  • 发布日期:2022-02-22
  • 作者简介:陈学仕(1994— ),男,硕士生,研究方向:计算机视觉、数据科学。

Printed Circuit Board Defect Detection Algorithm Based on Improved Faster RCNN

CHEN Xueshi,SU Tong,QI Weimin*   

  1. School of Artificial Intelligence,Jianghan University,Wuhan 430056,Hubei,China
  • Published:2022-02-22

摘要: PCB 印刷电路板上元器件较多且距离较小,电路走线颜色较为相近。传统检测方法基于机器视觉检测,其算法存在检测速度慢、误检率较多、能够检测出的瑕疵种类较少等问题。基于此,提出了一种基于改进Faster RCNN 的印刷电路板瑕疵检测算法。该算法可以同时检测出漏孔、缺口、断路、短路、毛刺、余铜6 种印刷电路板上的瑕疵。首先,采用Faster RCNN 作为基础检测框架,使用金字塔特征网络(FPN)、多尺度训练、锚点框、聚类作为基础改进措施;其次,以改进后损失函数(DIoU)替换原算法中的smoothL1 损失函数作为边界框定位回归的损失函数;最后,计算出在多种实验条件下的模型平均精度均值(mAP),对各种算法进行了对比。实验结果表明,原算法Faster RCNN 的mAP 为73. 7%,改进后Faster RCNN 的mAP 为95. 1%,相比原算法对印刷电路板瑕疵检测的mAP 上升了21. 4%,相比其他算法具有明显优势。

关键词: 印刷电路板瑕疵检测, Faster RCNN, 神经网络, 损失函数, 多尺度训练

Abstract: There are many electronic components on PCB,the distance between them is small,and the circuit routing color is relatively similar. The traditional method based on machine vision detection has some problems,such as slow detection speed,false detection rate,fewer types of defects that can be detected. Based on this,we propose a defect detection method of printed circuit board based on improved Faster RCNN,which can detect six kinds of defects on printed circuit board:leakage,notch,open circuit,short circuit,burr,and residual copper at the same time. Firstly,the basic detection framework is Faster RCNN,and the basic improvement measures are pyramid feature network(FPN),multiscale training,anchor box,and clustering. Secondly,we replace the smoothL1 loss function in the original algorithm with the improved loss function(DIoU)as boundary box location regression loss function. Finally,we calculate the mean precision(mAP)of the model under various experimental conditions and compare the results of different algorithms. The experimental results show that the mAP of the original Faster RCNN is 73. 7%,and the mAP of the improved Faster RCNN is 95. 1%. Compared with the original algorithm,the mAP of the printed circuit board defect detection model increases by 21. 4%,which has obvious advantages over other algorithms.

Key words: printed circuit board defect detection, Faster RCNN, neural network, loss function, multiscale training

中图分类号: