A traffic flow prediction method and system based on improved space-time coupling KA-LSTM

By improving the spatiotemporally coupled KA-LSTM model, combining the Kolmogorov-Arnold network and multi-head attention mechanism, the shortcomings of traditional traffic flow prediction methods in terms of spatiotemporal modeling accuracy and dynamic adaptability are solved, achieving high-precision prediction of traffic flow and adaptability in complex scenarios.

CN120260264BActive Publication Date: 2026-04-14HUAIYIN INSTITUTE OF TECHNOLOGY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUAIYIN INSTITUTE OF TECHNOLOGY
Filing Date
2025-03-07
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing traffic flow prediction methods are insufficient in terms of spatiotemporal modeling accuracy, dynamic adaptability, and computational efficiency. They are unable to effectively capture the nonlinear dynamic characteristics and complex temporal patterns of traffic flow, and cannot adapt to changes in road network topology and the impact of sudden events.

Method used

An improved spatiotemporally coupled KA-LSTM model is adopted. By fusing the Kolmogorov-Arnold network with LSTM, a multi-head attention mechanism and gating fusion technology are introduced to dynamically adjust the forget gate, input gate and memory update mechanism. Combined with the road network topology and multi-source data, a spatiotemporal feature tensor is generated to optimize the prediction model.

Benefits of technology

It significantly improves the ability to capture the long-term dependence of traffic flow, dynamically balances short-term fluctuations and long-term periodicity, enhances the model's expressive power and prediction accuracy, adapts to complex traffic scenarios, and improves the accuracy and robustness of predictions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120260264B_ABST
    Figure CN120260264B_ABST
Patent Text Reader

Abstract

The application discloses a traffic flow prediction method and system based on improved space-time coupling KA-LSTM, and belongs to the intelligent traffic and artificial intelligence technical field. The method aims at the problems of poor adaptability, low prediction accuracy and insufficient calculation efficiency of the traditional model in complex traffic scenes, constructs a KA-LSTM model, dynamically optimizes the forgetting gate, input gate and memory updating mechanism of the LSTM by using KANs, enhances the capturing ability of long-period dependence, and the system comprises data acquisition, model training, anomaly detection and real-time optimization modules. Experiments show that the MAE, RMSE and other indicators are reduced by more than 40.1% compared with the traditional LSTM, and the training efficiency is significantly improved, and the application is suitable for urban traffic management and optimization. The core advantage of the application lies in that the dynamic gate optimization, multi-modal data fusion and online updating strategy have good performance effects in prediction accuracy, real-time performance and adaptability to complex scenes, and provide an efficient and reliable solution for traffic flow prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the research field of intelligent transportation systems and artificial intelligence technology, specifically involving an improved spatiotemporally coupled KA-LSTM traffic flow prediction method and system. Background Technology

[0002] Traffic flow prediction, a core task of Intelligent Transportation Systems (ITS), aims to accurately predict future traffic flow, speed, and density on road networks using historical traffic data, providing crucial support for traffic management, congestion mitigation, and resource optimization. However, with accelerating urbanization and surging traffic demand, existing prediction methods still face significant challenges in complex and dynamic scenarios.

[0003] Traditional time series models (such as ARIMA) rely on linear assumptions, making it difficult to capture the nonlinear dynamics of traffic flow. Although recurrent neural networks (RNNs) and their improved long short-term memory networks (LSTMs) have shown advantages in time series modeling, their ability to capture long-period dependencies is still limited by the static design of the gating mechanism. For example, the forget gate and input gate of traditional LSTMs update the memory state through fixed weight parameters, making it difficult to adapt to the periodic fluctuations across time scales in traffic flow (such as the difference between morning / evening peak hours and weekend patterns), resulting in insufficient accuracy in modeling complex time series patterns.

[0004] Traffic flow changes at nodes in a transportation network exhibit strong spatial dependence, such as the congestion propagation effect between adjacent road segments or the interaction between arterial roads and secondary roads. Existing methods (such as models based on convolutional neural networks (CNNs) or single LSTM structures) typically use fixed adjacency matrices or local convolutional kernels to model spatial relationships, failing to effectively represent the implicit, nonlinear dynamic interactions between nodes. Furthermore, static spatial modeling struggles to adapt to changes in road network topology (such as construction or temporary closures), limiting the model's generalization ability in complex scenarios.

[0005] Most methods model temporal and spatial features separately (e.g., first using LSTM to extract temporal features, then processing spatial relationships through graph convolution), failing to fully explore the synergistic effects of the spatiotemporal dimensions. The spatiotemporal evolution of traffic flow is highly coupled (e.g., the rapid diffusion of traffic flow in a specific area during peak hours), while traditional step-by-step modeling strategies are prone to losing cross-dimensional dynamic correlation information, leading to prediction results that deviate from the actual distribution.

[0006] The spatiotemporal distribution of traffic flow is influenced by multiple factors such as weather and unforeseen events, exhibiting significant dynamic characteristics. However, traditional LSTM models have fixed parameter weights, making it impossible to dynamically adjust feature importance (such as the priority of sudden traffic surges or accident nodes) based on real-time data. Furthermore, existing methods typically update memory states using a single time scale, making it difficult to balance the contributions of short-term fluctuations and long-term trends, further limiting prediction accuracy. Summary of the Invention

[0007] Purpose of the invention: This invention aims to address the shortcomings of traditional traffic flow prediction methods in terms of spatiotemporal modeling accuracy, dynamic adaptability, and computational efficiency. It proposes a traffic flow prediction method and system based on an improved spatiotemporal coupled KA-LSTM, which enhances prediction performance by improving the LSTM structure and introducing a spatiotemporal joint mechanism.

[0008] Technical solution: This invention discloses a traffic flow prediction method based on an improved spatiotemporally coupled KA-LSTM, comprising the following steps:

[0009] Step 1: Acquire multi-dimensional traffic data from road network sensors.

[0010] Step 2: Deeply integrate Kolmogorov-Arnold networks (KANs) with Long Short-Term Memory networks (LSTM), improve the forget gate, input gate, memory update and output gate mechanisms of traditional LSTM, and construct a KA-LSTM model to enhance the dynamic modeling capability of traffic flow spatiotemporal characteristics.

[0011] Step 3: By using multi-head attention mechanism and gating fusion technology, the hidden state and spatiotemporal features generated by KA-LSTM are integrated to further enhance the model's ability to model the dynamic spatiotemporal relationship of traffic flow.

[0012] Step 4: Training and Predicting the KA-LSTM Model

[0013] Furthermore, in step 1, the collected traffic data is processed by using spatiotemporal weighted interpolation to complete missing data, removing outliers based on the Z-score method, standardizing, and performing Z-score standardization preprocessing on each feature dimension.

