Skip to content
AI.info

Research

RF-DETR: Neural Architecture Search for Real-Time Detection Transformers

RF-DETR: Neural Architecture Search for Real-Time Detection Transformers Overview Research area: Computer vision — real-time object detection and instance segmentation, specifically applying weight-sh

arXiv
2511.09554
Published
2025-11-12
Authors
Isaac Robinson, Peter Robicheaux, Matvei Popov, Deva Ramanan, Neehar Peri

AI summary

RF-DETR: Neural Architecture Search for Real-Time Detection Transformers

Overview

Research area: Computer vision — real-time object detection and instance segmentation, specifically applying weight-sharing neural architecture search (NAS) to end-to-end detection transformers (DETRs).

Technical level: Intermediate. The paper assumes familiarity with DETR-family detection, COCO benchmarking conventions, and NAS concepts, but its core argument and results are stated in accessible terms.

Scope: The paper introduces RF-DETR, a family of scheduler-free, NAS-based detection and segmentation models built on top of LW-DETR with a DINOv2 backbone, and reports state-of-the-art accuracy-latency tradeoffs on COCO and Roboflow100-VL, alongside a critique of latency benchmarking practices.

What This Paper Is About

Open-vocabulary detectors such as GroundingDINO and YOLO-World perform well on common COCO categories but generalize poorly to out-of-distribution classes, tasks, and imaging modalities, while specialist real-time detectors like D-FINE and RT-DETR are fast but less accurate than fine-tuned vision-language models. The paper argues that recent specialist detectors are implicitly overfit to COCO through bespoke architectures and learning-rate and augmentation schedulers, and it aims to build a fast specialist detector that transfers well to arbitrary target datasets by combining internet-scale pre-training with end-to-end weight-sharing NAS.

