Spatiotemporal modeling and prediction of road network traffic flow are essential components of intelligent transport systems (ITS), aimed at effectively enhancing road service levels. Sustainable and reliable traffic management in smart cities requires the use of modern algorithms based on a comprehensive analysis of a significant number of dynamically changing factors. This paper designs a Crested Porcupine Optimizer (CPO)-CNN-LSTM-Attention time series prediction model, which integrates machine learning and deep learning to improve the efficiency of traffic flow forecasting in the condition of urban roads. Based on historical traffic patterns observed on Paris’s roads, a traffic flow prediction model was formulated and subsequently verified for effectiveness. The CPO algorithm combined with multiple neural network models performed well in predicting traffic flow, surpassing other models with a root-mean-square error (RMSE) of 17.35–19.83, a mean absolute error (MAE) of 13.98–14.04, and a mean absolute percentage error (MAPE) of 5.97–6.62%. Therefore, the model proposed in this paper can predict traffic flow more accurately, providing a solution for enhancing urban traffic management in intelligent transportation systems, and thus offering a research direction for the future development of smart city construction.
Topilin et al. (2025) studied this question.