Traffic flow prediction method based on dynamic sparse graph convolution GRU

By adopting the method of dynamic sparse graph convolution GRU and space-time attention fusion layer in traffic flow prediction, the limitations of existing methods in dealing with nonlinearity and spatial correlation are solved, and more efficient traffic flow prediction is achieved to adapt to complex and dynamic traffic environments.

CN119694142AActive Publication Date: 2025-03-25山西省智慧交通实验室有限公司 +3

Patent Information

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

AI Technical Summary

Technical Problem

The existing traffic flow prediction methods depend on linear assumptions, cannot effectively process nonlinear features, and ignore the spatial correlation of traffic data, are difficult to adapt to dynamically changing traffic networks, and have limitations in insufficient comprehensiveness of spatiotemporal features.

Method used

The traffic flow prediction method based on dynamic sparse graph convolution GRU is adopted to construct an adaptive adjacency matrix through dynamic sparse graph convolution, combined with the gated cyclic unit GRU, local dynamic spatiotemporal features are synchronously extracted, and the model's understanding of complex spatiotemporal features is enhanced through the spatiotemporal attention fusion layer.

Benefits of technology

Effectively integrating time series features and complex spatial structure information improves the model's adaptability to complex traffic scenarios, enhances its ability to adapt to abnormal situations, and improves the prediction accuracy in complex and dynamic traffic environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119694142A_ABST
    Figure CN119694142A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of traffic transportation, and particularly relates to a traffic flow prediction method based on a dynamic sparse graph convolution GRU, which integrates a space-time attention fusion scheme of a gating mechanism, adds a dynamic sparse graph convolution gating cycle unit DSGCN-GRU in a model, and is adaptive to a dynamic sparse graph convolution embedded gating cycle network. Dynamic spatial structure information diffusion is simulated, heterogeneous features and local features of spatial data are effectively captured, the irregularity and dynamic variability represented by spatial information are further reflected, the understanding of the model on local and global spatial-temporal features is improved through the spatial-temporal attention of a gating mechanism, and the spatial-temporal attention of the gating mechanism is optimized. Unified description of a multi-scale and long-distance space-time mode is realized, and the strain of the model to long-term traffic flow prediction and sudden traffic events is enhanced. Compared with an existing traffic flow prediction method, the traffic flow prediction accuracy can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of transportation, and in particular relates to a traffic flow prediction method based on dynamic sparse graph convolution GRU. Background Art

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

