基于改进YOLOv8s的轻量级PCB缺陷检测算法
DOI:
CSTR:
作者:
作者单位:

1.天津职业技术师范大学;2.天津大学

作者简介:

通讯作者:

中图分类号:

TP391.4

基金项目:

高端装备智能运维数字孪生体建模理论(2022YFB3303601)


Lightweight PCB Defect Detection Algorithm Based on Improved YOLOv8s
Author:
Affiliation:

Fund Project:

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

    YOLO算法模型在轻量化与保证检测精度之间存在矛盾。针对印刷电路板(PCB)小目标缺陷检测任务,提出一种基于改进YOLOv8s的轻量级目标检测算法。首先,引入轻量级跨尺度特征融合模块CCFM(Cross-Scale Feature Fusion Module),并删除主干网络中最后的卷积层与C2f层,降低模型深度,在实现模型轻量化的同时提升小目标检测精度。其次,引入分布移位卷积DSConv(Distribution Shifting Convolution),将C2f与DSConv结合生成C2f_DSConv模块,再与轻量级注意力机制 CBAM(Convolutional Block Attention Module)集成,设计出C2f_DSConv_CBAM模块,分别替换骨干网络部分与Neck部分的C2f,进一步减少模型参数量,增强模型特征提取能力。最后结合辅助边界框损失函数Inner-IoU、边界框聚焦损失函数Focal IoU Loss、原边界框损失函数CIoU设计生成Focal Inner-CIoU,引入可控大小的辅助边界框计算定位损失,提高高IoU边界框的回归贡献,最终实现检测精度提升。实验表明,改进模型较YOLOv8s原模型参数量降低81.5%,计算量降低21.3%,模型大小降低72.3%,mAP提升3.0%。有效降低了算法的计算成本,便于实际应用部署。

    Abstract:

    There is a trade-off between the lightweight nature of YOLO algorithm models and maintaining detection accuracy. To address the task of detecting small defects in printed circuit boards (PCBs), we propose a lightweight object detection algorithm based on an improved YOLOv8s. This approach significantly reduces the number of parameters and model size while enhancing detection accuracy. Firstly, we introduce a lightweight Cross-Scale Feature Fusion Module (CCFM) and remove the final convolutional layer and C2f layer from the backbone network, reducing model depth and improving the detection accuracy of small objects while achieving model lightweighting. Secondly, we introduce Distribution Shifting Convolution (DSConv), combining C2f and DSConv to create the C2f_DSConv module, which is then integrated with the lightweight attention mechanism CBAM (Convolutional Block Attention Module) to design the C2f_DSConv_CBAM module. This module replaces the C2f components in both the backbone and neck networks, further reducing the number of model parameters and enhancing feature extraction capability. Finally, by combining the auxiliary bounding box loss functions Inner-IoU, the bounding box focal loss function Focal IoU Loss, and the original bounding box loss function CIoU, we design the Focal Inner-CIoU. This introduces a controllable auxiliary bounding box to calculate localization loss, improving the regression contribution of high IoU bounding boxes and ultimately enhancing detection accuracy. Experimental results show that compared to the original YOLOv8s model, the improved model reduces the number of parameters by 81.5%, computation by 21.3%, and model size by 72.3%, while increasing mAP by 3.0%. This effectively lowers the computational cost of the algorithm, making it more suitable for practical applications and deployment.

    参考文献
    相似文献
    引证文献
引用本文
分享
文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:2024-08-09
  • 最后修改日期:2025-01-17
  • 录用日期:2025-01-21
  • 在线发布日期:
  • 出版日期:
文章二维码