此页面上的内容需要较新版本的 Adobe Flash Player。

获取 Adobe Flash Player

Fast PCB defects detection method based on improved YOLOv5

WU Junhua, YAN Xiaoyu, GE Lusheng

(School of Electrical and Information Engineering, Anhui University of Technology, Ma’anshan 243000, China)

 

Abstract: A fast printed circuit board (PCB) defects detection method based on improved YOLOv5 is proposed to solve the problems of poor detection accuracy and low efficiency in detecting PCB defects in the industrial production process. Firstly, for the path aggregation network module (PANet), an improved attention mechanism module, parallel residual Ghostconv-convolutional block attention module (PRG-CBAM), is introduced, which eliminates the priority of the channel attention module and spatial attention module to increase the accuracy of object detection. Secondly, replacing the general convolution in the PANet module with ghost convolution (Ghostconv) can reduce the number of network parameters and the amount of calculation to improve the efficiency of object detection. The experimental results show that the proposed method compresses the parameters of YOLOv5s model by 18.8%, and detection speed of the algorithm for PCB board defects reaches 58.342 frame/s, which is 120.6%, 55.4% and 40.1% higher than that of single shot multiBox detector (SSD), YOLOv4 and YOLOv5s algorithms, respectively. The average detection accuracy reaches 99.0%, which is 28.1%, 2.0% and 1.5% higher than that of SSD, YOLOv4 and YOLOv5s algorithms, respectively. It indicates that the proposed board method has a remarkable real-time and high-precision detection effect, so it can be applied to the real-time detection of PCB defects in actual industrial production.

 

Key words: deep learning; printed circuit board (PCB) detection; lightweight network; attention mechanism

 

References

 

[1] LI S B, YANG J, WANG Z, et al. Review of development and application of defect detection technology. Acta Automatica Sinica, 2020, 46(11): 2319-2336.
[2] LI G H, QIAN Y H, WU W J, et al. Review of deep learning and its application in computer vision. Application Research of Computer, 2019, 36(12): 3521-3529.
[3] TAO X, HOU W, XU D. A survey of surface defect detection methods based on deep learning. Acta Automatica Sinica, 2021, 47(5): 1017-1034.
[4] GIRSHICK R, DONAHUE J, DARRELL J, et al. Rich feature hierarchies for accurate object detection and semantic segmentation. 2014-10-22. https://doi.org/10.48550/arXiv.1311.2524.
[5] HU B, WANG J H. Detection of PCB surface defects with improved Faster-RCNN and feature pyramid network. IEEE Access, 2020, 8: 108335-108345.
[6] TSAI D M, CHOU Y H. Fast and precise positioning in PCBs using deep neural network regression. IEEE Transactions on Instrumentation and Measurement, 2020, 69(7): 4692-4701.
[7] REDMON J, DIVVALA S, GIRSHICK R, et al. You only look once: unified, real-time object detection//IEEE Conference on Computer Vision and Pattern Recognition, Jun.1, 2016, Las Vegas, New York: IEEE, 2016: 779-788.
[8] LI Y T, KUO P, GUO J I. Automatic industry PCB board DIP process defect detection with deep ensemble method. IEEE Transactions on Components, Packing and Manufacturing Technology, 2021, 2: 11.
[9] WANG Y N, YU L X. SSD object detection algorithm with effective fusion and multi-scale. Journal of Frontiers of Computer Science and Technology, 2022, 16(2): 247-254.
[10] TAN X D, PENG H. Improved YOLOv5 ship target detection in SAR image. Computer Engineering and Applications, 2022, 58(4): 247-254.
[11] YANG X G, GAO F, LU R T, et al. Lightweight aerial object detection method based on improved YOLOv5. 2022, 51(3): 361-368.
[12] LIN S, LIU M Y, TAO Z Y. Detection of underwater reassuress using attention mechanism and improved YOLOv5. Transactions of the Chinese Society of Agricultural Engineering, 2021, 37(18): 307-314.
[13] PENG C, ZHANG Q H, TANG Z H, et al. Research on mask wearing detection method based on YOLOv5 enhancement model. Computer Engineering, 2022, 48(4): 39-49
[14] QIAN K, LI C X, CHEN M S, et al. Ship target and key parts detection algorithm based on YOLOv5. Systems Engineering and Electronics, 2022,44(6): 1823-1832.
[15] WU X N, HE P, DENG Z G, et al. A deep learning model of small object detection based on attention mechanism. Computer Engineering & Science, 2021, 43(1): 95-104.
[16] HU J, SHEN L, SUN G. Squeeze-and-excitation networks//IEEE/CVF Conference on Computer Vision and Pattern Recognition, Jun. 18-23, 2018,  Salt Lake City, USA. New York: IEEE, 2018: 7132-7141.
[17] WOO S, PARK J, LEE J Y, et al. CBAM: convolutional block attention module//15th European Conference on Computer Vision, Sept. 8-14, 2018,  Munich, Termany. Berlin: Springer, 2018: 3-19.
[18] HE K M, ZHANG X Y, REN S Q, et al. Deep residual learning for image recognition//IEEE Conference on Computer Vision and Pattern Recognition, Jun. 27-30, 2016, Las Vegas, USA. New York: IEEE, 2016: 770-778.


基于改进YOLOv5的PCB缺陷快速检测方法

 

吴俊华, 闫小宇, 葛芦生

 

(安徽工业大学 电气与信息工程学院, 安徽 马鞍山 243000)

 

摘要:针对工业生产过程中印刷电路板(Printed circuit board, PCB)缺陷检测中存在的检测精度差, 效率低等问题, 提出一种基于YOLOv5改进型PCB缺陷快速检测算法。 首先, 将改进型注意力机制模块(Parallel residual Ghostconv-convoluational block attention module,PRG-CBAM)引入路径聚合网络模块(Path aggregation network, PANet)模块中, 以消除通道注意力模块与空间注意力模块的优先级, 增加对目标物检测的精度。 其次, 将Ghost卷积(Ghostconv)代替PANet模块中一般卷积以减少网络参数量以及计算量, 提高检测效率。 实验结果表明, 所提出的方法可将YOLOv5s模型参数量压缩18.8%; 检测速度为58.342 frame/s, 较单步多框(SSD)、 YOLOv4、 YOLOv5s算法分别提高了120.6%、 55.4%、 40.1%。 平均检测精度达到了99.000%, 相比SSD、 YOLOv4和YOLOv5s算法分别提高了28.1%、 2.0%和1.5%。 该算法可实现实时高精度PCB板缺陷检测。

 

关键词:深度学习; 印刷电路板缺陷检测; 轻量化网络; 注意力机制

 

引用格式:WU Junhua, YAN Xiaoyu, GE Lusheng. Fast PCB defects detection method based on improved YOLOv5. Journal of Measurement Science and Instrumentation, 2023, 14(3): 340-349. DOI: 10.3969/j.issn.1674-8042.2023.03.011

 

[full text view]