现代电子技术2024,Vol.47Issue(15):115-121,7.DOI:10.16652/j.issn.1004-373x.2024.15.019
改进YOLOv8n的轻量级PCB缺陷检测算法
Lightweight PCB defect detection algorithm for improved YOLOv8n
摘要
Abstract
In view of the low accuracy of small object defect detection in printed circuit boards(PCBs)and the fact that the existing detection models are large and difficult to be deployed in edge equipment,a lightweight PCB defect detection model YOLOv8-t is proposed based on the improved YOLOv8n.The structures of the FasterNet Block and the Slim-Neck are used to optimize the structures of the Bockbone and the Neck to reduce the redundant calculations and memory accesses,so as to cope with the low detection accuracy caused by feature redundancy.The self-developed detection head Detect_G is used to improve the speed and accuracy of model detection.The attention mechanism EMA(efficient mutli-scale attention)based on cross-space multi-scale is introduced to improve the attention to the defect detection of small objects.Experiments were conducted with the publicly released PCB defect dataset of a laboratory of Peking University.The experimental results show that the proposed YOLOv8-t has a mean average precision(mAP)of 95.3%,a model weight size of 4.0 MB,a parameter quantity of 1.8×106,and a calculation amount of 3.8 GFLOPs.In comparison with those of the original algorithm YOLOv8n,the mAP@0.5 of the YOLOv8-t rises by 2.1%,its model weight size is reduced by 36.5%,its parameter quantity is reduced by 36.7%,and its calculation amount is reduced by 51.2%.The improved algorithm improves the detection accuracy and achieves good results in the model lightweight,so it is more suitable for the deployment on the edge.关键词
YOLOv8/PCB/轻量化/缺陷检测/注意力机制/Detect_GKey words
YOLOv8/PCB/lightweight/defect detection/attention mechanism/Detect_G分类
信息技术与安全科学引用本文复制引用
张淑卿,孟昊,葛超..改进YOLOv8n的轻量级PCB缺陷检测算法[J].现代电子技术,2024,47(15):115-121,7.基金项目
河北省自然科学基金资助项目(F2021209006) (F2021209006)