[0014] Furthermore, a three-dimensional spacetime tensor is generated. Where T: time step (e.g., a 5-minute time window); N: number of road network nodes (e.g., the number of road segments covered by traffic sensors); F: feature dimension (e.g., traffic flow, speed, density, etc.).

[0015] Furthermore, a road network adjacency matrix is ​​generated using road network topology data, road network connection relationship data, and other data.

[0016] The road network topology data includes: 1) Node information: Identifiers and geographic coordinates of all nodes in the network (such as intersections, road segment start and end points, etc.). 2) Edge information: Describing the connection relationships between nodes, i.e., which nodes have direct road connections. This typically includes the start and end nodes of the edges, as well as possible attributes.

[0017] Road network connectivity data includes: 1) Road connectivity: identifying which nodes are directly connected and which are not. This can be obtained through road network connectivity data, such as extraction from Geographic Information System (GIS) data. 2) Road directionality: if there are one-way roads in the road network, the directionality information of the roads needs to be recorded to ensure that the adjacency matrix can accurately reflect the actual traffic flow.

[0018] Furthermore, in step 2, the KA-LSTM model is specifically designed into initialization and input definition, forget gate improvement, input gate dynamic weighting, multi-scale memory fusion, and output gate optimization.

[0019] Furthermore, in step 2, a hidden state is initialized for each node i. and memory state All dimensions are d h The initial values ​​are set to zero vectors or determined through pre-training. Then, based on the road network adjacency matrix... and in The input for each time step t extracted step by step in the time dimension is Generate global spatial features through graph convolution:

[0020]

[0021] in, Given an adjacency matrix with self-loops, For degree matrix, For trainable weights, d s The spatial feature dimension is consistent with the subsequent KANs input.

[0022] Furthermore, in step 2, the KANs subnetwork KAN f Receive global spatial features Hidden state at the previous moment The original input features of node i at the current time step t Generate dynamic forgetting bias: Furthermore, by merging with the Gate of Oblivion, the following new Gate of Oblivion is obtained:

[0023]

[0024] in, This is the weight matrix. As the bias, σ is the sigmoid activation function. The forget gate output for node i at time t indicates that the memory from the previous time step is retained. The proportion.

[0025] Furthermore, in step 2, the KANs sub-network KANβ receives the original input features of node i at the current time step t. Generate feature importance vector Furthermore, regarding Perform weighted input calculation Where ⊙ represents element-wise multiplication. These are the weighted input features. Furthermore, the... To fuse the weighted input features into the input gate, a new input gate formula is obtained:

[0026]

[0027] in, This is the weight matrix. For bias, The input gate output represents the degree to which new information has been received.

[0028] Furthermore, in step 2, the candidate memory state is introduced from global spatial features. Through the KANs subnetwork KAN C The generated enhanced candidate memory vector Generate new candidate memory states:

[0029]

[0030] Furthermore, long-term hidden state Through the subnetwork KANs γ Generate a dynamic balance between short-term fluctuations and long-term periodicity long-term memory weights: Therefore, the memory state formula is updated as follows:

[0031]

[0032] in, Based on the current memory state, merge with short-term updates. and long-term memory

[0033] Furthermore, in step 2, the KANs subnetwork KAN f Receive global spatial features Generate dynamic forgetting bias Furthermore, by integrating this into the output gate, we obtain the following new output gate and hidden state output:

[0034] 1) Output gate: in, and For weights and biases, KAN oFor KANs subnetworks, the output is a dynamic bias with dimension d. h .

[0035] 2) Hidden state output: in, Let be the hidden state of node i at time t.

[0036] Furthermore, in step 3, the hidden state output by the KA-LSTM model in step 2 is received. (The hidden state of each node i at time t, d) h (Hidden state dimension) and spatial features (Generated by graph convolution in step 2, d) s (For spatial feature dimensions).

[0037] Furthermore, in step 3, a multi-head attention mechanism is used to extract the correlation of spatiotemporal features from different subspaces, and the expressive power of the model is enhanced through the following design.

[0038] Furthermore, the hidden states output by the KA-LSTM model are utilized. (The hidden state of each node i at time t, d) h (Hidden state dimension) and spatial features (Generated by graph convolution in step 2, d) s (For spatial feature dimensions). Generate queries, keys, and values ​​based on implicit states. and spatial features The vectors required to generate multi-head attention:

[0039]

[0040] in:

[0041] To query the weight matrix, W K , These are the key and value weight matrices, respectively.

[0042] d k =d h / H is the dimension of each attention head, and H is the number of attention heads;

[0043] Let $j$ be the query vector of node $j$ and the key-value vector of node $j$, where $j$ ∈ ${1, ..., N}. We will traverse all nodes.

[0044] Furthermore, utilizing and The attention weights are calculated, and the similarity between nodes for each attention head is calculated and normalized:

[0045]

[0046] in:

[0047] h = 1, ..., H represents the h-th attention head;

[0048] and Let h be the query and key vector of the h-th head;

[0049] This is a scaling factor to avoid excessively large values;

[0050] The attention weight of node i to node j reflects spatial correlation.

[0051] Furthermore, utilizing and The generated attention weights and We perform weighted aggregation of features from all nodes to obtain the attention output:

[0052]

[0053] in:

[0054] This is the value vector of the h-th head; The multi-head attention output of a node is generated by concatenating the results of H heads and performing a linear transformation:

[0055]

[0056] in, This is the output weight matrix.

[0057] Furthermore, in step 3, the original hidden state is dynamically balanced through gate control. With attention output Generate gated units:

[0058]

[0059] in:

[0060] For the gated weight matrix, For bias;

[0061] This is a concatenation of the hidden state and the attention output;

[0062] This is a gating vector, where each dimension independently controls the fusion ratio of the corresponding feature.

[0063] Furthermore, combined with the gating unit Primitive hidden state With attention output Generate the final hidden state:

[0064]

[0065] in: Let be the final hidden state of node i at time t; Preserve the original timing information. Incorporate spatial attention results.

[0066] Furthermore, in step 4, the KA-LSTM model and its spatiotemporal attention mechanism are trained by designing a joint loss function, optimization strategy and prediction output process, and the prediction results are output using a fully connected layer.

[0067] This invention discloses a traffic flow prediction system based on an improved spatiotemporally coupled KA-LSTM, comprising the following sub-modules:

[0068] (1) Data preprocessing module: used to collect and process road network traffic data and generate spatiotemporal tensors;

[0069] (2) KA-LSTM prediction module: Based on the improved LSTM structure and spatiotemporal attention mechanism of KANs, it generates traffic prediction results;

[0070] (3) Attention weight distribution identification module: Identifies traffic anomalies and adjusts prediction strategies based on attention weight distribution;

