Multi-heterogeneous graph neural network construction method for traffic prediction

Through the multi-heterogeneous graph neural network construction method, the traffic pattern structure and high-dimensional spatio-temporal relationship are processed by using the space-time decoupling and node clustering modules to generate a simple sub-graph with space-time fusion relationship, which solves the complex processing of existing models in traffic prediction. The lack of traffic data has achieved more accurate and efficient traffic flow forecasts.

CN119180299AActive Publication Date: 2024-12-24HANGZHOU DIANZI UNIV

Patent Information

Application Number
CN202411180648.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-27
Publication Date
2024-12-24
Estimated Expiration
2044-08-27

AI Technical Summary

Technical Problem

The existing traffic prediction model has shortcomings in dealing with traffic pattern structure, high-dimensional spatiotemporal relationships and heterogeneous multiple graphs, and cannot effectively capture the complex spatiotemporal relationships between nodes and the dynamic changes of different traffic patterns.

Method used

A multi-heterogeneous graph neural network construction method is proposed. Through the space-time decoupling module, node clustering module and dynamic space-time graph generation module, semantic information and high-dimensional features in the traffic network are captured, and a simple sub-graph with space-time fusion relationship is generated. , and feature extraction and weight configuration are performed through gated graph convolution and Hadamama product to finally generate the predicted state.

Benefits of technology

Effectively dealing with heterogeneous multiple graphs, capturing traffic pattern structure and high-dimensional spatiotemporal relationships, improves the accuracy of traffic flow prediction and the generalization ability of the model, and reduces the computational complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119180299A_ABST
    Figure CN119180299A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of traffic flow prediction, and discloses a multi-heterogeneous graph neural network construction method for traffic prediction, which comprises the following steps: step 1, constructing a space-time decoupling module; 2, constructing a node clustering module; step 3, constructing a DSTGG module; step 4, constructing an SIE module; and 5, designing an output and training strategy. The node clustering module provided by the invention has a substantial positive influence in the aspect of traffic flow prediction. The novel space diagram generation mode not only can distribute unique dynamic space-time diagrams for different traffic modes, but also can comprehensively consider the correlation between nodes and the dynamic change between the flows of different traffic modes. The clustering features and the space-time mode in the dynamic fusion subgraph generate substantial positive influence on the aspect of traffic flow prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of traffic flow prediction, and in particular relates to a method for constructing a multi-heterogeneous graph neural network for traffic prediction. Background Art

[0002] The task of traffic forecasting (such as traffic flow forecasting) is to predict future traffic conditions based on historical traffic conditions obtained by sensors. Its reliability and advancement drive the development of traffic planning, intelligent transportation systems, and urban sustainability research. The latest research usually describes traffic forecasting as a spatiotemporal modeling problem, and how to capture the complex dynamic spatiotemporal relationships between nodes has become the main challenge facing traffic forecasting.

[0003] Graph neural networks (GNNs) were introduced to effectively handle the non-uniform topological structure of urban traffic networks. Spatiotemporal graph neural networks (STGNNs) combine GNNs with different temporal learning methods to capture the hidden patterns of spatial irregular signals that change over time, thereby solving the spatiotemporal heterogeneity problem of non-Euclidean urban data. Based on STGNNs capturing traffic features in the spatial dimension of nodes, forward propagation captures temporal dimension features and shows good performance in solving short-term traffic prediction tasks. However, existing models still cannot solve the following problems when constructing spatiotemporal relationships between nodes in graphs:

[0004] (1) Lack of processing of traffic mode structure. Traffic signal characteristics are contributed by multiple traffic modes (such as trucks, passenger cars, and disabled vehicles). Figure 1 Node types with similar traffic patterns are shown to have similar flow (speed) variations, regardless of their physical distance.

[0005] (2) High-dimensional spatiotemporal relationships are not processed. Current methods usually use graph neural networks (GNNs) to aggregate low-dimensional spatial features of traffic or speed, and then use RNNs or TCNs to extract information about temporal features. In fact, real traffic data is dynamic and complex, and each node's spatial area exhibits high-dimensional traffic features with spatiotemporal heterogeneity.

[0006] (3) Lack of processing for heterogeneous multi-graphs. Existing methods usually model non-Euclidean traffic data as simple graphs with a single type of nodes and edges. Real complex traffic data such as Figure 1 As shown, it is a multi-graph with various node and edge types. The traffic flow of nodes of the same type shows similar change trends, and node pairs are connected by two types of edges: time relationship and spatial relationship. Summary of the invention

