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.
atef et al. (Tue,) studied this question.