Next Article in Journal
Social Geoparticipation and Spatial Justice in Campus Revitalization: The Warsaw University of Technology Case Study
Previous Article in Journal
Double Agglomeration of the Agricultural Industry, Technological Innovation, and Farmers’ Agricultural Incomes: Evidenced by the Citrus Industry
Previous Article in Special Issue
Developing Intelligent Integrated Solutions to Improve Pedestrian Safety for Sustainable Urban Mobility
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Predicting Urban Traffic Congestion Through Deterministic and Stochastic Modeling Using LSTM Neural Networks

1
Educational Program “Technology of Transport Processes”, Advanced Engineering School of Engine Building and Special Equipment “Heart of the Urals”, South Ural State University, 454080 Chelyabinsk, Russia
2
Department of Mathematical and Computer Modeling, South Ural State University, 454080 Chelyabinsk, Russia
3
Department of Organization and Traffic Safety, Moscow Automobile and Road Construction State Technical University, 125319 Moscow, Russia
4
Department of Computer Science, South Ural State University, 454080 Chelyabinsk, Russia
*
Author to whom correspondence should be addressed.
Sustainability 2025, 17(23), 10655; https://doi.org/10.3390/su172310655
Submission received: 23 October 2025 / Revised: 23 November 2025 / Accepted: 25 November 2025 / Published: 27 November 2025
(This article belongs to the Special Issue Smart Mobility for Sustainable Development)

Abstract

Urban traffic congestion leads to significant economic losses, increased air pollution, and reduced quality of life, making its prediction and mitigation a critical task for sustainable urban development. Traditional prediction methods are often not integrated with real-time monitoring data, which limits their practical applicability. To bridge this gap, this paper proposes a novel approach that combines deterministic and stochastic simulation modeling to predict traffic congestion of varying complexity. The approach is based on a simulation model developed in the Matlab Simulink environment. The model uses real data from the AIMS eco software package, which provides real-time traffic monitoring. The simulation experiments demonstrated the dynamics of congestion formation and dissipation under various scenarios. Based on these experiments, a neural network (based on LSTM) was developed and trained on an extended dataset to predict the growth of queue length. The LSTM model achieved high accuracy in predicting queue dynamics, with a mean absolute error (MAE) of 1.5 vehicles for the number of vehicles unable to pass through the intersection per cycle and 0.3 vehicles for the total queue size. The developed model represents an effective tool for analyzing and predicting traffic congestion, thereby providing a scientific foundation for integrating a predictive module into intelligent transportation systems (ITS) such as AIMS eco.

1. Introduction

