摘要
针对印刷电路板(PCB)表面缺陷小且与背景特征相似导致传统检测算法准确度低等问题,提出一种基于多尺度融合优化的PCB缺陷检测算法。在YOLOv8基础上,在主干网络特征融合层末端引入Swin Transformer模块捕捉全局信息,增强细节与整体特征理解。在backbone中嵌入全局注意力机制(GAM)聚焦目标区域,降低背景干扰。采用WIoU损失函数代替原来CIoU,通过差异化加权,增强了模型在小目标及复杂背景下的回归性能。在PCB_DATASET和DeepPCB两个数据集上,对不同算法进行对比实验,该算法在PCB_DATASET和DeepPCB数据集上检测精度分别较YOLOv8提高3.64百分点和2.42百分点,显著提升了缺陷识别的准确性。
A printed circuit board(PCB)defect detection algorithm based on multi-scale fusion optimization is proposed to address the low accuracy of traditional detection algorithms,which struggle with small surface defects resembling background features.Building on YOLOv8,a Swin Transformer module is integrated at the end of the backbone network’s feature fusion layer to capture global information and enhance the understanding of both detailed and overall features.A global attention mechanism is embedded in the backbone to focus on target areas and reduce background interference.The WIoU loss function replaces the original CIoU,incorporating differential weighting to improve regression performance for small targets and complex backgrounds.Comparative experiments are conducted using different algorithms on the PCB_DATASET and DeepPCB datasets.The proposed algorithm improves detection accuracy by 3.64 and 2.42 percentage points on the PCB_DATASET and DeepPCB datasets,respectively,significantly enhancing defect recognition accuracy.
作者
毛坤
朱学军
赖惠鸽
余坼操
熊垒垒
杨明
彭达
Mao Kun;Zhu Xuejun;Lai Huige;Yu Checao;Xiong Leilei;Yang Ming;Peng Da(School of Mechanical Engineering,Ningxia University,Yinchuan 750021,Ningxia,China)
出处
《激光与光电子学进展》
北大核心
2025年第10期133-144,共12页
Laser & Optoelectronics Progress
基金
国家自然科学基金(51765056)。
关键词
缺陷检测
注意力机制
损失函数
差异化加权
defect detection
attention mechanism
loss function
differentiated weighting