摘 要:针对印刷电路板缺陷检测技术,文章提出了基于 YOLOv5s 的一个轻量型的 CNN 模型 YOLO_AD,用于 PCB 缺陷检测。该模型主要体现在将轻量型 Ghost module 作为骨干特征提取网络,融合注意力机制,对输入分配偏好进行通用池化和信息加权平均后,引入空洞残差网络,减少了网络模型与卷积运算,提高了网络处理效率。部署到嵌入式板卡中,采用 MVC 架构配合硬件优化及软件设计搭建了实时在线的 PCB 目标缺陷检测系统。实验结果表明,测试各类缺陷识别率为 90.53%,检测速度为 30 FPS。
关键词:缺陷检测;轻量型网络;注意力机制;空洞残差网络;嵌入式系统
DOI:10.19850/j.cnki.2096-4706.2023.04.003
基金项目:国家自然科学基金(61805133)
中图分类号:TP391.4;TP18 文献标识码:A 文章编号:2096-4706(2023)04-0010-05
PCB defect Detection of Attention Mechanism and Dilated Residual Network
NIU Zhenzhen, CHEN Lirong, WANG Zhen, NIU Yali, LYU Xuyang
(College of Physics and Electronic Engineering, Shanxi University, Taiyuan 030006, China)
Abstract: For printed circuit board defect detection technology, this paper proposes a lightweight CNN model YOLO_AD based on YOLOv5s for PCB defect detection. The model mainly embodies the lightweight Ghost module as the backbone feature extraction network, incorporates the attention mechanism, introduces the null residual network after generalized pooling and information weighted averaging of input assignment preferences, reduces the network model and convolution operations, and improves the network processing efficiency. Deployed into the embedded board, the MVC architecture is used with hardware optimization and software design to build a real-time online PCB target defect detection system. The experimental results show that the test recognition rate of various types of defects is 90.53% and the detection speed is 30 FPS.
Keywords: defect detection; lightweight network; attention mechanism; dilated residual network; embedded system
参考文献:
[1] 王耀南,陈铁健,贺振东,等 . 智能制造装备视觉检测控制方法综述 [J]. 控制理论与应用,2015,32(3):273-286.
[2] ZHANG R S,GUO X W,HE M Y.Intelligent Pseudo Solder Detection in PCB Using Laser-Pulsed Thermography and Neural Network [J].IEEE Sensors Journal,2021,22(1):631-638.
[3] LOPEZ-ESCOGIDO D,LUCA A D. 2-D High Precision Laser Sensor for Detecting Small Defects in PCBs [C]//2012 9th International Conference on Electrical Engineering,Computing Science and Automatic Control(CCE).Mexico:IEEE,2012:1-6.
[4] ARDHY F,HARIADI F I. Development of SBC Based Machine-Vision System for PCB Board Assembly Automatic Optical Inspection [C]//2016 International Symposium on Electronics and Smart Devices(ISESD).Bandung:IEEE,2016:386-393.
[5] 何国忠,梁宇 . 基于卷积神经网络的 PCB 缺陷检测 [J].图学学报,2022,43(1):21-27.
[6] WANG D D,HE D J. Channel Pruned YOLO V5s-Based Deep Learning Approach for Rapid and Accurate Apple Fruitlet Detection before Fruit Thinning [J].Biosystems Engineering,2021,210:271-281.
[7] HAN K,WANG Y H,TIAN Q,et al. GhostNet:More Features From Cheap Operations [C]//2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition(CVPR).Seattle:IEEE, 2020:1577-1586.
[8] NIU Z Y,ZHONG G Q,YU H. A Review on the Attention Mechanism of Deep Learning [J].Neurocomputing,2021,452:48-62.
[9] HE K M,ZHANG X Y Z,REN S Q,et al. Deep Residual Learning for Image Recognition [C]//2016 IEEE Conference on Computer Vision and Pattern Recognition(CVPR).Las Vegas: IEEE,2016:770-778.
[10] DING R W,DAI L H,LI G P,et al. TDD-Net:A Tiny Defect Detection Network for Printed Circuit Boards [J].CAAI Transactions on Intelligence Technology,2019,4(2):110-116.
作者简介:牛振振(1995—),男,汉族,河南商丘人,硕士研究生在读,研究方向:机器视觉;陈力荣(1988—),男,汉族,山西吕梁人,副教授,博士,研究方向:机器视觉、光量子器件;王震(1997—)男,汉族,山西长治人,硕士研究生在读,研究方向:光通信;牛雅丽(1999—),女,汉族,山西晋城人,硕士研究生在读,研究方向:光通信;吕旭阳(2000—),男,汉族,河北邯郸人,硕士研究生在读,研究方向:机器视觉。