Next Article in Journal
The Applications of MALDI-TOF MS in the Diagnosis of Microbiological Food Contamination
Previous Article in Journal
Optimizing Contrastive Learning with Semi-Online Triplet Mining
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

xLSTM-Based Urban Traffic Flow Prediction for Intelligent Transportation Governance

1
National Center for High-Performance Computing, Hsinchu 30076, Taiwan
2
College of Artificial Intelligence, National Yang Ming Chiao Tung University, Hsinchu 30010, Taiwan
*
Author to whom correspondence should be addressed.
Appl. Sci. 2025, 15(14), 7859; https://doi.org/10.3390/app15147859
Submission received: 27 April 2025 / Revised: 21 May 2025 / Accepted: 27 May 2025 / Published: 14 July 2025

Abstract

Urban traffic congestion poses persistent challenges to mobility, public safety, and governance efficiency in metropolitan areas. This study proposes an intelligent traffic flow forecasting framework based on an extended Long Short-Term Memory (xLSTM) model, specifically designed for real-time congestion prediction and proactive police dispatch support. Utilizing a real-world dataset collected from over 300 vehicle detector (VD) sensors, the proposed model integrates vehicle volume, speed, and lane occupancy data at five-minute intervals. Methodologically, the xLSTM model incorporates matrix-based memory cells and exponential gating mechanisms to enhance spatio-temporal learning capabilities. Model performance is evaluated using multiple metrics, including congestion classification accuracy, F1-score, MAE, RMSE, and inference latency. The xLSTM model achieves a congestion prediction accuracy of 87.3%, an F1-score of 0.882, and an average inference latency of 41.2 milliseconds—outperforming baseline LSTM, GRU, and Transformer-based models in both accuracy and speed. These results validate the system’s suitability for real-time deployment in police control centers, where timely prediction of traffic congestion enables anticipatory patrol allocation and dynamic signal adjustment. By bridging AI-driven forecasting with public safety operations, this research contributes a validated and scalable approach to intelligent transportation governance, enhancing the responsiveness of urban mobility systems and advancing smart city initiatives.

1. Introduction