[0007] The purpose of the present invention is to provide a method for constructing a multi-heterogeneous graph neural network for traffic prediction to solve the above-mentioned technical problems.

[0008] In order to solve the above technical problems, the specific technical solution of a method for constructing a multi-heterogeneous graph neural network for traffic prediction of the present invention is as follows:

[0009] A method for constructing a multi-heterogeneous graph neural network for traffic prediction includes the following steps:

[0010] Step 1: Construct a spatiotemporal decoupling module; first obtain the heterogeneous spatiotemporal feature maps of different traffic modes, and then capture the semantic information and feature representation of each node in the traffic network; then, use a node embedding matrix initialized with learnable parameters To capture the semantic information and feature representation of each node in the transportation network;

[0011] Step 2: Construct a node clustering module; the node clustering module constructs a high-dimensional feature space by inputting p types of traffic mode features to perform node clustering;

[0012] Step 3: Construct the DSTGG module; introduce the STGG Module to model the potential spatiotemporal relationships between the node subsets, and generate a simple subgraph containing spatiotemporal fusion relationships. First, generate a spatial graph:

[0013] Extract the time feature matrix of day and week from the original total traffic features and

[0014] Select features from the time matrix according to the node numbers in the cluster; construct a simple graph containing spatiotemporal heterogeneous information based on the sparse spatial graph and the fused time information matrix; then sparse the spatiotemporal fusion graph to retain only the top-K closest node pairs’ spatiotemporal relationships;

[0015] Step 4: Construct the SIE module; p node clusters and their generated fusion subgraphs are subjected to the gated graph convolution operator to capture spatial dependencies, and then the node information of p clusters is pooled according to the node sequence S T Perform sorting regression, capture temporal patterns through the gated recurrent unit of RNN, extract and learn features through the local receptive field of Conv2d, and finally configure the weights of multi-scale spatiotemporal information through the Hadamard product of the learnable parameter matrix;

[0016] Step 5: Design output and training strategies: skip connections for important information flows within the model. Then, a regression layer is formed through full connection and two-dimensional convolution to generate the predicted state. Given the true value We optimize the model by calculating the loss using MAE.

[0017] Furthermore, the step 1 includes the following specific steps:

[0018] Introduced in STD Module the total traffic flow input The daily and weekly periodic feature matrix extracted from These features are continuous real-valued vectors transformed by two randomly initialized learnable slot embedding matrices, thus using the matrix and represents the temporal features of node i at time step t; then, a node embedding matrix initialized with learnable parameters is used To capture the semantic information and feature representation of each node in the traffic network, the feature representation at node i is The original traffic flow The weighted segmentation into P traffic mode characteristics formula is as follows:

[0019]

[0020] in W E ∈R C×D Map the original traffic to a higher-dimensional hidden dimension D, and W2∈R d×1 The high-dimensional spatiotemporal features are mapped to low-dimensional space with semantic preservation, and nonlinear activation functions ReLU and Sigmoid are introduced to increase the model's expressiveness to obtain Ω (t,i) ,Ω (t,i) The output represents the ratio of the specific traffic pattern of node i to the total traffic at time step t. The weight matrix is ​​converted into Broadcast to traffic All channels of the nth traffic mode feature space are obtained, and finally the flow characteristics of the first p-1 traffic modes are subtracted from the original flow to obtain the residual flow characteristics. Furthermore, the step 2 includes the following steps:

[0021] First, construct a clustering feature space based on the input p traffic modes:

[0022]

[0023] Among them, W i ∈R D×1 , i = 1, 2…p, maps the rich high-dimensional features to one dimension, and then T h The traffic mode characteristics of the step time window are connected and divided element by element with the embedded flow to obtain To T h The time step is averaged and pooled to obtain the ratio tensor R∈R N×P, then find the maximum value of R in P dimensions and record it as the limit particle matrix C∈R P , the limiting particle C p It represents the maximum limit state of the original traffic characteristics occupied by characteristic p.

[0024]

[0025] T i =argmin(D i ),i∈S T

[0026] Calculate the Euclidean distance matrix D∈R between the characteristic tensor R and the limit particle C in the P-dimensional space N×P , the type of node i is T i ∈R 1 That is, the type of limiting particle with the closest Euclidean distance, and i is placed in type T i The node sequence pool S T It is used for subsequent node homing. The time complexity of this clustering algorithm is O(N).

[0027] Furthermore, the step three includes the following specific steps:

[0028] First, generate a spatial map, the calculation formula is as follows:

