Adaptive graph learning traffic flow prediction system and method based on multi-dimensional time

By combining multi-dimensional time-scale feature fusion, mask matrix adaptive graph learning, and gated temporal convolution modules, the prediction accuracy and robustness issues of traditional traffic flow prediction systems under intelligent driving and complex road networks are solved, achieving more efficient and accurate traffic flow prediction.

CN120873472APending Publication Date: 2025-10-31HEILONGJIANG UNIVERSITY OF SCIENCE AND TECHNOLOGY
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510988208.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-17
Publication Date
2025-10-31

AI Technical Summary

Technical Problem

Existing traffic flow prediction systems struggle to achieve efficient and accurate traffic flow prediction when faced with the challenges of widespread adoption of autonomous driving and complex road networks, especially in medium- and long-term predictions where errors are significant. Furthermore, traditional models have limitations in spatiotemporal feature fusion and modeling.

Method used

By combining a multi-dimensional temporal scale feature fusion module, a mask matrix adaptive graph learning module, and a gated temporal convolution module, an adaptive graph learning structure is constructed through residual connections and a dynamic spatiotemporal correlation matrix to enhance the fusion and prediction capabilities of spatiotemporal features.

Benefits of technology

It improves the accuracy and robustness of traffic flow prediction, especially significantly reducing errors in medium- and long-term predictions, enhancing the model's generalization ability, and adapting to changes in complex traffic scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120873472A_ABST
    Figure CN120873472A_ABST
Patent Text Reader

Abstract

The invention discloses an adaptive graph learning traffic flow prediction system and method based on multi-dimensional time, and belongs to the technical field of traffic systems, the system is formed by stacking a plurality of space-time convolution blocks through residual connection, and each block comprises a multi-dimensional time scale feature fusion module, a mask matrix adaptive graph learning module and a gating time sequence convolution module. Wherein the multi-dimensional time scale feature fusion module extracts hour-day-week time scale features and splices the features; the mask matrix adaptive graph learning module constructs an adaptive graph learning structure in combination with the space-time dynamic incidence matrix and the anti-symmetric structure mask matrix; and the gating time sequence convolution module extracts time sequence features and outputs a prediction result. According to the prediction method, time scale decomposition, attention score calculation and other operations are performed on input data, a result is obtained through gating operation, and stable transmission of features is ensured through residual connection. Through deep decoupling and dynamic fusion of spatio-temporal features, prediction precision and robustness are improved, and the method has high practical application value and industrial popularization potential.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of transportation system technology, specifically a multidimensional time-based adaptive graph learning traffic flow prediction system and method. Background Technology

[0002] With the development of the times, the external factors affecting traffic flow have gradually increased, and the changes in traffic flow today present new challenges. First, the booming development of electric vehicles has brought the intelligence of automobiles to an unprecedented level. The emergence of functions such as assisted driving has changed people's travel habits and altered traditional traffic flow patterns. Second, in order to alleviate urban traffic congestion, many cities have carried out large-scale infrastructure renovations on existing urban roads, such as building elevated bridges on perennially congested sections and urban expressways on high-commuter routes. The complex urban road network increases the difficulty of information management. Based on the current background of big data and big modeling, the future Intelligent Transportation Systems (ITS) must be able to operate efficiently and accurately. Therefore, building a traffic flow prediction system is crucial. Rapid and accurate traffic flow prediction methods are beneficial for alleviating urban congestion and providing convenience for traffic management. To effectively address the new challenges brought about by current traffic flow changes, there is an urgent need for a system that can efficiently and accurately predict traffic flow. Summary of the Invention

[0003] To address the problems existing in the background technology, the present invention provides an adaptive graph learning traffic flow prediction system and method based on multidimensional time.

[0004] To achieve the above objectives, the present invention adopts the following technical solution: a multi-dimensional temporal adaptive graph learning traffic flow prediction system, comprising multiple spatiotemporal convolutional blocks; the multiple spatiotemporal convolutional blocks are stacked through residual connections, each spatiotemporal convolutional block comprising a multi-dimensional temporal scale feature fusion module, a mask matrix adaptive graph learning module, and a gated temporal convolutional module; the multi-dimensional temporal scale feature fusion module and the mask matrix adaptive graph learning module are connected through residual connections, and the mask matrix adaptive graph learning module and the gated temporal convolutional module are connected through residual connections.

[0005] The multi-dimensional time-scale feature fusion module is used to input traffic flow data, extract sequence features of time, day, and week, obtain attention outputs of each time dimension through a multi-head attention mechanism, and splice them according to node dimensions to form data that fuses multi-time-scale features.

[0006] The mask matrix adaptive graph learning module is used to receive fused multi-timescale feature data, combine the spatiotemporal dynamic correlation matrix and the antisymmetric structure mask matrix, and construct an adaptive graph learning structure by dynamically adjusting the fusion ratio through a learnable weight matrix to learn spatial features and output data fused spatiotemporal features.

[0007] The gated temporal convolution module is used to receive data with fused spatiotemporal features, extract temporal features through gating operations combining two-dimensional convolution and Tanh-Sigmoid, and output traffic flow prediction results.

[0008] In the multi-dimensional time-scale feature fusion module, there are 3 multi-head attention heads, corresponding to the time scales of hour, day, and week, with each head having a dimension of [missing information]. , For each attention head, the dimension is a positive integer. The attention output is added to the original input through residual connections, preserving the basic feature structure of the time series.

[0009] In the mask matrix adaptive graph learning module, the antisymmetric structure mask matrix S is embedded through a node embedding matrix. and The dot product difference is directly constructed without symmetric matrix decomposition, and is used to model the unidirectional constraints of traffic flow.

[0010] The residual connections are normalized using LayerNorm within each spatiotemporal convolutional block, and the number of channels is aligned between blocks using 1×1 convolutions to ensure stable feature propagation.

[0011] The output of the multi-dimensional time-scale feature fusion module serves as one of the inputs to the mask matrix adaptive graph learning module, guiding the dynamic adjustment of the spatial graph structure. Specifically, it maps the temporal features to the query vector Q, key vector K, and value vector V of spatial attention through linear transformation, thereby enhancing the temporal sensitivity of spatial dependencies.

[0012] The prediction method includes the following steps:

[0013] S1: Construct a multi-dimensional time-scale feature fusion module by using feature extraction and fusion modules for three time scales: time, day, and week. Input the traffic flow historical data tensor. Where R represents the set of real numbers, B is the batch dimension, N is the number of traffic network nodes, F is the feature dimension, and T is the number of time steps;

[0014] S2: Input spatiotemporal dynamic correlation matrix Fusion module with multi-dimensional time scale features Construct an adaptive graph learning module for the mask matrix;

[0015] S3: Transform the output shape of the mask matrix adaptive graph learning module into... It also serves as the input to the gated temporal convolution module.

[0016] S1 includes the following steps:

[0017] S101: Time scale decomposition, dividing the data into hours, days, and weeks. , , These correspond to time-level, day-level, and week-level sequence features, respectively.

[0018] S102: Calculation The process of calculating attention score: , Attention score at the time of receipt ,in These are the learnable parameters. For residual attention terms, the dimension is... Consistency is used to enhance attention stability. The superscript T is the matrix transpose, used to adjust the dimension of the weight matrix, and the subscript T represents the time scale.

[0019] S103: Calculate accordingly. , Attention scores were obtained for each day and week. , ;

[0020] S104: Further calculations , , The attention inputs and outputs for each time dimension are obtained respectively;

[0021] S105: , , The corresponding attention module outputs are respectively , and According to the node-based splicing, through , , obtained the The head integrates the attention output of the time period of Wednesday. .

[0022] S2 includes the following steps:

[0023] S201: Utilizing Learnable Node Embedding Matrices ,in To embed the dimension, calculate the antisymmetric matrix to represent the relationships between nodes: ,in Used to filter sparse connections and highlight unidirectional dependencies between upstream and downstream nodes;

[0024] S202: Introducing node self-connection weight vectors Increase, by generating learnable parameters through initialization, antisymmetric matrix Effectively reduces the adverse effects of one-way lanes through activation functions. A spatial expression matrix was constructed. ;

[0025] S203: Apply the structure mask matrix spatiotemporal dynamic correlation matrix The two components are then fused, and dynamically adjusted based on the learnable weight matrix S to ultimately obtain an adaptive graph learning structure: , and Use one first The convolutional layers are fused together, and then utilized... The activation function normalizes it; then through The parameters S that can be continuously learned can be used to dynamically adjust the weight relationship between the two to obtain the final matrix adaptive graph learning structure. , where ⊙ is the Hadama product;

[0026] S204: Further integrates multidimensional temporal and spatial features, input data... ,in, It is to output attention Transformed input data, It is a transformation matrix; After spatial encoding, it is used as input for spatial attention. , , During the calculation, , , The multidimensional time module outputs the query, key, and value vectors after linear transformation, respectively.

[0027] S205: Next, after the spatiotemporal dynamic correlation matrix Combined spatial attention, its output Continuing as input to the graph convolution, and in The spatiotemporal features are dynamically updated under adjustment. The overall calculation process is as follows: , , ,in These are Chebyshev polynomials, defined as follows: K is the convolution order. For the normalized Laplace matrix, These are the learnable convolution kernel parameters.

[0028] S3 includes the following steps:

[0029] S301: Next, perform the following calculations: , , , ,in, Represents the transformation matrix. It is a bias term. It is a convolution operation;

[0030] S302: After obtaining the convolution result, split it. Responsible for feature extraction, As a gating signal, after and The traffic flow output predicted by the gating mechanism is obtained after nonlinear transformation. .

[0031] Compared with the prior art, the beneficial effects of the present invention are:

[0032] I. Multi-dimensional time-scale feature fusion improves the accuracy of time series modeling:

[0033] 1. Multi-scale temporal feature capture: Through a multi-head attention mechanism (number of heads = 3) at three time scales (hour, day, and week), temporal features of different periods (such as short-term correlation, daily peak periodicity, and weekly workday regularity) are extracted and concatenated according to the node dimension to form a fusion feature, which solves the limitation of the single time scale of the traditional model. On the PeMS-D4 / D6 / D8 dataset, the MAE and RMSE of MTAGLN are reduced by 5%-15% compared with the baseline models (such as LSTM and ASTGCN), especially in the medium and long-term prediction (12 steps) with a significant reduction in error.

[0034] 2. Residual connections preserve basic features: Attention output and original input are added through residual connections to avoid loss of feature information, stabilize the basic structure of the time series, and improve the model's ability to learn complex time series patterns.

[0035] II. Adaptive Graph Learning Module, Enhancing Spatial Dependency Modeling:

[0036] 1. Dynamic spatiotemporal correlation matrix: Combining the spatiotemporal dynamic correlation matrix with the antisymmetric mask matrix S, the unidirectionality of traffic flow is modeled, effectively reducing the adverse effects;

[0037] 2. Temporal features guide spatial adjustment: The output of multi-dimensional temporal scale features generates spatial attention query vector Q, key vector K, and value vector V through linear transformation, which enhances the temporal sensitivity of spatial dependencies and realizes the dynamic fusion of spatiotemporal features.

[0038] III. Gated temporal convolution and residual structure to optimize feature propagation and training stability:

[0039] 1. Enhanced feature selectivity through gating mechanism: The gated temporal convolution module adopts two-dimensional convolution + Tanh-Sigmoid gating operation. By adjusting the size of the convolution kernel (such as 3, 5, 7), the receptive field of the time series is controlled, key features are selectively retained, noise is suppressed, and the ability to model long-term dependencies is improved. Compared with the traditional GLU structure, the Tanh-Sigmoid combination is more suitable for asymmetric distribution features of traffic flow.

[0040] 2. Residual connection and normalization techniques:

[0041] Intra-block normalization: LayerNorm normalization is used within each spatiotemporal convolutional block to alleviate internal covariate bias and stabilize the training process;

[0042] Inter-block dimensional alignment: Adjacent spatiotemporal convolutional blocks align the number of channels through 1×1 convolution to ensure smooth feature transfer across layers and avoid gradient vanishing / exploding.

[0043] IV. Overall Performance Advantages and Practical Application Value