Urban traffic congestion has become one of the most pressing challenges in contemporary metropolitan governance, affecting not only commuter efficiency but also the operational readiness of emergency services. In densely populated urban centers such as Taichung, the ability to accurately forecast traffic bottlenecks in real time has grown increasingly essential for enabling proactive police deployment and ensuring timely incident response [1,2].
Although recent advances in deep learning have considerably enhanced the accuracy of short-term traffic predictions, the practical integration of these predictive capabilities into real-world emergency response systems remains limited [3,4]. Traditional police dispatch mechanisms continue to rely on reactive protocols, typically initiated only after congestion or incidents have already occurred. This reactive paradigm is inadequate in the face of increasingly complex and dynamic urban traffic conditions, driven by surging vehicle ownership, asymmetric commuting flows, and nonlinear mobility behaviors [5].
To address these limitations, there is a critical need for predictive, data-driven systems capable of supporting real-time operational decisions in urban traffic governance. Accurate traffic flow forecasting plays a foundational role in smart city infrastructure, enabling responsive interventions such as signal optimization, route reallocation, and strategic resource deployment. Among various machine learning models, Recurrent Neural Networks (RNNs) and Long Short-Term Memory (LSTM) networks have shown notable success in capturing temporal dependencies in traffic data [6,7].
However, the unique urban morphology of Taiwanese cities, the high heterogeneity of vehicle types, and irregular daily commuting patterns pose significant challenges to standard forecasting models. In light of these challenges, this study proposes an extended LSTM (xLSTM)-based traffic prediction framework specifically tailored to the complexities of Taiwan’s urban road networks. By leveraging real-world vehicle detector (VD) sensor data and integrating forecast results into traffic governance protocols, this research contributes a scalable and validated model for intelligent, anticipatory urban traffic management [6,8,9].
According to the International Transport Forum, global urban vehicle ownership has surged by more than 30% over the past decade, resulting in longer commute times, increased greenhouse gas emissions, and substantial economic inefficiencies. Cities such as New York, London, and Beijing report annual commuter delays exceeding 80 h per capita [10,11]. Taiwan mirrors these global trends. Major cities like Taichung and Kaohsiung now rank among the most congested worldwide, with average travel times exceeding 22 min for a 10 km journey and commuters losing between 54 to 58 h per year to congestion [12,13].
Notably, these challenges persisted even during the COVID-19 pandemic, underscoring the structural nature of urban mobility inefficiencies. Taiwan’s unique congestion dynamics are fueled by exceptionally high vehicle ownership—over 14 million motorcycles and 8 million cars—combined with low public transit adoption and decentralized urban planning. This has resulted in disproportionate pressure on arterial road networks and limited the effectiveness of conventional infrastructure expansion strategies [14,15]. Tackling these issues requires more than physical road construction; it necessitates the deployment of intelligent, adaptive systems that can predict congestion in real time and support dynamic traffic interventions. This study addresses that need by introducing an xLSTM-based forecasting framework that integrates real-time vehicle detector (VD) data with advanced predictive modeling, specifically optimized for operational police dispatch applications.
In recent years, a substantial body of research has been dedicated to improving traffic forecasting capabilities through advanced deep learning techniques, graph-based representations, and hybrid architectures. These approaches aim to better capture the spatio-temporal dynamics of urban mobility, particularly in the context of real-time traffic management and predictive analytics.
Deep learning models have demonstrated considerable success in mobility prediction. Feng et al. proposed DeepMove, an attentional recurrent network that predicts individual mobility trajectories by capturing temporal dependencies in human behavior patterns. Similarly, Zhao et al. introduced T-GCN, which combines graph convolutional networks with gated recurrent units to model both spatial road network topology and temporal traffic variations [2].
In the realm of ensemble and hybrid systems, Hu et al. developed a deep learning ensemble model that integrates multiple forecasting components to improve robustness and accuracy under varying traffic conditions. Kostopoulos et al. proposed an explainable hybrid AI system for emergency dispatch that blends rule-based logic with deep learning to support real-time decisions [16].
Graph-based spatio-temporal learning has become a central theme in traffic modeling. Song et al. presented STSGCN [10], a synchronous graph convolutional network that fuses temporal and spatial features for congestion prediction, while Sun et al. utilized a multi-attention mechanism to adaptively learn the graph structure of traffic networks. These approaches are particularly effective in complex, interconnected road systems.
To support decentralized and privacy-aware computation, federated learning frameworks have also been proposed. Jiang et al. surveyed recent advances in collaborative traffic learning across smart cities, emphasizing security and communication efficiency.
Meanwhile, vision-based traffic modeling has also gained traction. Zhang et al. used deep residual networks to model citywide crowd flows in high-density urban settings [17], and Ma et al. employed CNNs to treat traffic data as spatial images, enabling accurate speed prediction across large networks [18]. Yu et al. [19] were among the first to formalize a spatio-temporal graph convolutional framework for traffic forecasting, laying the groundwork for subsequent GCN-based innovations.
Several studies have focused on specific architectural enhancements. Ke et al. implemented a spatio-temporal deep learning model for ride demand forecasting [20], while Chu et al. explored reinforcement learning strategies for adaptive signal control [21]. Attention-based models [22], multi-source data fusion [23], and lightweight CNNs for edge devices [24] have been proposed to balance complexity and efficiency.
Transformer-based innovations have also been adapted. Zhou et al. proposed FEDformer, a frequency-decomposed transformer for long-term traffic series forecasting [25]. Chen et al. developed a spatio-temporal self-attention network tailored to urban flow prediction [26], and Huang et al. combined multi-modal inputs such as video, sensor, and weather data into a deep fusion model for congestion prediction [27].
Collectively, these works underscore the growing sophistication of traffic forecasting research and provide a rich methodological foundation for our proposed xLSTM-based system. Unlike prior models, xLSTM balances predictive power with operational deployability in real-time police dispatch systems, addressing both spatio-temporal complexity and edge inference constraints.
The xLSTM architecture incorporates innovations’ memory cells and exponential gating mechanisms, enabling the model to learn complex spatial-temporal dependencies in traffic flow and to forecast congestion 15 to 30 min ahead of time. These predictive insights are directly linked to decision-support mechanisms for police operations, facilitating the proactive deployment of patrol units to high-risk intersections before congestion emerges. The contributions of this research lie at the intersection of artificial intelligence, urban traffic management, and public safety. Through validation using real-world traffic data from Taichung, we demonstrate that xLSTM-based forecasting can significantly improve dispatch response times, reduce the likelihood of secondary incidents, and enhance fuel efficiency in patrol routing. This work presents a scalable and operationally grounded framework for integrating predictive analytics into real-time policing strategies, advancing the broader vision of smart and responsive urban governance [6,7,8,15].
The main contributions of this study are as follows:
  • Proposing an xLSTM-based traffic forecasting model with matrix-based memory and exponential gating.
  • Achieving 87.3% accuracy with 41.2 ms inference latency for real-time applications.
  • Integrating the forecasting system into proactive police dispatch workflows.
  • Developing a scalable, edge-deployable system architecture for smart city governance.

2. Materials and Methods

Traffic forecasting is a foundational element of intelligent transportation systems (ITSs), enabling congestion management, route optimization, and emergency response. Traditional statistical models such as ARIMA, Kalman filters, and support vector regression offer baseline temporal prediction capabilities but often fail to capture the nonlinear and high-dimensional nature of urban traffic dynamics [5,16]. With the rise in deep learning, Recurrent Neural Networks (RNNs) and Long Short-Term Memory (LSTM) models have become prevalent due to their effectiveness in modeling temporal dependencies. LSTM, in particular, addresses issues of long-range memory and vanishing gradients, making it suitable for sequence-based traffic data. However, conventional LSTM architectures remain limited in large-scale urban contexts, where complex spatial dependencies, irregular congestion patterns, and vehicle heterogeneity pose additional modeling challenges. Recent advances such as graph neural networks (GNNs), attention mechanisms, and Transformer-based models have been developed to address these issues, although they often incur significant computational costs—making them less practical for real-time applications like police dispatch systems that require fast, low-latency inference. Moreover, while predictive analytics has seen success in crime hotspot detection, its integration with traffic forecasting for real-time police deployment remains underexplored. Current dispatch systems largely operate reactively, based on emergency calls or field reports, which delays response and undermines resource efficiency [5,6,13,28].
The xLSTM model, first introduced by Beck et al. [8], offers a promising solution. By incorporating matrix-based memory cells and exponential gating mechanisms, xLSTM enhances spatial-temporal representation, increases adaptability to non-stationary traffic patterns, and improves long-range learning. These innovations make it particularly suitable for congestion-aware and operationally scalable applications in urban governance. In Taiwan, where high vehicle density, limited public transit use, and dispersed urban development intensify congestion, such predictive models are especially relevant. Yet, prior research has rarely addressed the combined challenge of real-time traffic forecasting and tactical emergency coordination. This study seeks to bridge that gap by applying the xLSTM architecture to urban traffic flow prediction and integrating its outputs into police dispatch protocols—delivering a validated, data-driven approach to intelligent transportation governance [10].