[0029]

[0030] Node Embedding Matrix and represents the node embedding matrix randomly initialized for cluster P, and Represents the parameter matrix of the fully connected layer, α is the parameter for adjusting the saturation rate, and the activation function and subtraction term are regularized to generate an adjacency matrix containing the spatial relationship of cluster p Extract the time feature matrix of day and week from the original total traffic features and Select features from the time matrix according to the node number in the cluster, and then fuse the time information to construct the matrix:

[0031]

[0032] in, Capturing the periodic time characteristics of days and weeks, average pooling and nonlinear changes are used to obtain T in cluster p h Node pair time information matrix fused within the time window Construct a simple graph containing spatiotemporal heterogeneous information based on the sparse spatial graph and the fused temporal information matrix:

[0033]

[0034] Among them, β is a learnable saturation adjustment factor, tanh and ReLU in the temporal and spatial graphs limit the edge weights to the range of [0,1], and then the spatiotemporal fusion graph is sparsely constructed to retain only the top-K nearest node pairs’ spatiotemporal relationships to reduce the computational complexity.

[0035] Furthermore, the step 4 includes the following specific steps:

[0036] The MHGNet model introduces a gating mechanism in the graph convolution operation:

[0037]

[0038]

[0039] In the formula, is the adjacency matrix with self-connection, the degree matrix satisfy k represents the propagation depth, and the parameter γ represents the input nodes H that need to be retained during node update. p ratio to ensure the preservation of local features and the convenience of in-depth exploration,

[0040]

[0041]

[0042] Among them, X h is the result of the sub-graph convolution in a disrupted order, S N is a continuous sequence from 0 to N, S T It is the node sequence pool generated in NodeClusterer. The node order is regressed through Sort Module, and then the long-term time dependency is captured through RNN.

[0043]

[0044]

[0045] Model T c The inputs of the time steps are stacked together to form the output tensor

[0046]

[0047] The spatiotemporal information extracted from the subgraph is weighted by two-dimensional convolution and a learnable parameter matrix W:

[0048]

[0049] Where W∈R N×(M×D) The feature map after dimensionality reduction by two-dimensional convolution is weighted by different channels to improve the generalization ability of the model.

[0050] Furthermore, the step five includes the following specific steps:

[0051] Jump connections between important information flows within the model:

[0052] H={H out ||X out ||X in ||T D ||T W}

[0053] The obtained tensor H is input into the regression layer to integrate the features and perform nonlinear transformation to obtain the predicted state

[0054]

[0055] Given the true value The formula we use to optimize the model by calculating the loss through MAE is as follows:

[0056]

[0057] Furthermore, the step six includes the following specific steps:

[0058] The datasets PEMS03, PEMS04, PEMS07 and PEMS08 are divided into training, validation and test sets in a ratio of 6:2:2. The model is trained using the Adam optimization algorithm, with a weight decay wdecay of 1.0e-5 and an epsilon of 1.0e-8. The learning rate scheduler is used to automatically adjust the learning rate with a decay rate of 0.5. A warm-up strategy is used in the initial 20 training cycles, followed by course learning, where the course learning length increases every three cycles until it reaches 12, with the patience value set to 100. The model-related parameters on the four datasets include the node embedding dimension N, the time embedding dimension D, the top-k dimensions k_s and k_t of the spatial and temporal adjacency matrices, and the number of decoupled traffic modes G. The performance of all baseline models is evaluated using the three indicators of MAE, RMSE and MAPE in traffic prediction, as follows:

[0059]

[0060] Among them, MAE reflects the prediction accuracy, RMSE is sensitive to large errors, and MAPE pays more attention to relative errors. i represents the i-th predicted value, and Ω represents the length of the predicted sequence.

[0061] The method for constructing a multi-heterogeneous graph neural network for traffic prediction of the present invention has the following advantages:

[0062] 1. Propose a new method for decoupling spatiotemporal information:

[0063] This paper proposes a new method for decoupling time and space information. This method uses the similarity adjacency matrix generated by temporal embedding and the spatial graph generated by spatial information embedding, combined with a node embedding matrix initialized with learnable parameters to capture the semantic information and feature representation of each node in the traffic network, broadcasts the weight matrix to all channels of the traffic through the Hadamard product, obtains the feature space of a specific traffic mode, and finally subtracts the previous traffic mode flow characteristics from the original traffic to obtain the residual traffic characteristics.

[0064] 2. Propose a new node clustering module:

[0065] This paper proposes a new node clustering module. By inputting p types of traffic mode features to construct a high-dimensional feature space for node clustering. This method effectively processes heterogeneous multi-graphs. A large number of ablation experiments show that our node clustering module has a substantial positive impact on traffic flow prediction.

[0066] 3. Propose a novel way to generate space-time graphs:

[0067] This paper proposes a novel way to generate a spatial graph, which uses the similarity adjacency matrix generated by temporal embedding and the spatial graph generated by embedding spatial information to form a highly adaptable spatiotemporal graph. This method can not only assign unique dynamic spatiotemporal graphs to different traffic modes, but also comprehensively consider the correlation between nodes and the dynamic changes between traffic flows of different traffic modes.

[0068] 4. Propose a new clustering feature and a way to dynamically fuse spatiotemporal patterns in subgraphs:

[0069] This paper proposes a new clustering feature and a method for spatiotemporal patterns in dynamic fusion subgraphs. The core of this method is how to capture the spatiotemporal features of clusters and balance the multi-scale information. The p node clusters and the fusion subgraphs generated by them are subjected to the gated graph convolution operator to capture the spatial dependency. Then the node information of the p clusters is pooled according to the node sequence S. T We perform sorting regression, capture temporal patterns through the gated recurrent units of RNN, extract and learn features through local receptive fields, and finally weight the multi-scale spatiotemporal information through the Hadamard product of the learnable parameter matrix. A large number of ablation experiments show that our clustering features and the way of dynamically fusion spatiotemporal patterns in subgraphs have a substantial positive impact on traffic flow prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] Figure 1 This is a model architecture diagram of the present invention.

[0071] Figure 2 It is a schematic diagram of the node clustering module of the present invention.

[0072] Figure 3 Schematic diagram of the SIE module of the present invention. DETAILED DESCRIPTION

[0073] In order to better understand the purpose, structure and function of the present invention, the following is a further detailed description of a method for constructing a multi-heterogeneous graph neural network for traffic prediction in accordance with the present invention in conjunction with the accompanying drawings.

[0074] For problems one and two, the model MHGNet designed a Spatiotemporal Decoupling Module to decouple single traffic data into multi-modal traffic data through feature mapping of timestamp embedding matrix and node embedding matrix, and capture dynamic high-dimensional spatiotemporal information in traffic mode structure. For problem three, a node clusterer is used, which clusters nodes by calculating the Euclidean distance between nodes and different types of extreme particles in high-dimensional feature space, and saves the node sequence number in the node sequence pool. The dynamic spatiotemporal graph generation module generates a dynamic spatiotemporal simple subgraph with weighted spatiotemporal relationship fusion for each node cluster, and performs small simple isomorphic graph convolution operations on large complex multi-heterogeneous graphs, which can effectively reduce time complexity and reduce the use of computing resources. Finally, we regress the node features after subgraph convolution through the clustered node sequence number of the node sequence pool, adjust the weights of subgraph convolution results of different scales by two-dimensional convolution and learnable parameter matrix, and aggregate the output results to iteratively update the sequence dependency.

[0075] In order to effectively handle the traffic pattern structure and fully consider the high-dimensional spatiotemporal relationship and the processing of heterogeneous multi-graphs, we proposed a spatiotemporal modeling method for multiple heterogeneous graphs for traffic prediction, decoupled the low-dimensional traffic data and mapped it into a high-dimensional feature space, and used a node clusterer and a dynamic spatiotemporal generation graph module to convert the heterogeneous multi-graph into a simple isomorphic graph. A subgraph information extraction module was designed for gated spatiotemporal information extraction of subgraphs and weight adjustment of convolutional blocks of different scales, and the positions of clustered nodes after information extraction were regressed to the original positions.

[0076] In order to capture the high-dimensional spatiotemporal relationship of different traffic mode structures, this paper proposes a multi-heterogeneous graph neural network for traffic prediction. First, a new spatiotemporal decoupling module is proposed, then a new node clustering module is proposed, and a novel spatiotemporal graph generation method is proposed. Finally, a new clustering feature and a method of dynamically fusing spatiotemporal patterns in subgraphs are proposed.

[0077] In order to achieve the above-mentioned invention object, the present invention adopts the following technical solutions:

[0078] Step 1: Construct a spatiotemporal decoupling module.

[0079] When solving the problem of modeling the spatiotemporal relationship of traffic modes, we introduced a spatiotemporal decoupling module, whose goal is to decouple low-dimensional traffic flow data into p types of traffic mode data and increase the feature dimension.