[0071] (4) Real-time optimization interface module: outputs the prediction results to the traffic management system and supports traffic light timing optimization.

[0072] Furthermore, the traffic flow prediction system based on an improved spatiotemporally coupled LSTM includes the following sub-modules in its data preprocessing module: (1) Data acquisition module: automatically acquires traffic flow, speed, and density data from road network sensors at a time granularity of 5 minutes. (2) Missing value processing module: completes missing data using spatiotemporally weighted interpolation. (3) Outlier detection module: removes outliers based on the Z-score method with a threshold of 3. (4) Data standardization module: performs Z-score standardization on each feature dimension to generate a three-dimensional spatiotemporal tensor.

[0073] Furthermore, the traffic flow prediction system based on the improved spatiotemporal coupled LSTM includes the following sub-modules in the KA-LSTM prediction module: (1) Forget gate sub-module: dynamic forget weights are generated using KANs; (2) Input gate sub-module: dynamic weighting of features is achieved through KANs; (3) Multi-scale memory sub-module: short-term and long-term features are fused to update the memory state; (4) Spatiotemporal attention sub-module: hidden state output is optimized based on multi-head attention and gating fusion.

[0074] Furthermore, the traffic flow prediction system based on improved spatiotemporal coupled LSTM is characterized in that the attention weight distribution identification module includes the following sub-modules: (1) anomaly identification module: identifying traffic anomaly events based on attention weight distribution. (2) prediction strategy adjustment module: automatically adjusting the prediction strategy according to the anomaly situation to ensure the reliability and timeliness of the prediction results.

[0075] Furthermore, in the traffic flow prediction system based on the improved spatiotemporal coupled LSTM, the real-time optimization interface module includes the following sub-modules: (1) Prediction result output module: transmits the prediction results to the traffic management system and supports functions such as traffic light timing optimization. (2) Real-time optimization module: makes real-time traffic management decisions based on the prediction results.

[0076] Furthermore, the system functional design of the traffic flow prediction system based on improved spatiotemporal coupled LSTM specifically includes the following parts:

[0077] (1) Data Acquisition and Preprocessing: Traffic flow, speed and density data are automatically collected from road network sensors at a time granularity of 5 minutes. Missing data are filled in using spatiotemporal weighted interpolation, outliers are removed using the Z-score method, and each feature dimension is standardized by Z-score to finally generate a three-dimensional spatiotemporal tensor, providing high-quality data for subsequent model training.

[0078] (2) Traffic flow prediction: The system uses an improved LSTM structure based on KANs and a spatiotemporal attention mechanism to perform in-depth analysis on the preprocessed data. The system can accurately predict traffic flow in the future time period and provide the predicted flow value and confidence interval (such as 95% confidence level) to meet the prediction needs in different scenarios.

[0079] (3) Anomaly detection and adaptive adjustment: Real-time detection of traffic anomalies based on changes in the distribution of attention weights. Once an anomaly is detected, the system automatically increases the weight of short-term features to improve the response capability to emergencies and ensure the reliability and timeliness of the prediction results.

[0080] (4) Multimodal data fusion: Receive multi-source information such as weather data and traffic event data, generate dynamic weighted vectors through KANs, integrate multimodal features into the model, enhance the model's adaptability to complex traffic scenarios, and further improve prediction accuracy.

[0081] (5) Online update: When new data is input, the system updates the parameters of the KANs sub-network through incremental learning and adopts a sliding window strategy (window size is W, update frequency is every M time steps) so that the model can adapt to changes in traffic conditions in a timely manner and maintain good predictive performance.

[0082] (6) Real-time optimization interface: The prediction results are output to the traffic management system to provide data support for traffic management decisions such as traffic light timing optimization, help alleviate traffic congestion and improve traffic operation efficiency.

[0083] Furthermore, the traffic flow prediction system based on an improved spatiotemporally coupled LSTM is characterized in that the system architecture design specifically includes the following parts:

[0084] (1) Data Preprocessing Module: Responsible for collecting and processing road network traffic data. This module realizes functions such as data collection, missing value handling, outlier detection and standardization, and converts the raw data into a three-dimensional spatiotemporal tensor suitable for model input.

[0085] (2) KA-LSTM prediction module: It consists of a forgetting submodule, an input submodule, a multi-scale memory submodule, and a spatiotemporal attention submodule. The forgetting submodule uses KANs to generate dynamic forgetting weights; the input submodule uses KANs to dynamically weight features; the multi-scale memory submodule fuses short-term and long-term features to update the memory state; the spatiotemporal attention submodule optimizes the hidden state output based on multi-head attention and gating fusion. All submodules work together to generate accurate traffic prediction results.

[0086] (3) Attention weight distribution identification module: Based on the attention weight distribution, traffic anomalies are identified, and the prediction strategy is adjusted according to the anomaly to ensure that the prediction results can reflect the changes in traffic conditions in a timely manner.

[0087] (4) Real-time optimization interface module: Transmits the prediction results to the traffic management system, supports functions such as traffic light timing optimization, and realizes the application of prediction results in actual traffic management.

[0088] Furthermore, the traffic flow prediction system based on an improved spatiotemporally coupled LSTM is characterized in that the system usage method specifically includes the following parts:

[0089] (1) Ensure that the road network sensors are working properly and continuously collecting data. The system will automatically acquire data and preprocess it, and users do not need to manually intervene in the data acquisition and preprocessing process.

[0090] (2) After system initialization, the system will automatically train the model using historical data. After training, the system will predict traffic flow based on the input real-time data. Users can view the prediction results on the system interface, including traffic flow values ​​and confidence intervals for different future time periods.

[0091] (3) The system monitors traffic anomalies in real time during operation. When an anomaly is detected, users can learn about the anomaly information through system prompts. The system will automatically adjust its prediction strategy, and no additional user intervention is required.

[0092] (4) The system automatically receives and fuses multi-source data, and performs online updates according to the set update strategy. Users do not need to manually operate the multimodal data fusion and online updates, but can adjust relevant parameters in the system settings.

[0093] (5) The prediction results will be automatically transmitted to the traffic management system. Traffic management personnel can use the prediction data provided by the system to perform operations such as optimizing traffic light timings in order to improve traffic conditions.

[0094] Furthermore, the traffic flow prediction system based on improved spatiotemporal coupled LSTM is characterized in that the system maintenance and update part specifically includes the following components:

[0095] (1) Regular inspection: Regularly inspect the working status of the road network sensors to ensure the accuracy and completeness of data acquisition. Check the operation of each module of the system and promptly identify and resolve potential problems.

[0096] (2) Data Update: Update historical data in a timely manner to ensure the effectiveness of model training. Regularly clean up invalid or erroneous data to improve data quality.