[0044] 1. High-precision prediction and generalization ability: On the PeMS-D4 / D6 / D8 datasets, TAGLN outperforms baseline models such as AGCRN and RGSL in terms of MAE, RMSE, and MAPE. Especially in complex road scenarios (such as mixed ramp and main road nodes, PeMS-D6), MAE is reduced by 14.44% and RMSE is reduced by 15.54%.

[0045] 2. Addressing new challenges in traffic flow: Adapting to scenarios such as the popularization of intelligent driving and the increasing complexity of road networks, dynamic spatiotemporal modeling is used to capture fluctuations in traffic flow inflow / outflow (such as the connection between elevated bridges and expressway nodes); ablation experiments have shown that the stacking of multi-dimensional time modules and multi-ST Block residuals is the key to performance improvement and is indispensable.

[0046] V. Experimental Verification and Industry Application Potential

[0047] Hardware and framework compatibility: Based on the PyTorch framework, it supports GPU acceleration (such as NVIDIA A30) and is suitable for real-time prediction of large-scale traffic networks;

[0048] Comparative experimental results: In the 12-step long-term prediction, the MTAGLN curve fluctuates less and its stability is significantly better than the baseline model, which can provide traffic management departments with more reliable congestion warning and diversion solutions.

[0049] In summary, this invention achieves a dual improvement in traffic flow prediction accuracy and robustness through deep decoupling and dynamic fusion of spatiotemporal features, and has strong practical application value and industry promotion potential. Attached Figure Description

[0050] Figure 1 This is a flowchart of the traffic flow prediction system of the present invention;

[0051] Figure 2 This is a comparison between standard network and residual network structures, where:

[0052] Figure 2 (a) is a schematic diagram of a standard network structure;

[0053] Figure 2 (b) is a schematic diagram of the residual network structure;

[0054] Figure 3 This is a schematic diagram of the time-week sequence data;

[0055] Figure 4 This is a schematic diagram of the multi-dimensional time-scale feature extraction module;

[0056] Figure 5 This is a schematic diagram of the adaptive graph learning module;

[0057] Figure 6 This is a schematic diagram of a gated temporal convolution module;

[0058] Figure 7 This is a schematic diagram of a multi-timescale adaptive graph learning network model;

[0059] Figure 8 This is a step-by-step diagram illustrating the various indicators of PeMS-D4, including:

[0060] Figure 8 (a) is the MAE indicator diagram of PeMS-D4;

[0061] Figure 8 (b) is the MAPE indication diagram of PeMS-D4;

[0062] Figure 8 (c) is the RMSE indicator diagram of PeMS-D4;

[0063] Figure 9 This is a step-by-step diagram illustrating the various indicators of PeMS-D6, including:

[0064] Figure 9 (a) is the MAE indicator diagram of PeMS-D6;

[0065] Figure 9 (b) is the MAPE indication diagram of PeMS-D6;

[0066] Figure 9 (c) is the RMSE indicator diagram of PeMS-D6;

[0067] Figure 10 This is a step-by-step diagram illustrating the various indicators of PeMS-D8, including:

[0068] Figure 10 (a) is the MAE indicator diagram of PeMS-D8;

[0069] Figure 10 (b) is the MAPE indication diagram of PeMS-D8;

[0070] Figure 10 (c) is the RMSE indicator diagram of PeMS-D8;

[0071] Figure 11 This is a diagram illustrating the selected time period for PeMS-D4 data, where:

[0072] Figure 11 (a) is a schematic diagram of traffic data in the PeMS-D4 dataset;

[0073] Figure 11 (b) is a magnified view of the E1 region dataset;

[0074] Figure 11 (c) is a magnified view of the E2 region dataset;

[0075] Figure 12 This is a diagram illustrating the selected time period for PeMS-D6 data, where:

[0076] Figure 12 (a) is a schematic diagram of traffic data in the PeMS-D6 dataset;

[0077] Figure 12 (b) is a magnified view of the E3 region dataset;

[0078] Figure 12 (c) is a magnified view of the E4 region dataset;

[0079] Figure 13 This is a diagram illustrating the selected time period for PeMS-D8 data, where:

[0080] Figure 13 (a) is a schematic diagram of traffic data in the PeMS-D8 dataset;

[0081] Figure 13 (b) is a magnified view of the E5 region dataset;

[0082] Figure 13 (c) is a magnified view of the E6 region dataset;

[0083] Figure 14 This is a schematic diagram illustrating the fit of the baseline models AGCRN, ASTGCN, GMSDR, STGODE, RGSL, and MTAGLN, where:

[0084] Figure 14 (a) is a schematic diagram of the AGCRN baseline model;

[0085] Figure 14 (b) is a schematic diagram of the ASTGCN baseline model;

[0086] Figure 14 (c) is a schematic diagram of the GMSDR baseline model;

[0087] Figure 14 (d) is a schematic diagram of the STGODE baseline model;

[0088] Figure 14 (e) is a schematic diagram of the RGSL baseline model;

[0089] Figure 14 (f) is a schematic diagram of the MTAGLN baseline model;

[0090] Figure 15 This is a schematic diagram of the 12-step prediction data for AGCRN, ASTGCN, GMSDR, STGODE, RGSL, and MTAGLN, where:

[0091] Figure 15 (a) is a schematic diagram of the 12-step prediction data curve of AGCRN;

[0092] Figure 15 (b) is a schematic diagram of the 12-step prediction data curve of ASTGCN;

[0093] Figure 15 (c) is a schematic diagram of the 12-step prediction data curve of STGODE;

[0094] Figure 15 (d) is a schematic diagram of the 12-step prediction data curve of RGSL;

[0095] Figure 15 (e) is a schematic diagram of the 12-step prediction data curve of GMSDR;

[0096] Figure 15 (f) is a schematic diagram of the 12-step prediction data curve of MTAGLN;

[0097] Figure 16 This is a schematic diagram of the ablation model indicators, where:

[0098] Figure 16 (a) is a schematic diagram of the MAE indicator;

[0099] Figure 16 (b) is a schematic diagram of the MAPE index;

[0100] Figure 16 (c) is a diagram of the RMSE indicator. Detailed Implementation

[0101] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the invention, not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0102] This embodiment describes a multidimensional temporal adaptive graph learning traffic flow prediction system, including multiple spatio-temporal convolution blocks (ST blocks); the multiple spatio-temporal convolution blocks are stacked through residual connections, and each spatio-temporal convolution block includes a multidimensional time-scale feature fusion module, a mask matrix adaptive graph learning module, and a gated temporal convolution module (GTCM).