[0080] In order to obtain the heterogeneous spatiotemporal feature maps of different traffic modes, we introduced the total traffic flow input in STD Module. The daily and weekly periodic feature matrix extracted from These features are continuous real-valued vectors transformed by two randomly initialized learnable slot embedding matrices, thus using the matrix and represents the temporal features of node i at time step t. Then, we use a node embedding matrix initialized with learnable parameters To capture the semantic information and feature representation of each node in the traffic network, the feature representation at node i is For the original traffic flow The weighted segmentation into P traffic mode characteristics formula is as follows:

[0081]

[0082] in W E ∈R C×D Map the original traffic to a higher-dimensional hidden dimension D, and W2∈R d×1 The high-dimensional spatiotemporal features are mapped to low-dimensional space with semantic preservation, and nonlinear activation functions ReLU and Sigmoid are introduced to increase the model's expressiveness to obtain Ω (t,i) ,Ω (t,i) The output represents the ratio of the specific traffic pattern of node i to the total traffic at time step t. The weight matrix is ​​converted into Broadcast to traffic All channels of the nth traffic mode feature space are obtained, and finally the flow characteristics of the first p-1 traffic modes are subtracted from the original flow to obtain the residual flow characteristics.

[0083] Step 2: Build a node clustering module.

[0084] like Figure 2As shown in the figure, the node clustering module constructs a high-dimensional feature space by inputting p types of traffic mode features for node clustering. There are two challenges in this step: (1) how to select appropriate clusters based on the p types of node features; (2) the time complexity of traditional clustering algorithms increases exponentially with the number of nodes N. How to reduce the time complexity?

[0085] First, construct a clustering feature space based on the input p traffic modes:

[0086]

[0087] C j =Max(R j ),j=1,2,…,p

[0088] Among them, W i ∈R D×1 , i = 1, 2…p, maps the rich high-dimensional features to one dimension, and then T h The traffic mode characteristics of the step time window are connected and divided element by element with the embedded flow to obtain To T h The time step is averaged and pooled to obtain the ratio tensor R∈R N×P , then find the maximum value of R in P dimensions and record it as the limit particle matrix C∈R P , the limiting particle C p It represents the maximum limit state of the original traffic characteristics occupied by characteristic p.

[0089] D i,j =|R i,j -C j |,j=1,2,…,p

[0090] T i =argmin(D i ),i∈S T

[0091] Calculate the Euclidean distance matrix D∈R between the characteristic tensor R and the limit particle C in the P-dimensional space N×P , the type of node i is T i ∈R 1 That is, the type of limiting particle with the closest Euclidean distance, and i is placed in type T i The node sequence pool S T In, it is used for subsequent node homing. The time complexity of this clustering algorithm is O(N), which greatly saves computing resources compared with traditional clustering algorithms.

[0092] Step 3: Build the DSTGG module

[0093] We introduced the STGG Module to model the potential spatiotemporal relationships between pairs of node subsets and generate a simple subgraph containing spatiotemporal fusion relationships. First, we apply an effective way to generate a spatial graph, and the calculation formula is as follows:

[0094]

[0095] Node Embedding Matrix and represents the node embedding matrix randomly initialized for cluster P, and Represents the parameter matrix of the fully connected layer, α is the parameter for adjusting the saturation rate, and the activation function and subtraction term are regularized to generate an adjacency matrix containing the spatial relationship of cluster p

[0096] The key step in constructing a time graph is how to capture the temporal relationship between node pairs and form a dynamic time graph. We extract the time feature matrix of the day and week from the original total traffic features. and Select features from the time matrix according to the node number in the cluster, and then fuse the time information to construct the matrix:

[0097]

[0098] in, Capturing the periodic time characteristics of days and weeks, average pooling and nonlinear changes are used to obtain T in cluster p h Node pair time information matrix fused within the time window Construct a simple graph containing spatiotemporal heterogeneous information based on the sparse spatial graph and the fused temporal information matrix:

[0099]

[0100]

[0101] Among them, β is a learnable saturation adjustment factor, tanh and ReLU in the temporal and spatial graphs limit the edge weights to the range of [0,1], and then the spatiotemporal fusion graph is sparsely constructed to retain only the top-K nearest node pairs’ spatiotemporal relationships to reduce the computational complexity.

[0102] Step 4: Build the SIE module