2.1. Data Collection and Preprocessing

This study utilizes real-time traffic data acquired from the Vehicle Detector (VD) sensor network installed across major intersections in Taichung City, Taiwan. The dataset comprises time-stamped vehicle counts, average speeds, and lane occupancy rates, aggregated at five-minute intervals. These data are publicly available through the city government’s open data platform and accurately represent real-world traffic dynamics, providing a robust foundation for empirical model training and evaluation.
To ensure data quality, we implement a series of preprocessing procedures. Missing values are imputed using linear interpolation, while anomalous entries are filtered based on Z-score thresholds. All input features are normalized to a consistent scale to facilitate stable model convergence. In preparation for model learning, road segments are grouped spatially according to their connectivity and historical congestion propagation patterns. This spatial structuring enables the model to capture cross-road dependencies more effectively. For temporal representation, a sliding window approach is adopted: traffic conditions over the past 30 min are used as input features to forecast congestion levels 15 to 30 min ahead.
As illustrated in Figure 1, the system architecture ensures seamless real-time operation, and the system workflow is composed of four sequential modules. First, the Data Acquisition Layer collects real-time traffic information through the VD sensor network and CCTV video streams. Second, the Preprocessing and Data Fusion Module cleans, filters, and aggregates multivariate traffic features to enhance data reliability. Third, the xLSTM-based Prediction Engine generates short-term congestion forecasts across spatial regions. Finally, the Police Duty Notification Interface translates predictive alerts into actionable recommendations for proactive patrol deployment. This integrated architecture ensures that real-time traffic insights are efficiently captured, processed, and operationalized to support dynamic urban traffic governance [2,8].

2.2. xLSTM Model Architecture and Training [8]

At the core of the proposed forecasting framework lies the extended Long Short-Term Memory (xLSTM) model, an advanced variant of the traditional LSTM architecture. Unlike conventional LSTM networks, xLSTM employs matrix-based memory cells and exponential gating mechanisms, which significantly enhance its capacity to model long-term dependencies and nonlinear spatio-temporal interactions. These architectural innovations are particularly well suited for urban traffic environments, where congestion patterns are often abrupt and spatially diffused across interconnected road segments [6,8].
The model takes as input a set of multivariate time series features derived from the VD sensor network, including vehicle speed, volume, and occupancy rates. To account for spatial positioning, positional embeddings are incorporated, encoding the physical location of each sensor within the urban road network. The xLSTM outputs a multi-horizon congestion score for each monitored segment, which is subsequently mapped to discrete congestion levels—normal, moderate, or severe—based on empirically determined thresholds. The training process adopts a dual-objective loss formulation: the mean squared error (MSE) is used for optimizing the regression-based congestion score predictions, while cross-entropy loss evaluates the classification accuracy of congestion levels. To ensure robust model generalization, the dataset is temporally partitioned into training (70%), validation (15%), and testing (15%) sets. The model is implemented using the PyTorch v2.5.1 framework and trained using the Adam optimizer, with early stopping applied based on validation loss performance [8].
The xLSTM architecture is particularly well suited to the unique characteristics of Taiwanese urban environments, which feature highly variable road geometries, diverse modal splits (e.g., motorcycles versus private vehicles), and uneven patterns of population density. These conditions introduce significant spatial and temporal variability, making accurate short-term traffic forecasting especially challenging.
First, exponential gating replaces conventional sigmoid-based activation in the gating functions with exponential mechanisms. This adjustment yields smoother gradients and greater stability across extended time steps, thereby improving the model’s ability to retain long-range temporal dependencies. Such capability is crucial for capturing peak-hour surges and irregular flow patterns that frequently occur in Taiwanese cities.
Second, matrix memory cells extend traditional scalar memory units into higher-dimensional matrix structures. This enables the model to process complex spatial features, including multi-road junction densities, regional travel time vectors, and localized congestion heatmaps. These enhanced representations allow xLSTM to learn spatial dependencies that are often overlooked by standard LSTM architectures (Figure 2). The xLSTM architecture integrates two cell types: mLSTM and sLSTM. The mLSTM cells encode both input x t and previous hidden state h t 1 into structured matrix memories, followed by memory mixing and exponential gating. The flattened outputs are passed to the sLSTM cells, which perform cross-memory interactions and apply exponential gating to produce the final output h t . This hybrid structure enhances temporal modeling and information flow across time steps.
Third, multi-branch parallelization supports the concurrent execution of multiple xLSTM blocks across subdivided temporal windows or spatial clusters. This parallel learning strategy improves training and inference efficiency while enhancing system robustness in the face of sensor failures, missing data, or communication latency—challenges commonly encountered in city-scale traffic monitoring systems.
Unlike Transformer-based models, which provide strong global context modeling at the cost of quadratic memory complexity, xLSTM maintains linear scalability and low inference latency. This makes it more appropriate for edge deployment environments such as police dispatch control centers or onboard intelligent transportation systems (ITSs), where real-time responsiveness is essential.
Moreover, xLSTM demonstrates greater robustness under limited or noisy datasets, a frequent scenario when integrating heterogeneous traffic data streams from multiple municipal departments or legacy infrastructure. As such, xLSTM strikes an optimal balance between predictive accuracy, computational efficiency, and deployment feasibility—making it a practical solution for real-time, congestion-aware urban traffic governance.
Traditional dropout techniques—designed to prevent overfitting by randomly deactivating neurons during training—have proven effective in feedforward and standard recurrent neural networks. However, when applied directly to the xLSTM architecture, conventional dropout strategies introduced undesirable constraints that hindered performance consistency [29]. This prompted a re-evaluation of regularization mechanisms better aligned with the xLSTM’s native structure.
Rather than applying dropout externally, this study adopts a structural simplification strategy to achieve regularization effects through parameter minimization. Specifically, certain internal parameter matrices are discarded to reduce model complexity and computational overhead. This approach draws inspiration from the Gated Recurrent Unit (GRU), which achieves comparable performance to LSTM models while utilizing fewer trainable parameters. In line with this insight, the xLSTM design selectively eliminates redundant projection matrices while preserving core modeling capabilities.
Assume that for all t 1 , T , the hidden state h t 1 R h represents the memory from the forward pass, which is defined as follows:
x t x t 1 , , x 1 x t ~ h t 1
Forget   gate :   f t = σ W f x t + U f h t 1 + b f
I n p u t   g a t e :   i t = σ W i x t + U i h t 1 + b i
C a n d i d a t e   a c t i v a t i o n :   z t = t a n h W z x t + U z h t 1 i t + b z
h t = 1 f t h t 1 + f t z t
G t = e x p W x x t + W h h t 1
To enhance clarity, we explicitly define all the symbols used in Equations (1)–(5) as follows:
x t : input vector at time step t ;
h t 1 : hidden state from the previous time step;
f t : forget gate output;
i t : input gate output;
C ~ t : candidate cell state;
C t : current cell (memory) state;
o t : output gate;
h t : current hidden state;
W * , U * : trainable weight matrices;
: element-wise multiplication;
e x p : exponential activation function used in gate computations.
The final hidden state h t is passed through a fully connected layer followed by a sigmoid activation to generate a congestion score s t [ 0 , 1 ] , which serves as the prediction target. The output of the xLSTM model is a continuous congestion score s t [ 0 , 1 ] , which represents the predicted severity of traffic conditions. To facilitate actionable interpretation, the score is discretized into four levels based on empirically determined thresholds, as follows:
Free flow                      ( s t < 0.2 );
Normal traffic              ( 0.2 s t < 0.5 );
Moderate congestion  ( 0.5 s t < 0.8 );
Severe congestion        ( s t 0.8 ).
These thresholds were calibrated using historical data distributions and validated through cross-validation experiments to align with operational dispatch needs. The corresponding color legend is illustrated at the bottom of Figure 3, visually mapping the congestion score to intuitive traffic severity levels.
Additionally, this study explored the xGRU architecture, an extended version of GRU infused with key concepts from xLSTM, including exponential gating and matrix memory dynamics. While the initial derivations of xGRU followed a theoretical path, empirical observations ultimately guided its final configuration due to the stability issues encountered during preliminary training. These regularization enhancements enable the xLSTM family of models to maintain predictive accuracy while ensuring robustness, generalization, and computational efficiency, crucial attributes for real-time, edge-deployable intelligent transportation systems.