[0003] Traditional statistical methods: Early studies mainly relied on traditional time series analysis methods, which are based on linear interdependencies between time series, but have limited effects in traffic flow prediction. Machine learning methods: In order to overcome the limitations of traditional methods, researchers have begun to adopt machine learning techniques such as support vector regression (SVR) and K-nearest neighbor (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 a major shift in traffic flow prediction. Researchers have designed a variety of deep learning-based traffic flow prediction methods using the automatic feature extraction capabilities of deep learning. In particular, recurrent neural networks (RNNs), including long short-term memory networks (LSTMs) and gated recurrent units (GRUs), have been widely used to capture the temporal characteristics of traffic data. Convolutional neural networks (CNNs): Some studies have also introduced convolutional neural networks (CNNs) to process time series data to make up for the limitations of RNNs in processing long sequences. Graph convolutional networks (GCNs): In order to better capture the spatial correlation of traffic data, researchers have begun to use graph convolutional networks (GCNs), which enable the model to effectively simulate the relationship between nodes in the traffic network.

[0004] The existing technologies in the field of traffic flow prediction have the following problems: 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 space feature processing, ignoring the spatial correlation of traffic data; graph neural networks rely on preset graph structures, making it difficult to adapt to dynamically changing traffic networks; they fail to fully consider the impact of emergencies on traffic flow, resulting in insufficient response capabilities; and are limited in the lack of comprehensiveness of temporal and spatial features. Summary of the invention

[0005] In view of 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 characteristics, the present invention provides a traffic flow prediction method based on dynamic sparse graph convolution GRU, which aims to effectively integrate time series characteristics 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 convolution 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, 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 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;

[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 of enhancing the spatiotemporal features by using the input data preprocessing layer in S1 is: taking the traffic flow P = [Xθ-T+1, Xθ-T+2, ..., Xθ]∈RN×C×T as input data, and obtaining the enhanced spatiotemporal feature representation through the processing of the fully connected layer and the convolutional layer, which is calculated 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; the 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 (GRU): In the DSGCGRN model, each GRU is embedded with two dynamic sparse graph convolution blocks and one graph attention block. GRU is responsible for storing and processing time series information. Combining the advantages of dynamic sparse graph convolution, it can provide insights into spatiotemporal correlations and temporal dynamic characteristics.

[0020] S2.3, Feature extraction and fusion: Through the DSGCN module, the model can dynamically update the adjacency matrix to capture the spatial correlation in the traffic network that evolves over time; combined with the gated temporal attention and spatial attention mechanisms, DSGCGRN can make up for the limitations of capturing abnormal conditions and long-distance 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 contains a temporal multi-head attention block, which is responsible for capturing important features in the time dimension. By weighting the time series data, the model can identify the features that have a greater impact on the prediction results at different time points.

[0025] S3.3. Constructing a spatial multi-head attention block SA: At the same time, STAF also contains 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 flow between different locations by weighting the spatial position;

[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 of time and space, thereby improving the understanding of complex spatiotemporal features.

[0027] The method for constructing dynamic sparse graph convolution in S2.1 is: using adaptive node embedding to calculate the adjacency matrix A∈R N×N Then, A is sparsely processed, the first k maximum similarity connections between each node and its neighbor 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: using Chebyshev polynomials to approximate the graph convolution kernel, so as to effectively capture and integrate the complex relationship between the nodes in the graph and their distant neighbors and even the global structure without increasing too much computational cost; thus, the dynamic graph convolution 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 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 gating; given a 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, and 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 according to 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 dilation gated multi-head self-attention block TA is composed of dilated convolution gating and temporal attention mechanism; firstly, the dilated convolution gating structure is used to dynamically adjust its learning and response to spatiotemporal features, effectively obtain local and global features, and thus more flexibly adapt to sudden changes in traffic conditions; the definition is 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; 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: SA directly uses the output of the dynamic sparse graph convolutional loop network to calculate the query Q, key K and value V matrix to obtain the spatial attention output; pay special attention to applying convolution operations 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, as described below:

[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 It 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 conversion to generate a predicted future sequence Q∈RN×C×T for regression; in this process, considering that there are usually outliers in the traffic data set caused by sensor failures and other reasons, the L1Loss loss function is used to measure the deviation between the predicted value and the true value. This loss function will 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. A dynamic sparse graph convolution gated recurrent network (DSGCN-GRU) is proposed to simultaneously extract local dynamic spatiotemporal features. Traditional graph convolutional networks (GCN) can usually only process static graph structures, while DSGCN-GRU can effectively capture the spatial correlation of traffic flow at different times by adaptively constructing a dynamic adjacency matrix, reflecting the significant correlation between roads in the traffic network due to dynamic changes in traffic flow. DSGCN-GRU combines gated recurrent networks (GRU) and dynamic sparse graph convolution, and can simultaneously process time series information and spatial features, overcoming the limitation of RNN-based methods that only consider time changes and ignore spatial correlation. In traffic flow prediction, data usually has multivariate heterogeneous characteristics. DSGCN-GRU effectively captures the changes of these features through dynamic sparse graph convolution, improving the model's adaptability to complex traffic scenarios. The model design takes into account the impact of sudden traffic events, enhances the ability to respond to abnormal situations, and improves the prediction accuracy in complex and dynamic traffic environments.

[0064] 2. The spatiotemporal attention fusion model (STAF) is proposed, which introduces the spatiotemporal attention mechanism and multi-scale feature extraction to solve the limitations of traditional methods in processing complex spatiotemporal data. By introducing the spatiotemporal attention mechanism, STAF can effectively integrate the spatiotemporal features in traffic flow data, overcoming the problem of insufficient feature extraction of traditional methods when processing spatiotemporal data. At the same time, STAF can adapt to the dynamic changes of traffic flow, especially in the face of emergencies and complex traffic scenes, the model can better capture these changes, thereby improving the accuracy of prediction. STAF designs a multi-scale spatiotemporal feature extraction method that can simultaneously consider local and global information, and enhance the model's understanding of traffic flow characteristics at different time scales and spatial scales. In traffic flow prediction, data usually has multivariate heterogeneous characteristics. 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 and deeply explores the spatial heterogeneity of the road network. The gated spatiotemporal attention fusion mechanism is used to capture key, 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 the baseline. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] In order to more clearly illustrate the implementation methods of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the implementation methods or the description of the prior art. Obviously, the drawings in the following description are only exemplary, and for ordinary technicians in this field, other implementation drawings can be derived from the provided drawings without creative work.

[0067] The structures, proportions, sizes, etc. illustrated in this specification are only used to match the contents disclosed in the specification so as to facilitate understanding and reading by persons familiar with the technology. They are not used to limit the conditions under which the present invention can be implemented, and therefore have no substantial technical significance. Any structural modification, change in proportion or adjustment of size shall still fall within the scope of the technical contents disclosed in the present invention without affecting the effects and purposes that can be achieved by the present invention.

[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 structure diagram of the spatiotemporal attention fusion 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 the present application, rather than 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 the present 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 specific implementation of the present invention is further described in detail below in conjunction with the accompanying drawings and examples. The following examples 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) Construct 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 DSGCGRN, each GRU unit is embedded with two dynamic sparse graph convolution blocks and one graph attention block. GRU is responsible for storing and processing time series information, and combined with the advantages of dynamic sparse graph convolution, it can provide insights into spatiotemporal associations and temporal dynamic characteristics.

[0078] Step 5) Feature extraction and fusion: Through the DSGCN module, the model can dynamically update the adjacency matrix to capture the spatial correlation in the traffic network that evolves over time. Combined with the gated temporal attention and spatial attention mechanisms, DSGCGRN can make up for the limitations of capturing abnormal conditions and long-distance information, and enhance the model's understanding of complex spatiotemporal features.

[0079] Step 6) Spatiotemporal Attention Fusion Layer (STAF): This layer combines the 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 contains a temporal multi-head attention block, which is responsible for capturing important features in the time dimension. By weighting the time series data, the model can identify the 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 contains 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 flow between 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 the dynamic changes of time and space at the same time, thereby improving the understanding of complex spatiotemporal features.

[0084] Step 11) The features processed in the above steps 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.

[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 adopts 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 traffic flow data. STFDSGCN has significantly improved results on PEMS04 and PEMS08, and outperforms all baseline methods in most cases. In PEMS04, STFDSGCN improves the MAE and MAPE indicators by 1.5% and 1.26% respectively over the advanced method DSTAGNN. In PEMS08, STFDSGCN improves the state-of-the-art method ST-AE by 5.02% and 2.63% in MAE and RMSE respectively, and improves the ST-AE method by 3.8% in MAPE, which can better predict traffic flow.

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

Claims

1. A traffic flow prediction method based on dynamic sparse graph convolution GRU, characterized in that: 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; 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. S3, 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; 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. According to claim 1, a traffic flow prediction method based on dynamic sparse graph convolution GRU is characterized in that: The method of enhancing the spatiotemporal features by using the input data preprocessing layer in S1 is: taking the traffic flow P = [Xθ-T+1, Xθ-T+2, ..., Xθ]∈RN×C×T as input data, and obtaining the enhanced spatiotemporal feature representation through the processing of the fully connected layer and the convolutional layer, 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.

3. According to claim 1, a traffic flow prediction method based on dynamic sparse graph convolution GRU is characterized in that: The method for constructing the DSGCGRN model in S2 is: S2.

1. Constructing dynamic sparse graph convolution: The DSGCGRN model uses dynamic sparse graph convolution DSGCN to construct an adjacency matrix; the 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 (GRU): In the DSGCGRN model, each GRU is embedded with two dynamic sparse graph convolution blocks and one graph attention block. GRU is responsible for storing and processing time series information. Combining the advantages of dynamic sparse graph convolution, it can provide insights into spatiotemporal correlations and temporal dynamic characteristics. S2.3, Feature extraction and fusion: Through the DSGCN module, the model can dynamically update the adjacency matrix to capture the spatial correlation in the traffic network that evolves over time; combined with the gated temporal attention and spatial attention mechanisms, DSGCGRN can make up for the limitations of capturing abnormal conditions and long-distance information, and enhance the model's understanding of complex spatiotemporal features; S2.

4. Combine the gated recurrent unit GRU with dynamic sparse graph generation.

4. The traffic flow prediction method based on dynamic sparse graph convolution GRU according to claim 1 is characterized in that: The method of processing in S3 by the spatiotemporal attention fusion layer STAF is: 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 contains a temporal multi-head attention block, which is responsible for capturing important features in the time dimension. By weighting the time series data, the model can identify the features that have a greater impact on the prediction results at different time points. S3.

3. Constructing a spatial multi-head attention block SA: At the same time, STAF also contains 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 flow between different locations by weighting the spatial position; 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 consider dynamic changes in time and space simultaneously, thereby improving the understanding of complex spatiotemporal characteristics.

5. The traffic flow prediction method based on dynamic sparse graph convolution GRU according to claim 3 is characterized in that: The method for constructing dynamic sparse graph convolution in S2.1 is: using adaptive node embedding to calculate the adjacency matrix A∈R N×N Then, A is sparsely processed, the first k maximum similarity connections between each node and its neighbor nodes are retained, and normalized with the softmax function 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.

6. The traffic flow prediction method based on dynamic sparse graph convolution GRU according to claim 3 is characterized in that: The method for constructing the gated recurrent unit GRU in S2.2 is: using Chebyshev polynomials to approximate the graph convolution kernel, so as to effectively capture and integrate the complex relationship between the nodes in the graph and their distant neighbors and even the global structure without increasing too much computational cost; thus, the dynamic graph convolution 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 learnable parameters of the model.

7. The traffic flow prediction method based on dynamic sparse graph convolution GRU according to claim 3 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 gating; given a 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: 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-in t )⊙c t +G att Among them (★ G ) represents the graph convolution operation, σ represents the sigmoid activation function, and 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 according to the distance in GAT, M is the dynamic attention coefficient matrix, and W is the learnable weight parameter.

8. The traffic flow prediction method based on dynamic sparse graph convolution GRU according to claim 4 is characterized in that: The method for constructing the temporal multi-head attention block TA in S3.2 is as follows: the temporal dilation gated multi-head self-attention block TA is composed of dilated convolution gating and temporal attention mechanism; firstly, the dilated convolution gating structure is used to dynamically adjust its learning and response to spatiotemporal features, effectively obtain local and global features, and thus more flexibly adapt to sudden changes in traffic conditions; the definition is 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 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; query Q, key K, and value V matrices are derived through a linear layer to obtain the attention score; the expression is 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:

9. The traffic flow prediction method based on dynamic sparse graph convolution GRU according to claim 4 is characterized in that: The method for constructing the spatial multi-head attention block SA in S3.3 is: SA directly uses the output of the dynamic sparse graph convolutional loop network to calculate the query Q, key K and value V matrices to obtain the spatial attention output; pay special attention to applying convolution operations to obtain Q and K, which are 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; the calculation of attention scores and final output results follows multi-head self-attention, as described below: 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 It is the output of the spatiotemporal attention fusion layer.

10. The traffic flow prediction method based on dynamic sparse graph convolution GRU according to claim 4, 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 conversion to generate a predicted future sequence Q∈RN×C×T for regression; in this process, considering that there are usually outliers in the traffic data set caused by sensor failures and other reasons, the L1Loss loss function is used to measure the deviation between the predicted value and the true value. This loss function will not overly amplify the impact of extreme errors and can effectively improve the robustness of the model; the formula is as follows: Loss(y_i,y^_i)=y_i-y^_i.

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 flow prediction model construction method and prediction method based on adaptive dynamic graph

    CN116187555A

  • Multi-modal feature fusion emotion recognition method based on gating cross-attention mechanism

    CN117370828A

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

    CN118116194A

Cited By

  • Traffic flow prediction method and system based on decoupling graph convolution circulation network

    CN119942804A

  • Traffic Flow Prediction Method and System Based on Decoupled Graph Convolutional Recurrent Network

    CN119942804B

  • Intelligent underground water quality supervision method and system

    CN120013706A

  • Traffic prediction method and device based on spatio-temporal feature embedding and gate operation optimization

    CN120014840A

  • Wind power generation power prediction method based on space-time diagram convolution and gating attention

    CN120597214A