[0103] like Figure 3As shown in Figure 1, we introduced the SIE Module to capture the spatiotemporal patterns in clustering features and dynamic fusion subgraphs. The core of the SIE Module is how to capture the spatiotemporal features of clustering and balance the multi-scale information. The p node clusters and their generated fusion subgraphs are passed through the gated graph convolution operator to capture the spatial dependencies. Then the node information of the p clusters is pooled according to the node sequence S. T Sorting regression is performed, the temporal pattern is captured by the gated recurrent unit of RNN, Conv2d performs feature extraction and learning through the local receptive field, and finally the multi-scale spatiotemporal information is weighted by the Hadamard product of the learnable parameter matrix.

[0104] In order to achieve information control and learn long-term dependencies, the MHGNet model introduces a gating mechanism in the graph convolution operation:

[0105]

[0106] In the formula, is the adjacency matrix with self-connection, the degree matrix satisfy k represents the propagation depth, and the parameter γ represents the input nodes H that need to be retained during node update. p proportions to ensure preservation of local features and convenience of in-depth exploration.

[0107]

[0108] Among them, X h is the result of the sub-graph convolution in a disrupted order, S N is a continuous sequence from 0 to N, S T It is the node sequence pool generated in NodeClusterer. The node order is regressed through Sort Module, and then the long-term time dependency is captured through RNN.

[0109]

[0110] Model T c The inputs of the time steps are stacked together to form the output tensor

[0111]

[0112] The spatiotemporal information extracted from the subgraph is weighted by two-dimensional convolution and a learnable parameter matrix W:

[0113]

[0114] Where W∈R N×(M×D)The feature map after dimensionality reduction by two-dimensional convolution is weighted by different channels to improve the generalization ability of the model.

[0115] Step 5: Design output and training strategies

[0116] We skip the important information flows within the model:

[0117] H={H out ||X out ||X in ||T D ||T W}

[0118] The obtained tensor H is input into the regression layer to integrate the features and perform nonlinear transformation to obtain the predicted state

[0119]

[0120] Given the true value The formula we use to optimize the model by calculating the loss through MAE is as follows:

[0121]

[0122] Step 6: Model training

[0123] The experiments were conducted on a system equipped with an NVIDIA GeForce RTX 4090 GPU. The datasets PEMS03, PEMS04, PEMS07, and PEMS08 were split into training, validation, and test sets in a ratio of 6:2:2. The model was trained using the Adam optimization algorithm with a weight decay (wdecay) of 1.0e-5 and an epsilon (eps) of 1.0e-8. In addition, a learning rate scheduler was used to automatically adjust the learning rate with a decay rate of 0.5. A warm-up strategy was used in the initial 20 training epochs, followed by a curriculum learning strategy where the course length was increased every three epochs until it reached 12. An early stopping mechanism was used to prevent overfitting, where the patience value was set to 100. The relevant configurations of the model parameters on the four datasets are shown in Table 2, including the node embedding dimension N, the temporal embedding dimension D, the spatial and temporal adjacency matrix top-k dimensions k_s and k_t, and the number of decoupled traffic modes G.

[0124] We used three commonly used metrics in traffic prediction to evaluate the performance of all baseline models: (1) MAE (mean absolute error), (2) root mean square error (RMSE), and (3) mean absolute percentage error (MAPE), as follows:

[0125]

[0126] Among them, MAE reflects the prediction accuracy, RMSE is sensitive to large errors, and MAPE pays more attention to relative errors. i represents the i-th predicted value, Ω represents the length of the predicted sequence, and in our experiment Ω = 12.

[0127] Step 7: Experimental results

[0128] The following table shows the comparison of mean absolute error (MAE), root mean square error (RMSE) and mean absolute percentage error (MAPE) of all methods on four datasets.

[0129]

[0130] From this we can draw the following conclusions:

[0131] (1) Non-graphical models such as FC-LSTM and DSANet only use deep learning methods to capture temporal features from traffic data, ignoring the spatial correlation in the traffic network, and the effect is poor.

[0132] (2) Graph-based algorithms such as GraphWaveNet perform well, which proves the effectiveness of graphs. However, DCRNN is limited in expressing the correlation between nodes by using a predefined graph to capture spatial features. In contrast, STGODE and STG-NCD proposed ODE and NCDE to increase their spatial receptive fields. However, they failed to mine global spatial correlations and were therefore inferior to DSTAGNN in terms of performance.

[0133] (3) Except for the MAPE indicator on the PEMS03 dataset, our MHGNet achieved the best results on other indicators of the four datasets, proving that the spatiotemporal fusion graph generated by our MHGNet using periodic features and spatial embedding has a good ability to capture global spatiotemporal features and performs well on different datasets.

