基于改进RT-DETR的异形电子元件表面缺陷检测算法

An Improved RT-DETR-Based Object Detection Model for Irregular-Shaped Electronic Components

  • 摘要: 异形电子元件表面缺陷检测是提高异形插件机插装工艺水平的关键环节。传统的人工检测易受人为主观性影响,模板匹配算法的效率较低,且在样本数据不足的情况下,现有深度学习技术在缺陷检测方面存在精度低、实时性不足等问题。为提高异形元件检测的精度和实时性,文章对目标检测模型RT-DETR进行改进,提出了一种实时多维特征自适应网络(RT-MDAFNet):首先,在模型特征融合层处设计自适应融合金字塔网络(AFPN),通过动态通道注意力机制和选择性特征融合机制来提高模型对多尺度目标的适应性和特征提取能力;然后,设计了自适应通道-空间聚合网络模块(SASE-RepNet),通过结合多层次特征聚合、通道自适应权重分配和空间选择性增强机制来提升在复杂背景下的检测精度和效率。在现有数据集缺乏的情况下,构建了异形电子元件数据集,并将RT-MDAFNet模型与DETR、Faster R-CNN、YOLO系列等8种基线模型进行了对比实验。对比实验结果表明:RT-MDAFNet模型的帧率为41.5 FPS,每秒浮点运算次数(GFLOPs)为75.3,参数量为24.31 M,mAP50值为80.87%,mAP50-95值分别为50.43%。与目前最佳的基线模型(DINO)相比,RT-MDAFNet模型的mAP50、mAP50-95值分别提高了3.31%、3.46%。最后,为了探讨关键组件对模型效果的影响,在自建数据集上进行了消融实验。消融实验结果表明:RT-MDAFNet模型中的AFPN模块和SASE-RepNet模块在模型轻量化和精度提升上具备有效性。与RT-DETR模型相比,RT-MDAFNet模型的mAP50、mAP50-95值分别提高了4.66%、2.54%,参数量降低了9.67 M,GFLOPs减少了28.1,帧率提高了18.7 FPS。总体而言,RT-MDAFNet模型在保证轻量化的同时,也提升了异形元件的检测精度。

     

    Abstract: The detection of surface defects in irregularly shaped electronic components is a critical step in enhancing the insertion process of automated plug-in machines. Traditional manual inspection is easily affected by subjectivity, template matching algorithms are inefficient, and in the case of insufficient sample data, existing deep lear-ning technologies have problems such as low accuracy and lack of real-time performance in defect detection. To improve the accuracy and real-time performance of defect detection in irregular components, the existing RT-DETR model has been enhanced, leading to the development of a real-time multidimensional feature adaptive network (RT-MDAFNet). First, an Adaptive Fusion Pyramid Network (AFPN) is designed in the feature fusion layer, incorporating a dynamic channel attention mechanism and a selective feature fusion mechanism to enhance the adaptability and feature extraction capability for multi-scale targets. Then, a Self-Adaptive Spatial-Channel Aggregation Network module (SASE-RepNet) is introduced. By integrating multi-level feature aggregation, channel-adaptive weight allocation, and spatially selective enhancement mechanisms, the detection accuracy and efficiency under complex backgrounds are improved. Due to the lack of existing datasets, a dedicated dataset for irregular electronic components was constructed, comparative experiments were conducted between RT-MDAFNet and eight models, including DETR, Faster R-CNN, and the YOLO series. The results demonstrate that RT-MDAFNet achieves a frame rate of 41.5 FPS, a floating-point operation count (GFLOPs) of 75.3, and a parameter size of 24.31M, with an mAP50 of 80.87% and an mAP50-95 of 50.43%. The model maintains a lightweight structure while outperforming other baseline models in detection accuracy. Compared to the best-performing baseline model (DINO), RT-MDAFNet improves mAP50 and mAP50-95 by 3.31% and 3.46%, respectively. Finally, to explore the impact of key components on model performance, ablation experiments were conducted on the self-constructed dataset. The results indicate that the AFPN and SASE-RepNet modules effectively contribute to model lightweighting and accuracy enhancement. Compared to the original RT-DETR model, RT-MDAFNet improves mAP50 and mAP50-95 by 4.66% and 2.54%, respectively, while reducing the number of parameters by 9.67M, decreasing GFLOPs by 28.1, and increasing the frame rate by 18.7 FPS. Overall, RT-MDAFNet successfully ensures a lightweight design while enhancing the detection accuracy of irregular electronic components.

     

/

返回文章
返回