3. Results

This section presents the experimental outcomes of the proposed xLSTM-based traffic forecasting framework. The results are analyzed across multiple metrics, including accuracy, MAE, RMSE, F1-score, and inference latency, to comprehensively assess the model’s effectiveness and real-time applicability. All reported values represent the average of three independent experimental runs to ensure statistical robustness.

3.1. Performance Evaluation

The primary objective is to assess how accurately and efficiently the model can predict short-term traffic congestion, enabling timely decision-making for police dispatch and traffic governance.
The forecasting task is designed around 15 to 30 min prediction horizons, which are critical time windows for proactive congestion mitigation. Evaluation focuses not only on predictive accuracy but also on how well the system supports real-time application requirements, such as inference speed and robustness to noisy data. Table 1 presents a comparative analysis between the xLSTM-powered system and other benchmark models commonly used in traffic prediction. All the results in Table 1 were derived from evaluations conducted under uniform experimental conditions [6,7,8,9,30].
The results indicate that the xLSTM-based system consistently achieves the highest predictive accuracy for congestion levels while maintaining low latency, making it particularly effective for deployment in time-sensitive traffic control environments. Notably, the model was able to predict congestion hotspots with over 87% accuracy, and reliably classify severity levels (normal, moderate, severe) in real time.
Unlike Transformer- or graph-based models which suffer from high computational costs and longer inference times, the xLSTM model delivers a practical balance between performance and deployability, making it suitable for integration with edge-based systems like police command centers. The predictive output directly informs patrol unit deployment and traffic signal control, demonstrating tangible utility in live urban traffic scenarios [13,21].
These results substantiate the core contribution of this study: that xLSTM, when integrated into a real-time traffic prediction and dispatch system, provides an empirically validated foundation for intelligent urban traffic governance and proactive police operations.

3.2. Case Study: Real-Time Congestion Prediction and Police Deployment