[0134] It is to be understood that the present invention is described by some embodiments, and it is known to those skilled in the art that various changes or equivalent substitutions may be made to these features and embodiments without departing from the spirit and scope of the present invention. In addition, under the teachings of the present invention, these features and embodiments may be modified to adapt to specific circumstances and materials without departing from the spirit and scope of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application are within the scope of protection of the present invention.

Claims

1. A method for constructing a multi-heterogeneous graph neural network for traffic prediction, characterized in that: The steps include: Step 1: Construct a spatiotemporal decoupling module; first obtain the heterogeneous spatiotemporal feature maps of different traffic modes, and then capture the semantic information and feature representation of each node in the traffic network; Then, using a node embedding matrix initialized with learnable parameters To capture the semantic information and feature representation of each node in the transportation network; Step 2: Construct a node clustering module; the node clustering module constructs a high-dimensional feature space by inputting p types of traffic mode features to perform node clustering; Step 3: Construct DSTGG module; introduce STGG Module to model the potential spatiotemporal relationship between pairs of node subsets and generate a simple subgraph containing spatiotemporal fusion relationships. First, generate a spatial graph: extract the time feature matrix of the day and week from the original total traffic features and Select features from the time matrix based on the node number in the cluster; A simple graph containing spatiotemporal heterogeneous information is constructed based on the sparse spatial graph and the fused temporal information matrix. Then the spatiotemporal fusion graph is sparsed to retain only the top-K closest node pairs’ spatiotemporal relationships. Step 4: Construct the SIE module; p node clusters and their generated fusion subgraphs are subjected to the gated graph convolution operator to capture spatial dependencies, and then the node information of p clusters is pooled according to the node sequence S T Perform sorting regression, capture temporal patterns through the gated recurrent unit of RNN, extract and learn features through the local receptive field of Conv2d, and finally configure the weights of multi-scale spatiotemporal information through the Hadamard product of the learnable parameter matrix; Step 5: Design output and training strategies: skip connections for important information flows within the model. Then, a regression layer is formed through full connection and two-dimensional convolution to generate the predicted state. Given the true value We optimize the model by calculating the loss using MAE.

2. The method for constructing a multi-heterogeneous graph neural network for traffic prediction according to claim 1, characterized in that: The step 1 includes the following specific steps: Introduced in STD Module from total traffic flow input The daily and weekly periodic feature matrix extracted from These features are continuous real-valued vectors transformed by two randomly initialized learnable slot embedding matrices, thus using the matrix and represents the time characteristics of node i at time step t; Then, using a node embedding matrix initialized with learnable parameters To capture the semantic information and feature representation of each node in the traffic network, the feature representation at node i is For the original traffic flow The weighted segmentation into P traffic mode characteristics formula is as follows: in W E ∈R C×D Map the original traffic to a higher-dimensional hidden dimension D, and W2∈R d×1 The high-dimensional spatiotemporal features are mapped to low-dimensional space with semantic preservation, and nonlinear activation functions ReLU and Sigmoid are introduced to increase the model's expressiveness to obtain Ω (t,i) ,Ω (t,i) The output represents the ratio of the specific traffic pattern of node i to the total traffic at time step t. The weight matrix is ​​converted into Broadcast to traffic All channels of the nth traffic mode feature space are obtained, and finally the flow characteristics of the first p-1 traffic modes are subtracted from the original flow to obtain the residual flow characteristics.

3. The method for constructing a multi-heterogeneous graph neural network for traffic prediction according to claim 1, characterized in that: The step 2 comprises the following steps: First, construct a clustering feature space based on the input p traffic modes: C j =Max(R j ),j=1,2,…,p Among them, W i ∈R D×1 , i = 1, 2…p, maps the rich high-dimensional features to one dimension, and then T h The traffic mode characteristics of the step time window are connected and divided element by element with the embedded flow to obtain To T h The time step is averaged and pooled to obtain the ratio tensor R∈R N×P , then find the maximum value of R in P dimensions and record it as the limit particle matrix C∈R P , the limiting particle C p It represents the maximum limit state of the original traffic characteristics occupied by characteristic p. D i,j =|R i,j -C j |,j=1,2,…,p T i =argmin(D i ),i∈S T Calculate the Euclidean distance matrix D∈R between the characteristic tensor R and the limit particle C in the P-dimensional space N×P , the type of node i is T i ∈R 1 That is, the type of limiting particle with the closest Euclidean distance, and i is placed in type T i The node sequence pool S T It is used for subsequent node homing. The time complexity of this clustering algorithm is O(N).

