A traffic flow prediction method based on dynamic sparse graph convolution GRU

By combining the dynamic sparse graph convolution GRU with the spatiotemporal attention fusion layer, the problems of spatiotemporal feature integration and emergency event handling in traffic flow prediction are solved, achieving more efficient traffic flow prediction.

CN119694142BActive Publication Date: 2025-10-10山西省智慧交通实验室有限公司 +3
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411841778.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-10-10
Estimated Expiration
2044-12-13

AI Technical Summary

Technical Problem

Existing traffic flow prediction methods are ineffective in dealing with nonlinear characteristics, cannot effectively integrate time series characteristics and spatial structure information, ignore the spatial correlation of traffic data, and have difficulty coping with the impact of emergencies.

Method used

A method based on dynamic sparse graph convolution GRU is adopted. The DSGCGRN model is combined with dynamic sparse graph convolution and gated recurrent unit GRU, and combined with the spatiotemporal attention fusion layer STAF to enhance the understanding and processing capabilities of spatiotemporal features.

Benefits of technology

It improves the accuracy and adaptability of traffic flow prediction, can effectively capture the complex spatiotemporal characteristics of the traffic network and the impact of emergencies, and improves the prediction performance of the model in a dynamic traffic environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119694142B_ABST
    Figure CN119694142B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of transportation and specifically relates to a traffic flow prediction method based on dynamic sparse graph convolution GRU, which integrates a spatiotemporal attention fusion scheme of a gating mechanism, increases a dynamic sparse graph convolution gating recurrent unit DSGCN-GRU in the model, and increases a self-adaptive dynamic sparse graph convolution embedding gating recurrent network, so as to simulate dynamic spatial structure information diffusion, effectively capture heterogeneous features and local characteristics of spatial data, further reflect irregularity and dynamic variability of spatial information, improve the understanding of local and global spatiotemporal characteristics of the model through the spatiotemporal attention of the gating mechanism, realize unified description of multi-scale and long-distance spatiotemporal patterns, and strengthen the response of the model to long-term traffic flow prediction and sudden traffic events. Compared with existing traffic flow prediction methods, the application can effectively improve the accuracy of traffic flow prediction.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of transportation, and particularly relates to a traffic flow prediction method based on a dynamic sparse graph convolution GRU. BACKGROUND

[0002] Traffic flow prediction is an important research problem in intelligent transportation systems. With the acceleration of urbanization and the increase in transportation demand, accurate prediction of traffic flow becomes particularly important. Traditional traffic flow prediction methods often rely on linear models such as historical average (HA), autoregressive moving average (ARIMA), and vector autoregressive (VAR). These methods perform poorly when dealing with complex traffic flow changes because traffic flow changes are often complex and nonlinear.

[0003] Traditional statistical methods: Early research mainly relied on traditional time series analysis methods, which are based on linear interdependence between time series, but have limited effectiveness in traffic flow prediction. Machine learning methods: To overcome the limitations of traditional methods, researchers began to use machine learning techniques such as support vector regression (SVR) and K-nearest neighbors (KNN), which can handle complex nonlinear dependencies with the support of feature engineering. Deep learning methods: In recent years, the rapid development of deep learning has brought significant changes to traffic flow prediction. Researchers have designed various deep learning-based traffic flow prediction methods using the automatic feature extraction capabilities of deep learning. In particular, recurrent neural networks (RNN), including long short-term memory networks (LSTM) and gated recurrent units (GRU), are widely used to capture the temporal characteristics of traffic data. Convolutional neural networks (CNN): Some studies have introduced convolutional neural networks (CNN) to process time series data to compensate for the limitations of RNN in long sequence processing. Graph convolutional networks (GCN): To better capture the spatial correlation of traffic data, researchers have begun to use graph convolutional networks (GCN), which enable the model to effectively simulate the relationships between nodes in the traffic network.