Key Contributions

  1. RF-DETR model family. A family of scheduler-free, NAS-based detection and segmentation models that outperform prior state-of-the-art on RF100-VL and among real-time methods with latencies of 40 ms or less on COCO. RF-DETR (2x-large) reaches 60.1 AP on COCO, which the authors state is the first real-time detector to exceed 60 AP.

  2. Revisiting NAS "tunable knobs" for DETRs. The authors explore end-to-end weight-sharing NAS over patch size, number of decoder layers, number of query tokens, image resolution, and number of windows per windowed attention block. This is described as the first end-to-end weight-sharing NAS applied to object detection and segmentation, and it allows transfer of a large-scale pre-trained model to small datasets.

  3. A standardized latency benchmarking protocol. The paper identifies GPU power throttling and GPU overheating as a major source of irreproducible latency numbers (for example, D-FINE's reported latency for LW-DETR is 25% faster than originally reported) and proposes buffering for 200 ms between forward passes, plus reporting accuracy and latency with the same model artifact.

  4. RF-DETR-Seg. A lightweight instance segmentation head added to RF-DETR, pre-trained on Objects-365 pseudo-labeled with SAM2 instance masks, enabling NAS-derived Pareto-optimal architectures for real-time instance segmentation.

Main Findings

  • Nano model accuracy on COCO: RF-DETR (nano) achieves 48.0 AP on COCO with 30.5M parameters, 31.9 GFLOPs and 2.3 ms latency. The abstract reports this as beating D-FINE (nano) by 5.3 AP at similar latency; the introduction and conclusion state an improvement of 5% AP over D-FINE (nano). By comparison, D-FINE (nano) reports 42.7 AP at 2.1 ms and LW-DETR (tiny) reports 42.9 AP at 1.9 ms.

  • Small and medium models: RF-DETR (small) reaches 52.9 AP at 3.5 ms with 32.1M parameters, versus D-FINE (small) at 50.6 AP and 3.5 ms. RF-DETR (medium) reaches 54.7 AP at 4.4 ms with 33.7M parameters, versus D-FINE (medium) at 55.0 AP and 5.4 ms.

  • Surpassing 60 AP on COCO: RF-DETR (2x-large) reaches 60.1 AP with 126.9M parameters, 438.4 GFLOPs and 17.2 ms latency (AP50 78.5, AP75 65.5, APS 43.2, APM 64.9, APL 76.2). The paper states this is the first real-time detector to surpass 60 AP on COCO.

  • Matching larger YOLO models: RF-DETR (nano) matches the performance of YOLOv8 and YOLOv11 at medium size (YOLOv8 medium reports 47.3 AP and YOLOv11 medium 48.3 AP on COCO).

  • Instance segmentation: RF-DETR-Seg (nano) reaches 40.3 AP on COCO at 3.4 ms with 33.6M parameters; RF-DETR-Seg (small) reaches 43.1 AP at 4.4 ms; RF-DETR-Seg (medium) reaches 45.3 AP at 5.9 ms. The paper reports RF-DETR-Seg (nano) outperforming YOLOv8 and YOLOv11 at all sizes, beating FastInst (34.9 AP) by 5.4% while running nearly ten times faster, and RF-DETR-Seg (large) outperforming MaskDINO (R50, 46.3 AP, 242 ms PyTorch latency) at a fraction of its runtime.

  • RF100-VL generalization: RF-DETR (2x-large) reaches 63.3 AP on RF100-VL at 15.6 ms with 123.5M parameters, and 63.5 AP with optional fine-tuning. GroundingDINO (tiny) reports 62.3 AP at 309.9 ms and LLMDet (tiny) 62.3 AP at 308.4 ms, so RF-DETR (2x-large) outperforms GroundingDINO (tiny) by 1.2 AP while running 20 times as fast. RF-DETR (nano) reaches 57.8 AP (58.6 with fine-tuning) at 2.5 ms; RF-DETR (small) 60.9 AP (61.2 fine-tuned) at 3.7 ms; RF-DETR (medium) 61.7 AP (62.0 fine-tuned) at 4.6 ms.

  • COCO overfitting of D-FINE: RT-DETR (medium) reports 59.6 AP on RF100-VL, outperforming D-FINE (medium) at 60.6 AP on COCO but 60.6 AP on RF100-VL — the paper's point is that RT-DETR outperforms D-FINE at AP50 on RF100-VL, indicating D-FINE's hyperparameters are potentially overfit to COCO.

  • Latency measurement variance: Reported latencies shift substantially between papers and protocols. In Table 1, YOLOv8 (M) goes from a reported 5.86 ms to 14.8 ms with buffering in FP-32, and YOLOv11 (M) from 4.7 ms to 18.7 ms. D-FINE (M) goes from 5.62 ms to 13.9 ms. Naively quantizing D-FINE to FP16 reduces performance to 0.5 AP, which the authors fix by changing the export code to use ONNX opset 17.

  • Ablation of design choices: Starting from LW-DETR (M) at 52.6 AP, gentler hyperparameters (larger batch size, lower learning rate, layer norm instead of batch norm) drop performance by 1.0% to 51.6 AP. Replacing CAEv2 with a DINOv2 backbone recovers and exceeds this (53.6 AP), additional Objects-365 pre-training raises it to 54.3 AP, and weight-sharing NAS reaches 54.6 AP. The authors state the final model improves over LW-DETR by 2% without increasing latency, and that weight-sharing NAS improves the base configuration even though patch size 14 is not in the NAS search space.

  • Backbone comparison: DINOv2 ViT/S-14 reaches 54.3 AP at 4.7 ms and 32.3M parameters, versus CAEv2 ViT/S-16-truncated at 52.3 AP, 4.4 ms and 28.3M parameters. SigLIPv2 ViT/B-32 reaches 50.4 AP and SAM2 Hiera-S 53.6 AP (11.2 ms, 44.0M parameters) — the paper notes SAM2's Hiera-S is considerably slower despite having fewer parameters than SigLIPv2. All backbones were pre-trained with 60 epochs of Objects-365.

  • Architecture augmentation as regularization: Because a random configuration is sampled at every training iteration, the paper finds the weight-sharing NAS acts as a regularizer, and that sub-nets not explicitly seen during training still achieve high performance (Appendix F).

Methodology in Plain English

The team starts from LW-DETR, a real-time detection transformer, and modernizes it. The CAEv2 backbone is swapped for DINOv2 (12 layers, patch size 14, versus CAEv2's 10 layers and patch size 16) to inherit internet-scale pre-trained features. Windowed and non-windowed attention blocks are interleaved, layer norm replaces batch norm in the multi-scale projector so training works with gradient accumulation on consumer-grade GPUs, and detection and segmentation losses are applied at every decoder layer so decoder layers can simply be dropped at inference.

Instead of training one fixed architecture, RF-DETR trains thousands of sub-networks at once by sampling a random configuration each training iteration — varying image resolution, patch size, number of windows per block, number of decoder layers, and number of query tokens — and taking one gradient step. Training hyperparameters are deliberately gentle and scheduler-free: learning rate 1e-4 (LW-DETR uses 4e-4), batch size 128, an EMA scheduler, gradient clipping above 0.1, and a per-layer multiplicative decay of 0.8 on the DINOv2 backbone. Augmentations are limited to horizontal flips and random crops, and images are resized at the batch level rather than per image to reduce padding and window artifacts.

After the base model is fully trained on the target dataset, the authors run grid search over configurations on a validation set to trace an accuracy-latency Pareto curve, with no further fine-tuning required. They evaluate 6,468 network configurations (11 resolutions × 7 patch sizes × 7 decoder layers × 3 window settings × 4 query settings), estimating roughly 10,000 GPU hours (200 T4 GPUs × 48 hours). Total training time is about two to four times a non-NAS baseline, but one run yields every model size. For segmentation, a lightweight head bilinearly interpolates encoder output into a pixel embedding map and takes dot products with projected query tokens; the model is pre-trained on Objects-365 with SAM2-pseudo-labeled masks. Latency is measured on an NVIDIA T4 GPU with TensorRT 10.4 and CUDA 12.4, using CUDA graphs and 200 ms buffering between forward passes.

Why This Matters

Impact on research. The paper challenges two common practices: tuning architectures and schedulers to maximize COCO validation performance, and reporting latency with inconsistent protocols or mismatched precision artifacts. It suggests that the community benchmark on datasets with public validation and test splits, such as RF100-VL, to avoid implicit overfitting, and it argues that end-to-end weight-sharing NAS — previously studied for classification and for detector sub-components like backbones and FPNs — is viable for whole detection and segmentation models.

Real-world applications:

  • Safety-critical perception, such as pedestrian detection in self-driving systems, where the authors specifically argue that vertical-flip augmentation can cause false positives from reflections in puddles.
  • Domain-specific inspection and monitoring, where target classes are out of distribution relative to internet pre-training and a lightweight specialist beats a fine-tuned vision-language model.
  • Edge and interactive deployment, where inference must fit within roughly 40 ms or less on modest hardware such as an NVIDIA T4, and where a single training run can be re-searched to fit different hardware or latency budgets.
  • Real-time instance segmentation, such as producing per-object masks in robotics or video analytics pipelines where the paper reports RF-DETR-Seg (nano) beating YOLOv8 and YOLOv11 segmentation at all sizes.

Industry relevance. The work comes from Roboflow and Carnegie Mellon University, and the authors

Authors’ abstract

Open-vocabulary detectors achieve impressive performance on COCO, but often fail to generalize to real-world datasets with out-of-distribution classes not typically found in their pre-training. Rather than simply fine-tuning a heavy-weight vision-language model (VLM) for new domains, we introduce RF-DETR, a light-weight specialist detection transformer that discovers accuracy-latency Pareto curves for any target dataset with weight-sharing neural architecture search (NAS). Our approach fine-tunes a pre-trained base network on a target dataset and evaluates thousands of network configurations with different accuracy-latency tradeoffs without re-training. Further, we revisit the "tunable knobs" for NAS to improve the transferability of DETRs to diverse target domains. Notably, RF-DETR significantly improves over prior state-of-the-art real-time methods on COCO and Roboflow100-VL. RF-DETR (nano) achieves 48.0 AP on COCO, beating D-FINE (nano) by 5.3 AP at similar latency, and RF-DETR (2x-large) outperforms GroundingDINO (tiny) by 1.2 AP on Roboflow100-VL while running 20x as fast. To the best of our knowledge, RF-DETR (2x-large) is the first real-time detector to surpass 60 AP on COCO. Our code is available at https://github.com/roboflow/rf-detr

Read the original paper