[0103] The multi-dimensional time-scale feature fusion module is used to input traffic flow data, extract sequence features at three time scales: hour, day, and week, obtain attention outputs for each time dimension through a multi-head attention mechanism, and concatenate them according to node dimensions to form data that fuses multi-time-scale features. The multi-dimensional time-scale feature fusion module is connected to the mask matrix adaptive graph learning module through residuals. The mask matrix adaptive graph learning module is used to receive the fused multi-time-scale feature data, combine the spatiotemporal dynamic correlation matrix and the antisymmetric structure mask matrix, and construct an adaptive graph learning structure by dynamically adjusting the fusion ratio through a learnable weight matrix to learn spatial features and output data that fuses spatiotemporal features. The mask matrix adaptive graph learning module is connected to the gated temporal convolution module through residuals. The gated temporal convolution module is used to receive the data that fuses spatiotemporal features, extract temporal features through gating operations combining two-dimensional convolution and Tanh-Sigmoid, and output traffic flow prediction results. In the traffic flow prediction system of this invention, residual connections are widely used within spatiotemporal convolution blocks and between adjacent spatiotemporal convolution blocks. Residual connections enable the skipping of feature information through identity mapping, which helps avoid feature bias and gradient vanishing or exploding problems. Within a spatiotemporal convolutional block, residual connections are used to connect the multi-dimensional temporal scale feature fusion module, the mask matrix adaptive graph learning module, and the gated temporal convolution module. Specifically, the output of each module is added to its input through a residual connection to form a residual block. This design helps preserve and pass feature information, improving the model's prediction accuracy. Between adjacent spatiotemporal convolutional blocks, residual connections are also used to connect the output of the previous spatiotemporal convolutional block to the input of the next. To ensure smooth feature information transfer, when the output and input dimensions of adjacent spatiotemporal convolutional blocks are inconsistent, the system aligns the channel number using a 1×1 convolution, calculated using the following formula: ,in These are the input features of the model. It is a nonlinear mapping transformation in a neural network model. It is the output feature, through this identity mapping method, even nonlinear mapping transformation Even with deviations, the neural network model can still adapt to the input features. Ensure basic feature information, such as Figure 2 As shown, the standard network and residual network structures are compared, where (a) is the standard network and (b) is the residual network.

[0104] In the multi-dimensional time-scale feature fusion module, there are 3 multi-head attention heads, corresponding to the time scales of hour, day, and week, with each head having a dimension of [missing information]. , The dimension of each attention head is a positive integer with a default value of 64, which can be dynamically adjusted according to the size of the traffic network. The attention output is added to the original input through residual connections to preserve the basic feature structure of the time series.

[0105] In the mask matrix adaptive graph learning module, the antisymmetric structure mask matrix S is embedded through a node embedding matrix. and The dot product difference is directly constructed without symmetric matrix factorization, where the node embedding matrix has a dimension of . ×N, The embedding dimension (default value is preferred to be 128), N is the number of traffic network nodes, used to model the unidirectional constraints of traffic flow, such as the upstream and downstream traffic flow directions.

[0106] The residual connections are normalized using LayerNorm within each spatiotemporal convolutional block, and the number of channels is aligned between blocks using 1×1 convolutions to ensure stable feature propagation.

[0107] The output of the multi-dimensional time-scale feature fusion module serves as one of the inputs to the mask matrix adaptive graph learning module, guiding the dynamic adjustment of the spatial graph structure. Specifically, it maps the temporal features to the query vector Q, key vector K, and value vector V of spatial attention through linear transformation, thereby enhancing the temporal sensitivity of spatial dependencies.

[0108] The prediction method includes the following steps:

[0109] S1: Construct a multi-dimensional time-scale feature fusion module by using feature extraction and fusion modules for three time scales: time, day, and week. Input the traffic flow historical data tensor. Where R represents the set of real numbers, B is the batch dimension, N is the number of traffic network nodes, F is the feature dimension, and T is the number of time steps;

[0110] S101: Time scale decomposition, dividing the data into hours, days, and weeks. , , These correspond to time-level, day-level, and week-level sequence features, respectively.

[0111] S102: Calculation The process of calculating attention score: , Attention score at the time of receipt ,in These are the learnable parameters. For residual attention terms, the dimension is... Consistency is used to enhance attention stability. The superscript T is the matrix transpose, used to adjust the dimension of the weight matrix, and the subscript T represents the time scale.

[0112] S103: Calculate accordingly. , Attention scores were obtained for each day and week. , ;

[0113] S104: Further calculations , , The attention inputs and outputs for each time dimension are obtained respectively;

[0114] S105: , , The corresponding attention module outputs are respectively , and According to the node-based splicing, through , , can obtain the first The head integrates the attention output of the time period of Wednesday. ;

[0115] S2: Input spatiotemporal dynamic correlation matrix Fusion module with multi-dimensional time scale features Construct an adaptive graph learning module for the mask matrix;

[0116] S201: Utilizing Learnable Node Embedding Matrices , of which To embed the dimension, calculate the antisymmetric matrix to represent the relationships between nodes: ,in Used to filter sparse connections and highlight unidirectional dependencies between upstream and downstream nodes;

[0117] S202: Introducing node self-connection weight vectors Increase, by generating learnable parameters through initialization, antisymmetric matrix Effectively reduces the adverse effects of one-way lanes through activation functions. A spatial expression matrix was constructed. ;

[0118] S203: Apply the structure mask matrix spatiotemporal dynamic correlation matrix The two components are then fused, and dynamically adjusted based on the learnable weight matrix S to ultimately obtain an adaptive graph learning structure: , and Use one first The convolutional layers are fused together, and then utilized... The activation function normalizes it; then through The parameters S that can be continuously learned can be used to dynamically adjust the weight relationship between the two to obtain the final matrix adaptive graph learning structure. , where ⊙ is the Hadama product;

[0119] S204: Further integrates multidimensional temporal and spatial features, input data... ,in, It is to output attention Transformed input data, It is a transformation matrix. After spatial encoding, it is used as input for spatial attention. , , During the calculation, , , Output the linearly transformed query, key, and value vectors to the multidimensional time module;