[0004] The existing technology in the field of traffic flow prediction has the following limitations: traditional statistical methods rely on linear assumptions and cannot effectively handle nonlinear features; machine learning methods rely on manual feature selection, resulting in insufficient generalization ability; RNN and CNN-based models separate time and spatial feature processing, ignoring the spatial correlation of traffic data; graph neural networks rely on pre-set graph structures, making them difficult to adapt to dynamically changing traffic networks; the impact of sudden events on traffic flow is not fully considered, resulting in insufficient response capabilities; and the limitations of insufficient spatiotemporal feature integration. SUMMARY

[0005] In response to the technical problem that traditional statistical methods in the field of traffic flow prediction mentioned above rely on linear assumptions and cannot effectively handle nonlinear features, the present invention provides a traffic flow prediction method based on dynamic sparse graph convolution GRU, which aims to effectively integrate time series features with complex spatial structure information.

[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0007] A traffic flow prediction method based on dynamic sparse graph convolutional neural network (GRU) includes the following steps:

[0008] S1. Data preprocessing: Use the input data preprocessing layer to enhance the spatiotemporal features to ensure that the model can effectively utilize the information in the input data;

[0009] S2. Build a DSGCGRN model. The DSGCGRN model consists of a multi-layer DSGCN-GRU structure. Each layer receives the output of the previous layer and generates a new hidden state.

[0010] S3 is processed by the spatiotemporal attention fusion layer STAF, which combines temporal attention and spatial attention mechanisms to enhance the model's understanding of complex spatiotemporal features;

[0011] S4. The features processed from S1 to S3 are integrated and used to predict traffic flow. The model will output the traffic flow prediction results for a period of time in the future.

[0012] S5. Finally, through experiments on real traffic flow datasets, the prediction performance of the model is evaluated and compared with other baseline models.

[0013] The method for enhancing the spatiotemporal features using the input data preprocessing layer in S1 is as follows: the traffic flow P = [Xθ-T+1, Xθ-T+2, ..., Xθ]∈RN×C×T is used as input data, and the enhanced spatiotemporal feature representation is obtained through processing by the fully connected layer and the convolutional layer. The calculation is as follows:

[0014] X FC =W2(relu(W1(P)))⊙P

[0015]

[0016] Among them, W1 and W2 are the weight matrices of the first and second linear layers in the fully connected layer, relu and sigmoid are activation functions, and ⊙ represents the element-by-element product; is the enhanced hidden feature representation.

[0017] The method for constructing the DSGCGRN model in S2 is:

[0018] S2.1. Constructing Dynamic Sparse Graph Convolution: The DSGCGRN model uses dynamic sparse graph convolution (DSGCN) to construct an adjacency matrix. This adjacency matrix can adaptively reflect the dynamic changes in traffic flow data, thereby more accurately simulating the spatial correlation of traffic flow at different times.

[0019] S2.2. Constructing Gated Recurrent Units (GRUs): In the DSGCGRN model, each GRU is embedded with two dynamic sparse graph convolution blocks and one graph attention block. The GRU is responsible for storing and processing time series information. Combined with the advantages of dynamic sparse graph convolution, it can provide insights into spatiotemporal correlations and temporal dynamics.

[0020] S2.3. Feature Extraction and Fusion: Through the DSGCN module, the model can dynamically update the adjacency matrix to capture the spatial correlations in the traffic network that evolve over time. Combined with gated temporal and spatial attention mechanisms, the DSGCGRN can overcome the limitations of capturing abnormal conditions and long-range information, and enhance the model's understanding of complex spatiotemporal features.

[0021] S2.4. Combine the gated recurrent unit (GRU) with dynamic sparse graph generation.

[0022] The method of processing in S3 by the spatiotemporal attention fusion layer STAF is:

[0023] S3.1 Input processing: The spatiotemporal attention fusion layer STAF receives the output from the dynamic sparse graph convolution gated recurrent network DSGCGRN, which is an H t ∈R N×T×D tensors to capture long-range, multi-scale spatiotemporal patterns;