[0097] (3) Model optimization: Based on new research findings and feedback from practical applications, the KA-LSTM model is optimized and upgraded. For example, the model structure is adjusted and the algorithm parameters are improved to enhance the predictive performance of the system.

[0098] (4) System Upgrades: Regularly upgrade the system software, fix vulnerabilities, and enhance system stability and security. Simultaneously, add new functional modules based on user needs and technological advancements to improve the system's usability and adaptability.

[0099] Beneficial effects:

[0100] (1) This invention utilizes KANs to dynamically optimize the forget gate, input gate, and memory update mechanism of LSTM, significantly improving the ability to capture long-term dependence of traffic flow. Specifically, the dynamic forget weights generated by KANs avoid the static linear assumption of the traditional LSTM forget gate and enhance the model's selective retention of historical information.

[0101] (2) This invention employs multi-scale memory fusion technology, which dynamically balances short-term fluctuations and long-term periodicity, adapting to the complex dynamic changes in traffic flow. Specifically, the candidate memory state integrates short-term and long-term features, enhancing the model's ability to capture multi-timescale patterns. This improvement enables the model to significantly outperform traditional LSTM in long-term predictions, further enhancing prediction accuracy.

[0102] (3) This invention designs a multi-head attention mechanism to extract the correlation of spatiotemporal features from different subspaces and dynamically capture the spatial dependence and temporal evolution trend between nodes. Specifically, the multi-head attention mechanism generates query, key, and value vectors, calculates and normalizes the similarity between nodes, generates attention weights, and then weights and aggregates the features of all nodes. This improvement significantly enhances the expressive power of the model, enabling it to more accurately capture the dynamic spatiotemporal relationship of traffic flow and further improve prediction accuracy.

[0103] (4) This invention utilizes gated fusion technology to dynamically balance the original hidden state and attention output, optimizing the spatiotemporal contribution of the final representation. Specifically, the gate unit generates a gated vector by concatenating the hidden state and attention output, with each dimension independently controlling the fusion ratio of the corresponding feature. This improvement enables the model to adjust feature fusion more flexibly, preserving the original temporal information while incorporating spatial attention results, further enhancing prediction accuracy and model robustness.

[0104] (5) This invention introduces a joint loss function (MAE and spatiotemporal consistency loss) to improve the robustness and generalization ability of the model. Specifically, the joint loss function constrains the spatial feature similarity of adjacent nodes by jointly optimizing prediction error and temporal consistency, ensuring the appropriate representation strength of the fused image. This improvement makes the model more stable in complex traffic scenarios and significantly improves the model's generalization ability and prediction accuracy. Attached Figure Description

[0105] Figure 1 Overall architecture diagram of KA-LSTM algorithm

[0106] Figure 2 KA-LSTM Structure Diagram

[0107] Figure 3 KA-LSTM Data Processing Flowchart

[0108] Figure 4 Schematic diagram of spatiotemporal attention mechanism

[0109] Figure 5 Comparison of predicted and actual values ​​from ablation experiments

[0110] Figure 6Comparison chart of predicted and actual values ​​from different models

[0111] Figure 7 Line chart comparing ablation test indicators

[0112] Figure 8 Bar chart comparing ablation test indicators

[0113] Figure 9 Line chart comparing experimental indicators of different models

[0114] Figure 10 Bar chart comparing experimental indicators of different models

[0115] Figure 11 System architecture diagram Detailed Implementation

[0116] To better understand this invention, the following description, in conjunction with the accompanying drawings of the embodiments of this invention, will provide further details, but these descriptions are not intended to limit the scope of the invention. Various modifications and improvements made to the technical solutions of this invention by those skilled in the art without departing from the inventive concept should fall within the protection scope of this invention.

[0117] like Figure 1-11 As shown, a traffic flow prediction method and system based on an improved spatiotemporally coupled KA-LSTM are described below:

[0118] Step 1: Data Acquisition and Preprocessing

[0119] (1) Data Acquisition: The PEMS-D7 dataset contains traffic flow data for a specific area of ​​Highway 7 in California. Traffic flow, speed, and density data for N road segments within a time window T are extracted from this dataset, with a time granularity of 5 minutes. Due to missing and outlier data in some parts of the PEMS-D7 dataset, preprocessing is required.

[0120] (2) Preprocessing process:

[0121] 1) Missing value handling: Missing data is filled using spatiotemporal weighted interpolation.

[0122]

[0123] Among them, w ij α represents the spatial distance weight between nodes i and j (based on the Gaussian kernel function), and α∈[0,1] is the spatiotemporal balance factor, which is set to 0.7 by default.

[0124] 2) Outlier detection: Outliers are removed based on the Z-score method (threshold set to 3).

[0125] 3) Standardization: Perform Z-score standardization on each feature dimension:

[0126]

[0127] (3) Output format: Generate a three-dimensional spacetime tensor (F is the feature dimension.)

[0128] Step 2: KA-LSTM Model Design

[0129] This step involves deeply fusing Kolmogorov-Arnold networks (KANs) with Long Short-Term Memory (LSTM) networks, improving the forgetting gate, input gate, memory update, and output gate mechanisms of traditional LSTMs to construct a KA-LSTM model, thereby enhancing the dynamic modeling capability of traffic flow spatiotemporal characteristics. The specific design is divided into the following sub-steps:

[0130] 2.1 Initialization and Input Definition

[0131] (1) Input data: Receive the normalized three-dimensional spacetime tensor output from step 1. (T is the time step, N is the number of nodes, and F is the feature dimension, such as flow, speed, and density).

[0132] (2) Hidden State and Memory Initialization: Initialize the hidden state for each node i. and memory state All dimensions are d h (Default 128), the initial value is set to the zero vector or determined through pre-training.

[0133] (3) Spatial feature extraction: based on road network adjacency matrix And the current input X t Global spatial features are generated through graph convolution:

[0134]

[0135] in, Given an adjacency matrix with self-loops, For degree matrix, For trainable weights, d s The spatial feature dimension (e.g., 64) is consistent with the subsequent KANs input.

[0136] 2.2 Improvements to the Forgot Gate

[0137] (1) KANS introduces nonlinear dynamic adjustment through basis function decomposition, avoiding the static linear assumption of the traditional LSTM forget gate and improving the ability to capture long-period dependencies. By dynamically adjusting the forgetting weights through KANS, the model's ability to selectively retain historical information is enhanced.

[0138] (2) Implementation method:

[0139] 1) KANs subnetwork KAN f Receive global spatial features Hidden state at the previous moment and current input Generate dynamic forgetting bias:

[0140]

[0141] Among them, KAN f The structure consists of two layers: the first layer is a basis function decomposition layer (using 3rd-order spline functions with 10 grids), and the second layer is a linear transformation layer with an output dimension of d. h (and Consistent).

