基于改进YOLOv12n的PCB缺陷检测算法研究
DOI:
CSTR:
作者:
作者单位:

1.安徽工程大学电气工程学院芜湖241000;2.巢湖学院计算机与人工智能学院巢湖238024; 3.上海大学机电工程与自动化学院上海200444

作者简介:

通讯作者:

中图分类号:

TP391;TN912

基金项目:

安徽省自然科学基金项目(2308085QF205)、安徽省高校自然科学研究重点项目(2025AHGXZK30132,2024AH051323)、安徽省高校中青年教师培养行动项目(YQYB2025032)、安徽省高校理工科教师赴企业挂职实践计划项目(2025jsqygz72)、安徽省高校自然科学优秀科研创新团队(2024AH010022)、电气传动与控制安徽省重点实验室开放基金资助项目(DQKJ202402)、巢湖学院产学研合作项目(hxkt20240009)资助


Research on PCB defect detection algorithm based on improved YOLOv12n
Author:
Affiliation:

1.School of Electrical Engineering, Anhui Polytechnic University, Wuhu 241000, China; 2.School of Computer Science and Artificial Intelligence, Chaohu University, Chaohu 238024, China; 3.School of Mechatronic Engineering and Automation, Shanghai University, Shanghai 200444, China

Fund Project:

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 资源附件
  • |
  • 文章评论
    摘要:

    针对工业边缘设备计算资源受限环境下印刷电路板缺陷检测模型存在轻量化与检测精度难以兼顾的难题,提出一种基于YOLOv12n的轻量化PCB缺陷检测算法。首先,设计融合令牌混合器采用深度可分离卷积的C3K2-CF模块,在具有更少参数的同时提高对小目标的感知能力;其次,提出一种新的特征融合增强网络(feature fusion enhancement network, FFEN),在跨尺度特征传递中保证目标信息的完整,从而强化模型对目标的关注能力;再次,设计一种特征聚焦融合模块(feature-focused fusion, FFF),实现多尺度上下文信息的充分融合,增强模型对复杂特征提取能力;最后,针对PCB缺陷检测中的小目标漏检的问题,引入任务对齐动态检测头(task-aligned dynamic detection head, TADDH),打通定位与分类双检测头的信息交互通道,进而提升模型对小尺寸缺陷的检测精度。实验结果表明,与原始YOLOv12n模型相比,改进算法在数据增强的PKU-Market-PCB数据集上mAP@0.5达到98.6%,更严格的mAP@0.5:0.95指标提升了7.2%,参数量和计算量分别减少47.2%和16.9%。在Deep PCB公开数据集上,改进模型的检测精度mAP@0.5达到97.5%,mAP@0.5:0.95提升了2.5%。由此可知,改进算法有效地实现了高精度的PCB缺陷检测,满足工业场景下的泛化小目标的检测需求。

    Abstract:

    Aiming at the problem that the defect detection model of printed circuit boards in the environment of limited computing resources of industrial edge devices is difficult to balance lightweight and detection accuracy, a lightweight PCB defect detection algorithm based on YOLOv12n is proposed. Firstly, the design of the fusion token mixer adopts the C3K2-CF module of depthwise separable convolution, which not only reduces the number of parameters but also enhances the perception ability for small targets. Secondly, a new feature fusion enhancement network FFEN is proposed to ensure the integrity of the target information in cross-scale feature transfer, thereby strengthening the model’s ability to pay attention to the target. Secondly, a feature-focused fusion module FFF is designed to fully integrate multi-scale context information and enhance the model’s ability to extract complex features. Finally, to address the issue of missed detection of small targets in PCB defect detection, the task-aligned dynamic detection head TADDH is introduced. This enabled the information exchange channel between the localization and classification dual detection heads to be established, thereby improving the detection accuracy of the model for small-sized defects. The experimental results show that, compared with the original YOLOv12n model, the improved algorithm achieves an mAP@0.5 of 98.6% on the PKU-Market-PCB dataset with data augmentation. The stricter mAP@0.5:0.95 metric has been improved by 7.2%. The parameter count and computational cost have been reduced by 47.2% and 16.9%, respectively. On the Deep PCB public dataset, the improved model achieved a detection accuracy of 97.5% mAP@0.5, representing a 2.5% improvement over mAP@0.5:0.95. It can be seen from this that the improved algorithm effectively achieves high-precision PCB defect detection and meets the detection requirements of generalized small targets in industrial scenarios.

    参考文献
    相似文献
    引证文献
引用本文

王宇,魏利胜,张平改,胡保玲.基于改进YOLOv12n的PCB缺陷检测算法研究[J].电子测量与仪器学报,2026,40(6):89-100

复制
分享
相关视频

文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:
  • 最后修改日期:
  • 录用日期:
  • 在线发布日期: 2026-08-12
  • 出版日期:
文章二维码
×
《电子测量与仪器学报》
关于防范虚假编辑部邮件的郑重公告