[0024] S3.2. Constructing a Temporal Multi-Head Attention Block (TA): STAF includes a temporal multi-head attention block that is responsible for capturing important features in the temporal dimension. By weighting the time series data, the model can identify features that have a greater impact on the prediction results at different time points.

[0025] S3.3. Constructing a spatial multi-head attention block: STAF also includes a spatial multi-head attention block that focuses on capturing important features in the spatial dimension. This block helps the model understand the relationship between traffic flows at different locations by weighting spatial locations.

[0026] S3.4, the outputs of the temporal multi-head attention block TA and the spatial multi-head attention block SA will be fused to form a comprehensive spatiotemporal feature representation; this fusion process enables the model to simultaneously consider the dynamic changes in time and space, thereby improving the understanding of complex spatiotemporal features.

[0027] The method for constructing dynamic sparse graph convolution in S2.1 is to calculate the adjacency matrix A∈R by adaptively generating node embeddings. N×N Then, A is sparsely processed, the top k maximum similarity connections between each node and its neighboring nodes are retained, and the normalized softmax function is used to obtain the normalized adaptive sparse adjacency matrix S A ∈R N×N ; The formula is defined as:

[0028] A=relu(EE T )

[0029] S A =softmax(ReLU(sparsify(A;k)))

[0030] where E∈R N×d is the adaptive node embedding matrix, d represents the embedding dimension of the node; sparsify(*) represents the sparse operation, and k is the sparsity rate.

[0031] The method for constructing the gated recurrent unit (GRU) in S2.2 is to use Chebyshev polynomials to approximate the graph convolution kernel, thereby effectively capturing and integrating the complex relationships between nodes in the graph and their distant neighbors and even the global structure without increasing excessive computational costs. Therefore, the dynamic graph convolutional network is defined as:

[0032] L=(I+S A )X H EW+Eb

[0033] Where I represents the identity matrix, X H ∈R N×C is the input graph signal, L∈R N×D Represents the output signal of the graph convolution operation, W∈R C×D and b∈R d×D are the learnable parameters of the model.

[0034] The method of combining the gated recurrent unit GRU with dynamic sparse graph generation in S2.4 is as follows: integrating dynamic graph convolution operation on the basis of GRU with graph attention GAT gate; given the previously hidden representation H t-1 and the input data X at time t t ∈R N×D , the gated recurrent unit can be expressed as follows:

[0035] u t =σ([X t ,H t―1 ]★ G W u +b u )

[0036] r t =σ([X t ,H t―1 ]★ G W r +b r )

[0037] c t =tanh([X t ,(r t ⊙H t―1 )]★ G W c +b c )

[0038] G att =(M⊙A)X H W

[0039] H t =u t ⊙H t―1 +(1―u t )⊙c t +G att

[0040] Among them (★ G ) represents the graph convolution operation, σ represents the sigmoid activation function, W u 、b u 、W r 、b r 、W c and b c is the learnable parameter of the recurrent network layer, H t is the output at time t; A is the static matrix calculated based on the distance in GAT, M is the dynamic attention coefficient matrix, and W is the learnable weight parameter.

[0041] The method for constructing the temporal multi-head attention block TA in S3.2 is as follows: the temporal dilated gated multi-head self-attention block TA consists of dilated convolutional gating and temporal attention mechanism. First, the dilated convolutional gating structure is used to dynamically adjust its learning and response to spatiotemporal features, effectively acquiring local and global features, thereby more flexibly adapting to sudden changes in traffic conditions. It is defined as follows:

[0042] filter=tanh(D_conv(H t ))

[0043] gate=σ(D_conv(H t ))

[0044] X tg =filter⊙gate

