Automatic Vehicle Detection using DETR: A Transformer-Based Approach for Navigating Treacherous Roads
Authors: Istiaq Ahmed Fahad, Abdullah Ibne Hanif Arean, Nazmus Sakib Ahmed, Mahmudul Hasan
Organizations: Institute of Information Technology, University of Dhaka, Dhaka, Bangladesh · Dept. of Computer Science and Engineering, University of Dhaka, Dhaka, Bangladesh
Automatic Vehicle Detection (AVD) in diverse driving environments presents unique challenges due to varying lighting conditions, road types, and vehicle types. Traditional methods, such as YOLO and Faster R-CNN, often struggle to cope with these complexities. As computer vision evolves, combining Convolutional Neural Networks (CNNs) with Transformer-based approaches offers promising opportunities for improving detection accuracy and efficiency. This study is the first to experiment with Detection Transformer (DETR) for automatic vehicle detection in complex and varied settings. We employ a Collaborative Hybrid Assignments Training scheme, Co-DETR, to enhance feature learning and attention mechanisms in DETR. By leveraging versatile label assignment strategies and introducing multiple parallel auxiliary heads, we provide more effective supervision during training and extract positive coordinates to boost training efficiency. Through extensive experiments on DETR variants and YOLO models, conducted using the BadODD dataset, we demonstrate the advantages of our approach. Our method achieves superior results, and improved accuracy in diverse conditions, making it practical for real-world deployment. This work significantly advances autonomous navigation technology and opens new research avenues in object detection for autonomous vehicles. By integrating the strengths of CNNs and Transformers, we highlight the potential of DETR for robust and efficient vehicle detection in challenging driving environments.
Figures & tables
Fig. 1 : Districts of Bangladesh from which the BadODD data were collected
Fig. 2 : Location-wise train–test data distribution
Fig. 3 : Class Distribution of BadODD Dataset
Fig. 4 : Examples from the dataset illustrating diverse road conditions and vehicle types under different lighting scenarios. The top row (a)–(c) depicts daytime scenes, while the bottom row (d)–(f) shows nighttime scenes. This dataset is intended for studying diverse traffic patterns and vehicle behavior in Bangladesh.
Fig. 5 : Comparison of image enhancement techniques applied to a raw street scene. (a) Raw image, (b) Image after Histogram Equalization, (c) Image after Contrast Limited Adaptive Histogram Equalization (CLAHE), and (d) Image after Gamma Correction. These techniques improve visual clarity and highlight different features in the dataset.
Fig. 6 : Workflow of the proposed methodology for automatic vehicle detection using DETR
Fig. 7 : Framework of collaborative hybrid assignments training for DETR (Co-DETR). The auxiliary branches are discarded during inference [ 13 ]
Parameter
Value
Model
YOLOv8m
Base learning rate
0.018
Momentum
0.933
Cosine learning-rate schedule
Enabled
Deterministic training
Enabled
Random seed
43
TABLE I : YOLOv8m Training Configuration
Parameter
Value
Model
Co-DETR
Backbone
Swin Transformer
Pretrained image size
384
Embedding dimensions
192
Depths
[2, 2, 18, 2]
Number of heads
[6, 12, 24, 48]
TABLE II : Co-DETR Training Configuration
Epochs
mAP Scores
YOLOv8m
Co-DETR
1
0.236
0.372
4
0.255
0.418
9
0.295
0.438
TABLE III : Mean Average Precision (mAP) Scores for YOLOv8m and Co-DETR Models Across Different Epochs