To validate the practical effectiveness of the proposed xLSTM-based congestion forecasting system, a case study was conducted using real-world traffic data from major intersections. The model’s predictive outputs were compared against actual measurements across three critical traffic parameters: total vehicle volume, average vehicle speed, and lane occupancy rate. Figure 4 illustrates the comparison between the predicted and historical total traffic volume over a 2-day period. The xLSTM model successfully captures the periodic patterns and abrupt surges associated with peak-hour congestion events. Both weekday commuting peaks and weekend variations are effectively reflected, demonstrating the model’s ability to adapt to diverse urban traffic rhythms.
Figure 5 presents the model’s prediction versus the ground truth for average vehicle speeds. Despite the higher volatility inherent in speed measurements, particularly during congestion onset and dissipation, the predicted trends closely track the observed fluctuations. This indicates that the xLSTM model not only forecasts volume accumulation but also anticipates corresponding speed reductions—a critical indicator for early congestion detection.
Figure 6 shows the lane occupancy rate predictions. Occupancy levels, often subject to sharp increases during bottleneck formation, are accurately predicted, including sudden congestion buildups and release phases. The model’s ability to forecast these micro-level dynamics is essential for informing timely police intervention strategies.
Overall, the results substantiate that the proposed xLSTM forecasting system achieves high fidelity in short-term congestion prediction across multiple traffic attributes, supporting its operational deployment for proactive patrol dispatch and traffic flow management. Notably, the observed shifts in traffic patterns after January 1 align with Taiwan’s extended New Year holiday period (1–2 January). These temporal anomalies typically result in abrupt deviations in traffic flow, such as reduced vehicle volume during holidays and sharp rebounds afterward. Despite these irregularities, the xLSTM model effectively captured both the suppressed traffic conditions during holidays and the post-holiday surges, demonstrating its robustness under non-routine mobility patterns. Holiday and weekend intervals have been marked in Figure 4, Figure 5 and Figure 6 for reference.

Real-Time Forecasting Scenario

To illustrate the practical utility of the xLSTM-based system in real-time congestion management, a forecasting scenario was analyzed on 16 May 2025. At 09:00, the observed traffic conditions indicated severe congestion, with an average speed of 28 km/h, an occupancy rate of 73%, and a total of 82 vehicles in the monitored segment (Figure 7).
Using the xLSTM forecasting model, traffic conditions were predicted 30 min ahead. At 09:30, the model forecasted a significant alleviation in congestion, with an anticipated average speed increase to 26.2 km/h, an occupancy rate of 35.6%, and a corresponding decrease in vehicle volume to 48 cars (Figure 8).
This real-time forecast provided critical lead time for police and traffic control units to dynamically adjust patrol allocations and signal control strategies, optimizing resource usage without unnecessary deployments during the natural dissipation of congestion. Such predictive capability enhances operational efficiency and improves traveler experience by minimizing secondary disruptions.

4. Discussion

This study demonstrates the feasibility and effectiveness of integrating an xLSTM-based forecasting model into real-time urban traffic governance systems. Through empirical evaluation using real-world vehicle detector (VD) and CCTV data, the proposed framework achieves high predictive accuracy (over 87% in congestion classification) and low inference latency (approximately 41 ms per instance). These outcomes substantiate the system’s operational viability for proactive police deployment and dynamic traffic management.
Compared to conventional LSTM, GRU, and more recent Transformer-based or graph neural network (GNN) models, the xLSTM architecture offers a distinctive balance between predictive precision and computational efficiency. While Transformer and GNN approaches often achieve strong global feature modeling, they impose substantial computational demands, which can hinder real-time edge deployment in resource-constrained environments such as police dispatch centers. By contrast, xLSTM’s lightweight yet expressive design, enhanced by matrix-based memory cells and exponential gating, supports scalable forecasting without sacrificing responsiveness. Inspired by GRU’s parameter efficiency, the xLSTM model removes the redundant projection matrices typically present in multi-layer LSTM configurations. As a result, the total parameter count is reduced by approximately 28.1%, from 1.52 million in standard three-layer LSTM to 1.09 million in the xLSTM configuration used in this study. This compact architecture helps to reduce the memory footprint and accelerates both training and inference.
The empirical findings further indicate that the xLSTM model effectively adapts to the complexities of Taiwan’s urban traffic environments, including highly variable road geometries, significant modal splits (e.g., high motorcycle densities), and irregular congestion patterns. The ability to predict both congestion buildup and dissipation provides a critical lead time advantage for law enforcement agencies, allowing for optimized patrol deployment and traffic signal interventions based on reliable short-term forecasts.
Nevertheless, several limitations warrant consideration. The model’s performance exhibits slight degradation under extreme conditions, such as during heavy rainfall events, public holidays, or sudden road closures, where traffic patterns deviate substantially from historical norms. Furthermore, variations in sensor quality and data synchronization across different administrative regions may introduce additional noise into the forecasting pipeline. Future research should explore the integration of auxiliary information, such as real-time weather reports, accident notifications, and floating car data, to further enhance model robustness [31].
Looking forward, the proposed system holds substantial potential for broader smart city applications. Beyond supporting proactive police dispatch, xLSTM-based traffic forecasts could inform adaptive traffic signal control, dynamic rerouting recommendations for drivers, and urban infrastructure planning initiatives. Expanding the system’s coverage to encompass regional or national transportation networks, in collaboration with governmental agencies, represents a promising avenue for future development. Additionally, incorporating online learning mechanisms could enable continuous adaptation to evolving traffic behaviors, further strengthening the system’s resilience and long-term effectiveness.

5. Conclusions