[0045] Where σ is the sigmoid activation function; X tg Represents the input of the subsequent multi-head attention; then the multi-head attention mechanism is applied to capture dynamic temporal relationships, enabling the model to learn complex temporal dependencies; the query Q, key K and value V matrices are derived through a linear layer to obtain the attention score; the expression is as follows:

[0046] Q T ,K T ,V T =Linear(X tg )

[0047]

[0048]

[0049] Here, Is a learnable parameter matrix; then the output MSA of the dilated convolution gated temporal self-attention T ∈R N×T×D The calculation is as follows:

[0050]

[0051] The method for constructing the spatial multi-head attention block SA in S3.3 is as follows: SA directly uses the output of the dynamic sparse graph convolutional recurrent loop network to calculate the query Q, key K and value V matrices to obtain the spatial attention output; in particular, the convolution operation is applied to obtain Q and K, which are defined as follows:

[0052] Q S ,K S =conv(H t )

[0053] V S =Linear(H t )

[0054] This can effectively capture local and global dependencies, and thus efficiently complete the fusion and compression of spatial information. The calculation of attention scores and final output results follows multi-head self-attention, which is expressed as follows:

[0055]

[0056] in is the learnable parameter matrix; MSA S ∈R N×T×D is the output representation of spatial attention;

[0057] The final output of the STAF layer is defined as follows:

[0058] X F=LN(FC(MSA T +MSA S ))

[0059] Where FC(*) represents the fully connected layer operation, LN(*) represents the normalization operation; X F ∈R N×T×D is the output of the spatiotemporal attention fusion layer.

[0060] The method for fusing the outputs of the temporal multi-head attention block TA and the spatial multi-head attention block SA in S3.4 is as follows: the high-dimensional spatiotemporal features obtained by deep fusion of the spatiotemporal attention mechanism are mapped to a low-dimensional space through a convolutional layer to regress and generate a predicted future sequence Q∈RN×C×T; in this process, considering that there are usually outliers in the traffic dataset caused by sensor failures, the L1Loss loss function is used to measure the deviation between the predicted value and the true value. This loss function does not overly amplify the impact of extreme errors and can effectively improve the robustness of the model; the formula is as follows:

[0061] Loss(y_i,y^_i)=y_i-y^_i.

[0062] Compared with the prior art, the present invention has the following beneficial effects:

[0063] 1. We propose a dynamic sparse graph convolutional gated recurrent network (DSGCN-GRU) to simultaneously extract local dynamic spatiotemporal features. Traditional graph convolutional networks (GCNs) are typically limited to processing static graph structures. However, the DSGCN-GRU, by adaptively constructing a dynamic adjacency matrix, effectively captures the spatial correlation of traffic flows at different times, reflecting the significant correlations between roads in a traffic network caused by dynamic changes in traffic flow. The DSGCN-GRU combines a gated recurrent network (GRU) with dynamic sparse graph convolution to simultaneously process both time series information and spatial features, overcoming the limitation of RNN-based methods that only consider temporal changes while ignoring spatial correlations. In traffic flow prediction, data often exhibits multivariate and heterogeneous characteristics. The DSGCN-GRU effectively captures the changes in these features through dynamic sparse graph convolution, improving the model's adaptability to complex traffic scenarios. The model design considers the impact of sudden traffic events, enhancing its ability to respond to abnormal situations and improving prediction accuracy in complex and dynamic traffic environments.

[0064] 2. A spatiotemporal attention fusion model (STAF) is proposed, which introduces a spatiotemporal attention mechanism and multi-scale feature extraction to address the limitations of traditional methods in processing complex spatiotemporal data. By introducing a spatiotemporal attention mechanism, STAF can effectively fuse the spatiotemporal features in traffic flow data, overcoming the problem of insufficient feature extraction in traditional methods when processing spatiotemporal data. At the same time, STAF can adapt to the dynamic changes in traffic flow. Especially in the face of emergencies and complex traffic scenarios, the model can better capture these changes, thereby improving the accuracy of predictions. STAF designs a multi-scale spatiotemporal feature extraction method that can simultaneously consider local and global information, enhancing the model's understanding of traffic flow characteristics at different time and spatial scales. In traffic flow prediction, data usually has multivariate heterogeneous features. STAF can effectively identify and utilize these heterogeneous features through the attention mechanism, thereby improving the adaptability and accuracy of the model.