[0142] 2) Forgot Gate Update Formula:

[0143]

[0144] in, This is the weight matrix. As the bias, σ is the sigmoid activation function. The forget gate output for node i at time t indicates that the memory from the previous time step is retained. The proportion.

[0145] (3) Design details:

[0146] KAN f Captured by basis function decomposition The nonlinear spatial dependence in [the text] has approximately 10 F·d. h (Number of grids × Input dimension × Output dimension).

[0147] During training, W f and b f KAN is updated via backpropagation. f Independent parameter optimization.

[0148] 2.3 Dynamic weighting of input gates

[0149] (1) The dynamic weighting mechanism enables the model to adapt to the spatiotemporal changes of input features, which is more flexible than the fixed weights of traditional LSTM. By dynamically weighting the input features through KANs, the contribution of key features (such as traffic mutations) is highlighted.

[0150] (2) Implementation method:

[0151] 1) The KANs subnetwork KANβ receives the current input. Generate feature importance vectors:

[0152]

[0153] Among them, KAN β It is a single-layer network that uses a learnable spline function (order 3, number of grids 5), with an output dimension of F and a value range of [0, 1], representing the relative importance of each feature.

[0154] 2) Weighted input calculation:

[0155]

[0156] Where ⊙ represents element-wise multiplication. These are the weighted input features.

[0157] 3) Input gate update formula:

[0158]

[0159] in, This is the weight matrix. For bias, The input gate output represents the degree to which new information has been received.

[0160] (3) Design details:

[0161] The dynamic nature of KAN allows the model to adapt to changes in features, such as increasing the weight of traffic features during sudden increases in traffic. β It has a small number of parameters (approximately 5·F2) and low computational cost.

[0162] 2.4 Multi-scale memory fusion

[0163] (1) Multi-scale memory fusion dynamically balances short-term fluctuations and long-term periodicity through KANs, which is more adaptable to the complex dynamics of traffic flow than the single time scale of traditional LSTM. By fusing short-term and long-term memories, multi-time scale patterns of traffic flow are captured.

[0164] (2) Implementation method:

[0165] 1) Calculation of candidate memory states:

[0166]

[0167] in, and For weights and biases, KAN C For KANS subnetworks, receive spatial features The output dimension is d h This enhances the spatial context awareness of candidate states.

[0168] 2) Long-term memory weight generation:

[0169]

[0170] Among them, KAN γ It is a single-layer network using spline functions (order 3, number of grids 5), and the output is a scalar. This is a long-term hidden state (Δt is a long period span, such as 12 steps, which represents 1 hour).

[0171] 3) Memory state update:

[0172]

[0173] in, Based on the current memory state, merge with short-term updates. and long-term memory

[0174] (3) Design details:

[0175] Δt can be adjusted according to the application scenario (e.g., 6 steps for highway networks, 12 steps for urban networks). KAN C and KAN γ It dynamically adjusts memory updates by leveraging spatial and temporal features, making it more flexible than traditional LSTM.

[0176] 2.5 Output gate optimization

[0177] (1) The output gate introduces spatial feature adjustment to make the hidden state more accurately reflect the road network dynamics. The hidden state output is optimized by combining spatial context to improve prediction accuracy.

[0178] (2) Implementation method:

[0179] 1) Output gate calculation:

[0180]

[0181] in, and For weights and biases, KAN o For KANs subnetworks, the output is a dynamic bias with dimension d. h .

[0182] 2) Hidden state output:

[0183]

[0184] in, Let be the hidden state of node i at time t.

[0185] (3) Technical details: KAN oStructure and KAN f Similarly, enhance the output's sensitivity to spatial dependencies.

[0186] 2.6 Parameter and Calculation Optimization

[0187] KANs parameters: Each KANs subnetwork (KAN) f 、KAN β 、KAN c 、KAN γ 、KAN o Both adopt a two-layer structure: the first layer is a spline function (order 3, number of grids 5-10), and the second layer is a linear transformation. The total number of parameters accounts for about 25% of the LSTM.

[0188] Regularization: Apply L1 regularization (coefficient 0.01) to the weights of KANs to reduce overfitting.

[0189] Computational efficiency: Supports node-level parallel computing with a time complexity of O(n log n). Step 3: Fusion of spatiotemporal attention mechanisms

[0190] This step utilizes a multi-head attention mechanism and gating fusion technology to integrate the hidden states and spatiotemporal features generated by KA-LSTM, further enhancing the model's ability to model the dynamic spatiotemporal relationships of traffic flow. The specific implementation consists of the following sub-steps.

[0191] 3.1 Input and Target Definition

[0192] (1) Input data: Receive the hidden state output by the KA-LSTM model in step 2. (The hidden state of each node i at time t, d) h The hidden state dimension (e.g., 128) and spatial features (Generated by graph convolution in step 2.1, d) s For spatial feature dimensions, such as 64).

[0193] (2) Design goal: To dynamically capture the spatial dependencies and temporal evolution trends between nodes through an attention mechanism, and generate enhanced hidden state representations. Improve prediction accuracy.

[0194] 3.2 Multi-head attention calculation

[0195] (1) Design goal: To enhance the expressive power of the model by using the multi-head attention mechanism to extract the correlation of spatiotemporal features from different subspaces.

[0196] (2) Implementation method:

[0197] 1) Query, key, and value generation: based on implicit state and spatial features The vectors required to generate multi-head attention:

[0198]

[0199] in:

[0200] To query the weight matrix, W K , These are the key and value weight matrices, respectively.

[0201] d k =d h / H is the dimension of each attention head, and H is the number of attention heads;

[0202] Let $j$ be the query vector of node $j$ and the key-value vector of node $j$, respectively, where $j \in {1, ..., \in \mathbb{R}$.

[0203] Iterate through all nodes in N.

[0204] 2) Attention weight calculation: Calculate and normalize the similarity between nodes for each attention head:

[0205]

[0206] in:

[0207] h = 1, ..., H represents the h-th attention head;

[0208] and Let h be the query and key vector of the h-th head;

[0209] This is a scaling factor to avoid excessively large values;

[0210] The attention weight of node i to node j reflects spatial correlation.

[0211] 3) Attention Output: Weighted aggregation of features from all nodes:

[0212]

[0213] in:

[0214] This is the value vector of the h-th head; The multi-head attention output of a node is generated by concatenating the results of H heads and performing a linear transformation:

[0215]

[0216] in, This is the output weight matrix.

[0217] 3.3 Gating Fusion

[0218] (1) Design goal: To optimize the spatiotemporal contribution of the final representation by dynamically balancing the original hidden state and the attention output through gate control.

[0219] (2) Implementation method:

[0220] 1) Gating unit calculation:

[0221]

[0222] in:

[0223] For the gated weight matrix, For bias;

[0224] This is a concatenation of the hidden state and the attention output;

[0225] This is a gating vector, where each dimension independently controls the fusion ratio of the corresponding feature.

[0226] 2) Final hidden state generation:

[0227]

[0228] in:

[0229] Let be the final hidden state of node i at time t; Preserve the original timing information. Incorporate spatial attention results.

[0230] (3) Technical details: The dimensional design allows for feature-level fusion, which is more refined than scalar gating. The computational complexity of gating is O(n log n). Dimensionality reduction optimization (e.g., projecting to d) can be achieved. h / 2).

[0231] 3.4 Parameter Configuration and Optimization

[0232] (1) Attention parameter: W Q W K W V Initialized as a normal distribution (mean 0, variance 0.01), updated through training. H defaults to 3, d k =d h / H guarantees dimension matching.

[0233] (2) Gating parameters: W g and b gInitialize to a zero vector to avoid initial bias. Add L2 regularization (coefficient 0.001) to prevent overfitting.

[0234] (3) Optimization strategy: Support sparse pruning of attention weights, when Setting the time to 0 reduces unnecessary computation. Parallel computation of attention per head reduces time overhead to O(N). 2 ·d h / H).

[0235] 3.5 Output and Verification

[0236] (1) Output result: Generate the final hidden state As input for subsequent predictions.

[0237] (2) Validation method: Check attention weights The distribution of these values ​​verifies spatial correlation (e.g., neighboring nodes have higher weights). Compare... and The predictive performance ensures that the attention mechanism improves the effect.

[0238] (3) Technical details: Output dimension d h Consistent with KA-LSTM, ensuring module compatibility. Visualizing the attention matrix. Used for debugging and interpretive analysis.

[0239] Step 4: Model Training and Optimization

[0240] This step involves designing a joint loss function, optimization strategy, and prediction output process to train the KA-LSTM model and its spatiotemporal attention mechanism, ensuring prediction accuracy and model robustness. The specific implementation consists of the following sub-steps.

[0241] 4.1 Data Preparation and Division

[0242] (1) Input data: using the normalized three-dimensional spatiotemporal tensor generated in step 1 (T is the time step, N is the node dimension, F is the feature dimension, e.g., 3), and the corresponding real traffic labels. (Future K-step traffic value).

[0243] (2) Dataset partitioning: Training set: accounting for the first 70% of the total data, used for parameter learning. Validation set: accounting for the middle 20%, used for hyperparameter tuning. Test set: accounting for the last 10%, used for performance evaluation.

[0244] (3) Technical details: Data is divided in chronological order to avoid information leakage. Each batch of input is a time series segment (e.g., 24 steps in length, 2 hours), and the default batch size is 32.

[0245] 4.2 Loss Function Design

[0246] (1) Design goal: To jointly optimize prediction error and time consistency, and improve the accuracy and stability of the model.

[0247] (2) Implementation method

[0248] A weighted combination of MAE (mean absolute error) and spatiotemporal consistency loss is used:

[0249]

[0250] in:

[0251] Let i be the actual flow rate of node i at time t;

[0252] These are the model's predicted values;

[0253] The first term is MAE loss, which measures prediction accuracy;

[0254] The spatial characteristics of node i at time t (generated by step 2.1);

[0255] The second term is the spatiotemporal consistency loss, which constrains the spatial feature similarity of adjacent nodes. The square of the L2 norm;

[0256] λ is the regularization coefficient, with a default value of 0.1, which balances the contributions of the two losses.

[0257] (3) Technical details:

[0258] 1)∑ i , j Traversing all node pairs can be done by sparsifying the adjacency matrix A, calculating only adjacent node pairs (reducing the complexity to O(E·d)). s )).

[0259] 2) In MAE calculation, if the future K steps are predicted, it is expanded to:

[0260]

[0261] Where k = 1, ..., K (e.g., K = 12, predicting 1 hour).

[0262] 4.3 Optimization Strategy

[0263] (1) Design goal: To accelerate convergence and prevent overfitting through efficient optimization algorithms and regularization methods.

[0264] (2) Implementation method:

[0265] 1) Optimizer: Use the Adam optimizer with the following parameter settings:

[0266] Initial learning rate η = 0.001; momentum parameters β1 = 0.9, β2 = 0.999;

[0267] Exponential decay strategy: The learning rate is halved every 20 rounds, that is, the learning rate in round e is:

[0268]

[0269] 2) Gradient clipping: Apply norm constraints to the gradients of all parameters, with a threshold of 5.0.

[0270]

[0271] in, The gradient of the loss function with respect to the parameters is used to avoid gradient explosion in KANs subnetworks.

[0272] (3) Technical Details: 1) The default training epochs are 100. If the validation set loss does not decrease for 10 consecutive epochs, the training will stop early. 2) Dropout regularization (dropout rate 0.2) is added and applied to the hidden state and attention output of KA-LSTM. 3) Parameters updated in each iteration include: W f W i W c W o (KA-LSTM weights), W Q W K W V W g (Attention weights) and KANS subnetwork parameters.

[0273] 4.4 Prediction Output

[0274] (1) Design goal: Generate traffic prediction values ​​for the next K steps based on the trained model.

[0275] (2) Implementation method: The final hidden state is mapped to the predicted value through a fully connected layer:

[0276]

[0277] in:

[0278] The final hidden state output from step 3 (the node dimension has been expanded to N·d) h );

[0279] To output the weight matrix, For bias;

[0280] For the predicted flow vector of the next K steps, reshape it by node and time step as follows:

[0281] (2) Technical details:

[0282] 1) If the prediction is a single step (K=1), then Output

[0283] 2) Add confidence interval estimation: Calculate the 95% confidence interval based on the predicted residual distribution:

[0284]

[0285] Where, σ res To verify the standard deviation of the set residuals.

[0286] 4.5 Training Process and Validation

[0287] (1) Training process:

[0288] 1) Initialize model parameters (normal distribution, mean 0, variance 0.01).

[0289] 2) Input the training batch and calculate the forward propagation output. And loss L.

[0290] 3) Backpropagate to update parameters, perform gradient pruning and Adam optimization.

[0291] 4) Evaluate MAE on the validation set in each round and record the best model.

[0292] (2) Verification method:

[0293] 1) Calculate MAE, RMSE (Root Mean Square Error), and MAPE (Mean Percentage Error):

[0294]

[0295] 2) Check the spatiotemporal consistency loss to ensure that the feature difference between adjacent nodes is less than a threshold (e.g., 0.5).

[0296] (3) Technical details:

[0297] Training is performed on a GPU (such as an NVIDIA RTX 4060), and each round takes about 5 seconds (N=500, T=24).