This study presents an xLSTM-based real-time traffic flow forecasting system designed to enhance urban traffic governance and proactive police deployment. By leveraging real-world vehicle detector and CCTV data, the system demonstrates superior predictive accuracy, low inference latency, and practical applicability in dynamic and heterogeneous urban environments.
The empirical results validate that the xLSTM architecture, featuring matrix-based memory cells and exponential gating mechanisms, effectively captures complex spatio-temporal traffic patterns. The proposed framework achieves an average congestion prediction accuracy exceeding 87%, providing sufficient lead time for tactical patrol unit deployment and incident management. Unlike computationally intensive Transformer-based or graph neural network models, xLSTM balances forecasting precision with computational efficiency, making it highly suitable for edge deployment scenarios such as dispatch control centers.
In practical terms, this research advances the integration of AI-driven forecasting technologies into smart city infrastructure, promoting more responsive, data-driven urban traffic management and public safety operations. The real-time forecasting capabilities demonstrated in this study offer tangible benefits for congestion mitigation, emergency response optimization, and infrastructure planning.

Author Contributions

Conceptualization, C.-I.H. and J.-S.C.; methodology, C.-I.H. and J.-S.C.; software, C.-I.H. and J.-S.C.; validation, C.-I.H., J.-S.C. and J.-W.H.; formal analysis, C.-I.H.; investigation, C.-I.H. and J.-W.H.; resources, C.-I.H.; data curation, C.-I.H. and J.-S.C.; writing—original draft preparation, C.-I.H.; writing—review and editing, C.-I.H. and J.-S.C.; visualization, C.-I.H. and J.-S.C.; supervision, C.-I.H. and W.-Y.C.; project administration, C.-I.H.; funding acquisition, J.-H.W. and W.-Y.C.; All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the National Science and Technology Council (NSTC), grant number NSTC 113-2221-E-492-016. The APC was funded by the National Science and Technology Council (NSTC).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data supporting the findings of this study are available through a public prototype at http://TCPS.nchc.org.tw (accessed on 28 May 2025), which demonstrates real-time forecast results. Further datasets can be made available from the corresponding author upon reasonable request.

Acknowledgments

We extend our appreciation to the National Center for High-performance Computing (NCHC) for providing the data and model marketplace platforms that were crucial for achieving data and model reuse in this project. We also wish to thank the Taichung City Government Transportation Bureau for providing open database data and the Hsinchu City Police Department for their guidance, both of which greatly contributed to the success of this study. A public prototype is available at http://TCPS.nchc.org.tw (accessed on 28 May 2025) for real-time forecast demonstration.

Conflicts of Interest

Author C.-I.H. was employed by the National Center for High-performance Computing (NCHC). The remaining authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Abbreviations

AbbreviationFull Term
xLSTMExtended Long Short-Term Memory
VDVehicle Detector
MAEMean Absolute Error
RMSERoot Mean Square Error
ITSIntelligent Transportation Systems
GRUGated Recurrent Unit
RNNRecurrent Neural Network
GNNGraph Neural Network
CCTVClosed-Circuit Television
DPIDots Per Inch

