Computer Engineering and Applications ›› 2023, Vol. 59 ›› Issue (10): 236-243.DOI: 10.3778/j.issn.1002-8331.2211-0143

• Graphics and Image Processing • Previous Articles     Next Articles

Research on PCB Defect Detection Algorithm Based on YOLOX-WSC

TUO Bing, HUANG Liwen, TANG Xin, CHEN Lieyong, ZHOU Jing   

  1. 1.School of Electrical and Electronic Engineering, Chongqing University of Technology, Chongqing 400000, China
    2.KingZon(Chongqing) Package Technology Co., Ltd., Chongqing 400000, China
  • Online:2023-05-15 Published:2023-05-15

基于YOLOX-WSC的PCB缺陷检测算法研究

庹冰,黄丽雯,唐鑫,谌列勇,周静   

  1. 1.重庆理工大学 电气与电子工程学院,重庆 400000
    2.鼎兆(重庆)包装科技有限公司,重庆 400000

Abstract: In view of the difficulty and variety of PCB defect detection in complex scenes, and the problems of false or missed detection are easy to occur, a PCB defect detection algorithm based on YOLOX-WSC is proposed. Firstly, the input model data are optimized, and the weakening data are used to enhance the inaccurate image introduced by Mosaic, and the convergence is completed in advance to improve the model detection effect. Secondly, a parameterless attention SimAM is added to the backbone network to evaluate effective features using energy functions without adding model parameters, so as to improve the feature extraction and localization capability of the algorithm. Finally, the CSPLayer structure is replaced by CSPHB module in the feature fusion network to obtain higher-order semantic information, improve the resolution ability, and strengthen the feature fusion interaction ability of the feature fusion network, so as to improve the model detection performance. The experimental results show that the improved mean precision mAP of each module has been improved to different degrees, the mAP@0.5 of YOLOX-WSC algorithm reaches 96.65%, mAP@0.5:0.95 reaches 79.58%. Compared with YOLOX, the average accuracy of each defect category is significantly improved 2.88 percentage points and 11.64 percentage points, which proves the effectiveness of the algorithm.

Key words: small target detection, YOLOX, non parametric attention, data enhancement, defect detection

摘要: 针对复杂场景下,PCB缺陷检测难度大、种类多、容易出现误检或漏检的问题,提出一种基于YOLOX-WSC的PCB缺陷检测算法。对输入模型数据进行优化,采用弱化数据增强减少Mosaic引入的不准确图像并提前完成收敛,提升了模型检测效果;在主干网络中添加无参数注意力SimAM,在不增加模型参数的同时使用能量函数评估有效特征,以提升算法的特征提取和定位能力;在特征融合网络中采用CSPHB模块替换CSPLayer结构,获取高阶语义信息,提高分辨能力,同时加强特征融合网络的特征融合交互能力,进而提高模型检测性能。实验结果表明,各模块的改进平均精度均值(mAP)都有不同程度的提升,YOLOX-WSC算法的mAP@0.5达到96.65%,mAP@0.5:0.95达到了79.58%,比YOLOX分别提升了2.88个百分点、11.64个百分点,并且各个类别缺陷平均精度有明显提升,证明了算法的有效性。

关键词: 小目标检测, YOLOX, 无参数注意力, 数据增强, 缺陷检测