YOLOv8 vs DETR vs RF-DETR: What Our Vehicle Detection Research Found
We compared YOLOv8n, DETR R50, and RF-DETR Nano to see how CNN-based, transformer-based, and hybrid object detectors perform on real-world traffic footage. Our research used the UA-DETRAC dataset, which contains more th
We compared YOLOv8n, DETR R50, and RF-DETR Nano to see how CNN-based, transformer-based, and hybrid object detectors perform on real-world traffic footage.
Our research used the UA-DETRAC dataset, which contains more than 140,000 frames from 100 traffic surveillance videos.
The results were interesting, but the biggest finding wasn't which model performed best. It was how much all three struggled when evaluated on a different visual domain.
The Three Models
We evaluated three approaches:
YOLOv8n: A lightweight CNN-based detector that uses convolutional features for object detection.
DETR R50: A transformer-based detector that combines a ResNet-50 backbone with attention-based object prediction.
RF-DETR Nano: A hybrid detector that combines convolutional feature extraction with transformer attention.
One important detail: RF-DETR was evaluated as a class-agnostic detector, meaning it identified vehicle-like objects without distinguishing cars, buses, and other vehicle categories.
This limits direct comparisons of classification performance between the models.
The Dataset
We used UA-DETRAC, a benchmark designed for vehicle detection and tracking in traffic surveillance footage.
It includes:
- 100 traffic surveillance videos
- More than 140,000 frames
- Different weather and traffic conditions
- Cars, buses, vans, and other vehicle categories
These scenes are challenging because vehicles can be small, distant, crowded together, or partially hidden.
Benchmark Results
We evaluated the models using average precision and average recall.
| Model | AP@[0.50:0.95] | [email protected] | AR@100 |
|---|---|---|---|
| YOLOv8n | 0.087 | 0.134 | 0.140 |
| DETR R50 | 0.071 | 0.115 | 0.145 |
| RF-DETR Nano | 0.082 | 0.120 | 0.140 |
1. YOLOv8n Achieved the Highest Average Precision
YOLOv8n achieved the highest scores on both average precision metrics.
Its [email protected] was 0.134, compared with 0.115 for DETR R50 and 0.120 for RF-DETR Nano.
Within our experimental setup, YOLOv8n performed best on these metrics.
However, the absolute scores were low. This does not mean the model was ready for reliable traffic surveillance deployment.
2. DETR R50 Achieved Slightly Higher Recall
DETR R50 achieved an AR@100 of 0.145, compared with 0.140 for the other two models.
The difference was small, and DETR's average precision was lower.
This result doesn't establish that transformers generally achieve higher recall. It describes the behavior we observed in this evaluation.
3. RF-DETR Nano Showed Intermediate Precision
RF-DETR Nano achieved an [email protected] of 0.120, placing it between YOLOv8n and DETR R50.
Its hybrid architecture combines convolutional features with transformer attention.
However, because we evaluated it as class-agnostic, its results should not be treated as a fully equivalent multi-class detection comparison.
The Bigger Problem: Domain Shift
All three models produced low absolute detection scores.
One likely reason was domain shift.
The models used general-purpose pretrained representations, while UA-DETRAC contains traffic footage with different camera angles, vehicle sizes, and viewing conditions.
A detector that performs well on ordinary photographs may struggle with small vehicles viewed from an elevated traffic camera.
Other possible factors discussed in our paper include:
- Lack of domain-specific fine-tuning
- Class distribution differences
- Detection threshold settings
- Occlusion and differences in object scale
This highlights why pretrained models should be evaluated on the actual data they will encounter in production.
What This Means for Real-World Computer Vision
There are several practical lessons from our experiment:
- Test on representative data. Public benchmark scores may not reflect performance on your target dataset.
- Compare multiple metrics. Higher precision doesn't necessarily mean higher recall.
- Check the detection setup. Class-agnostic and multi-class evaluations don't measure exactly the same capabilities.
- Consider domain adaptation. Fine-tuning may be necessary for specialized environments.
- Measure hardware performance separately. Accuracy results alone cannot establish which model is fastest.
Our study did not provide a controlled inference-speed or memory benchmark, so we cannot use these results to rank the models by runtime performance.
Conclusion
In our vehicle detection comparison:
- YOLOv8n achieved the highest average precision.
- DETR R50 achieved slightly higher average recall.
- RF-DETR Nano produced intermediate precision.
However, all three models struggled under the reported evaluation setup.
The main lesson is simple:
A model that performs well on a general benchmark isn't necessarily the right model for your real-world data.
Original Research
Paper: Comparative Analysis of CNN-Based and Hybrid Transformer-Based Object Detection for Vehicle Detection in Intelligent Transportation Systems
Authors: Dushko Sofronievski, Borjan Ladinski, Marija Stankova Medarovska, and Viktor Denkovski.
Affiliation: University American College Skopje, School of Computer Science and Information Technology.
Read the full technical article:
https://borjan.ladinski.com/articles/yolov8-vs-detr-vs-rf-detr-vehicle-detection/
About the Author
I'm Borjan Ladinski, an AI Engineer, AI Expert, and AI Consultant based in Skopje, North Macedonia.
I work on computer vision, machine learning, AI agents, LLM applications, RAG systems, and Python backend development.
Explore my projects and AI consulting services:
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.