Real-time Traffic Forecasting for Smart Cities using a Hybrid Transformer Architecture with Adaptive Optimization
摘要
Rapid urbanization and growing vehicle density have led to severe traffic congestion, causing delays, economic losses, and environmental degradation, while traditional traffic prediction models struggle to accurately capture dynamic spatial and temporal patterns. This study proposes a high-performance hybrid traffic prediction framework that integrates a Transformer-based spatial learning mechanism with a Temporal Convolutional Network (TCN) for temporal sequence modeling, optimized using the Adaptive Rectified Adam (AdaRAdam) optimizer to enhance convergence, reduce overfitting, and improve generalization. The model is trained and evaluated on the METR-LA dataset, a widely used real-world traffic speed and flow dataset collected from loop detectors across Los Angeles highways, ensuring realistic benchmarking. Advanced feature extraction, correlation-based feature selection, and ensemble output averaging further enhance predictive stability. Experimental results demonstrate that the hybrid Transformer–TCN model optimized with AdaRAdam achieves 98.7% prediction accuracy. Quantitatively, the Transformer–TCN model achieved an accuracy of 98.7%, with MAE = 1.83, RMSE = 3.41, MAPE = 3.12%, and R² = 0.982, outperforming the strongest baseline (Graph WaveNet, accuracy = 96.5%, RMSE = 3.62). The proposed framework provides a scalable and intelligent solution for real-time traffic forecasting, contributing to smarter route planning, reduced congestion, and more sustainable urban mobility in modern transportation systems.