References

  1. Feng, J.; Li, Y.; Zhang, C.; Sun, F.; Meng, F.; Gui, A.; Jin, D. DeepMove: Predicting human mobility with attentional recurrent networks. In Proceedings of the 29th International World Wide Web Conference (WWW 2018), Lyon, France, 23–27 April 2018; pp. 1459–1468. [Google Scholar] [CrossRef]
  2. Zhao, L.; Song, Y.; Zhang, C.; Liu, Y.; Wang, P.; Lin, T.; Pei, J. T-GCN: A temporal graph convolutional network for traffic prediction. IEEE Trans. Intell. Transp. Syst. 2020, 21, 3848–3858. [Google Scholar] [CrossRef]
  3. Zhang, H.; Xie, Q.; Shou, Z.; Gao, Y. Dynamic Spatial–Temporal Memory Augmentation Network for Traffic Prediction. Sensors 2024, 24, 6659. [Google Scholar] [CrossRef] [PubMed]
  4. Li, M.; Abdel-Aty, M. Real-Time Crash Likelihood Prediction Using Temporal Attention–Based Deep Learning and Trajectory Fusion. J. Transp.Eng. Part A Syst. 2022, 148, 04022043. [Google Scholar] [CrossRef]
  5. Chen, X.; Chen, H.; Yang, Y.; Wu, H.; Zhang, W.; Zhao, J.; Xiong, Y. Traffic Flow Prediction by an Ensemble Framework with Data Denoising and Deep Learning Model. Phys. A Stat. Mech. Its Appl. 2021, 565, 125574. [Google Scholar] [CrossRef]
  6. Guo, S.; Lin, Y.; Feng, N.; Song, C.; Wan, H. Attention-based spatial-temporal graph convolutional networks for traffic flow forecasting. In Proceedings of the AAAI Conference on Artificial Intelligence (AAAI 2019), Honolulu, HI, USA, 27 January–1 February 2019; pp. 922–929. [Google Scholar] [CrossRef]
  7. Sharma, A.; Sharma, A.; Nikashina, P.; Gavrilenko, V.; Tselykh, A.; Bozhenyuk, A.; Masud, M.; Meshref, H. A Graph Neural Network (GNN)-Based Approach for Real-Time Estimation of Traffic Speed in Sustainable Smart Cities. Sustainability 2023, 15, 11893. [Google Scholar] [CrossRef]
  8. Beck, M.; Pöppel, K.; Spanring, M.; Auer, A.; Prudnikova, O.; Kopp, M.; Klambauer, G.; Brandstetter, J.; Hochreiter, S. xLSTM: Extended long short-term memory. In Proceedings of the 38th Conference on Neural Information Processing Systems (NeurIPS 2024), Vancouver, BC, Canada, 9–15 December 2024. [Google Scholar]
  9. Wang, D.; Yang, H.; Zhou, H. Dynamic Spatial–Temporal Self-Attention Network for Traffic Flow Prediction. Future Internet 2024, 16, 189. [Google Scholar] [CrossRef]
  10. Song, C.; Lin, Y.; Guo, S.; Wan, H. Spatial-Temporal Synchronous Graph Convolutional Networks: A New Framework for Spatial-Temporal Network Data Forecasting. Proc. AAAI Conf. Artif. Intell. 2020, 34, 914–921. [Google Scholar] [CrossRef]
  11. Liu, L.; Cao, Y.; Dong, Y. Attention-Based Multiple Graph Convolutional Recurrent Network for Traffic Forecasting. Sustainability 2023, 15, 4697. [Google Scholar] [CrossRef]
  12. Zheng, Z.; Zhou, Y.; Sun, Y.; Wang, Z.; Liu, B.; Li, K. Applications of Federated Learning in Smart Cities: Recent Advances, Taxonomy, and Open Challenges. Connect. Sci. 2022, 34, 1–28. [Google Scholar] [CrossRef]
  13. Jiang, J.; Han, C.; Zhao, W.X.; Wang, J. PDFormer: Propagation Delay-Aware Dynamic Long-Range Transformer for Traffic Flow Prediction. In Proceedings of the AAAI Conference on Artificial Intelligence, Washington, DC, USA, 7–14 February 2023; pp. 4365–4373. [Google Scholar]
  14. Jiang, M.; Liu, Z. Traffic Flow Prediction Based on Dynamic Graph Spatial-Temporal Neural Network. Mathematics 2023, 11, 2528. [Google Scholar] [CrossRef]
  15. Tomasiello, D.B.; Giannotti, M.; Feitosa, F.F. ACCESS: An agent-based model to explore job accessibility inequalities. Comput. Environ. Urban Syst. 2020, 81, 101462. [Google Scholar] [CrossRef]
  16. Kostopoulos, G.; Davrazos, G.; Kotsiantis, S. Explainable Artificial Intelligence-Based Decision Support Systems: A Recent Review. Electronics 2024, 13, 2842. [Google Scholar] [CrossRef]
  17. Zhang, J.; Zheng, Y.; Qi, D. Deep spatio-temporal residual networks for citywide crowd flows prediction. In Proceedings of the AAAI Conference on Artificial Intelligence (AAAI 2017), San Francisco, CA, USA, 4–9 February 2017; pp. 1655–1661. [Google Scholar] [CrossRef]
  18. Ma, X.; Dai, Z.; He, Z.; Ma, J.; Wang, Y.; Wang, Y. Learning traffic as images: A deep convolutional neural network for large-scale transportation network speed prediction. Sensors 2017, 17, 818. [Google Scholar] [CrossRef]
  19. Yu, B.; Yin, H.; Zhu, Z. Spatio-temporal graph convolutional networks: A deep learning framework for traffic forecasting. In Proceedings of the 27th International Joint Conference on Artificial Intelligence (IJCAI 2018), Stockholm, Sweden, 13–19 July 2018; pp. 3634–3640. [Google Scholar] [CrossRef]
  20. Ke, J.; Zheng, H.; Yang, H.; Chen, X. Short-term forecasting of passenger demand under on-demand ride services: A spatio-temporal deep learning approach. Transp. Res. Part C Emerg. Technol. 2017, 85, 591–608. [Google Scholar] [CrossRef]
  21. Chu, T.; Wang, J.; Codecà, L.; Li, Z. Multi-Agent Deep Reinforcement Learning for Large-Scale Traffic Signal Control. IEEE Trans. Intell. Transp. Syst. 2020, 21, 1086–1095. [Google Scholar] [CrossRef]
  22. Nadarajan, J.; Sivanraj, R. Attention-Based Multiscale Spatiotemporal Network for Traffic Forecast with Fusion of External Factors. ISPRS Int. J. Geo-Inf. 2022, 11, 619. [Google Scholar] [CrossRef]
  23. Yan, P.; Li, Z.; Ijaradar, J.; Pape, S.; Körner, M.; Wang, M. An Imputation-Enhanced Hybrid Deep Learning Approach for Traffic Volume Prediction in Urban Networks: A Case Study in Dresden. Data Sci.Transp. 2024, 6, 22. [Google Scholar] [CrossRef]
  24. Zhou, J.; Dai, H.-N.; Wang, H. Lightweight Convolution Neural Networks for Mobile Edge Computing in Transportation Cyber Physical Systems. ACM Trans. Intell. Syst. Technol. 2019, 10, 11–12. [Google Scholar] [CrossRef]
  25. Zhou, T.; Ma, Z.; Wen, Q.; Wang, X.; Sun, L.; Jin, R. FEDformer: Frequency enhanced decomposed transformer for long-term series forecasting. In Proceedings of the 39th International Conference on Machine Learning (ICML 2022), Baltimore, MD, USA, 17–23 July 2022; pp. 27268–27286. [Google Scholar]
  26. Chen, Y.-T.; Liu, A.; Li, C.; Li, S.; Yang, X. Traffic flow prediction based on spatial-temporal multi factor fusion graph convolutional networks. Sci. Rep. 2025, 15, 12612. [Google Scholar] [CrossRef]
  27. Huang, X.; Jiang, Y.; Wang, J.; Lan, Y.; Chen, H. A Multi-Modal Attention Neural Network for Traffic Flow Prediction by Capturing Long-Short Term Sequence Correlation. Sci. Rep. 2023, 13, 21859. [Google Scholar] [CrossRef]
  28. Ling, J.; Lan, Y.; Huang, X.; Yang, X. A Multi-Scale Residual Graph Convolution Network with Hierarchical Attention for Predicting Traffic Flow in Urban Mobility. Complex Intell. Syst. 2024, 10, 3305–3317. [Google Scholar] [CrossRef]
  29. Li, Y.; Yu, R.; Shahabi, C.; Liu, Y. Diffusion convolutional recurrent neural network: Data-driven traffic forecasting. In Proceedings of the International Conference on Learning Representations (ICLR 2018), Vancouver, BC, Canada, 30 April–3 May 2018. [Google Scholar] [CrossRef]
  30. Dou, Z.; Guo, D. DPSTCN: Dynamic Pattern-Aware Spatio-Temporal Convolutional Networks for Traffic Flow Forecasting. ISPRS Int. J. Geo-Information. 2025, 14, 10. [Google Scholar] [CrossRef]
  31. Sayed, S.A.; Abdelhamid, Y.; Hefny, H.A. Traffic Flow Prediction Using Big Data and Geographic Information Systems: A Survey of Data Sources, Frameworks, Challenges, and Opportunities. Int. J. Comput. Digit. Syst. 2023, 14, 613–632. [Google Scholar] [CrossRef]
