Intelligent ROI-Based Vehicle Counting Framework for Automated Traffic Monitoring
Authors: Mohamed A. Abdelwahab, Zaynab Al-Ariny, Mahmoud Fakhry, El-Sayed Hasaneen
Organizations: Electrical Engineering Dept., Faculty of Energy Engineering, Aswan University, Aswan, Egypt · Information Technology Dept., New Assiut Technological University (NATU), Assiut, Egypt · Electrical Engineering Dept., Faculty of Engineering, Sohag University, Sohag, Egypt · Electrical Engineering Dept., Faculty of Engineering, Aswan University, Aswan, Egypt · CEIEC Research Institute, Universidad Francisco de Vitoria, Madrid, Spain
Accurate vehicle counting through video surveillance is crucial for efficient traffic management. However, achieving high counting accuracy while ensuring computational efficiency remains a challenge. To address this, we propose a fully automated, video-based vehicle counting framework designed to optimize both computational efficiency and counting accuracy. Our framework operates in two distinct phases: estimation and prediction. In the estimation phase, the optimal region of interest (ROI) is automatically determined using a novel combination of three models based on detection scores, tracking scores, and vehicle density. This adaptive approach ensures compatibility with any detection and tracking method, enhancing the framework's versatility. In the prediction phase, vehicle counting is efficiently performed within the estimated ROI. We evaluated our framework on benchmark datasets like UA-DETRAC, GRAM, CDnet 2014, and ATON. Results demonstrate exceptional accuracy, with most videos achieving 100% accuracy, while also enhancing computational efficiency, making processing up to four times faster than full-frame processing. The framework outperforms existing techniques, especially in complex multi-road scenarios, demonstrating robustness and superior accuracy. These advancements make it a promising solution for real-time traffic monitoring.
Figures & tables
Figure 1: The optimal region for vehicle counting varies considerably between videos. Interestingly, each video demonstrates strong internal consistency, with the best region-highlighted in yellow-remaining relatively stable throughout the video. (a), (b) and (c) show the counting accuracy of different videos from the UA-DETRAC dataset
Figure 2: Key components of the proposed AIR-VC framework, including estimation and prediction phases
Figure 3: The camera-limited regions (highlighted in red) for different scenarios from the UA-DETRAC dataset. For the area near the camera, the camera angle restricts the visibility of the leftmost and rightmost lanes in (a) and (b). In (c), an obstacle hides the middle area of the frame
Figure 4: Identifying the HDDR: A Heatmap is generated using the previously obtained detection scores. The HDDR (region within cl1 and cl2 ) is identified according to the generated heat map. The HDDR is represented by the wider region with the most vehicle detections
Figure 5: Selecting the optimal counting line(the red dashed line) within the HDDR which indicated by ( cl1 , cl2 )
Figure 6: Samples of selected ROI for videos from UA-DETRAC Dataset. Samples show videos with (a) vertical and (b) horizontal traffic flow
Sequence
Entire Frame
AIR-VC
Speed
h×w
FPS
h×w
FPS
Imp.
M_30
480 × 800
32
98 × 800
114
255%
Highway
240 × 320
26
112 × 320
53
103%
HighwayII
240 × 320
26
36 × 320
115
337%
MVI_63521
540 × 960
32
99 × 960
114
258%
MVI_40992
540 × 960
26
540 × 376
32
23%
Table 1: Processing speed (FPS) using the entire frame and the proposed AIR-VC for each video sequence. h×w refers to the sequence resolution (Height × Width). The last column shows the speed improvement achieved by using AIR-VC compared to using the entire frame.
Figure 7: Counting accuracy for M-30, Highway and HighwayII video sequences using clo selected by the proposed AIR-VC (red line) and other uniformly distributed counting lines across the frame (white lines)
Figure 8: Counting accuracy for video sequences from UA-DETRAC dataset using clo selected by the proposed AIR-VC (red line) and other uniformly distributed counting lines across the frame (white lines)
Sequence
M-30
Highway
HighwayII
lanes
4
2
4
S. Li [ 6 ]
100%
96.3%
N/A
Abdelwahab [ 8 ]
93.51%
96.43%
95.83%
Zaynab [ 9 ]
98.7%
100%
97.9%
A. Gomaa [ 2 ]
100%
100%
97.9%
Adson [ 1 ]
98.7%
100%
97.92%
Table 2: Counting accuracy comparison for M-30, Highway and HighwayII video sequences.
Sequence
S. Li [ 7 ]
Yang [ 32 ]
Proposed
name
lanes
AIR-VC
MVI_63521
3+3
97.56%
N/A
100%
MVI_40992
2
N/A
N/A
100%
MVI_40963
5
98.57%
N/A
100%
MVI_40192
4+4
99.08%
97.96%
98.9%
Table 3: Counting accuracy comparison for video sequences from UA-DETRAC dataset.
Sequence
Accuracy
name
lanes
M-30
3+3+4
99.1%
HighwayII
3+4
85.7%
MVI_40963
1+5+3
98.1%
Table 4: Counting accuracy for M-30, HighwayII and MVI_40963 video sequences considering multi-roads scenario using the proposed AIR-VC.
Figure 9: Counting accuracy considering multi-roads scenario using clo selected by the proposed AIR-VC (red line) and other uniformly distributed counting lines across the frame (white lines)
Recent advancements in computer vision, driven by artificial intelligence, have significantly enhanced monitoring systems. One notable application is traffic monitoring, which leverages computer vision alongside deep learning-based object detection and counting. We present an offline, real-time traffic monitoring system that couples a pre-trained YOLOv11 detector with BoT-SORT/ByteTrack for multi-object tracking, implemented in PyTorch/OpenCV and wrapped in a Qt-based desktop UI. The CNN pipeline enables efficient vehicle detection and counting from video streams without cloud dependencies. Across diverse scenes, the system achieves (66.67-95.83%) counting accuracy. Class-wise detection yields high precision (cars: 0.97-1.00; trucks: 1.00) with strong recall (cars: 0.82-1.00; trucks: 0.70-1.00), resulting in F1 scores of (0.90-1.00 for cars and 0.82-1.00 for trucks). While adverse weather conditions may negatively impact this performance, results remain robust in typical conditions. By integrating lightweight models with an accessible, cloud-independent interface, this paper contributes to the modernization and development of future smart cities by showing the capacity of AI-driven traffic monitoring systems.
Shkelqim Sherifi
Dept. of Computer Science, University of Tetovo, Tetove, R.N.Macedonia
Accurate vehicle detection is a critical component of autonomous driving, traffic surveillance, and intelligent transportation systems. This paper presents an enhanced YOLOv8n-based model that integrates the Ghost Module, Convolutional Block Attention Module (CBAM), and Deformable Convolutional Networks v2 (DCNv2) to improve detection performance. The Ghost Module reduces feature redundancy through efficient feature generation, CBAM refines feature representation via channel and spatial attention, and DCNv2 enhances adaptability to geometric variations in vehicle structures. Evaluated on the KITTI dataset, the proposed model achieves 95.4% [email protected], representing an 8.97% improvement over the baseline YOLOv8n, along with 96.2% precision, 93.7% recall, and a 94.93% F1-score. Comparative analysis against seven state-of-the-art detectors demonstrates consistent superiority across key performance metrics, while ablation studies validate the individual and combined contributions of the integrated modules. By addressing feature redundancy, attention refinement, and spatial adaptability, the proposed approach offers a robust and computationally efficient solution for vehicle detection in diverse and complex traffic environments.
Syed Sajid Ullah, Muhammad Zunair Zamir, Ahsan Ishfaq +1
School of Energy and Electrical Engineering, Chang’an University, Xi’an, China · School of Information Engineering, Chang’an University, Xi’an, China
Urban traffic management increasingly requires intelligent sensing systems capable of adapting to dynamic traffic conditions without costly infrastructure modifications. Vision-based vehicle detection has therefore become a key technology for modern intelligent transportation systems. This study presents Video Detector (VD), a dual-phase vision-based traffic intersection management system designed as a flexible and cost-effective alternative to traditional inductive loop detectors. The framework integrates a real-time module (VD-RT) for intersection control with an offline analytical module (VD-Offline) for detailed traffic behavior analysis. Three system configurations were implemented using SSD Inception v2, Faster R-CNN Inception v2, and CenterNet ResNet-50 V1 FPN, trained on datasets totaling 108,000 annotated images across 6-10 vehicle classes. Experimental results show detection performance of up to 90% test accuracy and 29.5 [email protected], while maintaining real-time throughput of 37 FPS on HD video streams. Field deployments conducted in collaboration with Istanbul IT and Smart City Technologies Inc. (ISBAK) demonstrate stable operation under diverse environmental conditions. The system supports virtual loop detection, vehicle counting, multi-object tracking, queue estimation, speed analysis, and multiclass vehicle classification, enabling comprehensive intersection monitoring without the need for embedded road sensors. The annotated dataset and training pipeline are publicly released to support reproducibility. These results indicate that the proposed framework provides a scalable and deployable vision-based solution for intelligent transportation systems and smart-city traffic management.
Mustafa Fatih Şen, Halûk Gümüşkaya, Şenol Pazar
Ankageo Co. Ltd., Yıldız Technical University, İkitelli Technopark, 34220 Istanbul, Türkiye · Department of Computer Engineering, Istanbul Arel University, 34537 Istanbul, Türkiye · Department of Electrical and Electronics Engineering, Biruni University, 34015 Istanbul, Türkiye