Bayesian Hyperparameter Optimization of GRU and LSTM Models for Short-Term Traffic Flow Prediction: A Case Study of Globe Roundabout in Saudi Arabia
Abstract
Accurate short-term traffic flow prediction is vital for effective signal control and sustainable urban mobility. Deep learning models, such as the Gated Recurrent Unit (GRU) and Long Short-Term Memory (LSTM) networks, have demonstrated strong capability in modelling temporal traffic dynamics. However, the influence of their architectural and hyperparameter configurations remains underexplored. This study proposes a systematic methodology to assess the impact of hyperparameter optimization on GRU and LSTM models for predicting traffic flow at a signalized intersection. The methodology is evaluated using minute-level traffic data from the Globe Roundabout in Jeddah, Saudi Arabia. Bayesian optimization is applied to identify the best-performing hyperparameters. The results show that the optimized GRU model achieves a Root Mean Square Error (RMSE) of 0.0953, representing a 90.2% improvement compared to the baseline GRU (RMSE ≈ 0.969). Likewise, the optimized LSTM model attains an RMSE of 0.0960, corresponding to an 85.2% improvement relative to its baseline (RMSE ≈ 0.648). Similar gains are observed for the Mean Absolute Error. Visual analysis further shows that optimized models reduce smoothing bias, enhance the tracking of transient fluctuations, and produce stable, low-variance residuals. The findings demonstrate that hyperparameter optimization substantially improves predictive accuracy while preserving computational efficiency, enabling lightweight recurrent architectures to perform at a level comparable to more complex models.
Fields of Study & Subjects
Traffic Prediction and Management Techniques
Traffic control and management
Traffic and Road Safety
Publication details
- Journal / source
- Applied System Innovation
- Publisher
- MDPI AG
- Volume
- 9
- Issue
- 3
- Pages
- 57–57
- Publication date
- 10 March 2026
- Language
- EN