Distilling localization knowledge into compact detection transformers (DETRs) requires consistent teacher-student query correspondence across decoder layers. However, in DETRs with encoder-based query selection, the teacher and student select top-K proposals independently. Same-rank queries can originate from different spatial locations and correspond to different objects, making rank-based layer-wise supervision unreliable. To address this problem, we propose Trajectory-Aligned Encoder-Decoder Distillation (TAED), a framework for knowledge transfer between DETRs of different capacities. Encoder feature distillation matches normalized multi-scale features to strengthen student representations and increase the number of teacher-student query pairs from the same encoder locations. Source-indexed query alignment pairs native queries from the same encoder locations and retains pairs associated with the same object for which the teacher provides reliable and more accurate final localization than the student. Trajectory-aligned localization distillation maintains these correspondences and uses teacher proposals and corresponding decoder-layer box predictions to guide student refinement, without introducing additional queries. On COCO, TAED improves DINO-R18 and two-stage Deformable DETR-R18 by 2.5 and 1.7 AP, respectively. Further gains on D-FINE and ECDet demonstrate applicability to recent real-time DETRs at no additional inference cost.
Figures & tables
Figure 1: Query correspondence and cross-family results. (A) Comparison of query correspondence in existing methods and TAED. (B) AP gains of TAED across DETR families on COCO val2017 without additional inference cost.
Figure 2: Overview of TAED. Encoder feature distillation increases the number of teacher–student query pairs from the same encoder locations, while source-indexed query alignment selects reliable pairs. Trajectory-aligned localization distillation uses fixed query correspondence for proposal supervision and layer-wise localization target replacement.
Model
Teacher
Params
GFLOPs
Latency (ms)
AP
AP 50
AP 75
AP S
AP M
AP L
Deformable-R50 (2-stage)
–
41M
–
–
46.9
–
–
29.6
50.1
61.6
Deformable-R18 (2-stage)
–
29M
–
–
43.6
62.3
47.4
26.7
45.9
58.6
+ TAED
Deformable-R50
29M
–
–
45.3
63.6
49.1
27.2
48.0
60.5
DINO-R50
–
47M
–
–
49.0
66.4
53.3
31.4
52.2
64.0
DINO-R18
–
30M
–
–
44.0
61.2
48.1
27.4
46.9
56.9
+ KD-DETR [ 34 ]
DINO-R50
30M
–
–
46.1
63.1
50.1
29.2
48.7
61.1
Table 1: Distillation results across DETR families on COCO val2017. We compare TAED with existing distillation methods on two-stage Deformable DETR, DINO, and D-FINE. D-FINE-L follows the DEIM training recipe. Gray text denotes teachers, and shaded rows highlight TAED. † denotes teachers pretrained on Objects365 and fine-tuned on COCO.
Model
Params
GFLOPs
Latency (ms)
AP
AP 50
AP 75
AP S
AP M
AP L
ECDet-X
49M
151
12.70
57.9
76.0
62.9
38.7
63.4
76.1
YOLOv10-S [ 31 ]
7M
22
2.52
46.3
63.0
50.4
26.8
51.0
63.8
RT-DETRv4-S [ 18 ]
10M
25
3.66
49.7
66.8
54.1
30.2
53.6
66.9
DEIMv2-S [ 14 ]
10M
26
5.78
50.9
68.3
55.1
31.4
55.3
70.3
ECDet-S
10M
26
5.41
51.7
69.4
55.8
32.3
56.4
70.5
ECDet-S + TAED
10M
26
5.41
52.3
70.1
56.4
32.0
57.2
71.7
Table 2: Accuracy–efficiency results on COCO val2017. TAED is evaluated on ECDet-S/M/L using ECDet-X as the teacher. Other real-time detectors serve as references. Gray text denotes the teacher, and shaded rows highlight TAED.
Configuration
AP
D-FINE-L (DEIM) baseline
54.70
+ Encoder feature distillation
55.78
+ Layer-wise target replacement
56.12
+ Proposal localization distillation
56.16
+ DDF conflict masking ( Full TAED )
56.23
Removal from full TAED
Table 3: Component ablations of TAED. Results are for D-FINE-X † → D-FINE-L (DEIM). Components are added cumulatively; the last row removes encoder feature distillation from full TAED while keeping all other components unchanged.
Variant
Source-index align.
Quality gate
AP
w/o Quality gate
✓
–
56.06
w/o Source alignment
–
✓
55.93
Full TAED
✓
✓
56.23
Table 4: Source alignment and quality-gate ablations. Results are for D-FINE-X † → D-FINE-L (DEIM). Without source alignment, query pairs are formed by Hungarian matching.
Pairing strategy
w/o Encoder KD
Encoder KD
Rank-based
10.48
17.49
Hungarian
42.31
63.02
Source alignment
71.45
89.49
Table 5: Source consistency across pairing strategies. D-FINE-X † → D-FINE-L (DEIM), evaluated on 5,000 COCO val2017 images. Values are percentages of all student positive queries paired with teacher queries sharing the same encoder source index.
Query pairs
w/o Encoder KD
RT-DETRv4
Ours
Same source
129.96
149.78
174.17
+ Student GO
6.25
6.64
7.83
+ Same GT
5.89
6.25
7.49
+ Quality gate
1.77
1.76
2.30
Table 6: Query-pair selection statistics. The D-FINE-X † teacher and D-FINE-L (DEIM) students each select their top-300 native queries. Mean query pairs per image are reported after each step under different encoder feature distillation settings, measured offline using fixed models on COCO val2017 (5,000 images).
Figure 3: Qualitative comparison. Predictions are shown for the D-FINE-X † teacher, D-FINE-L (DEIM) baseline, and TAED-distilled student. Dashed yellow boxes denote GT; solid boxes denote predictions. IoU is computed against the highlighted GT box.
Figure 4: Final boxes and IoU trajectories. Two cases showing TAED gains over the baseline are selected from 2,000 COCO val2017 images. On the x-axis, P denotes the initial encoder proposal; 1–6 denote decoder layers.
Detection Transformers (DETRs) achieve strong performance in object detection but remain challenging to deploy on edge devices due to their high computational cost. Existing DETR distillation methods mainly focus on aligning distillation points, while largely overlooking the quality of the teacher's supervision itself. We observe that due to stage-wise non-monotonic prediction behavior in DETRs, well-localized or correctly classified predictions from earlier stages may degrade in later ones, and some negative predictions become increasingly overconfident. As a result, relying solely on the current stage's predictions yields inaccurate and inconsistent supervision. To address this issue, we propose Teacher Prediction Refinement Distillation (TPRD), a plug-and-play module that refines teacher predictions before distillation by exploiting stage-wise prediction information. TPRD improves supervision quality through Positive Prediction Correction (PPC), which corrects degraded positive predictions by restoring more accurate ones from earlier stages, ensuring reliable localization and classification signals, and Negative Prediction Suppression (NPS) suppresses the influence of overconfident negatives, preventing them from providing misleading supervision to the student. To preserve informative dark knowledge, we further introduce Maximum Dark Knowledge Preservation (MDKP), which selectively refines target-class logits while retaining non-target relations. Extensive experiments on MS COCO and PASCAL VOC demonstrate the effectiveness and robustness of the proposed method. Our code is available at https://github.com/xingyitong1/TPRD.
Yitong Xing, Yuhao Cheng, Yanping Li +1
School of Computer Science, Shanghai Jiao Tong University, Shanghai 200240, China
Detection Transformer (DETR) has redefined object detection by casting it as a set prediction task within an end-to-end framework. Despite its elegance, DETR and its variants still rely on fixed learnable queries and suffer from severe query utilization imbalance, which limits adaptability and leaves the model capacity underused. We propose PaQ-DETR (Pattern and Quality-Aware DETR), a unified framework that enhances both query adaptivity and supervision balance. It learns a compact set of shared latent patterns capturing global semantics and dynamically generates image-specific queries through content-conditioned weighting. In parallel, a quality-aware one-to-many assignment strategy adaptively selects positive samples based on localizatio-classification consistency, enriching supervision and promoting balanced query optimization. Experiments on COCO, CityScapes, and other benchmarks show consistent gains of 1.5%-4.2% mAP across DETR backbones, including ResNet and Swin-Transformer. Beyond accuracy improvement, our method provides interpretable insights into how dynamic patterns cluster semantically across object categories.
Zhengjian Kang, Jun Zhuang, Kangtong Mo +3
New York University · Boise State University · University of Illinois at Urbana-Champaign +3
Real-time object detection is crucial for real-world applications as it requires high accuracy with low latency. While Detection Transformers (DETR) have demonstrated significant performance improvements, current real-time DETR models are challenging to reproduce from scratch due to excessive pre-training overheads on the backbone, constraining research advancements by hindering the exploration of novel backbone architectures. In this paper, we want to show that by using general good design, it is possible to have high performance with low pre-training cost. After a thorough study of the backbone architecture, we propose EfficientNAT at various scales, which incorporates modern efficient convolution and local attention mechanisms. Moreover, we re-design the hybrid encoder with local attention, significantly enhancing both performance and inference speed. Based on these advancements, we present Le-DETR (Low-cost and Efficient DEtection TRansformer), which achieves a new SOTA in real-time detection using only ImageNet1K and COCO2017 training datasets, saving about 80% images in pre-training stage compared with previous methods. We demonstrate that with well-designed, real-time DETR models can achieve strong performance without the need for complex and computationally expensive pretraining. Extensive experiments show that Le-DETR-M/L/X achieves 52.9/54.3/55.1 mAP on COCO Val2017 with 4.45/5.01/6.68 ms on an RTX4090. It surpasses YOLOv12-L/X by +0.6/-0.1 mAP while achieving similar speed and +20% speedup. Compared with DEIM-D-FINE, Le-DETR-M achieves +0.2 mAP with slightly faster inference, and surpasses DEIM-D-FINE-L by +0.4 mAP with only 0.4 ms additional latency. Code and weights will be open-sourced.