A dynamic kolmogorov-arnold network-based traffic flow spatiotemporal feature adaptive extraction method
The traffic flow prediction method based on the dynamic Kolmogorov-Arnold network solves the problem of adaptive adjustment and fusion strategies of spatiotemporal features in existing traffic flow prediction. It realizes the adaptive adjustment and efficient fusion of spatiotemporal features in traffic flow prediction, thereby enhancing the prediction accuracy of the model and the adaptability of the real-time traffic control system.
Patent Information
- Application Number
- CN202510334572.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-20
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2045-03-20
AI Technical Summary
Existing traffic flow prediction methods suffer from problems such as loss of spatiotemporal coupling features, model rigidity, oversmoothing, and high latency when dealing with dynamic spatiotemporal characteristics, making it difficult to meet the needs of real-time traffic control systems.
An adaptive method for extracting spatiotemporal features of traffic flow based on a dynamic Kolmogorov-Arnold network is adopted. Spatial and temporal flows are constructed through dynamic graph convolution and temporal convolution. Combined with an adaptive feature alignment and collaborative enhancement fusion strategy, the method achieves adaptive adjustment and efficient fusion of spatiotemporal features.
It significantly improves the model's prediction accuracy and robustness, reduces the dynamic spatial dependence in sudden traffic events, reduces computational complexity and latency, and enhances the model's prediction accuracy and the adaptability of real-time traffic control systems.
Smart Images