[0065] 3. By combining the extraction of spatiotemporal features with the capture of dynamic changes, the model can more comprehensively reflect the nonlinearity and heterogeneity of traffic flow, overcoming the limitations of traditional methods in processing spatiotemporal features. STFDSGCN innovatively applies a dynamic sparse graph convolutional recurrent network to capture potential spatial correlation features, deeply exploring the spatial heterogeneity of road networks. It utilizes a gated spatiotemporal attention fusion mechanism to capture critical, long-range time series information and perceive unforeseen traffic emergencies. The model achieves unified and efficient capture of spatiotemporal correlations, achieving the best performance compared to baselines. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] To more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the embodiments or the description of the prior art. Obviously, the drawings described below are merely exemplary, and those skilled in the art can, without inventive effort, derive other implementation drawings based on the provided drawings.

[0067] The structures, proportions, sizes, etc. illustrated in this specification are intended solely to complement the contents disclosed herein and to facilitate understanding and reading by persons skilled in the art. They are not intended to limit the conditions under which the present invention may be implemented and therefore have no substantive technical significance. Any structural modifications, changes in proportions, or adjustments in sizes, without affecting the efficacy and objectives of the present invention, shall remain within the scope of the technical contents disclosed herein.

[0068] Figure 1 It is a schematic diagram of the principle of the present invention;

[0069] Figure 2 This is a structural diagram of the dynamic sparse graph convolutional recurrent network of the present invention;

[0070] Figure 3 This is the spatiotemporal attention fusion structure diagram of the present invention. DETAILED DESCRIPTION

[0071] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are only part of the embodiments of this application, not all the embodiments. These descriptions are only to further illustrate the features and advantages of the present invention, rather than to limit the claims of the present invention. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0072] The following embodiments of the present invention are described in further detail with reference to the accompanying drawings and examples. The following embodiments are used to illustrate the present invention but are not intended to limit the scope of the present invention.

[0073] A traffic flow prediction method based on dynamic sparse graph convolution GRU, such as Figure 1-Figure 3 As shown, the technical solution of the present invention is introduced in detail below.

[0074] Step 1) Data preprocessing: Use the input data preprocessing layer to enhance the spatiotemporal features to ensure that the model can effectively utilize the information in the input data.

[0075] Step 2) DSGCGRN consists of a multi-layer DSGCN-GRU structure, where each layer receives the output of the previous layer and generates a new hidden state.

[0076] Step 3) Constructing Dynamic Sparse Graph Convolution: DSGCGRN uses dynamic sparse graph convolution (DSGCN) to construct an adjacency matrix. This adjacency matrix can adaptively reflect the dynamic changes in traffic flow data, thereby more accurately simulating the spatial correlation of traffic flow at different times.

[0077] Step 4) Gated Recurrent Unit (GRU): In the DSGCGRN, each GRU unit is embedded with two dynamic sparse graph convolution blocks and a graph attention block. The GRU is responsible for storing and processing time series information. Combined with the advantages of dynamic sparse graph convolution, it can provide insights into spatiotemporal correlations and temporal dynamics.

[0078] Step 5) Feature Extraction and Fusion: Through the DSGCN module, the model dynamically updates the adjacency matrix to capture the spatial correlations in the traffic network that evolve over time. Combined with gated temporal and spatial attention mechanisms, the DSGCGRN overcomes limitations in capturing abnormal conditions and long-range information, enhancing the model's understanding of complex spatiotemporal features.

[0079] Step 6) Spatiotemporal Attention Fusion Layer (STAF): This layer combines temporal attention and spatial attention mechanisms to enhance the model’s understanding of complex spatiotemporal features.