[0120] S205: Next, after the spatiotemporal dynamic correlation matrix Combined spatial attention, its output Continuing as input to the graph convolution, and in Dynamically update spatiotemporal features under adjustment, through the overall computation process. , , ,in These are Chebyshev polynomials, defined as follows: k is the convolution order (in the experiment, the preferred value is 3, which can be adjusted according to the complexity of the graph structure). For the normalized Laplace matrix, These are learnable convolutional kernel parameters;

[0121] S3: Transform the output shape of the mask matrix adaptive graph learning module into... (Where T is the number of time steps, and C is the number of channels, C can preferably be 32) and it serves as the input to the gated temporal convolution module;

[0122] S301: Next, perform the following calculations: , , , ,in, Represents the transformation matrix. It is a bias term. It is a convolution operation;

[0123] S302: After obtaining the convolution result, split it. Responsible for feature extraction, As a gating signal, after and ( and The traffic flow output predicted by the gating mechanism is obtained after a nonlinear transformation of the activation function. .

[0124] First, traffic flow data is processed using a multidimensional temporal attention mechanism to extract sequence features across three time scales: time, day, and week. This data, incorporating multidimensional temporal features, continues to be transmitted downstream. Next, the spatiotemporal dynamic correlation matrix is ​​spatially represented using an adaptive graph learning module. During training, it continuously performs back-learning to update spatial dynamic changes, serving as input to the graph convolution along with the multidimensional temporal feature data, thus fully integrating the spatiotemporal factors of traffic flow. Finally, the data incorporating spatiotemporal features is fed into an improved gated temporal convolution module. This module can modify the receptive field of the time series by changing the convolution kernel size, outputting the final sequence prediction result. The overall process is as follows: Figure 1 As shown,

[0125] By capturing sequence features across three time scales (hour, day, week), spatiotemporal modeling is performed to construct a multi-timescale adaptive graph learning net (MTAGLN) to achieve better prediction results. Detailed analysis of traffic flow data characteristics at the hour, day, and week time scales is conducted. At the hour scale, traffic flow exhibits clear correlations; at the day and week scales, daily traffic flow changes show obvious periodic characteristics, such as the similarity between morning, noon, and evening peak traffic times, and similar trends in weekday and weekend traffic changes. Figure 3 As shown, the time-day-week series are distinguished by different colors. The data overlap is highest at the time scale, indicating that short-term changes in traffic flow have the greatest impact. Figure 4 As shown, segmenting time allows us to capture features from different time periods within a time series, enabling each segment to be computed separately within a multi-head attention mechanism. This results in finer-grained temporal dependencies and a spatiotemporal dynamic correlation matrix. On the one hand, it is used for feature fusion through spatial attention; on the other hand, it is used to replace the traditional adjacency matrix in graph convolution computation. It demonstrates superior performance in both comparative and ablation experiments. Its powerful representational capabilities, based on the meticulous capture of multidimensional temporal data features, are further enhanced to fully explore... Based on the information features, the Adaptive Graph Learning Module with Mask Matrix will further enhance the model's ability to learn spatial features. Normal traffic flow follows traffic rules and rarely involves reverse traffic. This means that there are irreversible flow changes upstream and downstream of the same lane, and there are no reverse or inverse flow changes. Therefore, the Adaptive Graph Learning Module first needs to construct a Structural Mask Matrix to simply represent the relationships between nodes, such as... Figure 5 As shown, combining the output of the attention mechanism with the graph learning structure effectively ensures the adaptability of the space. After normalization, element-wise multiplication with the Chebyshev polynomial allows the model to dynamically adjust the diffusion weights of different orders based on the attention score, thereby optimizing the computation of graph convolution and improving the model's ability to express dynamic graph structures. Figure 6 As shown, gating mechanisms are widely used in time series modeling tasks to improve the feature extraction capabilities of models. For example, the GRU in recurrent neural networks employs a gating mechanism to control the information flow of hidden states, effectively solving the gradient explosion problem in recurrent neural networks dealing with long-term series. The Gated Linear Unit (GLU) was proposed by Dauphin et al. in 2017 and has demonstrated excellent performance in language modeling tasks. GLU adjusts the information flow through a gating structure, making the model more stable in capturing long-term dependencies. This invention proposes a Gated Temporal Convolution Module (GTCM). GTCM uses two-dimensional convolution (Conv2D) to extract temporal features and utilizes a gating mechanism to selectively retain information. Unlike the traditional GLU structure, GTCM uses Tanh-Sigmoid combined with gating operations to ensure that only key features are transmitted, improving the prediction accuracy of the model. This chapter describes the computational flow and modeling process of GTCM in detail. To perform temporal convolution operations, the output shape of the graph learning structure is first adjusted to become... Using this as input to GTCM, GTCM selects and controls the information flow through gating operations combined with Tanh-Sigmoid. Compared with ReLU activation, it can better handle long-term dependencies. Furthermore, by adjusting the value of k, the receptive field size of the convolution kernel can be selected, enabling the model to learn appropriate sequence lengths for traffic flow data, effectively improving prediction performance.

[0126] To verify the effectiveness of the MTAGLN model, the PeMS-D4, PeMS-D6, and PeMS-D8 datasets were selected for comprehensive comparison and validation. The basic parameter settings are shown in Table 1.

[0127] Model settings

[0128]

[0129] Table 1

[0130] The hardware facilities and environment configuration used in the model experiment are consistent with those described above, and the specific settings are shown in Table 2:

[0131]

[0132] Table 2

[0133] A comprehensive analysis and validation of MTAGLN was conducted, and the selected model is described below:

[0134] (1) LSTM: Long Short-Term Memory model uses gate mechanism and memory unit to retain information in long time series, effectively avoid gradient explosion and vanishing problems, and can effectively process complex time series data with long-term dependencies.

[0135] (2) ASTGCN: Introduces attention mechanism and graph convolutional network to capture the spatial relationship of nodes, which is beneficial for processing complex traffic flow information.

[0136] (3) MSTGCN: It is an extension of ASTGCN, which removes the attention mechanism and learns the complex spatiotemporal features of traffic flow through multi-scale convolution, and can capture the multi-level temporal features of traffic flow.

[0137] (4) STSGCN: This is a model that processes traffic flow data through graph convolution. Its feature is that it uses spherical graph convolution and utilizes local time windows to process data, which can better capture the spatial structure in complex traffic networks and thus improve the prediction accuracy.

[0138] (5) AGCRN: It is an adaptive graph convolutional recurrent network that learns the adjacency matrix in a data-driven manner and captures spatiotemporal features through graph convolution and gated recurrent units, and has good generalization ability.

[0139] (6) STGODE: It is a spatiotemporal synchronous graph convolutional network model that connects the spatial graphs of adjacent time steps to form a local spatiotemporal graph. Each local spatiotemporal graph applies graph convolution operation, which effectively learns complex spatiotemporal dependencies and improves prediction performance.

[0140] (7) GMSDR: It is a spatiotemporal prediction model that uses multi-step dependency modeling to capture long-term time dependencies in time series modeling, uses graph neural networks to construct node relationships to form a spatial dependency matrix, and constructs a joint spatiotemporal relationship modeling mechanism to improve prediction performance.

[0141] (8) RGSL: It is a learning model for regularized graph structures. It obtains an implicit dense similarity matrix through node embedding, generates a sparse graph structure using the Gumbel Softmax technique, and then fuses it with an explicit graph generated by prior knowledge. By jointly learning the graph structure, it improves prediction performance.

[0142] Among them, LSTM is a classic variant of recurrent neural network models; ASTGCN, MSTGCN and STSGCN are graph convolutional traffic flow prediction models based on predefined graph structures; while AGCRN, STGODE, GMSDR and RGSL are models that fuse features in time and space.

[0143] Experimental Results Analysis: Table 3 shows the comparison between MTAGLN and the baseline model on the three datasets PeMSD4, D6, and D8, including the comparison of single-step data for the next 15, 30, and 60 minutes (i.e., steps 3, 6, and 12); Table 4 shows the comparison of average metrics for the next hour (i.e., all 12 steps).

[0144]

[0145] Table 3

[0146]

[0147] Table 4

[0148] Experimental data from the PeMS-D4 dataset show that MTAGLN significantly outperforms the traditional recurrent neural network LSTM. This is because LSTM primarily learns the time-series features of traffic flow but lacks the capture of topological spatial features. MTAGLN also effectively improves upon other spatiotemporal neural network models. In steps 3 and 6 of Table 3, MTAGLN shows a 1% improvement over the optimal model in MAE and MAPE metrics, while the improvement in RMSE is not significant. However, it outperforms the optimal model RGSL in step 12 and the average metric, and the improvement in RMSE is also increasing. This indicates that MTAGLN performs better than the baseline model in medium- to long-term predictions for data with a large error range.

[0149] Experimental data from the PeMS-D6 dataset show that MTAGLN significantly improves upon the baseline model in both MAE and RMSE metrics. Table 4 shows the average metric over 12 steps within the next hour, with MTAGLN improving by 14.44% and 15.54% respectively compared to the baseline best-performing model GMSDR. This indicates that the proposed model has excellent predictive performance within small urban areas. However, unlike the significant improvements in the first two metrics, Table 3 shows that while MTAGLN gradually improves in steps 3 and 6, it decreases by -2.80% in later steps, such as step 12, compared to the baseline best-performing model GMSDR, with an overall average improvement of only 0.56%. This indicates that the proposed model performs well in the short to medium term in terms of MAPE, but exhibits significant errors in later stages.

[0150] As can be seen from the experimental data of the PeMS-D8 dataset in Table 4, MTAGLN gradually improves the MAE and RMSE indicators in steps 3, 6, and 12. The average indicators for the next 12 steps are 10.40% and 7.67% higher than the baseline optimal model RGSL, respectively. Feature capture in the three time periods effectively reduces the error caused by the long time interval in long-term prediction and improves the accuracy of the mid-to-late stage prediction of this invention. The MAPE indicator fluctuates slightly but is relatively stable. The average indicator for the next 12 steps is 6.88% higher than the baseline optimal model RGSL.

[0151] Tables 3 and 4 detail the specific values ​​of the indicators for steps 3, 6, and 12, as well as the 12-step average indicator, and the improvement effect of MTAGLN compared to the baseline optimal model. To illustrate the trend of indicator changes more intuitively than in the tables, appendices are provided. Figure 8 , 9 As shown in Figure 10, the 12 steps of data are plotted into a line chart, which shows in detail the changing trend of the 12 steps over the next hour. Figure 8 As shown, in all stepwise metrics of the PeMS-D4 data, it slightly outperforms the baseline model; Figure 9 In the PeMS-D6 dataset, the MAE and RMSE metrics showed significant improvements compared to other baseline models. However, MAPE exhibited substantial errors in steps 11 and 12, slightly lower than the baseline model RGSL and worse than GMSDR. This is because, in the D6 dataset, to highlight the impact of local urban functional areas on urban traffic, the ratio of ramp nodes to main road nodes was approximately 1:2.25. Ramp traffic flow exhibited significant low-flow periods. The substantial improvements in MAE and RMSE indicate that MTAGLN has a strong spatiotemporal capture capability for complex urban functional areas. However, the large amount of low-flow data in ramps affected MAPE performance, resulting in a relatively stable improvement. Figure 10The gradual changes in the PeMS-D8 data clearly show the difference between the MTAGLN and baseline models. The mid-to-late stage line trends of MAE and MAPE also match the results analysis of the tabular data.

[0152] It can be seen that MTAGLN has excellent predictive capabilities. First, the spatiotemporal dynamic correlation matrix can capture the traffic fluctuations brought about by the convergence of traffic flow from urban functional areas into the main urban roads. Learning the strong dependencies between nodes allows for dynamic modeling of complex urban road networks, effectively linking the local and global topologies. Second, the multi-dimensional time scale module can capture the temporal features of the same node across three time scales: time, day, and week. It learns the peaks and periodic changes in traffic flow in and out of functional areas from long, medium, and short-term time series, and can also capture subtle fluctuations in global traffic flow. To more intuitively demonstrate the predictive performance, in Figure 11 , Figure 12 and Figure 13 Long-term forecast data is selected to demonstrate the comparison between MTAGLN and other baseline models at different times. Figure 11 The data in the middle is three days of traffic data from the D4 dataset. The preferred selections are the early morning rush hour on Friday and the period before the morning rush hour on Saturday, marked as regions E1 and E2 respectively, to demonstrate the prediction effect of this invention on weekdays and weekends.

[0153] Figure 12 The middle part is the D6 dataset. The preferred selection is the morning peak period of a certain workday and the rising period before the morning peak of the next day, which are marked as regions E3 and E4 respectively.

[0154] Figure 13 The middle part is the D8 dataset. The preferred selection is the peak volatility period of a certain workday and the peak volatility period of the next day, which are marked as regions E5 and E6, respectively.

[0155] In region E1, except for ASTGCN which showed significant errors, the other models generally met expectations. MTAGLN closely matched the actual values ​​and provided a more stable representation of the flow changes in this segment. In region E2, MTAGLN's predicted values ​​were generally stable, and the matching curve for the low flow segment also conformed to the results of the MAPE index discussion. With the actual value as the denominator, when the actual value is indeed low, the error of the MAPE index will inevitably increase. The peaks in regions E3 and E4 are relatively steep. E3 directly shows the prediction effect of the peak. It can be seen that MTAGLN is relatively smooth, and the overall trend is consistent with the peak of the actual value. Region E4 is the climbing period of the next day's peak. It closely matches the transition period between small peaks and small troughs, showing good anti-interference ability for sudden changes in flow. Regions E5 and E6 show obvious fluctuations. MTAGLN's predictions of the three peaks and two troughs are quite close, demonstrating MTAGLN's detailed grasp of the morning peak cycle.

[0156] exist Figure 11 , Figure 12 and Figure 13 The results demonstrate the MTAGLN model's high-precision traffic flow prediction capabilities, particularly its ability to capture peak traffic periods. To further demonstrate the model's predictive capabilities for different traffic flow values, such as... Figure 14 As shown, the fit between the true and predicted values ​​is demonstrated, and MTAGLN is compared with five other baseline models.

[0157] like Figure 14 As shown, the fit of MTAGLN to five baseline models—AGCRN, ASTGCN, GMSDR, STGODE, and RGSL—is demonstrated. Figure 14 The X-axis represents the range of true values, and the Y-axis represents the range of predicted values. Figure 14 The degree to which the scatter plot deviates from the diagonal (diagonal equation: Y=X) reflects the error of the prediction model. Figure 14 The histogram at the top represents the frequency distribution of the actual values, reflecting the concentration and range of variation of traffic flow data at different values. Similarly, the histogram on the right shows the frequency distribution of the predicted results, with the 400-450 flow rate segment, the 225-325 flow rate segment, and the flow rate segment below 75 flow rate marked in red, yellow, and green respectively. Figure 14 As can be seen, AGCRN, ASTGCN, GMSDR, and RGSL lack effective predicted values ​​for the peak traffic period of 400-450 vehicles on this day. The ratio of predicted values ​​to actual values ​​is marked on the left side of the box. Only STGODE and MTAGLN have predicted values ​​for the peak traffic period, and the ratio of predicted values ​​to actual values ​​is as follows: and The distribution of the scatter points shows that in the peak flow range of 225-325 MTAGLN, the scatter points are relatively evenly clustered near the diagonal. Two straight lines parallel to the fitted line are drawn, and the distance between the two lines is calculated and marked on the upper left and lower right sides of the fitted curve, using the points furthest apart. Figure 14 Numerically, it can be seen that MTAGLN exhibits better clustering than other models, reflecting the excellent predictive performance of this invention for peak flow. For flow rates below 75, the frequency distribution of predicted values ​​closely approximates the number and range of actual values. MTAGLN also performs exceptionally well in medium- and long-term predictions. This invention plots the 12-step prediction data curves of these five baseline models and MTAGLN on... Figure 15 The comparison is presented in the table, where the degree of aggregation across the 12 time steps represents the model's stability for medium- to long-term traffic flow predictions. Figure 15As can be seen from the marked areas, the baseline model's prediction curve exhibits strong jumps and fluctuations during peak flow periods. In contrast, the graph in MTAGLN is clustered and flat, indicating that the model has a relatively stable prediction effect for peak flow in the next hour. This also verifies the conclusions above regarding the comparison between actual and predicted values.

[0158] Ablation experiments: To verify the effectiveness of each module of MTAGLN, ablation experiments were conducted on the PeMS-D6 dataset. The ResMSTFF (without the multidimensional temporal module), ResAGLM (without the graph learning module), ResGTCM (replaced with ordinary convolution), and ResBlock (single STBlock) modules were compared with the original model. At the same time, the baseline model was retained as an external benchmark. Table 5 shows the settings of the MTAGLN ablation experiments.

[0159]

[0160] Table 5

[0161] The ablation of each module was performed according to the above description, and the experimental index results of each ablation model were obtained. The results are as follows: Figure 16 ;

[0162] from Figure 16 The experimental results show that the MTAGLN model has the lowest scores across all metrics, reflecting that each module of the model plays its due role. The most significant differences are found between the MTAGLN model and the ResMSTFF and ResBlock models. This is mainly because the multi-dimensional time-scale feature extraction module effectively considers the temporal, epochal, and weekly characteristics of real-world traffic flow data, effectively capturing feature details. The coherent residual fusion calculation between multiple ST Blocks ensures that spatiotemporal features are not overlooked. Furthermore, the comparison between ResAGLM and MTAGLN shows that the graph learning module's ability to capture spatiotemporal representations effectively improves the model's prediction performance. The gated temporal convolution module, as the crucial final prediction step, integrates all spatiotemporal features for convolutional fusion, achieving reductions of 1.62%, 1.89%, and 7.36% in MAE, RMSE, and MAPE compared to MTAGLN, respectively. This demonstrates that improvements to traditional convolution effectively enhance feature fusion and representation capabilities, improving prediction accuracy and robustness.

[0163] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of the equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.

Claims

1. A multidimensional time-based adaptive graph learning traffic flow prediction system, characterized in that: It includes multiple spatiotemporal convolutional blocks; the multiple spatiotemporal convolutional blocks are stacked through residual connections, and each spatiotemporal convolutional block includes a multidimensional temporal scale feature fusion module, a mask matrix adaptive graph learning module, and a gated temporal convolutional module; the multidimensional temporal scale feature fusion module and the mask matrix adaptive graph learning module are connected through residual connections, and the mask matrix adaptive graph learning module and the gated temporal convolutional module are connected through residual connections. The multi-dimensional time-scale feature fusion module is used to input traffic flow data, extract sequence features of time, day, and week, obtain attention outputs of each time dimension through a multi-head attention mechanism, and splice them according to node dimensions to form data that fuses multi-time-scale features. The mask matrix adaptive graph learning module is used to receive fused multi-timescale feature data, combine the spatiotemporal dynamic correlation matrix and the antisymmetric structure mask matrix, and construct an adaptive graph learning structure by dynamically adjusting the fusion ratio through a learnable weight matrix to learn spatial features and output data fused spatiotemporal features. The gated temporal convolution module is used to receive data with fused spatiotemporal features, extract temporal features through gating operations combining two-dimensional convolution and Tanh-Sigmoid, and output traffic flow prediction results.

2. The adaptive graph learning traffic flow prediction system based on multidimensional time as described in claim 1, characterized in that: In the multi-dimensional time-scale feature fusion module, there are 3 multi-head attention heads, corresponding to the time scales of hour, day, and week, with each head having a dimension of [missing information]. , For each attention head, the dimension is a positive integer. The attention output is added to the original input through residual connections, preserving the basic feature structure of the time series.

3. The adaptive graph learning traffic flow prediction system based on multidimensional time as described in claim 1, characterized in that: In the mask matrix adaptive graph learning module, the antisymmetric structure mask matrix S is embedded through a node embedding matrix. and The dot product difference is directly constructed without symmetric matrix decomposition, and is used to model the unidirectional constraints of traffic flow.

4. The adaptive graph learning traffic flow prediction system based on multidimensional time as described in claim 1, characterized in that: The residual connections are normalized using LayerNorm within each spatiotemporal convolutional block, and the number of channels is aligned between blocks using 1×1 convolutions to ensure stable feature propagation.

5. The adaptive graph learning traffic flow prediction system based on multidimensional time as described in claim 1, characterized in that: The output of the multi-dimensional time-scale feature fusion module serves as one of the inputs to the mask matrix adaptive graph learning module, guiding the dynamic adjustment of the spatial graph structure. Specifically, it maps the temporal features to the query vector Q, key vector K, and value vector V of spatial attention through linear transformation, thereby enhancing the temporal sensitivity of spatial dependencies.

6. A prediction method for a multidimensional time-based adaptive graph learning traffic flow prediction system as described in any one of claims 1-5, characterized in that: The prediction method includes the following steps: S1: Construct a multi-dimensional time-scale feature fusion module by using feature extraction and fusion modules for three time scales: time, day, and week. Input the traffic flow historical data tensor. Where R represents the set of real numbers, B is the batch dimension, N is the number of traffic network nodes, F is the feature dimension, and T is the number of time steps; S2: Input spatiotemporal dynamic correlation matrix Fusion module with multi-dimensional time scale features Construct an adaptive graph learning module for the mask matrix; S3: Transform the output shape of the mask matrix adaptive graph learning module into... It also serves as the input to the gated temporal convolution module.

7. The prediction method for a multidimensional time-based adaptive graph learning traffic flow prediction system according to claim 6, characterized in that: S1 includes the following steps: S101: Time scale decomposition, dividing the data into hours, days, and weeks. , , These correspond to time-level, day-level, and week-level sequence features, respectively. S102: Calculation The process of calculating attention score: , Attention score at the time of receipt ,in These are the learnable parameters. For residual attention terms, the dimension is... Consistency is used to enhance attention stability. The superscript T is the matrix transpose, used to adjust the dimension of the weight matrix, and the subscript T represents the time scale. S103: Calculate accordingly. , Attention scores were obtained for each day and week. , ; S104: Further calculations , , The attention input and output for each time dimension are obtained respectively; S105: , , The corresponding attention module outputs are respectively , and According to the node-based splicing, through , , obtained the The head integrates the attention output of the time period on Wednesday. .

8. The prediction method for a multidimensional time-based adaptive graph learning traffic flow prediction system according to claim 6, characterized in that: S2 includes the following steps: S201: Utilizing Learnable Node Embedding Matrices ,in To embed the dimension, calculate the antisymmetric matrix to represent the relationships between nodes: ,in Used to filter sparse connections and highlight unidirectional dependencies between upstream and downstream nodes; S202: Introducing node self-connection weight vectors Increase, by generating learnable parameters through initialization, antisymmetric matrix Effectively reduces the adverse effects of one-way lanes through activation functions. A spatial expression matrix was constructed. ; S203: Apply the structure mask matrix spatiotemporal dynamic correlation matrix The two components are then fused, and dynamically adjusted based on the learnable weight matrix S to ultimately obtain an adaptive graph learning structure: , and Use one first The convolutional layers are fused together, and then utilized... The activation function normalizes it; then through The parameters S that can be continuously learned can be used to dynamically adjust the weight relationship between the two to obtain the final matrix adaptive graph learning structure. , where ⊙ is the Hadama product; S204: Further integrates multidimensional temporal and spatial features, input data... ,in, It is to output attention Transformed input data, It is a transformation matrix; After spatial encoding, it is used as input for spatial attention. , , During the calculation, , , The multidimensional time module outputs the query, key, and value vectors after linear transformation, respectively. S205: Next, after the spatiotemporal dynamic correlation matrix Combined spatial attention, its output Continuing as input to the graph convolution, and in The spatiotemporal features are dynamically updated under adjustment. The overall calculation process is as follows: , , ,in These are Chebyshev polynomials, defined as follows: k is the convolution order. For the normalized Laplace matrix, These are the learnable convolution kernel parameters.

9. The prediction method for a multidimensional time-based adaptive graph learning traffic flow prediction system according to claim 6, characterized in that: S3 includes the following steps: S301: Next, perform the following calculations: , , , ,in, Represents the transformation matrix. It is a bias term. It is a convolution operation; S302: After obtaining the convolution result, split it. Responsible for feature extraction, As a gating signal, after and The traffic flow output predicted by the gating mechanism is obtained after nonlinear transformation. .

Citation Information

Cited By

  • Expressway traffic flow prediction method, storage medium and system

    CN121564995A