Urban traffic congestion remains one of the most pressing challenges in modern urban planning, with multifaceted negative impacts on the environment, the economy, and quality of life. A critical consequence of congestion is the significant deterioration of the urban environment. Idling and unsteady engine operation can increase pollutant emissions by 30% or more, posing a direct threat to the health of city residents [1,2,3,4]. Despite the existence of various mathematical models describing traffic congestion dynamics, their practical application is often limited by the lack of integration with real-time traffic monitoring systems [5,6,7,8]. Traditional approaches to congestion prediction demonstrate insufficient effectiveness when processing large volumes of heterogeneous data from modern intelligent transportation systems. This creates a significant gap between theoretical developments and their practical implementation in urban mobility management systems.
Congestion conditions vary greatly in their causes and contributing factors, scale, and duration. While there is no official classification of congestion, many authors offer their own classifications. Based on generalizations, a simple classification can be proposed: non-recurrent (random) and recurrent (pulsating) congestion [9,10,11,12].
Non-recurrent congestion occurs at unexpected locations along the road network and is typically caused by major incidents, such as accidents, the clearance of which can require up to 3–4 h. During such events, roadway capacity can decrease by 50 or even come to a complete standstill [13,14,15]. Similar situations arise from failures of underground utilities (e.g., water mains, gas pipelines, or electrical systems), requiring immediate emergency response and resulting in full or partial road closures.
Recurrent traffic congestion typically occurs in the same locations, most often at traffic signal intersections that are unable to handle the required traffic volume, or at sites of prolonged roadside repairs with closed road sections. Such congestion often not constitute a complete standstill but rather a pulsating flow that moves forward during green phases.
Traffic congestion, like any traffic delay, lead to economic losses, including time losses for passengers and vehicle owners, reduced efficiency of freight transportation, and increased fuel consumption [16]. It also contributes to a higher incidence of accidents (particularly rear-end collisions) and increases driver stress [17]. However, the most significant negative consequence of traffic congestion, especially in urban areas, is their severely negative impact on the environment. Increased fuel consumption, combined with a high proportion of stop-and-go driving and engine idling, can raise pollutant emissions by 30% or more, posing a substantial threat to human health [18,19,20,21].
Congestion is characterized by its duration and the number of vehicles involved. The latter can be estimated based on the queue length and the traffic density when vehicles are stationary.
In a slow-moving vehicle queue within a zone of complete traffic congestion, the negative environmental impact approaches that of a total standstill, while the economic indicators of the transportation process deteriorate significantly compared to standard norms. Therefore, many researchers and experts believe such a flow to be in a traffic congestion. They define the lower speed threshold for this state as 10–15 km/h (corresponding to a travel time of 4–6 min/km) [22,23].
Addressing the problem of congestion mitigation first requires identifying locations where congestion is expected and symptoms of insufficient capacity of road network nodes (congestion) are already present. This task can be most reliably solved through comprehensive monitoring. This task can be most effectively solved through comprehensive monitoring. Video surveillance using stationary street cameras is a highly effective method for collecting such information, as it is particularly adept at detecting congestion origins [24,25]. Owing to the ongoing development of Intelligent Transportation Systems (ITS), diverse traffic data sources provide substantial information volumes [26]. These big data are used to develop models for predicting various traffic conditions. Accurate prediction enables city transport services to take timely measures to mitigate traffic congestion [27,28].
The aim of this study is to develop a methodology for predicting traffic congestion of varying complexity based on the integration of simulation modeling and deep learning. To achieve this goal, the following tasks were set: (1) developing a simulation model of congestion formation in the MATLAB/Simulink (Math Works-Simulink R2014b) environment; (2) creating an LSTM model for predicting vehicle queue growth; and (3) verifying the developed models using real-world traffic monitoring data.
This paper presents the development of a simulation model for predicting traffic congestion of varying complexity at urban intersections. The AIMS eco “Real-Time Vehicle Emissions Monitoring System” software package (https://aims.susu.ru/demo/dashboard/chelyabinsk/city accessed on 1 October 2025) [29] serves as the primary data source for the model.

2. Related Work

Ye et al. [30] studied the factors of urban traffic congestion heterogeneity: population density and the location of the business district affect road congestion, while an increase in the number of bus stops reduces traffic congestion. Zhao et al. [31] addressed the problem of short-term congestion prediction by applying a Self-Organizing Feature Map (SOFM) model to classify congestion levels based on a system of indices. Similarly, building on traffic efficiency indices and the self-organizing map method, a study [32] proposed clustering traffic congestion patterns for different day types, including Mondays, Fridays, weekdays, weekends, and holidays. For short-term forecasting (30 min) of traffic flow (TF) at a signalized intersection, Qu et al. [33] compared a KNN regression model, a clustering-based algorithm, and two neural network models. Their findings indicate that such forecasting can enable users to plan trips and facilitate appropriate traffic management measures.
Elleuch et al. [34] developed a traffic congestion classification system (categorizing states into light, moderate, and heavy traffic) based on spectrograms derived from traffic videos and a neural network. Gatto and Forster [35] utilized sound sensors combined with machine learning for traffic monitoring.
In recent years, the continuous advancement of deep learning has led to the increasing adoption of neural network-based models for traffic forecasting [36,37]. Ma et al. [38] proposed a Long Short-Term Memory (LSTM) neural network for traffic flow analysis. The proposed model demonstrated superior accuracy and stability compared to other common algorithms.
Similarly, to predict traffic congestion occurrence, a study [39] implemented an LSTM model using data from vehicle detectors. Liu et al. [40] detected traffic congestion by analyzing transformed online road images, employing a deep graph convolutional neural network for prediction. A deep graph process model for predicting traffic congestions complexity in urban transport environments was presented in [41]. The traffic congestion early warning system introduced in [42] integrated point prediction, TF parameter characteristic estimation, interval prediction, and a comprehensive assessment of the overall road congestion level.
Recently, researchers have enhanced LSTM capabilities by training models on input data in both forward and backward directions, resulting in Bidirectional LSTM (BiLSTM) architectures, which have shown improved performance in capturing temporal dependencies [43].
The application of a deep reinforcement learning (RL) approach with BiLSTM-ASBO in [18] demonstrated higher predictive efficiency and reliability for traffic congestion occurrence. In [44], speed data from autonomous vehicles (AVs), shared via V2X communication, were utilized for time-series forecasting of road congestion. To enhance forecasting performance, researchers are increasingly adopting hybrid models, which consistently demonstrate superior results compared to single-model approaches. For instance, the short-term forecasting method introduced in [45] integrates a deep neural network with a subset selection technique for data mining. A study [36] proposes a model that leverages the temporal and spatial correlations of traffic flow, along with other key traffic flow parameters. A hybrid methodology combining deep learning with data-denoising algorithms is presented in [46] for accurate short-term traffic volume estimation at three adjacent intersections.
The role of Intelligent Transportation Systems (ITS) in mitigating traffic congestion is explored in [47].
A promising approach for traffic analysis, based on computational fluid dynamics theory, was applied in [48]. This study provides recommendations for infrastructure design to alleviate recurrent congestion and proposes dynamic speed limit controls for managing non-recurrent congestion caused by incidents.
Recent research demonstrates a paradigm shift from reactive to predictive and preventive management in approaches to solving traffic congestion problems [49,50,51]. A key condition for effective traffic congestion management is comprehensive traffic flow monitoring using diverse data sources, including video surveillance, vehicle detectors, sound sensors, and V2X technologies. Modern research is increasingly focused on the development of ITS that synthesize artificial intelligence methods with big data analytics. The dominant trend is a shift from isolated models to complex hybrid solutions, which combine:
-
Neural network architectures (LSTM, CNN, BiLSTM, graph networks);
-
Machine learning methods (SOFM, clustering, regression analysis);
-
Physical models (computational fluid dynamics).
Approaches that account for the spatiotemporal correlations of traffic flows and provide short-term forecasting (30 min or less) to support operational management decisions are considered particularly promising.
For instance, in the railway sector, investigation [52] proposes an Autonomous Train Control System (ATCS) to enhance the coordination and efficiency of train operations. This system is capable of processing real-world data, generating predictions, and implementing advanced operational strategies.
The development of ITS is advancing toward the creation of comprehensive early warning systems. Such systems are capable of not only detecting but also predicting congestion of varying severity, thereby enabling a proactive urban mobility management model. For example, studies show that a single autonomous vehicle within a traffic stream can positively influence the behavior of up to 20 surrounding vehicles, reducing speed deviation, fuel consumption, and excessive braking [53]. Similarly, the use of unmanned aerial vehicles (UAVs) for traffic monitoring, as presented in [54], leverages deep learning for vehicle detection and tracking. This approach enables the assessment of traffic flow characteristics, the extraction of vehicle trajectories, and collision prediction. However, challenges related to UAV flight safety and data integrity remain unresolved.

3. A Conceptual Approach to Constructing a Traffic Congestion Model

The final result of the developed computer model is the implementation of a software module for the AIMS eco package, designed to predict the aggravating congestion at urban transport network nodes and its dissipation when disturbances are eliminated. This implies the presence of a source data shaping macroblock, a calculation and analytical block for signaling potential congestion, and a traffic congestion state predicting block (Figure 1).
  • Source data shaping block.
The source data macroblock, which generally provides information in real time, should include the following blocks:
  • A block for determining the saturation flow (SF) or maximum traffic capacity (TCmax), both for the traffic directions and for the crossing intersection as a whole;
  • A block for generating the actual hourly average traffic flow (TFav). We assume that TFav corresponds to unsaturated traffic;
  • A block for monitoring the actual 2 min traffic flow (TFac).
2.
Analytical block.
The analytical macroblock should include blocks for calculating deviations in the traffic capacity values for the traffic directions: maximum, average, and actual over an averaged two-minute time interval. Based on these calculations, signal information about the possibility of congestion will be generated. The analytical macroblock will include the following blocks:
  • A block for creation of a “congestion profile” (CP) for the intersection as a margin in the deviation of the average capacity of traffic directions from the maximum capacity (CP = TCmax – TCav);
  • A signaling block for monitoring the margin based on the actual capacity (TFmarg = TCmax − TFac);
  • An analytical block, in the presence of congestion, of the actual traffic flow deviation from the average one (TFdev = TFav − TFac).
3.
Prediction block.
In case of congestion, forecasts are made for the increase in the queue of vehicles, or for the dissipation of the traffic congestion when its cause is eliminated. The levels of capacity deviations identified by the analytical block will be used to assess the level of complexity of a possible traffic congestion. The prediction block will include the following blocks:
  • A block for predicting the increase in the queue of vehicles in a traffic congestion;
  • A block for predicting the congestion dissipation time after elimination of the cause of congestion;
  • A block for assessing the level of complexity of possible congestion.
This paper examines in detail the construction of computer models for the third block, which will subsequently serve as the basis for implementing a similar software block for predicting traffic congestion in the AIMS eco package.

4. Predictive Mathematical Model

Let us consider the basic mathematical relationships that determine the calculated content of the blocks in the predictive part of the conceptual model.
It should be noted that all calculations use the specific value of traffic intensity, determined by the formula:
N s p = k 1 · N 1 + k 2 · N 2 + + k n · N n ,
where k1, k2, …, kn are coefficients for converting vehicle types to passenger car equivalents; N1, N2, …, Nn are the number of moving vehicles.
A common approach to create a traffic congestion predictive model that takes into account historical traffic data with a 2 min increment, the number of lanes and their maximum capacity, and the impact of accidents on the capacity of each lane, can be applying the multiple regression, taking into account the dynamic influence of factors. The linear multiple model is represented as follows:
T C t = f I t ; V t ; N ; C ; P ; S ; T = a 0 + a 1 · I t + a 2 · V t + a 3 · N + a 4 · C + a 5 · P + a 6 · S + a 7 · T ,
where TC is the time it takes for the congestion to reach a certain level; I(t) is traffic density at time t (vehicles/2 min); V(t) is average speed at time t (km/h); N is the number of lanes in the direction at the intersection; C is the maximum capacity of a line (vehicles/2 min); P is the number of lanes closed due to accidents; S is the share in the reduction in capacity for each closed lane; T is time of day (to account for peak hours).
The advantage of this approach is that it identifies the main factors influencing traffic congestion. However, in this form, where all factors are considered equal, the regression model is not correct. Generally, it is necessary to separate time-dependent factors from constant or weakly time-dependent parameters.
More accurately, a congestion situation in one direction at a controlled intersection should be characterized by the number KC(t) of vehicles causing the congestion, which is dynamic depending on the number of time t increments with generally accepted duration of 2 min. In this case, the dependence of KC(t) on the stated factors can be explicitly expressed by the formula:
K c t = i = 1 t T F a c i · j = 1 P i S j i N T C m a x T F a c i · N P i N ,   i f   K c t > 0 K c t = 0 ,       i f   K c t 0     ,
where t is the time changed by given increments of 2 min; TFac(i) is the actual crossing capacity in one direction; TCmax is the maximum crossing capacity in one direction; P(i); Sj(i) are the number of lanes closed due to accidents and the share in the reduction in capacity for each closed lane (parameters can change dynamically over time).
The general form of Formula (3) can be simplified by assuming that the cause of congestion is constant over time, and by replacing the actual capacity with its average value over a 2 min period:
K c t = i = 1 t T F a v · j = 1 P S j N T C m a x T F a v · N P N .
The transition from the general form in Equation (3) to the simplified Equation (4) is justified by the short-term nature of the prediction horizon. Over a 2 min interval, the primary cause of congestion –such as the number of closed lanes (P) and their capacity reduction (Sj)—can be considered constant for the purpose of operational forecasting. This assumption aligns with traffic flow theory, where parameters are often treated as stationary over short durations for manageability and stability in estimation. It allows us to substitute the dynamically changing actual capacity TFac(i) with its average value TFav over the interval, significantly simplifying the model while maintaining forecasting accuracy for the near future.
In this form, Equation (4) can be used to estimate the growth of congestion as the number of vehicles accumulating on the highway in front of the intersection, depending on time.
It is also possible to calculate the queue length growth L(t), based on the dimensions of vehicles Di of various k classes and their percentage content mi in the traffic flow, as well as the average distance between vehicles in the congestion ∆L:
L t = K c t · 1 N · L + i = 1 k D i · m i .
The predicted time T for the congestion to dissipate can be estimated based on the increase in crossing capacity from the average TFav to the maximum possible TCmax after eliminating the cause of the congestion. In this case, the time estimate is calculated using the formula:
T = K c n T C m a x T F a v
where T is the number of 2 min time increments; KC(n) is the number of vehicles in the congestion at the time its cause is eliminated, calculated using Equation (4).
In the model version, it is advisable to assess the congestion complexity level based on the direction capacity reduction on the intersection where the congestion occurred. In this approach, the congestion complexity score (CS), as a measure of the reduction in capacity, can be determined based on the constants characterizing the congestion, using the formula:
C S = 1 j = 1 P j · S j N
Based on the expert assessments of the authors, the following classification of traffic congestion complexity levels is proposed, accompanied by a specific value for the CS congestion complexity score calculated parameter:
  • Level 1: CS = (0.1–0.3)—light congestion, minor impact on traffic;
  • Level 2: CS = (0.3–0.6)—moderate congestion;
  • Level 3: CS = (0.6–0.9)—severe congestion, requiring intervention;
  • Level 4: CS = (0.9–1)—extreme congestion, requiring an immediate solution.
Let us conduct a preliminary evaluation experiment using the congestion growth model determined by Formula (4) for the eastbound three-lane intersection of Lenin Avenue and Engels Street in Chelyabinsk, Russian Federation. The value of the average hourly load TFav of the traffic flow for June 2024 is determined from the database of the AIMS eco software package https://aims.susu.ru/demo/dashboard/chelyabinsk/city (accessed on 1 Octomber 2025) [29] (Figure 2).
Figure 2 clearly shows the dynamics of traffic flow increase in the morning and evening hours for weekdays and the stability of the flow throughout the month (four average weekly graphs). Days off are characterized by greater flow variations throughout the month and a single average daily peak, which aligns well with a priori expected results.
In the calculations, we assume the actual traffic load level of the TFav on the highway for 1 July 2024, at 6:00 PM as 1774 vehicles/hour, or 59.1 vehicles/2 min. The maximum capacity TCmax of the highway, according to the AIMS eco software package, is estimated at 2000 vehicles/hour, or 66.7 vehicles/2 min.
For three-lane traffic, Equation (4) takes the form:
K c t = i = 1 t 59.1 · j = 1 3 · S j 3 7.6 · 3 P 3
The experiment includes variations in the number of lanes blocked by congestion, as well as the percentage of capacity reduction for each blocked lane. The congestion buildup time t is measured in 2 min increments. Figure 3 shows graphs of the vehicle queue growth in congestion over 10 discrete 2 min increments for different capacity reduction shares of both one and two lanes.
As Figure 3 shows, the growth of the vehicle queue in the congestion is linear. This is due to the simplified model, which assumes a constant actual vehicle flow and the state of the congestion itself.
The congestion growth model can be complicated by taking into account 2 min random variations in the actual traffic flow, which adds a probabilistic element to the model. In this case, the model under consideration turns from the class of continuously deterministic models (D-scheme) to the class of stochastic models (Q-scheme). To introduce probabilistic processes into the congestion growth model under consideration, it is necessary to evaluate the statistical characteristics of the actual traffic flow, such as the characteristics of the center and the variations for the 2 min initial data.
Traffic flow variations over two-minute intervals during one working day were obtained from the AIMS eco software database. Figure 4a presents them against the hourly average values. The figure also demonstrates the change in the mean square deviation of traffic flow for each hour of the day. To enable comparison of these values, the graph shows the variation coefficient, which represents the mean square deviation reduced to the mathematical expectation.
According to Figure 4b, the minimum variations in the number of vehicles are observed during the hours of maximum traffic flow, between 9:00 and 20:00. This time is the most critical for the development of severe traffic congestion. The average variation coefficient in this time range is approximately 10%. The value of this statistical parameter is used as the basis for introducing random factors into the congestion forecast model.

5. Simulation Modeling of Congestion Development

Creating a simulation model of traffic congestion development is most conveniently done using the Matlab mathematical laboratory with the Simulink application. The main advantages of this tool include the ability to record time dependencies of the parameters of interest, as well as the rapid generation of both random variables with specified statistical parameters and dynamic blocks simulating the inertia of real processes.
A general approach to creating a simulation model for studying multi-lane highway traffic congestion involves identifying submodels of the same type for each traffic lane, with separate variations in congestion parameters (Pi; Si) for them. In the first stage of modeling, a deterministic D-class model is created, which is then complexified to a stochastic Q-model by introducing a random actual flow (TFac) with the statistical parameters defined above.
The transition from the deterministic model (D-scheme) to the stochastic model (Q-scheme) is achieved by modeling the actual traffic flow TEac(i) as a random variable. The statistical parameters for this variable—the mean (μ), variance (σ2), and coefficient of variation (CV)—are derived directly from the historical 2 min traffic data (see Figure 4). This approach explicitly accounts for the inherent randomness in vehicle arrivals. The key assumption here is the local stationarity of the traffic flow process within each 2 min interval, enabling the use of fixed statistical moments to describe the stochastic dynamics of congestion formation. The core algorithm for this stochastic simulation is summarized in the pseudo-code provided in Appendix A Algorithm A1.
For the three-lane highway discussed above, the mathematical model, defined based on Equation (4), is transformed to the following form:
K c t = i = 1 t j = 1 3 1 3 T F a c ( i ) · P j · S j i + T C m a x T F a c ( i ) · P j 1
where TFac(i) is the actual traffic flow, which can generally change dynamically over time, determined by index i— the two-minute current time increment; the Pj parameter determines whether congestion is present in the j-th lane (Pj = 1) or absent (Pj = 0); the Sj(i) parameter is the share in traffic capacity reduction due to congestion in j-th lane (it can also change dynamically over time).
In this case, for each of the three lanes, either the first term from Equation (9) (presence of congestion) or the second one (absence of congestion) is taken into account. The corresponding simulation model is shown in Figure 5.
The presented Q-model of traffic congestion formation includes autonomous blocks for increasing the number of vehicles in each of the three lanes, which are determined individually by the input stationary congestion parameters (Pj; Sj). A discrete integrator allows for the summation of vehicles in the congestion over time for two-minute traffic light cycles. A common inertial “Dynamics” block, simulating the actual process of vehicle queue growth, has also been added to the model.
The experimental studies are focused on similar initial data expressed in Equation (7) for the eastbound highway at the selected intersection. Figure 6a shows the graph of the increase in congestion during an accident on the first lane, which restricts traffic by 100%, 80%, and 60%, over 10 standard 2 min traffic signal cycles.
Figure 6a clearly demonstrates the discreteness and dynamics of the vehicle queue growth in the congestion, as well as the random nature of the queue size change over time. Moreover, as the share Sj in traffic capacity reduction decreases, the congestion may not increase, but even resolve.
It should be noted that the statistical parameters of the actual TFac flow were determined for the time period of 18:00–19:00 (maximum traffic flow) and are as follows: mean value mx = 59.1 vehicles/2 min; variation coefficient Kvar = 6.7%. Figure 6b shows the time realization of a random TFac signal with a uniform distribution in the conventional variation range (mx ± 3∙σ).
The conducted experiment demonstrates the general trend of vehicle queue formation in congestion over a short-term time scale. The dynamics of congestion over a time scale of several hours, when the traffic situation is unstable, are also of interest, in particular, with the change in the actual traffic flow TFac = f(t) over time. For this purpose, another experiment was developed and conducted: a dynamic reduction in the TFac parameter was implemented for a time range starting with the peak flow at 6:00 PM over a period of 3–4 h.
Figure 7 shows a graph of the actual traffic flow for the eastbound highway at the intersection under study for 120 two-minute time increments (4 h). It clearly demonstrates a steady downward trend in the TFac parameter.
The simplest linear trend to implement in the model, also shown in Figure 7, has a high approximation quality (R2), covering 84.82% of the actual traffic flow variability.
The revealed linear time dependence model, TFac(t) = 58.14 − 0.2726 × t, is implemented in a simulation model without stochastic variations. The experimental results for a three-hour time range starting at 6:00 PM (90 two-minute increments) are shown in Figure 8.
As follows from the oscillogram in Figure 8a, when the actual traffic flow TFac decreases (Figure 8b), the congestion tends to dissolve on its own, even without any possible regulatory measures, such as eliminating the cause of the congestion or redirecting traffic flows to other routes. For example, when the capacity is reduced from S1 = 1 to S1 = 0.8, the congestion completely disappears in approximately 2.5 h. This is followed by a “flow growth reserve” defined by negative values for the queue size of vehicles in the congestion.
Subsequent simulation experiments involve the consideration and analysis of congestion of increased complexity (2 or 3 lanes with varying degrees of capacity reduction), as well as longer-term congestion, in which the statistical parameters of the actual traffic flow (TFac) change over time in accordance with Figure 2 or Figure 4.
In general, the presented simulation model serves as an illustrative simulator for analyzing congestion of varying complexity. Various model experiments identify general trends in the dynamics of vehicle congestion at various levels of complexity.
This will be a good basis for the subsequent creation of a corresponding predictive block in the AIMS eco software package [29] to develop informed management decisions to reduce the impact of congestion on the operation of the urban transport network.

6. Queue Length Prediction

6.1. Problem Statement and Data Preparation

To implement the predictive module in the AIMS eco system, the problem stated was the short-term prediction of key congestion parameters. A deep learning model operating on time series was chosen due to its ability to detect complex nonlinear relationships in sequential data.
The input data was obtained from the AIMS eco database and included records of vehicles passing through a selected intersection in Chelyabinsk over a period of seven working days. To standardize different type vehicles, conversion factors for passenger cars were used (Reduced number of vehicles = 1.0 × car + 3.0 × trolleybus + …). Trams were excluded from the analysis since their movement is often isolated from the general traffic flow. After processing, a time series of 138,663 records with two-minute increments was formed.
The maximum observed direction capacity over 2 min was 60 vehicles. This parameter was used to normalize the input data. Each input sample for the model represented a 1 h sequence (30 time intervals) and consisted of two features:
  • Normalized number of vehicles per interval (from 0 to 1);
  • Normalized time of day (from 0 to 1, where 1 corresponds to 1440 min).
Figure 9 represents the proposed neural network configuration.
A LSTM neural network architecture is given in Figure 10 [55].
Here, xt represents the observation of a vehicle at time t. Ct is the memory cell, which contains the information at time step t; σ indicates the sigmoid function, ft is the output of the Forget gate at time t.

6.2. Hybrid Neural Network Architecture

A number of architectures were developed and tested for predicting. The best results were achieved by a hybrid model combining convolutional layers (CNN), long short-term memory (LSTM) layers, and an attention mechanism (Transformer). The motivation for choosing this architecture was as follows:
  • Convolutional layer (CNN): Reveals local patterns and short-term dependencies in the data (e.g., traffic fluctuations over a period of a few minutes).
  • LSTM layer: Captures long-term time dependencies and cyclic patterns (e.g., morning and evening peak hours).
  • Attention mechanism (Transformer): Allows the model to dynamically “weight” the importance of different instants of time in the input sequence, which is critical for predicting abnormal events such as congestion.
The model output is a vector of three parameters for 20 increments ahead (40 min):
  • Queue Growth: the number of vehicles that failed to pass the intersection during the interval and increased the queue;
  • Total Queue Size: the total number of vehicles in the queue at the end of the interval;
  • Lane Closure Percentage: an exogenous parameter modeling the impact of accidents or road works.
The original dataset contained 138,663 records. It included data of 7 working days, one direction of vehicle movements. Brief statistics of the initial data is given in Table 1.
It was expanded artificially by overlapping bands from 0% to 100% with no use of generative algorithms or noise augmentation (10):
C o u n t n e w = C o u n t c u r r e n t × P C o u n t m a x C o u n t c u r r e n t × ( 1.0 P )
where P is the overlap of the road from 0 to 1; current_count and max_count are the current and maximum number of people who have passed the intersection over the entire time. Thus, the volume amounted to ~14 million records and covers various load and lane overlap scenarios.

6.3. Model Comparison

The following neural network models were selected for comparison:
  • LSTM Full (LSTM + CNN + Attention, which is our proposed hybrid model)—a com-plete model with CNN preprocessing, normalization, two-layer LSTM and attention mechanism;
  • LSTM Only—a simplified version using only two LSTM layers without additional modules;
  • LSTM + CNN—a model with a convolutional layer in front of the LSTM to highlight local time patterns;
  • LSTM + Attention—a model that uses Multi-Head Attention after LSTM to account for long-term dependencies;
  • LSTM Full (20-Step Input)—a complete model, but with a shortened input history to assess the impact of input length;
  • BiLSTM—a bidirectional LSTM that processes the forward and backward sequence;
  • GRU—a simpler and lighter alternative to LSTM;
  • BiGRU—a bidirectional version of GRU to account for the reverse context;
  • TransformerEncoder—a simplified transformer encoder that uses only attention mechanisms without recurrence.
Due to limited resources, only a part of the dataset was taken, around 5,000,000 ran-dom records. The resulting dataset was divided into training/validation/test parts in the ratio of 80%/10%/10%. The training and testing were performed on an NVIDIA A30 graphics card. The model was trained with the adam optimizer (learning rate = 0.0001) and the MSE loss function. Early Stopping (patience equal to 5; restoring the best weights) and ReduceLROnPlateau (reducing the learning rate by two times in the absence of im-provements) were used for stabilization. The training was performed for up to 100 epochs with batch size = 1024, and validation on a separate set. The training of each model lasted about 2 h. The comparison results for MAE, RMSE (denormalized by the first and second parameters, and as a percentage by the third), the inference time, and the number of parameters are shown in Table 2. The result of comparing neural network models by SMAPE (average of 3 parameters), MAE, and RMSE (average of 3 parameters) for short and long horizon (the first and last 5 steps) are shown in Table 3. The results of comparing neural network models by Error variance, MAE/RMSE (high/low-load) (average of 3 pa-rameters) are shown in Table 4.
A comparison of architectures showed that the extended LSTM Full (CNN + LSTM + Attention) model (the proposed one) demonstrates the best accuracy among all tested var-iants. Adding a convolutional block and an attention mechanism allows the model to capture both local and global dependencies well. The LSTM + CNN model shows compa-rable results for the main part of the metrics and is the second in quality: convolution ef-fectively highlights local time patterns and provides a noticeable improvement over the LSTM Only model. The LSTM + Attention variant also improves accuracy relative to the basic LSTM, but is inferior to the CNN architecture, which confirms the great importance of local dependencies in the data. The LSTM Only model shows the worst error values among LSTM-based models, which confirms the need for additional feature extraction mechanisms. The shortened LSTM Full (20-Step Input) model shows a deterioration in all metrics, which confirms the need to use a longer entry history.
GRU and BiGRU show results close to LSTM Only. BiLSTM does not provide an advantage. The TransformerEncoder model demonstrates the worst accuracy among all variants.
The overall result shows the best quality achieved by architectures that combine CNN and LSTM, whereas using attention and transformers without convolutional or recurrent components does not provide an advantage on short time windows.
SMAPE repeats the general trend from Table 1: hybrid models produce the best results. The long horizon hardly worsens compared to the short one.
LSTM Full (proposed) provides the lowest error in both high-load and low-load road conditions. The LSTM + CNN architecture demonstrates comparable quality and in some places surpasses RMSE in high-load modes, but on average, it is slightly inferior to the proposed model. The simplified LSTM Only model is noticeably weaker. The BiLSTM, GRU, and BiGRU models occupy an intermediate position and do not provide advantages. Transformer Encoder shows the worst results in all scenarios. Error variance is almost the same for all models, which indicates the stability of the error and the dominant influence of the task itself, rather than the choice of architecture.
The MAE, RMSE, and error variances for each step for the LSTM Full model are shown in Table 5.
The error in the prediction steps increases smoothly, without jumps and without acceleration. MAE grows from 0.044 to 0.046, RMSE increases from 0.1007 to 0.1014, and the error variance remains almost unchanged. This indicates the high stability of the model and the absence of error accumulation as the prediction horizon increases.

6.4. Model Training and Validation Results

The model was trained for 180 epochs until convergence. Results on the test set (20% of the data) demonstrated high forecast accuracy:
  • For queue growth: MAE = 1.5 VE (vehicles), RMSE = 3.1 VE.
  • For total queue size: MAE = 0.3 VE, RMSE = 0.7 VE.
  • For closure percentage: MAE = 9.9%, RMSE = 16.2%.
Error distribution for all predicted features across the entire validation set is stable, as confirmed by low and converging MAE and RMSE values (Figure 11 and Figure 12).
Interpretation of Results: The MAE value of 0.3 VE for total queue size indicates that, on average, the model error is less than one vehicle when estimating the current congestion length. This is an exceptionally high result for traffic predicting tasks, which validates the model applicability for operational control. The low queue growth error (MAE = 1.5 VE) allows for highly accurate predictions of congestion dynamics 40 min in advance, which is sufficient time horizon for proactive measures (e.g., traffic signal mode correction).
Visual analysis of random samples from the test set (Figure 13) confirms that the model adequately tracks both smooth changes and sharp spikes in the data, indicating its robustness and generalization ability.

7. Discussion

The study demonstrates the efficacy of an integrated approach combining deterministic simulation modeling and deep learning for traffic congestion prediction. A comparative analysis of the results from the Simulink simulation model and the LSTM network reveals a significant synergistic effect from their combined application. The simulation model, which integrates real-time monitoring data, provides a profound understanding of the physical processes underlying congestion formation and dissipation, effectively serving as a digital twin of an intersection. Its key advantage lies in the ability to simulate not only congestion growth but also its natural dissipation as traffic demand decreases or partial obstructions are removed. This capability accurately reflects the nonlinear dynamics of transportation systems and offers a valuable tool for analyzing network resilience.
The high predictive accuracy achieved by the LSTM model, particularly the low error in determining the total queue length (MAE = 0.3 VE), is crucial for practical implementation in ITS. This level of accuracy means the system can monitor traffic conditions with an error of less than one vehicle, establishing a reliable foundation for automated decision-making. For instance, by accurately predicting both the current queue length and its projected growth 40 min in advance (MAE = 1.5 vehicles), the control system can transition from a reactive to a proactive operational mode. This enables not just a reaction to existing congestion, but also the proactive optimization of traffic signal cycles at adjacent intersections or dynamic traffic rerouting, thereby preventing congestion escalation. The stable error distribution for all predicted parameters, as shown in Figure 11 and Figure 12, confirms the model’s reliability and its readiness for integration into decision-support systems such as AIMS eco.
Despite the promising results, this study has several limitations. Although the simulation model incorporates a stochastic component, it operates with largely deterministic congestion parameters (e.g., Pj, Sj). In a real urban environment, these parameters are subject to random variations. Furthermore, the model was validated on data from a limited number of intersections. Its scalability to a city-wide network requires further verification and must account for more complex spatiotemporal correlations between different network nodes.
Future research will be directed along several paths. The primary direction involves creating a unified framework in which the simulation model generates synthetic data. This data will be used to train and stress-test LSTM networks, particularly for scenarios with scarce real-world data on rare but critical congestion events. The integration of additional exogenous factors—such as detailed weather conditions, scheduled roadworks, and public events that significantly alter traffic patterns—is also a priority. Secondly, the development of more sophisticated hybrid architectures is warranted. For example, employing Graph Neural Networks (GNNs) would explicitly model the topology of the road network, capturing the complex interdependencies between intersections.
The implementation of these proposed advancements will contribute to developing a more sustainable, safe, and ecologically friendly urban transport environment. This progress will help reduce the economic and social costs associated with traffic congestion and directly support the achievement of Sustainable Development Goals related to intelligent transportation systems.

8. Conclusions

Currently, research aimed at developing comprehensive approaches combining simulation modeling methods and artificial intelligence for predicting traffic congestion becomes increasingly relevant. The integration of deterministic and stochastic models with deep learning capabilities is a promising direction, taking into account both the physical patterns of traffic flows and the complex nonlinear dependencies identified by neural networks.
This study demonstrates the effectiveness of integrating simulation modeling methods and deep machine learning for solving the challenging task of predicting traffic congestion. The developed comprehensive approach, which uses the capabilities of Matlab Simulink and LSTM networks, allows for highly accurate analysis and dynamics prediction of the congestion of various complexity based on real-time monitoring data of traffic flows.
The practical value of the research is confirmed by the creation of highly accurate predictive models with low error rates (MAE = 0.3–1.5 VE) and the possibility of their integration into software systems such as AIMS eco. The developed solutions form the basis for passing from reactive to proactive traffic management.
Areas of further research may include improving the proposed hybrid architecture of the model, for example, combining it with graph neural networks to improve performance, or developing federal models to more accurately account for spatial and temporal dependencies in traffic data, reduce network traffic, and increase the overall security of sensitive data. Additionally, it will be possible to add new data ranges and design a multimodal model to include new data sources (GPS tracks, data from traffic sensors, weather conditions, cameras, social networks, lidars, etc.) and explore various mechanisms for merging modalities. An explanation of how the models work is becoming highly demanded, including for the traffic congestion prediction model, the results of which will be used by administrative decision makers.
The issue of processing anomalies and their impact on the formation of local or net-work congestion (accidents, road works, mass events, road cleaning with special equipment, etc.) remains insufficiently investigated.
Horizontally, further research may cover issues of integration with real-time traffic control systems: using congestion duration predictions for adaptive traffic light control.
The practical application of the predicting system can be reflected in decision support and early warning systems: for example, the creation of panels for dispatchers with fore-casts and confidence levels, notifications of potential long-term congestion and recommendations for routing public transport, special equipment, and emergency rescue teams.
An important consequence of the expansion of the practical application of the pro-posed model may be more optimal planning and assessment of the effect of infrastructural changes (the introduction of new lanes, changing priorities of public transport), which may increase the planning horizon for the sustainability of modern cities.
Implementation of the presented developments will contribute to the creation of a more sustainable, safe, and ecologically friendly urban transport environment, reducing the economic and social costs associated with traffic congestions.
The developed model enables a transition from reactive to proactive management in intelligent transportation systems such as AIMS eco. The high-precision forecast of queue dynamics (MAE = 0.3–1.5 vehicles) with a 40 min prediction horizon allows the system to not just detect emerging congestion, but to proactively initiate preemptive scenarios: adaptively reconfigure traffic light cycles at neighboring intersections and redirect traffic flows. This prevents the avalanche-like growth of traffic congestions, implementing the principle of proactive control fundamental to modern intelligent transportation systems.

Author Contributions

Conceptualization, V.S. and A.G.; methodology, A.V.; software, O.I.; validation, V.S., and A.G.; investigation, O.I.; resources, A.G.; writing—original draft preparation, I.A.; writing—review and editing, V.S.; visualization, A.V.; supervision, V.S.; All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The link of original 7-day statistics data and the tested neural network models has been added: https://github.com/slobodinis/LSTMFull (1 October 2025).

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
AIMS ecoEnvironmental Monitoring System Using Artificial Intelligence
AVsAutonomous vehicles
BiLSTM ASBOBidirectional Long Short-Term Memory
CNNConvolutional Neural Network
CPCongestion profile
ITSIntelligent Transportation Systems
KNNK-Nearest Neighbors
LSTMLong Short-Term Memory
MAEMean Absolute Error
RLReinforcement Learning
RMSERoot Mean Squared Error
SFSaturation flow
SOFMSelf-Organizing Feature Mapping
TCTraffic capacity
TFTraffic flow
V2XVehicle-to-Everything

Appendix A

Pseudo-code for the Stochastic (Q-scheme) Simulation
Inputs:
  • TCmax: Maximum capacity of the road section.
  • Pj, Sj: Congestion parameters for each lane j (1 if blocked, 0 otherwise; capacity reduction share).
  • μ, σ: Mean and standard deviation of the 2 min traffic flow.
  • Nsteps: Number of 2 min intervals to simulate.
  • CV: Coefficient of variation for traffic flow.
Algorithm A1. Core algorithm
1: Initialize Kctotal = 0 (Total vehicles in congestion)
2: for each time step i = 1 to N steps:
3: Generate stochastic traffic flow: TEac(i) = random_normal (mean = μ, std_dev = σ)
4: For each lane j = 1 to 3
5:if Pj = 1 (Lane is blocked)
6:  Kclanej = (1/3) × TEac(i) × Sj
7: else (Lane is open)
8: Kclanej = (TCmaxTEac(i)) × (1/3)
9: Sum congestion for this step: Kcstep = sum(Kclanej for all j)
10: Accumulate total congestion: Kctotal += max(0, Kcstep)//Ignore negative values
11: Output Kctotal and time series of congestion growth

References

  1. Huang, Z.; Loo, B.P.Y. Urban Traffic Congestion in Twelve Large Metropolitan Cities: A Thematic Analysis of Local News Contents, 2009–2018. Int. J. Sustain. Transp. 2023, 17, 592–614. [Google Scholar] [CrossRef]
  2. Gañan-Cardenas, E.; Carolina Rios-Echeverri, D.; Ballesteros, J.R.; Branch-Bedoya, J.W. Estimating Traffic Congestion Cost Uncertainty Using a Bootstrap Scheme. Transp. Res. Part Transp. Environ. 2024, 136, 104462. [Google Scholar] [CrossRef]
  3. Xiao, D.; Kim, I.; Zheng, N. Does Built Environment Have Impact on Traffic Congestion?—A Bootstrap Mediation Analysis on a Case Study of Melbourne. Transp. Res. Part Policy Pract. 2024, 190, 104297. [Google Scholar] [CrossRef]
  4. Chaari, A.; Mouhali, W.; Louaked, M.; Sellila, N.; Mechkour, H. Numerical Simulation of Pollutant Concentration Patterns of a Two-Dimensional Congestion Traffic. Comput. Math. Appl. 2025, 188, 97–114. [Google Scholar] [CrossRef]
  5. Wang, C.; Shang, Q.; Liu, K.; Zhang, W. Traffic Congestion Recognition Based on Convolutional Neural Networks in Different Scenarios. Eng. Appl. Artif. Intell. 2025, 148, 110372. [Google Scholar] [CrossRef]
  6. Bawaneh, M.; Simon, V. Novel Traffic Congestion Detection Algorithms for Smart City Applications. Concurr. Comput. Pract. Exp. 2023, 35, e7563. [Google Scholar] [CrossRef]
  7. Thabit, A.S.M.; Kerrache, C.A.; Calafate, C.T. A Survey on Monitoring and Management Techniques for Road Traffic Congestion in Vehicular Networks. ICT Express 2024, 10, 1186–1198. [Google Scholar] [CrossRef]
  8. Wang, J.L.; Lai, H.B. Congestion Analysis on Urban Traffic Network. Adv. Mater. Res. 2013, 756–759, 1635–1638. [Google Scholar] [CrossRef]
  9. Rouky, N.; Bousouf, A.; Benmoussa, O.; Fri, M. A Spatiotemporal Analysis of Traffic Congestion Patterns Using Clustering Algorithms: A Case Study of Casablanca. Decis. Anal. J. 2024, 10, 100404. [Google Scholar] [CrossRef]
  10. Jilani, U.; Asif, M.; Rashid, M.; Siddique, A.A.; Talha, S.M.U.; Aamir, M. Traffic Congestion Classification Using GAN-Based Synthetic Data Augmentation and a Novel 5-Layer Convolutional Neural Network Model. Electronics 2022, 11, 2290. [Google Scholar] [CrossRef]
  11. Idura Ramli, N.; Mohamed Rawi, M.I. An Overview of Traffic Congestion Detection and Classification Techniques in VANET. Indones. J. Electr. Eng. Comput. Sci. 2020, 20, 437. [Google Scholar] [CrossRef]
  12. Pamuła, T. Determination of Congestion Levels Using Texture Analysis of Road Traffic Images. In Contemporary Challenges of Transport Systems and Traffic Engineering; Macioszek, E., Sierpiński, G., Eds.; Lecture Notes in Networks and Systems; Springer International Publishing: Cham, Switzerland, 2017; Volume 2, pp. 53–61. [Google Scholar] [CrossRef]
  13. Zheng, Z.; Wang, Z.; Zhu, L.; Jiang, H. Determinants of the Congestion Caused by a Traffic Accident in Urban Road Networks. Accid. Anal. Prev. 2020, 136, 105327. [Google Scholar] [CrossRef]
  14. Ma, Q.; Wang, X.; Niu, S.; Zeng, H.; Ullah, S. Analysis on Congestion Mechanism of CAVs around Traffic Accident Zones. Accid. Anal. Prev. 2024, 205, 107663. [Google Scholar] [CrossRef]
  15. Retallack, A.E.; Ostendorf, B. Relationship Between Traffic Volume and Accident Frequency at Intersections. Int. J. Environ. Res. Public. Health 2020, 17, 1393. [Google Scholar] [CrossRef] [PubMed]
  16. Jayasooriya, S.A.C.S.; Bandara, Y.M.M.S. Measuring the Economic Costs of Traffic Congestion. In Proceedings of the 2017 Moratuwa Engineering Research Conference (MERCon), Moratuwa, Sri Lanka, 29–31 May 2017; pp. 141–146. [Google Scholar] [CrossRef]
  17. Habiba, U.; Talukdar, S. The Impact of Traffic Congestion, Aggression and Driving Anger on Driver Stress: A Structural Equation Modelling Approach. J. Transp. Saf. Secur. 2025, 17, 901–922. [Google Scholar] [CrossRef]
  18. Krishnasamy, L.; C, S.; Dhanaraj, R.K.; Al-Khasawneh, M.A.; Al-Shehari, T.; Alsadhan, N.A.; Selvarajan, S. Intelligent Traffic Congestion Forecasting Using BiLSTM and Adaptive Secretary Bird Optimizer for Sustainable Urban Transportation. Sci. Rep. 2025, 15, 18423. [Google Scholar] [CrossRef] [PubMed]
  19. Jin, J.; Jin, J. Traffic Congestion and Air Pollution: Empirical Evidence before/after COVID-19 in Seoul, Korea. Int. J. Sustain. Transp. 2023, 17, 1356–1369. [Google Scholar] [CrossRef]
  20. AlAttar, M.A.; Al-Mutairi, N.Z. Quantification of Time and Fuel Losses Due to Daily Traffic Congestion in Kuwait. Int. J. Crashworthiness 2021, 26, 258–269. [Google Scholar] [CrossRef]
  21. Muneera, C.P.; Karuppanagounder, K. Economic Impact of Traffic Congestion-Estimation and Challenges. Eur. Transp.-Trasp. Eur. 2018, 68. [Google Scholar]
  22. Zhao, X.-T.; Hu, L.-W. Spatial and Temporal Variation Characteristics of Urban Traffic Congestion Factors and Source Analysis. J. Transp. Syst. Eng. Inf. Technol. 2023, 23, 300–310. [Google Scholar] [CrossRef]
  23. Wen, T.-H.; Chin, W.-C.-B.; Lai, P.-C. Understanding the Topological Characteristics and Flow Complexity of Urban Traffic Congestion. Phys. Stat. Mech. Its Appl. 2017, 473, 166–177. [Google Scholar] [CrossRef]
  24. Jian, C.; Lin, C.; Hu, X.; Lu, J. Selective Scale-Aware Network for Traffic Density Estimation and Congestion Detection in ITS. Sensors 2025, 25, 766. [Google Scholar] [CrossRef] [PubMed]
  25. Khan, S.W.; Hafeez, Q.; Khalid, M.I.; Alroobaea, R.; Hussain, S.; Iqbal, J.; Almotiri, J.; Ullah, S.S. Anomaly Detection in Traffic Surveillance Videos Using Deep Learning. Sensors 2022, 22, 6563. [Google Scholar] [CrossRef] [PubMed]
  26. Li, H. Intelligent Transportation System for Traffic Congestion Based on Dempster–Shafer Evidence Theory and Fuzzy Logic Control. Transp. Res. Rec. J. Transp. Res. Board 2025, 2679, 600–613. [Google Scholar] [CrossRef]
  27. Zhou, H.; Li, R.; Huang, A.; Wang, Q.; He, Z.; Wang, S. Forecasting urban traffic congestion conduction based on spatiotemporal association rule mining. Syst. Eng. Theory Pract. 2022, 42, 2210–2224. [Google Scholar] [CrossRef]
  28. Jenifer, J.; Priyadarsini, R.J. Empirical Research on Machine Learning Models and Feature Selection for Traffic Congestion Prediction in Smart Cities. Int. J. Recent Innov. Trends Comput. Commun. 2023, 11, 269–275. [Google Scholar] [CrossRef]
  29. Monitoring of Emissions from Vehicles in Real Time. Available online: https://aims.susu.ru/ (accessed on 1 June 2024).
  30. Ye, S.; He, Z.; Jia, Y.; Luo, Y. Analysis of Spatial Heterogeneity and Influencing Factors of Urban Traffic Congestion Based on GIS. In Proceedings of the 2020 3rd International Conference on Geoinformatics and Data Analysis, Marseille, France, 15–17 April 2020; ACM: Raleigh, NC, USA, 2020; pp. 48–52. [Google Scholar] [CrossRef]
  31. Zhao, X.; Hu, L.; Wang, X.; Wu, J. Study on Identification and Prevention of Traffic Congestion Zones Considering Resilience-Vulnerability of Urban Transportation Systems. Sustainability 2022, 14, 16907. [Google Scholar] [CrossRef]
  32. Zang, J.; Jiao, P.; Liu, S.; Zhang, X.; Song, G.; Yu, L. Identifying Traffic Congestion Patterns of Urban Road Network Based on Traffic Performance Index. Sustainability 2023, 15, 948. [Google Scholar] [CrossRef]
  33. Qu, W.; Li, J.; Yang, L.; Li, D.; Liu, S.; Zhao, Q.; Qi, Y. Short-Term Intersection Traffic Flow Forecasting. Sustainability 2020, 12, 8158. [Google Scholar] [CrossRef]
  34. Elleuch, J.F.; Mehdi, M.Z.; Sellami, D. Congest-Net: A New CNN Model for Audio Based Traffic Congestion. In Proceedings of the 2024 IEEE 12th International Symposium on Signal, Image, Video and Communications (ISIVC), Marrakech, Morocco, 21–23 May 2024; IEEE: Pasadena, NJ, USA, 2024; pp. 1–5. [Google Scholar] [CrossRef]
  35. Gatto, R.C.; Forster, C.H.Q. Audio-Based Machine Learning Model for Traffic Congestion Detection. IEEE Trans. Intell. Transp. Syst. 2021, 22, 7200–7207. [Google Scholar] [CrossRef]
  36. Zhang, T.; Xu, J.; Cong, S.; Qu, C.; Zhao, W. A Hybrid Method of Traffic Congestion Prediction and Control. IEEE Access 2023, 11, 36471–36491. [Google Scholar] [CrossRef]
  37. Wang, Z. Attention-Weighted Traffic Flow Prediction and Congestion Early Warning Study with Synergy of ETC Gantry and Internet of Things Monitoring Data. Int. J. Hous. Sci. Its Appl. 2025, 46, 4435–4446. [Google Scholar] [CrossRef]
  38. Ma, X.; Tao, Z.; Wang, Y.; Yu, H.; Wang, Y. Long Short-Term Memory Neural Network for Traffic Speed Prediction Using Remote Microwave Sensor Data. Transp. Res. Part C Emerg. Technol. 2015, 54, 187–197. [Google Scholar] [CrossRef]
  39. Lee, C.; Kim, Y.; Jin, S.; Kim, D.; Maciejewski, R.; Ebert, D.; Ko, S. A Visual Analytics System for Exploring, Monitoring, and Forecasting Road Traffic Congestion. IEEE Trans. Vis. Comput. Graph. 2020, 26, 3133–3146. [Google Scholar] [CrossRef]
  40. Liu, B.; Lam, C.-T.; Ng, B.K.; Yuan, X.; Im, S.K. A Graph-Based Framework for Traffic Forecasting and Congestion Detection Using Online Images from Multiple Cameras. IEEE Access 2024, 12, 3756–3767. [Google Scholar] [CrossRef]
  41. Zhang, T.; Wang, J.; Wang, T.; Pang, Y.; Wang, P.; Wang, W. A Deep Marked Graph Process Model for Citywide Traffic Congestion Forecasting. Comput.-Aided Civ. Infrastruct. Eng. 2024, 39, 1180–1196. [Google Scholar] [CrossRef]
  42. Jiang, P.; Liu, Z.; Zhang, L.; Wang, J. Advanced Traffic Congestion Early Warning System Based on Traffic Flow Forecasting and Extenics Evaluation. Appl. Soft Comput. 2022, 118, 108544. [Google Scholar] [CrossRef]
  43. Abduljabbar, R.L.; Dia, H.; Tsai, P.-W. Development and Evaluation of Bidirectional LSTM Freeway Traffic Forecasting Models Using Simulation Data. Sci. Rep. 2021, 11, 23899. [Google Scholar] [CrossRef]
  44. Fukumaru, T.; Morino, H. Traffic Congestion Mitigation by Deceleration Control with Short-Term Velocity Forecasting Using V2X. In Proceedings of the 2023 IEEE International Conference on Pervasive Computing and Communications Workshops and other Affiliated Events (PerCom Workshops), Atlanta, GA, USA, 13–17 March 2023; IEEE: Pasadena, NJ, USA, 2023; pp. 21–26. [Google Scholar] [CrossRef]
  45. Tang, W.M.; Yiu, K.F.C.; Chan, K.Y.; Zhang, K. Conjoining Congestion Speed-Cycle Patterns and Deep Learning Neural Network for Short-Term Traffic Speed Forecasting. Appl. Soft Comput. 2023, 138, 110154. [Google Scholar] [CrossRef]
  46. Mirzahossein, H.; Gholampour, I.; Sajadi, S.R.; Zamani, A.H. A Hybrid Deep and Machine Learning Model for Short-term Traffic Volume Forecasting of Adjacent Intersections. IET Intell. Transp. Syst. 2022, 16, 1648–1663. [Google Scholar] [CrossRef]
  47. Sawalha, A. A Comprehensive Review of Intelligent Transportation Systems toward Alleviating Traffic Congestion. Mater. Res. Proc. 2025, 48, 951–960. [Google Scholar] [CrossRef]
  48. Dong, S.; Zhang, H.; Li, S.; Jia, N.; He, N. A Study on Urban Traffic Congestion Pressure Based on CFD. Sustainability 2024, 16, 10911. [Google Scholar] [CrossRef]
  49. Lin, W.-H.; Lo, H.K. Highway Voting System: Embracing a Possible Paradigm Shift in Traffic Data Acquisition. Transp. Res. Part C Emerg. Technol. 2015, 56, 149–160. [Google Scholar] [CrossRef]
  50. Banad, Y.M.; Sharif, S.S.; Rezaei, Z. Artificial Intelligence and Machine Learning for Smart Grids: From Foundational Paradigms to Emerging Technologies with Digital Twin and Large Language Model-Driven Intelligence. Energy Convers. Manag. X 2025, 28, 101329. [Google Scholar] [CrossRef]
  51. Medina-Tapia, M.; Robusté, F. Exploring Paradigm Shift Impacts in Urban Mobility: Autonomous Vehicles and Smart Cities. Transp. Res. Procedia 2018, 33, 203–210. [Google Scholar] [CrossRef]
  52. Song, H.; Gao, S.; Li, Y.; Liu, L.; Dong, H. Train-Centric Communication Based Autonomous Train Control System. IEEE Trans. Intell. Veh. 2023, 8, 721–731. [Google Scholar] [CrossRef]
  53. Stern, R.E.; Cui, S.; Delle Monache, M.L.; Bhadani, R.; Bunting, M.; Churchill, M.; Hamilton, N.; Haulcy, R.; Pohlmann, H.; Wu, F.; et al. Dissipation of Stop-and-Go Waves via Control of Autonomous Vehicles: Field Experiments. Transp. Res. Part C Emerg. Technol. 2018, 89, 205–221. [Google Scholar] [CrossRef]
  54. Butilă, E.V.; Boboc, R.G. Urban Traffic Monitoring and Analysis Using Unmanned Aerial Vehicles (UAVs): A Systematic Literature Review. Remote Sens. 2022, 14, 620. [Google Scholar] [CrossRef]
  55. Sinha, A.; Chorzepa, M.G.; Yang, J.J.; Kim, S.-H.S.; Durham, S. Deep-Learning-Based Temporal Prediction for Mitigating Dynamic Inconsistency in Vehicular Live Loads on Roads and Bridges. Infrastructures 2022, 7, 150. [Google Scholar] [CrossRef]
Figure 1. Conceptual model for predicting congestion.
Figure 1. Conceptual model for predicting congestion.
Sustainability 17 10655 g001
Figure 2. Average hourly load TFav of the traffic flow (from 1 June to 30 June 2024).
Figure 2. Average hourly load TFav of the traffic flow (from 1 June to 30 June 2024).
Sustainability 17 10655 g002
Figure 3. Vehicle queue growth in congestion of varying complexity: (a) Accident closes 1 lane; (b) Accident closes 2 lanes.
Figure 3. Vehicle queue growth in congestion of varying complexity: (a) Accident closes 1 lane; (b) Accident closes 2 lanes.
Sustainability 17 10655 g003
Figure 4. Traffic flow variations during one working day (two-minute intervals): (a) Traffic flow variations over two-minute intervals during one working day; (b) Variation coefficient.
Figure 4. Traffic flow variations during one working day (two-minute intervals): (a) Traffic flow variations over two-minute intervals during one working day; (b) Variation coefficient.
Sustainability 17 10655 g004
Figure 5. Simulation model of congestion development for three-lane highway.
Figure 5. Simulation model of congestion development for three-lane highway.
Sustainability 17 10655 g005
Figure 6. Queue growth in congestion with an accident on one lane: (a) The increase in congestion during an accident on the first lane; (b) Simulation of actual traffic flow variations, TFac.
Figure 6. Queue growth in congestion with an accident on one lane: (a) The increase in congestion during an accident on the first lane; (b) Simulation of actual traffic flow variations, TFac.
Sustainability 17 10655 g006
Figure 7. Dynamics of the decrease in actual traffic flow over 4 h.
Figure 7. Dynamics of the decrease in actual traffic flow over 4 h.
Sustainability 17 10655 g007
Figure 8. Congestion queue dynamics during 3 h (90 two-minute increments): (a) Change in vehicle queue length in congestion; (b) Linear model of actual traffic flow TFac variations.
Figure 8. Congestion queue dynamics during 3 h (90 two-minute increments): (a) Change in vehicle queue length in congestion; (b) Linear model of actual traffic flow TFac variations.
Sustainability 17 10655 g008
Figure 9. Neural network configuration.
Figure 9. Neural network configuration.
Sustainability 17 10655 g009
Figure 10. LSTM architecture.
Figure 10. LSTM architecture.
Sustainability 17 10655 g010
Figure 11. MAE for each predicted feature of the neural network on the entire validation set.
Figure 11. MAE for each predicted feature of the neural network on the entire validation set.
Sustainability 17 10655 g011
Figure 12. RMSE for each predicted feature of the neural network on the entire validation set.
Figure 12. RMSE for each predicted feature of the neural network on the entire validation set.
Sustainability 17 10655 g012
Figure 13. Source data, predicted data, and MAE for each feature of the neural network on a random record.
Figure 13. Source data, predicted data, and MAE for each feature of the neural network on a random record.
Sustainability 17 10655 g013
Table 1. Statistics of the initial dataset.
Table 1. Statistics of the initial dataset.
Number of Samples, RecordsTotal Vehicle Number of All Types, mlnSampling Period
138,663~0.561 April 2025, 2 April 2025, 8 April 2025, 9 April 2025,
14 April 2025, 22 April 2025, 30 April 2025
Table 2. Results of comparing neural network models by MAE, RMSE, inference time, and number of parameters.
Table 2. Results of comparing neural network models by MAE, RMSE, inference time, and number of parameters.
ModelQueue GrowthTotal Queue Length, VehiclesPercentage of
Overlap, %
Inference Time, msParameters
MAERMSEMAERMSEMAERMSE
LSTM Full (proposed)1.723.350.310.7010.0816.518.43880,700
LSTM Only1.843.490.400.8110.8016.994.95486,588
LSTM + CNN1.743.360.310.7010.4216.774.80617,020
LSTM + Attention1.803.450.370.7710.3016.745.80750,268
LSTM Full (20-Step Input)1.813.470.420.8810.5416.875.52880,700
BiLSTM1.923.580.450.8811.7717.726.18355,516
GRU1.843.500.400.8110.7317.024.51372,156
BiGRU1.863.530.420.8510.9717.205.58273,852
Transformer-Encoder1.933.590.450.8911.7117.773.09157,116
Table 3. Result of comparing SMAPE, MAE, and RMSE metrics of neural network models over a short and long horizon (the first and last 5 steps).
Table 3. Result of comparing SMAPE, MAE, and RMSE metrics of neural network models over a short and long horizon (the first and last 5 steps).
ModelSMAPEMAE_ShortRMSE_ShortMAE_LongRMSE_Long
LSTM Full (proposed)48.130.04420.07580.04580.0792
LSTM Only48.940.04760.07890.04950.0822
LSTM + CNN48.410.04540.07680.04700.0802
LSTM + Attention48.610.04560.07760.04730.0809
LSTM Full (20-Step Input)48.760.04660.07890.04840.0819
BiLSTM49.770.05140.08210.05350.0856
GRU48.950.04740.07900.04920.0824
BiGRU49.270.04830.08000.05030.0834
Transformer-Encoder49.640.05130.08230.05340.0859
Table 4. Results of comparing neural network models by Error variance, MAE/RMSE (high-/low-load).
Table 4. Results of comparing neural network models by Error variance, MAE/RMSE (high-/low-load).
ModelError
Variance
MAE
(High-Load)
RMSE
(High-Load)
MAE
(Low-Load)
RMSE
(Low-Load)
LSTM Full (proposed)0.00650.02510.04210.04500.1011
LSTM Only0.00660.02700.04390.04860.1042
LSTM + CNN0.00660.02520.04190.04620.1025
LSTM + Attention0.00670.02650.04270.04650.1027
LSTM Full (20-Step Input)0.00670.03190.04830.04760.1035
BiLSTM0.00670.02900.04460.05250.1085
GRU0.00670.02950.04530.04830.1044
BiGRU0.00670.02920.04500.04930.1055
Transformer-Encoder0.00690.03290.04960.05240.1088
Table 5. MAE, RMSE, and error variances for each step for the proposed LSTM Full model.
Table 5. MAE, RMSE, and error variances for each step for the proposed LSTM Full model.
Prediction StepMAERMSEError
Variance
10.0440680.1006770.008194
20.0440660.1005860.008176
30.0441590.1006180.008174
40.0442330.1006480.008174
50.0442960.1006450.008167
60.0443860.1006470.00816
70.0445230.1006760.008153
80.0446120.1007260.008156
90.0447540.100770.008152
100.044790.1008120.008157
110.0449030.1008620.008157
120.0450030.100860.008147
130.0450980.1008980.008147
140.0451230.1008790.008141
150.0452340.1009490.008145
160.0454940.1010310.008138
170.0455920.101130.008149
180.0456890.1011680.008147
190.0459020.1012670.008148
200.0460980.1014460.008166
The best (minimum) MAE value in the column is highlighted in bold.
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Shepelev, V.; Glushkov, A.; Vorobyev, A.; Ivanova, O.; Alferova, I. Predicting Urban Traffic Congestion Through Deterministic and Stochastic Modeling Using LSTM Neural Networks. Sustainability 2025, 17, 10655. https://doi.org/10.3390/su172310655

AMA Style

Shepelev V, Glushkov A, Vorobyev A, Ivanova O, Alferova I. Predicting Urban Traffic Congestion Through Deterministic and Stochastic Modeling Using LSTM Neural Networks. Sustainability. 2025; 17(23):10655. https://doi.org/10.3390/su172310655

Chicago/Turabian Style

Shepelev, Vladimir, Aleksandr Glushkov, Andrey Vorobyev, Olga Ivanova, and Irina Alferova. 2025. "Predicting Urban Traffic Congestion Through Deterministic and Stochastic Modeling Using LSTM Neural Networks" Sustainability 17, no. 23: 10655. https://doi.org/10.3390/su172310655

APA Style

Shepelev, V., Glushkov, A., Vorobyev, A., Ivanova, O., & Alferova, I. (2025). Predicting Urban Traffic Congestion Through Deterministic and Stochastic Modeling Using LSTM Neural Networks. Sustainability, 17(23), 10655. https://doi.org/10.3390/su172310655

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop