Architectural Design of RT-DETR-L for PCB Surface Defect Detection: A Systematic Comparison of Attention Mechanisms, Backbone Replacement, and Cross-Dataset Generalization
Download PDF

Keywords

PCB defect detection
RT-DETR
Attention mechanism comparison
EMA
FasterNet
Cross-dataset generalization

DOI

10.26689/jera.v10i6.15345

Submitted : 2026-06-07
Accepted : 2026-06-22
Published : 2026-07-07

Abstract

Based on RT-DETR-L, this paper systematically compares five attention mechanisms (SE, CBAM, CA, ECA, and EMA) at the P3/P4/P5 outputs of the feature-pyramid neck under identical training conditions, and evaluates FasterNet backbone replacement and a P2 small-object detection head as complementary improvements. Experiments reveal a performance gap of up to 4.29 percentage points (CA: 93.04% to EMA: 97.33% in mAP50), indicating that the choice of attention mechanism has a substantial impact on RT-DETR-type PCB detectors. EMA achieves the best mAP50 (97.33%) and the highest mAP50:95 (56.45%); ECA offers a competitive trade-off without increasing GFLOPs (96.69%); CA performs worst (93.04%), a 3.34 pp drop below the baseline, tentatively attributed to an architectural conflict with the AIFI encoder. FasterNet backbone replacement trades accuracy for efficiency (31% fewer parameters, 40% lower GFLOPs); and, when trained from scratch on the second dataset DeepPCB, the EMA variant again yields the largest gain (mAP5089.33%, 4.83 pp over the baseline), showing that the improvement is not specific to a single dataset.

References

Ling Q, Isa N, 2023, Printed Circuit Board Defect Detection Methods Based on Image Processing, Machine Learning and Deep Learning: A Survey. IEEE Access, 11: 15921–15944.

Zhao Y, Lv W, Xu S, et al., 2024, DETRs Beat YOLOs on Real-Time Object Detection. CVPR.

Wang Y, Wu B, Zhang L, et al., 2025, Enhanced PCB Defect Detection Via HSA-RTDETR on RT-DETR. Scientific Reports, 15: 31783.

Ouyang D, He S, Zhang G, et al., 2023, Efficient Multi-Scale Attention Module with Cross-Spatial Learning. ICASSP.

Hu J, Shen L, Sun G, 2018, Squeeze-and-Excitation Networks. CVPR: 7132–7141.

Woo S, Park J, Lee J, et al., 2018, CBAM: Convolutional Block Attention Module. ECCV: 3–19.

Hou Q, Zhou D, Feng J, 2021, Coordinate Attention for Efficient Mobile Network Design. CVPR: 13713–13722.

Chen J, Kao S, He H, et al., 2023, Run, Don’t Walk: Chasing Higher FLOPS for Faster Neural Networks. CVPR: 12021–12031.

Tang S, He F, Huang X, et al., 2019, On-Line PCB Defect Detector on a New PCB Defect Dataset. arXiv: 1902.06197.

Wang Q, Wu B, Zhu P, et al., 2020, ECA-Net: Efficient Channel Attention for Deep Convolutional Neural Networks. CVPR: 11534–11542.