Traffic density estimation combines vision and forecasting models

Real-Time Traffic Density Estimation: A Hybrid Computer Vision and Predictive Machine Learning Pipeline

Computer Vision and Pattern Recognition

Summary

Traffic cameras see cars but understanding how many are on the road right now and what will happen next is hard. The authors built a two-step system: first it spots and follows cars on the road, then it predicts short-term trends using smart prediction models. They tested different ways to detect cars and forecast traffic to find what balances accuracy and speed best. While the system shows promise, some parts like road filtering weren’t fully tested due to missing data.

What this means in practice

Authors

Prince Kwabena Appiah Boadu

Abstract

Traffic density estimation from camera feeds requires connecting visual perception with short-horizon forecasting. We present a two-stage pipeline that combines vehicle detection and tracking with a spatial logic layer, followed by a temporal estimator. The spatial layer filters bounding boxes by their overlap with a precomputed road mask and extracts per-frame traffic features. LSTM, GRU, and Temporal Convolutional Network (TCN) estimators use these features to predict five future steps from a ten-frame input window. We benchmark ten detector variants from six families on a dataset of 5,716 annotated frames using a single NVIDIA GPU. YOLOv5l achieves the highest mAP@50:95 of 0.524 at 56 frames per second, while YOLOv8n reaches 258 frames per second at 0.487 mAP@50:95; these rates measure detector inference without tracking or spatial filtering. Temporal evaluation on 29,243 held-out windows yields aggregate R-squared values of 0.858 for GRU, 0.856 for LSTM, and 0.840 for TCN. These metrics measure forecasts of detector-derived telemetry and are dominated by direction variance, rather than establishing absolute traffic-density accuracy. No road mask was available for the evaluation stream, limiting validation of the spatial filtering component. A live run on a third camera stream examines forecasting behavior within the complete pipeline. The results characterize detector speed-accuracy trade-offs and the limitations of short-window traffic telemetry forecasting.