[0080] Step 7) Input processing: STAF receives the output from the dynamic sparse graph convolutional gated recurrent network (DSGCGRN), which is an H t ∈R N×T×D tensors to capture long-range, multi-scale spatiotemporal patterns.

[0081] Step 8) Temporal Multi-Head Attention Block (TA): STAF includes a temporal multi-head attention block that is responsible for capturing important features in the temporal dimension. By weighting the time series data, the model is able to identify features that have a greater impact on the prediction results at different time points.

[0082] Step 9) Spatial Multi-Head Attention Block (SA): STAF also includes a spatial multi-head attention block that focuses on capturing important features in the spatial dimension. This block helps the model understand the relationship between traffic flows at different locations by weighting the spatial locations.

[0083] Step 10) The outputs of TA and SA are fused to form a comprehensive spatiotemporal feature representation. This fusion process enables the model to consider dynamic changes in both time and space, thereby improving the understanding of complex spatiotemporal features.

[0084] Step 11) The features processed in the above steps are integrated and ultimately used to predict traffic flow. The model outputs traffic flow prediction results for a certain period of time in the future.

[0085] Step 12) Evaluate the prediction performance of the model through experiments on real traffic flow datasets (such as PeMS04 and PeMS08) and compare it with other baseline models.

[0086] The present invention uses three evaluation indicators to evaluate the model performance, namely mean absolute error (MAE), mean absolute percentage error (MAPE) and root mean square error (RMSE).

[0087] Performance comparison experiments were conducted on two test sets of real-world traffic flow data. STFDSGCN achieved significant improvements on both PEMS04 and PEMS08, outperforming all baseline methods in most scenarios. In PEMS04, STFDSGCN outperformed the leading method DSTAGNN by 1.5% in MAE and 1.26% in MAPE. In PEMS08, STFDSGCN outperformed the state-of-the-art method ST-AE by 5.02% in MAE and 2.63% in RMSE, respectively, and by 3.8% in MAPE, enabling better traffic flow prediction.

[0088] The above only describes in detail the preferred embodiments of the present invention, but the present invention is not limited to the above embodiments. Various changes can be made within the knowledge of ordinary technicians in this field without departing from the purpose of the present invention, and various changes should be included in the scope of protection of the present invention.

Claims

1. A traffic flow prediction method based on dynamic sparse graph convolutional neural network (GRU), characterized by: The following steps are involved: S1. Data preprocessing: Use the input data preprocessing layer to enhance the spatiotemporal features to ensure that the model can effectively utilize the information in the input data; the method of using the input data preprocessing layer to enhance the spatiotemporal features in S1 is: traffic flow P = [X θ-T+1 ,X θ-T+2 ,...,X θ ]∈R N×C×T As input data, after being processed by the fully connected layer and the convolutional layer, the enhanced spatiotemporal feature representation is obtained, which is calculated as follows: X FC =W2(return(W1(P)))⊙P Among them, W1 and W2 are the weight matrices of the first and second linear layers in the fully connected layer, relu and sigmoid are activation functions, and ⊙ represents the element-by-element product; is the enhanced hidden feature representation; S2. Build a DSGCGRN model. The DSGCGRN model consists of a multi-layer DSGCN-GRU structure. Each layer receives the output of the previous layer and generates a new hidden state. S2.

1. Constructing Dynamic Sparse Graph Convolution: The DSGCGRN model uses dynamic sparse graph convolution (DSGCN) to construct an adjacency matrix. This adjacency matrix can adaptively reflect the dynamic changes in traffic flow data, thereby more accurately simulating the spatial correlation of traffic flow at different times. S2.

2. Constructing Gated Recurrent Units (GRUs): In the DSGCGRN model, each GRU is embedded with two dynamic sparse graph convolution blocks and one graph attention block. The GRU is responsible for storing and processing time series information. Combined with the advantages of dynamic sparse graph convolution, it can provide insights into spatiotemporal correlations and temporal dynamics. S2.

3. Feature Extraction and Fusion: Through the DSGCN module, the model can dynamically update the adjacency matrix to capture the spatial correlations in the traffic network that evolve over time. Combined with gated temporal and spatial attention mechanisms, the DSGCGRN can overcome the limitations of capturing abnormal conditions and long-range information, and enhance the model's understanding of complex spatiotemporal features. S2.

4. Combining the Gated Recurrent Unit (GRU) with dynamic sparse graph generation. S3 is processed by the spatiotemporal attention fusion layer STAF, which combines temporal attention and spatial attention mechanisms to enhance the model's understanding of complex spatiotemporal features; S3.1 Input processing: The spatiotemporal attention fusion layer STAF receives the output from the dynamic sparse graph convolution gated recurrent network DSGCGRN, which is an H t ∈R N×T×D tensors to capture long-range, multi-scale spatiotemporal patterns; S3.

2. Constructing a Temporal Multi-Head Attention Block (TA): STAF includes a temporal multi-head attention block that is responsible for capturing important features in the temporal dimension. By weighting the time series data, the model can identify features that have a greater impact on the prediction results at different time points. The temporal dilated gated multi-head self-attention block TA consists of dilated convolutional gating and temporal attention mechanism. First, the dilated convolutional gating structure is used to dynamically adjust its learning and response to spatiotemporal features, effectively acquiring local and global features, thereby more flexibly adapting to sudden changes in traffic conditions. It is defined as follows: filter=tanh(D_conv(H t )) gate=σ(D_conv(H t )) X tg =filter⊙gate Where σ is the sigmoid activation function; X tg Represents the input of subsequent temporal multi-head attention; then applies a multi-head attention mechanism to capture dynamic temporal relationships, enabling the model to learn complex temporal dependencies; S3.

3. Constructing a spatial multi-head attention block: STAF also includes a spatial multi-head attention block that focuses on capturing important features in the spatial dimension. This block helps the model understand the relationship between traffic flows at different locations by weighting spatial locations. SA directly uses the output of the dynamic sparse graph convolutional recurrent network to calculate the query Q, key K and value V matrices to obtain the spatial attention output; applying the convolution operation to obtain Q and K, defined as follows: Q S ,K S =conv(H t ) V S =Linear(H t ) This can effectively capture local and global dependencies, and thus efficiently complete the fusion and compression of spatial information; S3.4, the outputs of the temporal multi-head attention block TA and the spatial multi-head attention block SA are fused to form a comprehensive spatiotemporal feature representation; this fusion process enables the model to consider the dynamic changes of time and space simultaneously, thereby improving the understanding of complex spatiotemporal features; S4. The features processed from S1 to S3 will be integrated and finally used for traffic flow prediction. The model will output the traffic flow prediction results for a period of time in the future. S5. Finally, through experiments on real traffic flow datasets, the prediction performance of the model is evaluated and compared with other baseline models.

2. A traffic flow prediction method based on dynamic sparse graph convolution GRU according to claim 1, characterized in that: The method for constructing dynamic sparse graph convolution in S2.1 is to calculate the adjacency matrix A∈R by adaptively generating node embeddings. N×N Then, A is sparsely processed, the top k maximum similarity connections between each node and its neighboring nodes are retained, and the normalized softmax function is used to obtain the normalized adaptive sparse adjacency matrix S A ∈R N×N ; The formula is defined as: A=relu(YES T ) S A =softmax(ReLU(sparsify(A;k))) where E∈R N×d is the adaptive node embedding matrix, d represents the embedding dimension of the node; sparsify(*) represents the sparse operation, and k is the sparsity rate.

