首页|基于改进YOLOv7的PCB缺陷检测算法

基于改进YOLOv7的PCB缺陷检测算法

扫码查看
在PCB缺陷检测领域中检测精度的提高一直是1个具有挑战性的任务。为了解决这个问题,提出一系列基于PCB缺陷检测的改进方法。首先,引入一种新的注意力机制,即BiFormer注意力机制,这种机制利用双层路由实现动态的稀疏注意力,从而减少计算量;其次,采用一种创新的上采样算子CARAFE,能够结合语义信息与内容信息进行上采样,使得上采样过程更加全面且高效;最后,基于MPDIoU度量采用一种新的损失函数,即LMPDIoU损失函数,能够有效地处理不平衡类别、小目标和密集性问题,从而进一步提高图像检测的性能。实验结果表明,所提改进后的模型在平均精度均值(mAP)方面取得了显著提高,达到了 93。91%,与原YOLOv5模型相比提高了 13。12个百分点,同时,在识别精度方面,所提改进后的模型表现也非常出色,达到了 90。55%,与原YOLOv5模型相比提高了 8。74个百分点。引入 BiFormer注意力机制、CARAFE上采样算子以及LMPDIoU损失函数,对于提高PCB缺陷检测的精度和效率具有非常积极的作用,为工业检测领域的研究提供了有价值的参考。
PCB Defect Detection Algorithm Based on Improved YOLOv7
Achieving enhanced detection accuracy is a challenging task in the field of PCB defect detection.To address this problem,this study proposes a series of improvement methods based on PCB defect detection.First,a novel attention mechanism,referred to as BiFormer,is introduced.This mechanism uses dual-layer routing to achieve dynamic sparse attention,thereby reducing the amount of computation required.Second,an innovative upsampling operator called CARAFE is employed.This operator combines semantic and content information for upsampling,thereby making the upsampling process more comprehensive and efficient.Finally,a new loss function based on the MPDIoU metric,referred to as the LMPDIoU loss function,is adopted.This loss function effectively addresses unbalanced categories,small targets,and denseness problems,thereby further improving image detection performance.The experimental results reveal that the model achieves a significant improvement in mean Average Precision(mAP)with a score of 93.91%,13.12 percentage points higher than that of the original model.In terms of recognition accuracy,the new model reached a score of 90.55%,representing an improvement of 8.74 percentage points.These results show that the introduction of the BiFormer attention mechanism,CARAFE upsampling operator,and LMPDIoU loss function effectively improves the accuracy and efficiency of PCB defect detection.Thus,the proposed methods provide valuable references for research in industrial inspection,laying the foundation for future research and applications.

PCB defectBiFormer attention mechanismMPDIoU loss functionupsampling operator CARAFEtarget detection

张旭、陈慈发、董方敏

展开 >

三峡大学计算机与信息学院,湖北宜昌 443002

三峡大学水电工程智能视觉监测湖北省重点实验室,湖北宜昌 443002

三峡大学湖北省建筑质量检测装备工程技术研究中心,湖北宜昌 443002

PCB缺陷 BiFormer注意力机制 MPDIoU损失函数 上采样算子CARAFE 目标检测

2024

计算机工程
华东计算技术研究所 上海市计算机学会

计算机工程

CSTPCD北大核心
影响因子:0.581
ISSN:1000-3428
年,卷(期):2024.50(12)