Figure 1. System workflow.
Figure 1. System workflow.
Applsci 15 07859 g001
Figure 2. Architecture diagram of the gate/memory flow in xLSTM.
Figure 2. Architecture diagram of the gate/memory flow in xLSTM.
Applsci 15 07859 g002
Figure 3. Congestion forecast map-based dashboard.
Figure 3. Congestion forecast map-based dashboard.
Applsci 15 07859 g003
Figure 4. Comparison of predicted and actual total traffic volume over a 2-day period. The xLSTM model effectively captures peak and off-peak fluctuations.
Figure 4. Comparison of predicted and actual total traffic volume over a 2-day period. The xLSTM model effectively captures peak and off-peak fluctuations.
Applsci 15 07859 g004
Figure 5. Predicted versus observed average vehicle speeds, highlighting the model’s ability to track congestion-induced speed variations in real time.
Figure 5. Predicted versus observed average vehicle speeds, highlighting the model’s ability to track congestion-induced speed variations in real time.
Applsci 15 07859 g005
Figure 6. Forecasted versus actual lane occupancy rates, illustrating the xLSTM model’s sensitivity to localized traffic density changes and congestion buildup.
Figure 6. Forecasted versus actual lane occupancy rates, illustrating the xLSTM model’s sensitivity to localized traffic density changes and congestion buildup.
Applsci 15 07859 g006
Figure 7. Observed traffic congestion at 15:50, with low speed, high occupancy, and vehicle accumulation.
Figure 7. Observed traffic congestion at 15:50, with low speed, high occupancy, and vehicle accumulation.
Applsci 15 07859 g007
Figure 8. Forecasted traffic condition at 16:20, predicting congestion relief with increased speed and reduced vehicle density.
Figure 8. Forecasted traffic condition at 16:20, predicting congestion relief with increased speed and reduced vehicle density.
Applsci 15 07859 g008
Table 1. Comparative performance of different models in short-term urban traffic congestion prediction.
Table 1. Comparative performance of different models in short-term urban traffic congestion prediction.
ModelCongestion Accuracy (%)F1-ScoreMAERMSEInference Latency (ms)
LSTM81.40.8240.1420.18867.9
GRU82.10.8320.1370.18254.7
xGRU84.20.8540.1270.16639.5
ST-GCN85.70.8640.1250.161123.6
DCRNN86.20.8690.1220.157141.2
Informer83.90.8410.1320.171228.4
Autoformer85.10.8580.1280.164195.6
xLSTM87.30.8820.1160.14941.2
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

Huang, C.-I.; Chang, J.-S.; Hsieh, J.-W.; Wu, J.-H.; Chang, W.-Y. xLSTM-Based Urban Traffic Flow Prediction for Intelligent Transportation Governance. Appl. Sci. 2025, 15, 7859. https://doi.org/10.3390/app15147859

AMA Style

Huang C-I, Chang J-S, Hsieh J-W, Wu J-H, Chang W-Y. xLSTM-Based Urban Traffic Flow Prediction for Intelligent Transportation Governance. Applied Sciences. 2025; 15(14):7859. https://doi.org/10.3390/app15147859

Chicago/Turabian Style

Huang, Chung-I, Jih-Sheng Chang, Jun-Wei Hsieh, Jyh-Horng Wu, and Wen-Yi Chang. 2025. "xLSTM-Based Urban Traffic Flow Prediction for Intelligent Transportation Governance" Applied Sciences 15, no. 14: 7859. https://doi.org/10.3390/app15147859

APA Style

Huang, C.-I., Chang, J.-S., Hsieh, J.-W., Wu, J.-H., & Chang, W.-Y. (2025). xLSTM-Based Urban Traffic Flow Prediction for Intelligent Transportation Governance. Applied Sciences, 15(14), 7859. https://doi.org/10.3390/app15147859

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