[0298] 4.6 Parameters and Optimization Configuration

[0299] (1) Hyperparameters:

[0300] Batch size: 32 (adjustable to 64 or 128).

[0301] Hidden state dimension d h =128, spatial feature dimension d s =64.

[0302] The regularization coefficient λ = 0.1 (adjustable range [0.01, 1.0]).

[0303] (2) Optimize details:

[0304] Warm-up phase: The learning rate increases linearly to 0.001 in the first 5 rounds.

[0305] Learning rate scheduler: Cosine annealing optional, 20 rounds per cycle.

[0306] (3) Computational complexity:

[0307] Single forward propagation (Including KA-LSTM and attention mechanisms), total training complexity (E is the round number, I is the iteration number).

[0308] 4.4 Prediction Process and Output Format

[0309] Input the preprocessed spatiotemporal tensor, based on Predicting future K-step traffic using a fully connected layer:

[0310]

[0311] Furthermore, the predicted flow rate and confidence interval (e.g., 95% confidence level) are output.

[0312] To verify the effectiveness of the various modules improved and introduced in this invention in improving the model, under the same parameter conditions, the following eight sets of ablation experiments were conducted on the five innovative points of this invention. The results of the ablation experiments and comparative experiments are shown in Tables 1 and 2:

[0313] Table 1 Ablation Experiment Results

[0314]

[0315] The baseline LSTM model exhibits the highest MAE (15.2 vehicles / minute), RMSE (22.5), and MAPE (12.8%), revealing the inherent limitations of traditional LSTM in complex spatiotemporal modeling. By introducing a spatiotemporal attention mechanism, model performance is significantly optimized, with MAE decreasing to 13.6 (a 10.5% reduction), and RMSE and MAPE improving simultaneously, validating the crucial role of the attention mechanism in dynamically capturing spatial relationships and temporal evolution. Further optimization with dynamic gating of KANs further compresses MAE to 12.8 (a 15.8% reduction from the baseline), while training time only increases slightly (4.0 seconds / round), indicating that KANs overcome the linear assumptions of traditional LSTM while maintaining computational efficiency. However, when using multi-scale memory fusion alone, its improvement in long-term prediction is limited (MAE = 14.1), but its synergistic effect with KANs in the complete model is significant, highlighting its reliance on modules such as dynamic weighting to fully capture multi-timescale features. The application of dynamically weighted input features reduced the MAE to 13.3 (a 12.5% ​​decrease), demonstrating its strong adaptability to sudden traffic patterns, especially in anomalous scenarios. While the spatiotemporal consistency loss had limited effect when used alone (MAE = 14.5), it significantly improved the robustness of the complete model by constraining the similarity of features between adjacent nodes. Notably, the MAE of KA-LSTM (Experiment 7) with the spatiotemporal consistency loss removed increased to 10.5, a 13.3% increase compared to the complete model (Experiment 8), confirming the crucial role of this loss function in generalization ability. Ultimately, the complete KA-LSTM, through the synergy of its modules, achieved a low MAE of 9.1 (a 40.1% decrease from the baseline), with RMSE and MAPE of 14.7 and 7.5%, respectively, demonstrating superior overall performance, while still meeting real-time requirements with a training time of 5.5 seconds per epoch. These improvements demonstrate that, through dynamic gating optimization, multi-scale feature fusion, and the synergistic design of spatiotemporal constraints, KA-LSTM has achieved a comprehensive surpassing of traditional and advanced models in terms of accuracy, efficiency, and adaptability, providing a superior solution for complex traffic scenarios.

[0316] Table 2 Comparison of experimental results

[0317]

[0318] The traditional linear model ARIMA suffers from a MAE as high as 18.7 vehicles / minute, with RMSE and MAPE of 26.3% and 16.5%, respectively, demonstrating its severe inadequacy in modeling nonlinear spatiotemporal features. Despite having the shortest training time (0.8 seconds / round), its accuracy is insufficient for complex scenarios. Traditional LSTM reduces the MAE to 15.2 (18.7% lower than ARIMA) through its temporal modeling capabilities, but its performance is still limited by the lack of spatial dependency modeling. CNN-LSTM, combining spatial local features of CNNs, further compresses the MAE to 14.0 (25.1% lower than ARIMA), but its fixed convolutional kernel limits its ability to capture global dynamic spatial relationships. STGCN, based on graph convolution, significantly improves the MAE to 11.5 (38.5% lower than ARIMA) by explicitly modeling spatial dependencies, but it relies on a static adjacency matrix, making it difficult to adapt to dynamic road network changes, and its training time is relatively long (6.3 seconds / round). DCRNN introduces diffusing convolution to enhance spatial propagation modeling, reducing MAE to 10.9 (41.7% lower than ARIMA), but multi-step iterative computation further increases training time (7.1 seconds / episode), limiting real-time performance. Transformer relies on self-attention mechanisms to capture long-term dependencies, achieving an MAE of 12.3 (34.2% lower than ARIMA), but its high computational complexity (8.5 seconds / episode training time) and insufficient response to short-term burst traffic become bottlenecks. In contrast, the complete KA-LSTM, through KANs dynamic optimization of the gating mechanism, multi-scale memory fusion, and spatiotemporal attention co-design, achieves an MAE as low as 9.1 (51.3% lower than ARIMA), with RMSE and MAPE of 14.7% and 7.5% respectively, demonstrating superior overall performance. Its training time (5.5 seconds / episode) is significantly better than STGCN, DCRNN, and Transformer, reflecting the efficiency advantages of KANs' lightweight design. KA-LSTM's dynamic adaptability is particularly outstanding. Through dynamic feature weighting and spatiotemporal consistency loss, it maintains stable predictions in abnormal events and multimodal data scenarios. Ultimately, it achieves a systematic surpassing of traditional and advanced models in terms of accuracy, efficiency, and scenario adaptability, providing a better solution for highly dynamic urban traffic management.

[0319] The above embodiments are only for illustrating the technical concept and features of the present invention, and are intended to enable those skilled in the art to understand the content of the present invention and implement it accordingly. They should not be construed as limiting the scope of protection of the present invention. All equivalent changes or modifications made in accordance with the spirit and essence of the present invention should be covered by the present invention.

Claims