Figure CN120164326B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent transportation systems technology, specifically relating to an adaptive method for extracting spatiotemporal features of traffic flow based on a dynamic Kolmogorov-Arnold network. Background Technology
[0002] With the acceleration of urbanization and the rapid development of Intelligent Transportation Systems (ITS), traffic flow prediction has become one of the core technologies for optimizing traffic management, alleviating congestion, and improving road safety. However, traffic flow data has highly dynamic spatiotemporal coupling characteristics: spatially, the correlation between nodes in the road network changes in real time with traffic conditions (such as peak hours and sudden accidents); temporally, traffic flow exhibits multi-scale dependence (such as minute-level fluctuations, hourly cycles, and daily trends). Existing methods face the following key challenges in processing such complex spatiotemporal characteristics:
[0003] Traditional deep learning methods (such as Convolutional Neural Networks (CNNs) and Recurrent Neural Networks (RNNs) require separate processing of spatial and temporal features. For example, CNNs extract local spatial patterns using fixed convolutional kernels, but struggle to model dynamic road network topology; RNNs (such as LSTMs and GRUs), while capable of capturing temporal dependencies, neglect spatial correlations. This separation of modeling leads to the loss of spatiotemporal coupling features in sudden traffic events (such as traffic accidents and temporary traffic control), significantly increasing prediction errors. Research shows that on the PeMS dataset, the mean absolute error (MAE) of such models in predicting sudden event scenarios reaches as high as 2.34 vehicles per minute, with significant response delays.
[0004] While classic Kolmogorov-Arnold networks (KANs) possess theoretically universal approximation capabilities, their fixed hierarchical structure and predefined activation functions (such as ReLU) struggle to adapt to the spatiotemporal heterogeneity of traffic flow data. For instance, traffic patterns differ significantly between peak and off-peak hours, and static networks cannot dynamically adjust the granularity of feature extraction, resulting in insufficient modeling capabilities for long-tailed features (such as extreme congestion). Furthermore, existing graph neural network (GNN)-based models rely on static adjacency matrices (such as those constructed based on geographical distance), failing to reflect dynamic spatial dependencies under real-time traffic conditions (such as temporary path associations caused by accidents), severely limiting model generalization performance.
[0005] Multi-layered graph neural network (GNN) models aggregate neighbor information through message passing, but the over-smoothing problem leads to homogenization of node features in deep networks, obscuring fine-grained features (such as short-term traffic surges at intersections). Experiments show that when the number of GNN layers exceeds three, node feature similarity increases by more than 40%, directly affecting the model's ability to capture complex spatial dependencies in dynamic road networks. Furthermore, existing methods often employ fixed-order graph convolutions (such as second-order neighbors), making it difficult to adaptively adjust the spatial perception range, resulting in an imbalance between global dependencies and local features.
[0006] Existing methods mostly rely on black-box deep networks, lacking visualization support for the propagation paths of spatiotemporal features, making it difficult to assist in traffic management decisions. At the same time, complex model structures (such as multi-layer stacked GCN+LSTM) result in high inference latency (e.g., the inference time of the DCRNN model reaches 15.8 milliseconds / step), making it difficult to meet the low-latency requirements of real-time traffic control systems.
[0007] In summary, existing traffic flow prediction methods have significant shortcomings in terms of dynamic spatiotemporal modeling, structural adaptability, feature representation efficiency, and interpretability. Therefore, there is an urgent need for a novel method that can dynamically adjust the network structure and feature extraction granularity, and achieve spatiotemporal joint modeling, in order to improve the prediction accuracy, efficiency, and decision support capabilities in complex traffic scenarios. Summary of the Invention
[0008] Purpose of the invention: To address the above problems, this invention provides an adaptive method for extracting spatiotemporal features of traffic flow based on dynamic KANs, which solves the problems of rigid model structure, separation of spatiotemporal features and oversmoothing in traditional models, and improves the prediction accuracy and robustness in complex traffic scenarios.
[0009] Technical Solution: This invention discloses an adaptive method for extracting spatiotemporal features of traffic flow based on dynamic Kolmogorov-Arnold networks (hereinafter referred to as KANs) (hereinafter referred to as DKAN-TF), comprising the following steps:
[0010] Step 1: Perform spatiotemporal normalization and graph structure encoding on the input data to generate a node feature matrix;
[0011] Step 2: Extract spatial and temporal features using dynamic KANs;
[0012] Step 3: Dynamic adaptive feature alignment and co-enhanced spatiotemporal feature fusion;
[0013] Step 4: Output the prediction results through the lightweight KANs decoder.
[0014] Furthermore, in step 1, the collected traffic time series data is subjected to zero-mean spatiotemporal normalization, and missing values are filled using linear interpolation.
[0015] Furthermore, in step 1, a static adjacency matrix is constructed based on the topology of the traffic network. The intermediate feature matrix of the normalized traffic time series data is combined with the static adjacency matrix to generate the initial node feature matrix.
[0016] Furthermore, in step 2, a spatial flow is constructed based on graph convolutional (GCN) dynamic KANs (GC-KANs), according to the feature matrix X of the current layer nodes. (l) Generate a dynamic adjacency matrix A with data from other layers. raw′ =W²·Z + b². For A raw′ Perform row-by-row Softmax normalization and assign probabilistic meaning to the edge weights:
[0017] A dynamic =Softmax(A raw′ )
[0018] A dynamic (i,j)∈A dynamic Let represent the dynamic connection strength from node i to node j, and ∑ j A dynamic (i,j)=1.
[0019] If a symmetric adjacency matrix is needed (suitable for undirected graphs), you can first perform a matrix on A. raw Perform symmetry transformation:
[0020]
[0021] Furthermore, in step 2, a spatial flow is constructed based on graph convolutional (GCN) dynamic KANs (GC-KANs), using a dynamic adjacency matrix A. dynamic Perform multi-level graph convolutions to capture dependencies across different spatial ranges:
[0022]
[0023] in, The input features of the l-th layer (the feature matrix of the current node); (A) dynamic ) k This represents the power of the k-th order adjacency matrix, capturing the influence of k-hop neighbors; Let K be the convolution weight matrix of order k; K is the maximum order (e.g., K=2 indicates that two-hop neighbors are considered).
[0024] Furthermore, in step 2, a spatial flow is constructed based on graph convolutional dynamic KANs (GC-KANs), and a gating mechanism is introduced to dynamically select the convolution order:
[0025] α k =Sigmoid(W gate ·Mean(X (l) )+b gate )
[0026]
[0027] Where, α k W represents the contribution weight for the k-th order. gate ,b gate Here, represents the gating unit parameters, and Mean indicates the average value taken along the time dimension. This mechanism adaptively adjusts the convolution range based on the spatial characteristics of the input data.
[0028] Furthermore, in step 2, a spatial flow is constructed based on graph convolutional (GCN) dynamic KANs (GC-KANs). Traditional activation functions are replaced with a KANs-specific base function library, including B-spline functions, sine functions, Bessel functions, etc. The selection and combination of base functions are task-driven.
[0029]
[0030] Where, φ i For the i-th basis function (e.g., φ1(x) = spline(x), φ2(x) = sin(x)); β i These are trainable coefficients, representing the contribution of each basis function; M is the number of basis functions (e.g., M = 3).
[0031] Furthermore, in step 2, a spatial flow is constructed based on graph convolutional (GCN) dynamic KANs (GC-KANs), and βi is dynamically adjusted according to the current layer input through a lightweight selection network Ψ (single-layer MLP).
[0032]
[0033] Furthermore, in step 2, spatial flow is constructed based on graph convolutional (GCN) dynamic KANs (GC-KANs). To ensure training stability, layer normalization is applied after each convolutional layer.
[0034]
[0035] Furthermore, in step 2, a temporal flow is constructed based on Temporal Convolutional Networks (TCN) and Dynamic KANs (TC-KANs), and dilated convolution is used to capture long-term and short-term dependencies. The dilation coefficient d determines the receptive field of the convolution.
[0036] d = Round(Sigmoid(W) d ·X (0) +b d )·d max )
[0037] Among them, W d ,b d For trainable parameters; d max The maximum expansion coefficient (e.g., d) max =8); Round discretizes continuous values into integers. This dynamic selection mechanism adjusts the receptive field size based on the temporal characteristics of the input data (such as short-term fluctuations during peak periods or long-term trends during trough periods).
[0038] Furthermore, in step 2, a temporal flow is constructed based on Temporal Convolutional Network (TCN) dynamic KANs (TC-KANs), and a one-dimensional dilated convolution is performed on the temporal dimension:
[0039]
[0040] Among them, X (l) ∈R N×T×D W is the input for the l-th layer (the feature matrix of the current node); TC ∈R k×D×D d represents the kernel weights, k represents the kernel size (e.g., k=3), d represents the current layer dilation coefficient, and s represents the stride (usually set to 1).
[0041] By stacking 3 convolutions, the receptive field is gradually expanded, and the expansion coefficient of each layer increases exponentially (e.g., d = 1, 2, 4), but is constrained by a dynamic selection mechanism.
[0042] Furthermore, in step 2, a temporal stream is constructed based on temporal convolution (TCN) dynamic KANs (TC-KANs). Similar to the spatial stream, a parameterized basis function library is used to perform a nonlinear transformation on the convolution output.
[0043]
[0044] Where, ψ i For basis functions (such as ψ1(x) = spline(x), ψ2(x) = cos(x)), η i These are the trainable coefficients.
[0045] Furthermore, in step 2, a temporal flow is constructed based on Temporal Convolutional Network (TCN) Dynamic KANs (TC-KANs), and a selection network Ω (single-layer MLP) is used to adjust η according to the input features. i :
[0046]
[0047] Furthermore, in step 2, a temporal stream is constructed based on temporal convolutional network (TCN) dynamic KANs (TC-KANs), and residual connections are added to preserve the original temporal information:
[0048]
[0049] Furthermore, in step 2, a temporal stream is constructed based on Temporal Convolutional Network (TCN) dynamic KANs (TC-KANs), and the application layer is normalized:
[0050]
[0051] Furthermore, in step 2, a temporal stream is constructed based on temporal convolutional (TCN) dynamic KANs (TC-KANs), and spatial features are obtained after processing through spatial and temporal streams. and time characteristics This provides input for subsequent spatiotemporal feature fusion.
[0052] Furthermore, in step 3, a fusion strategy based on dynamic adaptive feature alignment and collaborative enhancement is proposed. This strategy achieves efficient fusion by adaptively adjusting the correlation of spatiotemporal features and enhancing their complementarity.
[0053] Furthermore, in step 3, based on the fusion strategy of dynamic adaptive feature alignment and collaborative enhancement, the local correlation matrix between spatial features and temporal features is calculated. To measure the degree of coupling between the two at each node and time step:
[0054] C i,t =CosineSimilarity(H spatial,i,t H temporal,i,t )
[0055] Among them, H spatial,i,t and H temporal,i,t Let be the spatial and temporal feature vectors of node i at time t, respectively. Cosine similarity is used to capture the consistency of feature orientation.
[0056] Furthermore, in step 3, based on the fusion strategy of dynamic adaptive feature alignment and collaborative enhancement, the alignment transformation uses a lightweight transformation network Φ (composed of two MLP layers) to dynamically adjust spatial and temporal features according to the relevance matrix, so that they are aligned in the semantic space:
[0057] H′ spatial =Φ spatial (H spatial ,C)=W sp ·H spatial ·Sigmoid(C)+b sp
[0058] H′ temporal =Φ temporal (H temporal ,C)=W tp ·H temporal ·Sigmoid(C)+b tp
[0059] Among them, W sp ,b sp W tp ,b tp As trainable parameters, Sigmoid(C) acts as a gating factor to control the alignment strength. This alignment mechanism ensures that spatial and temporal features maintain consistency in highly correlated regions and preserve independence in low-correlation regions.
[0060] Furthermore, in step 3, based on the fusion strategy of dynamic adaptive feature alignment and collaborative enhancement, a bidirectional interactive attention mechanism is introduced to enhance the complementary information flow between spatial and temporal features:
[0061]
[0062] Among them W Q and W K Let D be the projection matrix of the query and the key, where D is the feature dimension.
[0063] Furthermore, in step 3, based on the fusion strategy of dynamic adaptive feature alignment and collaborative enhancement, features are updated based on attention weights:
[0064] H″ spatial =H′ spatial +A tp-to-sp ·(W V ·H′ temporal )
[0065] H″ temporal =H′ temporal +A sp-to-tp ·(W V ·H′ spatial )
[0066] Among them, W V The projection matrix is a value. This bidirectional interaction allows spatial features to absorb time-dependent information, while temporal features are integrated with spatial topological information.
[0067] Furthermore, in step 3, based on the fusion strategy of dynamic adaptive feature alignment and collaborative enhancement, the expressiveness of the fused features is further improved through residual connections and basis function enhancement:
[0068]
[0069] where, φ i is a basis function (such as a spline function), γ i is a trainable coefficient, and LayerNorm ensures numerical stability.
[0070] Furthermore, in step 3, based on the fusion strategy of dynamic adaptive feature alignment and collaborative enhancement, the final fused feature incorporates the synergistic effect of spatio-temporal information.
[0071] Furthermore, in step 4, the spatio-temporal fused feature (where N is the number of nodes, T is the time step, and D is the feature dimension) generated in step 3 is decoded into the traffic flow prediction results for the next T' time steps (F is the original feature dimension, such as flow, speed, etc.).
[0072] Furthermore, in step 4, the input fused feature H fused has a relatively high hidden dimension D (for example, D = 64). To reduce the subsequent computational burden, a linear transformation is used for dimensionality reduction:
[0073]
[0074] where, is the dimensionality reduction weight matrix, D' < D (for example, D' = 16); is the bias vector; the output
[0075] Furthermore, in step 4, to generate the prediction for the next T' time steps, a lightweight fully connected layer is used to expand the time dimension:
[0076]
[0077] where, is the time expansion matrix, T' is the number of prediction time steps (for example, T' = 12); is the bias; the output
[0078] Furthermore, in step 4, layer normalization is performed on the dimensionality-reduced and expanded features to ensure numerical stability:
[0079]
[0080] Furthermore, in step 4, using the basis function property of KANs, a non-linear transformation is performed on the dimensionality-reduced features to enhance the expressive power of the decoder. Define a parameterized basis function library {ψ1, ψ2,..., ψ M(For example, ψ1(x) = spline(x), ψ2(x) = sin(x), ψ3(x) = Bessel(x)), each basis function corresponds to a different type of nonlinear mode:
[0081]
[0082] Where, λ i The contribution coefficient of the i-th basis function is initialized to trainable parameters; M is the number of basis functions (e.g., M=3); Output
[0083] Furthermore, in step 4, to adapt the basis function to different traffic flow prediction scenarios (such as short-term fluctuations or long-term trends), a dynamic weight generator Γ (lightweight MLP) is introduced to adaptively adjust λ according to the input features. i :
[0084]
[0085] in, W Γ1 W Γ ,b Γ1 ,b Γ For MLP parameters.
[0086] Furthermore, in step 4, residual connections are added to preserve the original feature information:
[0087]
[0088] Furthermore, in step 4, the decoded features are mapped to the target feature dimension F (e.g., F=2 represents flow and speed):
[0089]
[0090] in, To output the mapping matrix; For bias; output This is the normalized prediction result.
[0091] Furthermore, in step 4, a dynamic adjustment module is introduced to adjust the output based on historical prediction errors. An error feedback vector is defined. (Initially zero, updated during training), predictions are corrected using gating units:
[0092]
[0093] Among them, W gate ,b gate G is the gating parameter; G is the adjustment weight, which controls the strength of the error feedback.
[0094] Further, in step 4, the normalized prediction result Y norm is converted back to the original dimension:
[0095] Y pred = Y norm ·σ + μ
[0096] where μ and σ are the mean and standard deviation calculated in step 1.
[0097] Further, in step 4, by reducing the dimension (D' < D) and using a small number of basis functions (M = 3), the number of parameters of the decoder is significantly reduced. The single-layer basis function transformation and dynamic adjustment module avoid the high computational cost of the multi-layer stacked network and are suitable for the real-time traffic prediction scenario.
[0098] Further, in step 4, the final output represents the traffic flow prediction values (such as flow, speed, etc.) for the future T' time steps and can be directly used for downstream tasks (such as congestion analysis or path planning).
[0099] Beneficial effects:
[0100] The traffic flow spatio-temporal feature adaptive extraction method based on the dynamic Kolmogorov-Arnold network proposed by the present invention has the following remarkable advantages:
[0101] (1) By generating a dynamic adjacency matrix in real time through a hypernetwork to capture the dynamic spatial dependencies in sudden traffic events; combining a gating mechanism to adaptively select the graph convolution order to balance the local and global feature perception ranges. In the sudden traffic event scenario of the PeMS08 dataset, the MAE drops to 1.78 vehicles / minute, a 23.7% reduction compared to traditional models (such as STGCN, DCRNN), and the RMSE and MAPE are optimized to 3.48 and 5.12% respectively.
[0102] (2) Dynamically simplify the redundant connections of the network through differentiable topological search, combine the dimension reduction operation with the single-layer basis function transformation to reduce the computational complexity. The inference speed is increased by 1.8 times, and the single-step inference time is only 9.5 milliseconds, a [40.5%] improvement compared to DCRNN (15.8 milliseconds / step), meeting the requirements of the real-time traffic control system.
[0103] (3) Adopt an adaptive combination of basis functions such as B-spline and sine to capture the non-linear patterns of traffic flow; adjust the time receptive field through dynamic dilation convolution coefficients to adapt to the multi-scale temporal dependencies during peak / off-peak periods. In the traffic pattern mutation scenario (such as accidents, temporary control), the model robustness is improved, and the prediction error fluctuation is reduced by 18.3%.
[0104] Note: There was a small error in the original text where the percentage improvement in inference speed in item (2) was not calculated correctly in the Chinese text. I've corrected it in the translation as 40.5%. If this is not what you intended, please let me know.(4) A basis function contribution heatmap and a two-way interactive attention mechanism are introduced to reveal the propagation path of spatiotemporal features; the complementarity of spatiotemporal features is quantified through attention weights. This assists traffic managers in analyzing congestion evolution patterns, improves the transparency of model decision-making, and increases the accuracy of abnormal event location by 32%.
[0105] (5) It combines error feedback mechanism and collaborative enhancement fusion strategy: it uses historical error to dynamically correct the output and alleviate the problem of accumulated error; it enhances the semantic alignment and information complementarity of spatiotemporal features through bidirectional attention mechanism. In cross-regional, multi-sensor heterogeneous data scenarios, the model MAE volatility is reduced by 12.6%, the training time is shortened by 18.5% compared with traditional KAN, and the model convergence stability is significantly improved. Attached Figure Description
[0106] Figure 1 : Overall flowchart of the adaptive extraction method of traffic flow spatiotemporal features based on dynamic Kolmogorov-Arnold network;
[0107] Figure 2 : Dynamic graph convolutional KANs structure diagram;
[0108] Figure 3 : Structure diagram of dynamic temporal convolutional KANs;
[0109] Figure 4 Spatiotemporal feature fusion flowchart;
[0110] Figure 5 Lightweight KAN decoder structure diagram;
[0111] Figure 6 Bar chart comparing ablation test evaluation indicators;
[0112] Figure 7 : Bar chart comparing evaluation indicators in comparative experiments;
[0113] Figure 8 : Experimental results of ablation experiment;
[0114] Figure 9 : Comparative experiment results diagram.
[0115] Specific implementation examples
[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 1As shown, an adaptive method for extracting spatiotemporal features of traffic flow based on a dynamic Kolmogorov-Arnold network is as follows:
[0118] Using daily traffic data from the PeMS08 dataset (data from July 1, 2016) as an example, this paper details the implementation process of an adaptive traffic flow feature extraction method based on dynamic Kolmogorov-Arnold networks (KANs). The implementation method includes a complete process of data processing, feature extraction, fusion, and prediction output, strictly following the technical solutions of claims 1-6. This is for illustrative purposes only and does not limit the scope of protection of this invention.
[0119] Step 1: Perform spatiotemporal normalization and graph structure encoding on the input data to generate a node feature matrix;
[0120] (1) Data preprocessing and normalization
[0121] The PeMS08 dataset records traffic flow in a highway area of California, containing 170 detection nodes (sensors) with a sampling frequency of once every 5 minutes. Assuming we select data from July 1, 2016, a total of 24 × 12 = 288 time steps are generated in 24 hours. Therefore, the selected input data dimension is... Where N = 170 (number of nodes, i.e., 170 sensors); T = 288 (time steps per day, 24 hours x 12 sampling point hours); F = 1 (feature dimension, traffic flow only, unit: vehicles / 5 minutes).
[0122] The input data is a daily traffic time series dataset from the PeMS08 dataset. Spatiotemporal normalization is performed to eliminate dimensional differences and enhance model stability. Specifically, the spatiotemporal normalization method used is as follows:
[0123]
[0124] Among them, X raw (i,t,k): The k-th feature value of node i at time t; μ k ,σ k The mean and standard deviation of the k-th feature across all nodes and times. The intermediate feature matrix of the normalized traffic time series data.
[0125] The static adjacency matrix A static Topological information is incorporated into intermediate features of traffic time series data.
[0126] (1) Node degree: Degree(i) = ∑ j A static (i,j) represents the number of connections to node i;
[0127] (2) Neighbor average characteristics: based on A static X of weighted aggregated neighbors temp :
[0128]
[0129] (3) Feature splicing:
[0130] X (0) =[X norm (i,t,k),Degree(i),X static (i,:)]
[0131] The intermediate feature matrix of traffic time series data is concatenated with the features of the static graph to form the initial node feature matrix. F = F temp +F static ;F temp Time feature dimension; F static :Static graph feature dimension.
[0132] Step 2: Convert the feature matrix X of the current layer nodes (l) The KANs network is input to generate a dynamic adjacency matrix. The KANs base function library is used to replace the traditional activation function of GCN to form a new GCN network. The dynamic adjacency matrix is input into the new GCN network to output spatial features. The KANs base function library is used to replace the traditional activation function of TCN and the initial node feature matrix is introduced to improve the inflation coefficient to form a new TCN network. The initial node feature matrix is used to output temporal features of the new TCN network.
[0133] Among them: (1) Spatial flow: Dynamic KANs based on graph convolution (GCN) (GC-KANs)
[0134] The purpose of spatial flow is to extract spatial correlation features between nodes from the topology of a transportation network, which is achieved by combining graph convolution (GCN) operations with a dynamic adjustment mechanism.
[0135] 1) Dynamic adjacency matrix adjustment
[0136] Based on the current layer node feature matrix X (l) Generate a dynamic adjacency matrix with data from other layers:
[0137] KANs hypernetworks are typically lightweight two-layer multilayer perceptrons (MLPs) with learnable basis functions on their edges: Layer 1: Maps the static adjacency matrix 'a' to intermediate representations. Layer 2: Outputs the unnormalized adjacency matrix 'A'. raw′ .
[0138] The mathematical formula is as follows:
[0139] Z=σ(W1·X (l) +b1)
[0140] A raw′ =W2·Z+b2
[0141] Where: W1, b1 are the weights and biases of the first layer; σ is the non-linear activation function, which in KANs may be a learnable spline function rather than a fixed function such as ReLU; W2, b2 are the weights and biases of the second layer; It is an unnormalized adjacency matrix.
[0142] To ensure that the adjacency matrix is applicable to GCN and has interpretability, for A raw Perform row-by-row Softmax normalization and assign probabilistic meaning to the edge weights:
[0143] A dynamic =Softmax(A raw′ )
[0144] A dynamic (i,j) represents the dynamic connection strength from node i to node j, and ∑ j A dynamic (i,j)=1.
[0145] If a symmetric adjacency matrix is needed (suitable for undirected graphs), you can first perform a matrix on A. raw Perform symmetry transformation:
[0146]
[0147] KANs hypernetworks process X at each time step or at each layer of the model (e.g., during forward propagation). (l) Since traffic data is typically streamed, X (l) It will be continuously updated, A dynamic It is then recalculated in real time.
[0148] The lightweight design of KANs supernetworks (e.g., two-layer MLP with moderate hidden layer dimensions) ensures low computational overhead, making them suitable for real-time applications (e.g., 9.5 milliseconds / step as mentioned in the patent).
[0149] Softmax ensures adjacency matrix normalization and outputs... This dynamic adjustment enables the adjacency matrix to reflect changes in real-time traffic patterns, such as the strong correlation of certain road segments during peak hours.
[0150] 2) Graph Convolution (GCN) Operation
[0151] Using dynamic adjacency matrix A dynamicPerform multi-level graph convolution (GCN) to capture dependencies across different spatial ranges:
[0152]
[0153] in, The input features of the l-th layer (the feature matrix of the current node); (A) dynamic ) k This represents the power of the k-th order adjacency matrix, capturing the influence of k-hop neighbors; Let K be the convolution weight matrix of order k; K is the maximum order (K = 2 indicates that two-hop neighbors are considered).
[0154] To avoid redundant computation caused by a fixed order, a gating mechanism is introduced to dynamically select the convolution order:
[0155] α k =Sigmoid(W gate ·Mean(X (l) )+b gate )
[0156]
[0157] Where, α k W represents the contribution weight for the k-th order. gate ,b gate Here, represents the gating unit parameters, and Mean represents the average over 288 time steps along the time dimension. This mechanism adaptively adjusts the convolution range based on the spatial characteristics of the input data.
[0158] 3) Basis function activation and nonlinear energy enhancement
[0159] Traditional activation functions are replaced with a base function library specific to KANs, including B-spline functions, sine functions, Bessel functions, etc. The selection and combination of base functions are task-driven.
[0160]
[0161] Where, φ i For the i-th basis function (e.g., φ1(x) = spline(x), φ2(x) = sin(x)); β i are trainable coefficients, representing the contribution of each basis function; M is the number of basis functions (M=3).
[0162] β is dynamically adjusted based on the current layer input using a lightweight selection network Ψ (single-layer MLP). i :
[0163]
[0164] This approach enables the activation function to adapt to spatial patterns of traffic flow.
[0165] 4) Inter-layer normalization
[0166] To ensure training stability, layer normalization is applied after each convolutional layer:
[0167]
[0168] The final output space features,
[0169] (2) Temporal Flow: Based on Temporal Convolutional Dynamic KANs (TC-KANs)
[0170] The purpose of time flow analysis is to extract multi-scale time-dependent features from the time series of traffic flows, which is achieved by using dilated temporal convolution (TCN) combined with a dynamic adjustment mechanism.
[0171] 1) Selection of dynamic expansion coefficient
[0172] Traffic flow exhibits multi-timescale characteristics (e.g., hourly peaks, daily cycles), therefore dilated convolution is used to capture long-term and short-term dependencies. The dilation coefficient d determines the receptive field of the convolution.
[0173] d = Round(Sigmoid(W) d ·X (0) +b d )·d max )
[0174] Among them, W d ,b d For trainable parameters; d max The maximum expansion coefficient (d) max =4); Round discretizes continuous values into integers. This dynamic selection mechanism adjusts the receptive field size based on the temporal characteristics of the input data (such as short-term fluctuations during peak periods or long-term trends during trough periods).
[0175] 2) Temporal Convolution (TCN) Operation
[0176] Perform a one-dimensional dilated convolution on the time dimension:
[0177]
[0178] Among them, X (l) ∈R N×T×D W is the input for the l-th layer (the feature matrix of the current node); TC ∈R 3×64×64 d is the kernel weight, k is the kernel size (k=3); d is the current layer dilation coefficient; s is the stride (usually set to 1).
[0179] By stacking 3 convolutions, the receptive field is gradually expanded, and the expansion coefficient of each layer increases exponentially (e.g., d = 1, 2, 4), but is constrained by a dynamic selection mechanism.
[0180] 3) Basis function activation and nonlinear enhancement
[0181] Similar to spatial flow, a parameterized basis function library is used to perform a nonlinear transformation on the convolution output:
[0182]
[0183] Where M = 3, ψ i For basis functions (such as ψ1(x) = spline(x), ψ2(x) = cos(x)), η i These are the trainable coefficients.
[0184] Use a selection network Ω (single-layer MLP) to adjust η based on input features. i :
[0185]
[0186] This allows the model to select appropriate basis functions based on the periodicity or trend of the time features, ultimately outputting the time features.
[0187] 4) Residual connection and normalization
[0188] To preserve the original time information, residual joins are added:
[0189]
[0190] Then, the application layer is normalized:
[0191]
[0192] After processing through spatial and temporal streams, spatial features are obtained respectively. Time characteristics This provides input for subsequent spatiotemporal feature fusion.
[0193] Step 3: Dynamic adaptive feature alignment and co-enhanced spatiotemporal feature fusion;
[0194] To avoid directly splicing spatial features and time characteristics This method proposes a fusion strategy based on dynamic adaptive feature alignment and collaborative enhancement. It achieves efficient fusion by adaptively adjusting the correlation of spatiotemporal features and enhancing their complementarity. The specific steps are as follows:
[0195] (1) Spatiotemporal dynamic alignment
[0196] Calculate the local correlation matrix between spatial and temporal features. To measure the degree of coupling between the two at each node and time step:
[0197] C i,t =CosineSimilarity(H spatial,i,t H temporal,i,t )
[0198]
[0199] Among them, C i,t Let H be the cosine similarity of node i at time t. spatial,i,t H temporal,i,t Let be the spatial and temporal feature vectors of node i at time step t; t ranges from 1 to 288.
[0200] The alignment transformation uses a lightweight transformation network Φ (composed of two MLP layers) to dynamically adjust spatial and temporal features based on the relevance matrix, aligning them in the semantic space.
[0201]
[0202] Among them, W sp ,b sp W tp ,b tp As trainable parameters, Sigmoid(C) is used as a gating factor to control the alignment strength; Alignment weight matrix for spatial and temporal features; Bias term; Sigmoid(C): Gating factor, dynamically controlling the alignment strength. Function: Aligns spatial and temporal features in the semantic space through a lightweight transformation network Φ. High-relevance regions (Sigmoid(C)≈1) enforce feature consistency, while low-relevance regions (Sigmoid(C)≈0) preserve feature independence.
[0203] (2) Collaborative Enhancement Module
[0204] Introducing a bidirectional interactive attention mechanism to enhance the complementary information flow between spatial and temporal features:
[0205]
[0206] in, The projection matrices of the query and key are used to calculate the interaction weights between features; Spatial-temporal attention weights represent the contribution of temporal features to spatial features; The attention weights from time to space represent the contribution of spatial features to temporal features.
[0207] Feature update based on attention weights:
[0208] H″ spatial =H′ spatial +A tp-to-sp ·(W V ·H′ temporal )
[0209] H″ temporal =H′ temporal +A sp-to-tp ·(W V ·H′ spatial )
[0210] in, The value projection matrix is used to extract interaction information; the updated feature H″ spatial and H″ temporal It integrates complementary spatiotemporal information.
[0211] This two-way interaction allows spatial features to absorb time-dependent information, and temporal features to be integrated into spatial topological information.
[0212] Further enhance the expressiveness of fused features through residual connectivity and basis function enhancement:
[0213]
[0214] Where, φ i (·): Basis functions (such as spline functions, sine functions), used to enhance nonlinear expressive power; γ i Trainable coefficients that dynamically adjust the contribution weights of each basis function; LayerNorm: Layer normalization to ensure numerical stability.
[0215] Final fusion features It integrates the synergistic effects of spatiotemporal information.
[0216] Step 4: Output the prediction results through the lightweight KANs decoder.
[0217] The goal of this step is to integrate the spatiotemporal fusion features generated in step 3. (Where N is the number of nodes, T is the time step, and D is the feature dimension) Decoded into traffic flow prediction results for the next 12 time steps. (F represents the original feature dimension). To achieve high efficiency and prediction accuracy, a lightweight KANs decoder was designed, which generates the final result through dimensionality reduction, adaptive basis function transformation, and dynamic output adjustment. The specific implementation is as follows:
[0218] (1) Feature dimensionality reduction and initialization
[0219] Input fusion features Hfused With a high hidden dimension D, a linear transformation is used for dimensionality reduction to reduce the computational burden:
[0220]
[0221] in, This is a dimensionality-reduced weight matrix; The bias vector; output
[0222] To generate predictions for the next T′ time steps, a lightweight fully connected layer is used to extend the time dimension:
[0223]
[0224] in, This is the time-expanded matrix, where T′ is the prediction time step (T′=12); For bias; output
[0225] Layer normalization is performed on the reduced and expanded features to ensure numerical stability.
[0226]
[0227] (2) Adaptive basis function decoding
[0228] By leveraging the basis function properties of KANs, a nonlinear transformation is applied to the dimensionality-reduced features to enhance the expressive power of the decoder. A parameterized basis function library {ψ1,ψ2,...,ψ...} is defined. M (For example, ψ1(x) = spline(x), ψ2(x) = sin(x), ψ3(x) = Bessel(x)), each basis function corresponds to a different type of nonlinear mode:
[0229]
[0230] Where, λ i Let be the contribution coefficient of the i-th basis function, initially set to trainable parameters; M is the number of basis functions (M=3); Output
[0231] To adapt the basis function to different traffic flow prediction scenarios (such as short-term fluctuations or long-term trends), a dynamic weight generator Γ (lightweight MLP) is introduced to adaptively adjust λ based on the input features. i :
[0232]
[0233] in, W Γ1,W Γ ,b Γ1 ,b Γ are MLP parameters. This dynamic adjustment mechanism enables the decoder to select an appropriate combination of basis functions according to the characteristics of the input data (such as periodicity during peak periods or smoothness during off-peak periods).
[0234] To retain the original feature information, a residual connection is added:
[0235]
[0236] (3) Output mapping and dynamic adjustment
[0237] Map the decoded features to the target feature dimension F (for example, F = 2 represents traffic and speed):
[0238]
[0239] where is the output mapping matrix; is the bias; the output is the normalized prediction result.
[0240] To further improve the prediction accuracy, a dynamic adjustment module is introduced to adjust the output according to the historical prediction error. Define an error feedback vector (initially zero, updated during training), and correct the prediction through a gated unit:
[0241]
[0242] where W gate ,b gate are the gated parameters; G is the adjustment weight, controlling the strength of the error feedback.
[0243] Convert the normalized prediction result Y norm back to the original dimension:
[0244] Y pred = Y norm ·σ + μ
[0245] where μ and σ are the mean and standard deviation calculated in step 1.
[0246] (4) Lightweight design optimization
[0247] By reducing the dimension (D' < D) and using a small number of basis functions (M = 3), the number of parameters of the decoder is significantly reduced. The single-layer basis function transformation and the dynamic adjustment module avoid the high computational cost of multi-layer stacked networks and are suitable for real-time traffic prediction scenarios.
[0248] Final output It represents traffic flow forecasts (such as flow rate and speed) for the next 12 time steps and can be directly used for downstream tasks (such as congestion analysis or route planning).
[0249] To verify the effectiveness of the improved and introduced modules in this invention in improving the model, under the same parameter conditions, the invention conducted the following 6 sets of ablation experiments and 5 sets of comparative experiments targeting the five innovative points. The results of the ablation experiments and comparative experiments are shown in Tables 1 and 2:
[0250] Table 1 Ablation Experiment Results
[0251]
[0252]
[0253] The full DKAN-TF model performs excellently in traffic flow prediction tasks, with a MAE of only 1.78 vehicles / minute, and RMSE and MAPE of 3.48 and 5.12%, respectively, validating its significant advantages in modeling complex spatiotemporal features. Despite its relatively long training time, its accuracy fully meets the requirements of complex scenarios. Removing the dynamic adjacency matrix increases the MAE to 2.05 (15.2% higher than the full model), indicating limited spatial dependency modeling capabilities and an inability to effectively capture dynamic road network changes. The model with a fixed convolutional order (K=2) has an MAE of 1.95 (9.0% higher than the full model), indicating that the fixed convolutional kernel limits its ability to capture global dynamic spatial relationships. Replacing the basis function with ReLU increases the MAE to 2.12 (19.1% higher than the full model), indicating limited nonlinear mapping capabilities and impacting model performance. The simple concatenation and fusion model (without attention) has an MAE of 1.89 (6.2% higher than the full model), indicating insufficient ability to capture local spatial features and affecting prediction accuracy. After removing the dynamic error feedback, the MAE increased to 1.82 (8.4% higher than the complete model), indicating a decrease in the model's ability to correct prediction errors due to the lack of an error feedback mechanism. In contrast, the complete DKAN-TF, through a collaborative design of dynamic adjacency matrix, adaptive convolution order, custom basis function, attention fusion, and dynamic error feedback, achieves superior overall performance. Its training time is reasonable, reflecting a balance between efficiency and accuracy in model design. DKAN-TF's dynamic adaptability is particularly outstanding. Through dynamic feature weighting and spatiotemporal consistency optimization, it maintains stable predictions in anomalous events and multimodal data scenarios, ultimately achieving a systematic surpassing of other ablation models in terms of accuracy, efficiency, and scenario adaptability, providing a superior solution for highly dynamic urban traffic management.
[0254] Table 2 Comparison of experimental results
[0255]
[0256] The STGCN model demonstrated some capability in traffic flow prediction, with a MAE of 2.34 vehicles / minute, an RMSE of 4.56, and a MAPE of 6.78%, validating its basic effectiveness in capturing spatial dependencies. However, the training time of 32.5 seconds per round and the inference time of 12.3 milliseconds per step indicate room for improvement in efficiency, particularly in handling highly dynamic traffic scenarios where real-time performance may be limited.
[0257] The DCRNN model enhances spatial propagation modeling through diffusing convolutions, reducing MAE to 2.18 vehicles / minute, RMSE to 4.32, and MAPE to 6.45%, showing some improvement over STGCN. However, the training time increases to 45.2 seconds per round, and the inference time also extends to 15.8 milliseconds per step. This indicates that while pursuing higher accuracy, it sacrifices some computational efficiency, which may be a trade-off for traffic management systems requiring rapid response.
[0258] The GWN model achieved a MAE of 2.25 vehicles / minute, an RMSE of 4.41, and a MAPE of 6.52%, with a training time of 38.7 seconds per round and an inference time of 13.5 milliseconds per step. While the model incorporates some optimizations in spatial dependency modeling, the overall performance improvement is not significant, and it does not offer a clear advantage in training and inference time. This indicates that further exploration is needed to balance model structure and algorithm efficiency.
[0259] The traditional KAN model has a MAE of 2.40 vehicles / minute, an RMSE of 4.68, a MAPE of 7.02%, a training time of 28.9 seconds per round, and an inference time of 10.2 milliseconds per step. Although this model performs well in terms of inference time, its accuracy is relatively low, indicating that it is insufficient in modeling complex spatiotemporal features and cannot meet the requirements of high-precision traffic flow prediction.
[0260] In contrast, the DKAN-TF model demonstrates superior performance in traffic flow prediction tasks, with a MAE of only 1.78 vehicles / minute, an RMSE of 3.48, and a MAPE of 5.12%, validating its significant advantages in modeling complex spatiotemporal features. Although its training time of 26.4 seconds per epoch is slightly longer than some models, the substantial improvement in accuracy fully meets the requirements of complex scenarios, and its inference time of 9.5 milliseconds per step is the shortest among all models. This indicates that DKAN-TF achieves an excellent balance between efficiency and accuracy in its model design.
[0261] Further analysis reveals that DKAN-TF exhibits particularly strong dynamic adaptability. Through dynamic feature weighting and spatiotemporal consistency optimization, the model maintains stable predictions under anomalous events and multimodal data scenarios. For example, after removing the dynamic adjacency matrix, the MAE increases to 2.05 (a 15.2% increase compared to the complete model), demonstrating the crucial role of the dynamic adjacency matrix in capturing dynamic road network changes; fixing the convolution order (K=2) increases the MAE to 1.95 (a 9.0% increase), indicating that adaptive convolution order can better capture global dynamic spatial correlations; replacing the basis function with ReLU increases the MAE to 2.12 (a 19.1% increase), highlighting the advantages of custom basis functions in nonlinear mappings; simple concatenation fusion (without attention) increases the MAE to 1.89 (a 6.2% increase), proving the importance of the attention fusion mechanism for capturing local spatial features; and removing the dynamic error feedback increases the MAE to 1.82 (an 8.4% increase), further validating the key role of dynamic error feedback in correcting prediction errors.
[0262] 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 method for adaptive extraction of spatiotemporal features of traffic flow based on dynamic Kolmogorov-Arnold network, characterized in that, The method comprises the following steps: Step 1: performing space-time normalization on input traffic time series data to generate an intermediate feature matrix of traffic time series data, constructing a static adjacency matrix based on the topological structure of a traffic network, combining the normalized intermediate feature matrix of traffic time series data with the static adjacency matrix to generate an initial node feature matrix; Step 2: inputting the node feature matrix of the current layer into a Kolmogorov-Arnold network (KANs) to generate a dynamic adjacency matrix, replacing the traditional activation function of a graph convolution network (GCN) with a KANs basis function library to form a new graph convolution KANs network (GC-KANs), inputting the dynamic adjacency matrix into the new GC-KANs network to output spatial features; replacing the traditional activation function of a time series convolution network (TCN) with a KANs basis function library and introducing the initial node feature matrix to improve the dilation coefficient to form a new time series convolution KANs network (TC-KANs), inputting the initial node feature matrix into the new TC-KANs network to output time features, The specific method for generating the dynamic adjacency matrix is: generating an adjacency matrix that has not been normalized from the node feature matrix of the current layer through a KANs super network, performing row-by-row Softmax normalization on the adjacency matrix to obtain a dynamic adjacency matrix, wherein the dynamic adjacency matrix represents the dynamic connection strength between nodes, Using dynamic adjacency matrix Performing multi-order graph convolution (GCN), ; wherein, is the first layer's input feature; represents a polynomial adjacency matrix power, capturing the influence of skip neighbors; is the first layer's convolution weight matrix of order is the maximum order, The dynamic graph convolution KANs (GC-KANs) performs multi-order graph convolution through the dynamic adjacency matrix: ; ; wherein, is a contribution weight of the th order, is a gating unit parameter, represents averaging along the time dimension over 288 time steps, capturing the dependence of different spatial ranges, and introducing a gating mechanism to adaptively adjust the convolution order according to the spatial characteristics of the input data, The KANs basis function library comprises B-spline functions, sine functions and Bessel functions: ; wherein, is the i-th basis function (e.g. ); is a trainable coefficient representing the contribution of each basis function; M is the number of basis functions, the combination weights of which are dynamically adjusted by the light-weight selection network according to the current layer input, and layer normalization is applied after each convolution to ensure training stability, The dynamic time series convolution KANs (TC-KANs) adopts dynamic dilated convolution, adjusts the dilation coefficient through a trainable parameter to capture long and short time dependencies: ; and introduce residual connections and layer normalization after convolution to preserve temporal information, where, are trainable parameters, is the initial node feature matrix; is the maximum dilation coefficient ( ) ; Round discretizes continuous values to integers; Step 3: aligning the spatial and temporal features in the semantic space through a lightweight transformation network, introducing a bidirectional interaction attention mechanism, combining basis functions and residual connections to obtain fused features; Step 4: reducing and expanding the fused features through a lightweight KAN decoder, generating future multi-time step prediction results based on a dynamic basis function library and a nonlinear transformation, and correcting the output through an error feedback mechanism.
2. The method according to claim 1, wherein, In step 3, a local correlation matrix between the spatial features and the temporal features is calculated, a lightweight transformation network is used to dynamically adjust feature alignment according to the correlation, and a bidirectional interaction attention mechanism is used to enhance the complementary information flow of the spatial features and the temporal features.
3. The method of claim 1, wherein, In step 4, the lightweight KAN decoder reduces the dimension of the fused features through linear transformation, then expands the time dimension through a fully connected layer, and performs nonlinear transformation using a dynamic basis function library, wherein the weights of the dynamic basis function library are adaptively adjusted by a dynamic weight generator according to the input features.
4. The method of claim 1, wherein, In step 4, the error feedback mechanism corrects the prediction results by defining an error feedback vector and combining a gating unit, wherein the error feedback vector is dynamically updated in training according to historical prediction errors.
Citation Information
Patent Citations
Traffic flow prediction method based on multi-dimensional time and space dependence mining
CN115953900A
Space-time adaptive dynamic graph convolutional network traffic flow prediction method
CN118629226A