作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2026, Vol. 52 ›› Issue (6): 326-338. doi: 10.19678/j.issn.1000-3428.0070196

• 交叉融合与工程应用 • 上一篇    下一篇

基于改进YOLOv8s轻量化网络的PCBA缺陷检测算法

沈明辉1,2, 刘宇杰1, 陈婧1, 叶康祈1, 高赫远1, 刘建1,*(), 姜烨1, 殷文斐1, 王恺豪1, 刘振宇1   

  1. 1. 合肥工业大学计算机与信息学院, 安徽 宣城 242000
    2. 电子科技大学计算机科学与工程学院, 四川 成都 611731
  • 收稿日期:2024-08-05 修回日期:2024-10-28 出版日期:2026-06-15 发布日期:2024-12-18
  • 通讯作者: 刘建
  • 作者简介:

    沈明辉(CCF学生会员),男,硕士研究生,主研方向为人工智能算法及其应用

    刘宇杰,硕士研究生

    陈婧,硕士研究生

    叶康祈,硕士研究生

    高赫远,学士

    刘建(通信作者),副教授、博士

    姜烨,讲师、博士

    殷文斐,讲师、博士

    王恺豪,学士

    刘振宇,学士

  • 基金资助:
    国家自然科学基金青年科学基金项目(61906057)

Defect Detection Algorithm for PCBA Based on Improved YOLOv8s Lightweight Network

SHEN Minghui1,2, LIU Yujie1, CHEN Jing1, YE Kangqi1, GAO Heyuan1, LIU Jian1,*(), JIANG Ye1, YIN Wenfei1, WANG Kaihao1, LIU Zhenyu1   

  1. 1. School of Computing and Information Technology, Hefei University of Technology, Xuancheng 242000, Anhui, China
    2. School of Computer Science and Engineering, University of Electronic Science and Technology of China, Chengdu 611731, Sichuan, China
  • Received:2024-08-05 Revised:2024-10-28 Online:2026-06-15 Published:2024-12-18
  • Contact: LIU Jian

摘要:

印刷电路板组件(PCBA)的缺陷检测对于提高流水线生产效率具有重要影响, 而在PCBA之后的检查通常由人工完成, 容易造成人力与时间的浪费和出现漏检与误检的情况。为此, 提出一种轻量化的YOLOv8s改进算法, 该算法在有效降低模型复杂度的同时可以提高PCBA缺陷的检测精度。首先, 由于没有公开的PCBA相关数据集, 因此构建一个名为PCBA-DET的组装后PCBA缺陷检测数据集, 并对PCBA-DET进行多种方式的数据增强以模拟实际生产场景和改善数据集的平衡性。其次, 将YOLOv8s的骨干网络最后一个C2f模块替换成重参数化大核卷积网络(RepLKNet)以减少计算开销和提高模型的有效感受野, YOLOv8s的颈部网络引入P2小目标检测层和幽灵卷积以捕捉更多的细节信息, 有效降低模型参数量。实验结果表明, 在数据增强后的PCBA-DET数据集上进行评估, 均值平均精度(mAP)@0.5∶0.95和mAP@0.5与基准模型相比分别上升了2.6和0.1百分点, 但参数量和基线模型相比下降了36.8%。

关键词: 印刷电路板组件, 缺陷检测, YOLOv8算法, Attention-GAN, 轻量化模型

Abstract:

In Printed Circuit Board Assembly (PCBA), defect detection is key to improving production line efficiency. However, after assembly, printed circuit boards are usually inspected manually, leading to labor and time wastage, as well as missed and false detections. To address these issues, this paper proposes an improved lightweight YOLOv8s network that effectively reduces model complexity while enhancing the accuracy of PCBA defect detection. First, owing to the lack of publicly available PCBA-related datasets, a dataset called PCBA-DET is constructed for post-assembly PCBA defect detection. Various data augmentation techniques are applied to PCBA-DET to simulate real-world production scenarios and improve the dataset balance. Second, the last C2f module of the YOLOv8s backbone is replaced with a Re-parameterized Large Kernel convolution Network (RepLKNet) to reduce computational cost and increase the effective receptive field of the model. In addition, in the neck network of YOLOv8s, a P2 small object detection layer and Ghost Convolution are introduced to capture more detailed information and effectively reduce the number of model parameters. On the augmented PCBA-DET dataset, the improved model achieves an increase of 2.6 and 0.1 percentage points in terms of mean Average Precision (mAP)@0.5∶0.95 and mAP@0.5, respectively, compared with the baseline model, whereas the number of parameters is reduced by 36.8%.

Key words: Printed Circuit Board Assembly (PCBA), defect detection, YOLOv8 algorithm, Attention-GAN, lightweight model