1. A traffic flow prediction method based on an improved spatiotemporally coupled KA-LSTM, characterized in that, Includes the following steps: Step (1) Data acquisition and preprocessing: Acquire data and process the data to generate a standardized three-dimensional spatiotemporal tensor; Step (2) Improve the LSTM structure: Use the Kolmogorov-Arnold network to dynamically optimize the forget gate, input gate, output gate and memory update mechanism of the Long Short-Term Memory network to generate a spatiotemporal feature weighted representation; Step (3) Spatiotemporal attention mechanism fusion: Through multi-head attention computation and gating fusion technology, multi-scale spatiotemporal features are fused to generate enhanced latent state representations; Step (4) Model Training and Prediction: Train the model using fully connected layers and a joint loss function, and use the trained model to predict traffic flow in future time periods. The improved LSTM structure in step (2) specifically includes: (2.1) Based on road network adjacency matrix and current input Global spatial features are generated through graph convolution: in, Given an adjacency matrix with self-loops, For degree matrix, For trainable weights, The spatial feature dimension is consistent with the subsequent KANs input. (2.2) Improved Forget Gate: Dynamic forgetting weights are generated using KANs and incorporated into the forget gate to obtain a new forget gate. The calculation formula is as follows: in, The forget gate output for node i at time t. and These are the weight matrix and the bias, respectively. KANs subnetworks based on global spatial features The output, This represents the Sigmoid activation function; (2.3) Dynamic weighting of the input gate: The feature weighting vector is generated through KANs, and the calculation formula is as follows: Integrate into the input gate and update as follows: in, Here, ⊙ represents the feature weighted vector, and ⊙ represents element-wise multiplication. The input features are weighted. This is the weight matrix. For bias, The input gate's output represents the degree to which new information has been received. This represents the Sigmoid activation function; (2.4) Multi-scale memory fusion: global spatial features via KANs subnetwork The generated enhanced candidate memory vector Generate new candidate memory states: Furthermore, long-term hidden state Subnetworks of KANs Generate a dynamic balance between short-term fluctuations and long-term periodicity long-term memory weights: Therefore, the memory state formula is updated as follows: in, Based on the current memory state, merge with short-term updates. and long-term memory ; (2.5) Output gate optimization: KANs subnetwork Receive global spatial features Generate dynamic forgetting bias When integrated into the output gate, we get: in, and For weights and biases, For KANs subnetworks, the output dynamic bias has a dimension of . , This represents the Sigmoid activation function; (2.5) Hidden state output: in, Let be the hidden state of node i at time t. The spatiotemporal attention mechanism fusion in step (3) specifically includes: (3.1) Multi-head attention calculation: Based on the hidden state and spatial features, query, key, and value vectors are generated. The calculation formula is as follows: Where H represents the number of attention heads. The dimension of the key vector; (3.2) Gated Fusion: By balancing the state and attention output of the gating unit, the gating unit and the final hidden state are generated. The calculation formula is as follows: in, To output the hidden state in the final output, , Use the Sigmoid activation function; The model training and prediction in step (4) specifically includes: (4.1) Loss Function Design: The loss function is jointly optimized using MAE and spatiotemporal consistency loss. The calculation formula is as follows: in, For the true value, Let λ be the predicted value, and λ be the regularization coefficient. This is the total number of time steps; It is the total number of nodes; (4.2) Optimization strategy: Use the Adam optimizer with an initial learning rate of 0.001, exponential decay, halving every 20 rounds, and a gradient clipping threshold of 5.0; (4.3) Prediction Output: The predicted value for the next K steps is generated through a fully connected layer. The calculation formula is as follows: in: This is the final hidden state; To output the weight matrix, For bias.

2. The traffic flow prediction method based on improved spatiotemporal coupled KA-LSTM according to claim 1, characterized in that: The data acquisition and preprocessing in step (1) specifically include: (1.1) Collect traffic flow, speed and density data from N road network nodes within a time window T, with a time granularity of 5 minutes; (1.2) Missing data is filled using spatiotemporal weighted interpolation. The calculation formula is as follows: in, Let be the complete value of node i at time t. Spatial distance weights based on Gaussian kernel function, This is the spatiotemporal balance factor, with a value range of [0,1]. (1.3) Outliers are removed using the Z-score method with a threshold of 3; (1.4) Perform Z-score normalization on each feature dimension and output the three-dimensional spatiotemporal tensor. , where T is the time step, N is the number of nodes, and F is the number of features.

3. A traffic flow prediction system based on an improved spatiotemporally coupled KA-LSTM, characterized in that, The traffic flow prediction method based on the improved spatiotemporally coupled KA-LSTM as described in claim 1 or 2 includes: (6.1) Data preprocessing module, used to collect and process road network traffic data and generate spatiotemporal tensors; (6.2) KA-LSTM prediction module, based on the improved LSTM structure of KANs and the spatiotemporal attention mechanism, generates traffic prediction results; (6.3) Attention weight distribution identification module, which identifies traffic anomalies and adjusts the prediction strategy based on attention weight distribution; (6.4) The real-time optimization interface module outputs the prediction results to the traffic management system and supports traffic light timing optimization.

4. The traffic flow prediction system based on improved spatiotemporal coupled KA-LSTM according to claim 3, characterized in that, The data preprocessing module includes: (7.1) Data acquisition submodule, which automatically collects traffic flow, speed and density data from road network sensors, with a time granularity of 5 minutes; (7.2) Missing value processing submodule, which uses spatiotemporal weighted interpolation to complete missing data; (7.3) Outlier detection submodule, which removes outliers based on the Z-score method, with a threshold of 3; (7.4) Data standardization submodule: Perform Z-score standardization on each feature dimension to generate a three-dimensional spatiotemporal tensor.

5. The traffic flow prediction system based on improved spatiotemporal coupled KA-LSTM according to claim 3, characterized in that, The KA-LSTM prediction module includes: (8.1) Forgetting submodule, using KANs to generate dynamic forgetting weights; (8.2) Input gate sub-modules, which implement dynamic feature weighting through KANs; (8.3) Multi-scale memory submodule, which integrates short-term and long-term features to update memory state; (8.4) Spatiotemporal attention submodule, which optimizes hidden state output based on multi-head attention and gating fusion.

6. The traffic flow prediction system based on improved spatiotemporal coupled KA-LSTM according to claim 3, characterized in that, The attention weight distribution identification module includes: (9.1) Anomaly recognition submodule, which identifies traffic anomaly events based on attention weight distribution; (9.2) Prediction strategy adjustment submodule: Automatically adjusts the prediction strategy according to abnormal situations to ensure the reliability and timeliness of prediction results.

7. The traffic flow prediction system based on improved spatiotemporal coupled KA-LSTM according to claim 3, characterized in that, The real-time optimization interface module includes: (10.1) Prediction result output submodule, which transmits the prediction results to the traffic management system and supports the function of traffic light timing optimization; (10.2) Real-time optimization submodule, which makes real-time traffic management decisions based on the prediction results.

Citation Information

Patent Citations

  • Traffic flow prediction method and system based on trend space-time diagram convolution, and medium

    CN116895157A

  • Traffic flow prediction method and system based on time-space synchronization dynamic graph attention network

    CN117671952A