4. The method for constructing a multi-heterogeneous graph neural network for traffic prediction according to claim 1, characterized in that: The step three includes the following specific steps: First, generate a spatial map, the calculation formula is as follows: Node Embedding Matrix and represents the node embedding matrix randomly initialized for cluster P, and Represents the parameter matrix of the fully connected layer, α is the parameter for adjusting the saturation rate, and the activation function and subtraction term are regularized to generate an adjacency matrix containing the spatial relationship of cluster p Extract the time feature matrix of day and week from the original total traffic features and Select features from the time matrix according to the node number in the cluster, and then fuse the time information to construct the matrix: in, Capturing the periodic time characteristics of days and weeks, average pooling and nonlinear changes are used to obtain T in cluster p h Node pair time information matrix fused within the time window Construct a simple graph containing spatiotemporal heterogeneous information based on the sparse spatial graph and the fused temporal information matrix: Among them, β is a learnable saturation adjustment factor, and the tanh and ReLU of the temporal graph and the spatial graph limit the edge weights to the range of [0,1]. Then, the spatiotemporal fusion graph is sparsely constructed, retaining only the top-K nearest node pairs’ spatiotemporal relationships to reduce the computational complexity.

5. The method for constructing a multi-heterogeneous graph neural network for traffic prediction according to claim 1, characterized in that: The step 4 includes the following specific steps: The MHGNet model introduces a gating mechanism in the graph convolution operation: In the formula, is the adjacency matrix with self-connection, the degree matrix satisfy k represents the propagation depth, and the parameter γ represents the input nodes H that need to be retained during node update. p ratio to ensure the preservation of local features and the convenience of in-depth exploration, Among them, X h is the result of the sub-graph convolution in a disrupted order, S N is a continuous sequence from 0 to N, S T It is the node sequence pool generated in Node Clusterer. The node order is regressed through Sort Module, and then the long-term time dependency is captured through RNN. Model T c The inputs of the time steps are stacked together to form the output tensor The spatiotemporal information extracted from the subgraph is weighted by two-dimensional convolution and a learnable parameter matrix W: Where W∈R N×(M×D) The feature map after dimensionality reduction by two-dimensional convolution is weighted by different channels to improve the generalization ability of the model.

6. The method for constructing a multi-heterogeneous graph neural network for traffic prediction according to claim 1, characterized in that: The step five includes the following specific steps: Jump connections between important information flows within the model: H={H out ||X out ||X in ||T D ||T W } The obtained tensor H is input into the regression layer to integrate the features and perform nonlinear transformation to obtain the predicted state Given the true value The formula we use to optimize the model by calculating the loss through MAE is as follows:

7. The method for constructing a multi-heterogeneous graph neural network for traffic prediction according to claim 1, characterized in that: The step six includes the following specific steps: The datasets PEMS03, PEMS04, PEMS07 and PEMS08 are divided into training, validation and test sets in a ratio of 6:2:

2. The model is trained using the Adam optimization algorithm, with a weight decay wdecay of 1.0e-5 and an epsilon of 1.0e-8. The learning rate scheduler is used to automatically adjust the learning rate with a decay rate of 0.

5. A warm-up strategy is used in the initial 20 training cycles, followed by course learning, where the course learning length increases every three cycles until it reaches 12, with the patience value set to 100. The model-related parameters on the four datasets include the node embedding dimension N, the time embedding dimension D, the top-k dimensions k_s and k_t of the spatial and temporal adjacency matrices, the number of decoupled traffic modes G, The performance of all baseline models is evaluated using the MAE, RMSE, and MAPE indicators in traffic prediction. The formula is as follows: Among them, MAE reflects the prediction accuracy, RMSE is sensitive to large errors, and MAPE pays more attention to relative errors. i represents the i-th predicted value, and Ω represents the length of the predicted sequence.

Citation Information

Patent Citations

  • Traffic flow prediction method and system based on residual connection and space-time decomposition

    CN116596138A

  • Space-time heterogeneous decoupling method based on multi-mode traffic flow prediction

    CN117558125A

  • Traffic flow forecasting method based on multi-mode dynamic residual graph convolution network

    US20230334981A1

  • Framework for multi-input, multi-output graph neural networks for heterogeneous graphs

    US20240273289A1

Cited By

  • Broadcast radio positioning system near-far effect elimination method, storage medium and terminal equipment

    CN120214842A

  • Method for eliminating near-far effect of broadcast radio positioning system, storage medium and terminal device

    CN120214842B