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.