摘要
针对PCB瑕疵检测问题,提出了基于YOLOv5s的轻量化PCB瑕疵检测算法,并基于树莓派平台搭建了一套PCB瑕疵自动检测系统。首先,在Backbone阶段使用改进的空间金字塔池化代替原有的C3网络;其次,在Backbone与Neck中引入残差结构,并在小目标检测层面加入CBAM注意力机制;最后,将所提轻量化算法部署到树莓派上,并使用NCS2套件进行辅助加速,通过摄像头进行自动检测。通过测试,所提算法检测PCB瑕疵mAP达到99.1%,与原YOLOv5s模型相比,Params为其23%,FLOPs为其21%,PCB瑕疵检测系统运行速度达到7 fps,满足自动检测要求。
Aiming at the problem of PCB defect detection,a lightweight PCB defect detection algorithm based on YOLOv5s is proposed and builds an automatic PCB defect detection system based on the Raspberry Pi platform.Firstly,a modified spatial pyramid pooling is used in the Backbone stage instead of the original C3 network.Secondly,a residual structure is introduced in Backbone and Neck,and a CBAM attention mechanism is added at the small target detection level.Finally,the proposed lightweight algorithm is deployed on Raspberry Pi with the NCS2 suite for auxiliary acceleration,and automatic detection is performed through the camera.Through testing,the proposed algorithm achieves 99.1%mAP for PCB defect detection,23%for Params and 21%for FLOPs compared to the original YOLOv5s model,and the PCB defect detection system runs at 7 fps,meeting the automatic detection requirements.
作者
贺鹏飞
刘志航
王菲菲
徐康
聂荣
He Pengfei;Liu Zhihang;Wang Feifei;Xu Kang;Nie Rong(School of Physics and Electronic Information,Yantai University,Yantai 264005,China;Shandong Qingdao Yanghydrogen Group Co.,Ltd;College of Intelligent Engineering,Zhengzhou University of Aeronautics,Henan Province)
出处
《单片机与嵌入式系统应用》
2023年第2期45-48,共4页
Microcontrollers & Embedded Systems
基金
烟台市2021年校地融合发展项目(1521001 WL21JY01)
2022年河南省科技攻关项目(222102220048)。