3. A traffic flow prediction method based on dynamic sparse graph convolution GRU according to claim 2, characterized in that: The method for constructing the gated recurrent unit (GRU) in S2.2 is to use Chebyshev polynomials to approximate the graph convolution kernel, thereby effectively capturing and integrating the complex relationships between nodes in the graph and their distant neighbors and even the global structure without increasing excessive computational costs. Therefore, the dynamic graph convolutional network is defined as: L=(I+S) A )X H EW+Eb Where I represents the identity matrix, X H ∈R N×C is the input graph signal, L∈R N×D Represents the output signal of the graph convolution operation, W∈R C×D and b∈R d×D are the learnable parameters of the model.

4. The traffic flow prediction method based on dynamic sparse graph convolution GRU according to claim 1 is characterized in that: The method of combining the gated recurrent unit GRU with dynamic sparse graph generation in S2.4 is as follows: integrating dynamic graph convolution operation on the basis of GRU with graph attention GAT gate; given the previously hidden representation H t-1 and the input data X at time t t ∈R N×D , the gated recurrent unit is expressed as follows: you t =σ([X t ,H t-1 ]* G W u +b u ) r t =σ([X t ,H t-1 ]* G W r +b r ) c t=tanh([X t ,(r t ⊙H t-1 )]* G W c +b c ) G att =(M⊙A)X H W H t =in t ⊙H t-1 +(1-u r )⊙c t +G att Among them (★ G ) represents the graph convolution operation, σ represents the sigmoid activation function, W u 、b u 、W r 、b r 、W c and b c is the learnable parameter of the recurrent network layer, H t is the output at time t; A is the static matrix calculated based on the distance in GAT, M is the dynamic attention coefficient matrix, and W is the learnable weight parameter.

5. The traffic flow prediction method based on dynamic sparse graph convolution GRU according to claim 1 is characterized in that: The method for constructing the temporal multi-head attention block TA in S3.2 is to derive the query Q, key K and value V matrices through a linear layer to obtain the attention score; it is expressed as follows: Q T ,K T ,V T =Linear(X tg ) Here, Is a learnable parameter matrix; then the output MSA of the dilated convolution gated temporal self-attention T ∈R N×T×D The calculation is as follows:

6. The traffic flow prediction method based on dynamic sparse graph convolutional GRU according to claim 5 is characterized in that: The method for constructing the spatial multi-head attention block SA in S3.3 is: the calculation of attention scores and final output results follows the multi-head self-attention, which is expressed as follows: in is the learnable parameter matrix; MSA S ∈R N×T×D is the output representation of spatial attention; The final output of the STAF layer is defined as follows: X F =LN(FC(MSA T +MSA S )) Where FC(*) represents the fully connected layer operation, LN(*) represents the normalization operation; X F ∈R N×T×D is the output of the spatiotemporal attention fusion layer.

7. The traffic flow prediction method based on dynamic sparse graph convolution GRU according to claim 1 is characterized in that: The method for fusing the outputs of the temporal multi-head attention block TA and the spatial multi-head attention block SA in S3.4 is as follows: the high-dimensional spatiotemporal features obtained by deep fusion of the spatiotemporal attention mechanism are mapped to a low-dimensional space through a convolutional layer to regress and generate a predicted future sequence Q∈R N×C×T In this process, considering the presence of outliers in the traffic data set caused by sensor failure, the L1Loss loss function is used to measure the deviation between the predicted value and the true value. This loss function does not overly amplify the impact of extreme errors and can effectively improve the robustness of the model. The formula is as follows:

Citation Information

Patent Citations

  • Method for predicting traffic flow by using spatial dynamic graph convolutional network

    CN115482656A

  • Traffic flow prediction method based on space-time diagram convolutional network

    CN116011684A

  • Traffic state prediction method based on adaptive dynamic space-time diagram convolutional network

    CN118116194A

  • Traffic flow prediction method based on feature attention decomposition and graph convolution network

    CN118470968A

  • Traffic prediction method based on dynamic causal analysis and space-time adaptive fusion graph learning

    CN119047618A