A multi-heterogeneous graph neural network construction method for traffic prediction
By constructing a multi-heterogeneous graph neural network, the problem of handling traffic pattern structure and high-dimensional spatiotemporal relationships in traffic prediction is solved, and the effective processing of heterogeneous multigraphs is achieved, improving the accuracy and efficiency of traffic prediction.
Patent Information
- Application Number
- CN202411180648.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2044-08-27
AI Technical Summary
Existing traffic prediction models are unable to effectively handle traffic pattern structures, lack the ability to handle high-dimensional spatiotemporal relationships, and lack the ability to handle heterogeneous multigraphs, resulting in poor performance in urban traffic data prediction.
A multi-heterogeneous graph neural network is constructed. The spatiotemporal decoupling module captures the semantic information and feature representation of nodes, the node clustering module constructs a high-dimensional feature space, the DSTGG module generates simple subgraphs with spatiotemporal fusion relationships, and the SIE module captures spatial dependencies and temporal patterns. Gated graph convolution and RNN are used for feature extraction and learning, and finally, the predicted state is generated through a regression layer.
It improves the accuracy and efficiency of traffic forecasting, effectively handles heterogeneous multigraphs and high-dimensional spatiotemporal relationships, and enhances the model's generalization ability and computational efficiency.
Smart Images

Figure CN119180299B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of traffic flow prediction technology, and in particular relates to a method for constructing a multi-heterogeneous graph neural network for traffic prediction. Background Technology
[0002] Traffic forecasting (such as traffic flow forecasting) aims to predict future traffic conditions based on historical traffic data obtained from sensors. Its reliability and sophistication drive the development of research in traffic planning, intelligent transportation systems, and urban sustainability. Recent research often describes traffic forecasting as a spatiotemporal modeling problem, and capturing the complex dynamic spatiotemporal relationships between nodes has become a major challenge in traffic forecasting.
[0003] Graph Neural Networks (GNNs) have been introduced to effectively handle the non-uniform topology of urban traffic networks. Spatiotemporal Graph Neural Networks (STGNNs) combine GNNs with different temporal learning methods to capture the hidden patterns of spatially irregular signals that vary over time, thus addressing the spatiotemporal heterogeneity problem of non-Euclidean urban data. Based on STGNNs capturing traffic features in the spatial dimension of nodes, forward propagation captures features in the temporal dimension, demonstrating 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 the graph:
[0004] (1) Lack of processing of traffic mode structure. Traffic signal characteristics are contributed by multiple traffic modes (such as trucks, passenger cars, disabled vehicles, etc.), such as Figure 1 The node types shown have similar traffic patterns and similar flow (speed) variations, independent of physical spatial distance.
[0005] (2) It does not address high-dimensional spatiotemporal relationships. Current methods typically use graph neural networks (GNNs) to aggregate low-dimensional spatial features of flow or speed, and then use RNNs or TCNs to extract temporal features. In reality, real traffic data is dynamic and complex, with each node exhibiting high-dimensional traffic features that are spatiotemporally heterogeneous within its spatial region.
[0006] (3) Lack of processing for heterogeneous multigraphs. Existing methods typically model non-Euclidean traffic data as simple graphs with a single type of node and edge, while real-world complex traffic data, such as... Figure 1 As shown, this is a multigraph with various node and edge types. The traffic flow of nodes of the same type shows similar trends, and the nodes are connected by edges of two types: time relationship and spatial relationship. Summary of the Invention
[0007] The purpose of this invention is to provide a method for constructing a multi-heterogeneous graph neural network for traffic prediction, so as to solve the above-mentioned technical problems.
[0008] To address the aforementioned technical problems, the present invention provides a specific technical solution for constructing a multi-heterogeneous graph neural network for traffic prediction, 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 mappings of different traffic modes; second, capture the semantic information and feature representation of each node in the traffic network; then, utilize 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 in order to perform node clustering;
[0012] Step 3: Construct the DSTGG module; introduce the STGG Module to model the potential spatiotemporal relationships between pairs of node subsets, generating a simple subgraph containing spatiotemporal fusion relationships. First, generate the spatial graph:
[0013] Extract daily and weekly time feature matrices from the original total traffic features. and
[0014] Features are selected from the temporal matrix based on the node numbers in the clusters; a simple graph containing spatiotemporal heterogeneous information is constructed based on the sparsified spatial graph and the fused temporal information matrix; then the spatiotemporal fusion graph is sparsified, retaining only the spatiotemporal relationships of the Top-K nearest node pairs;
[0015] Step 4: Construct the SIE module; the p-node clusters and their generated fused subgraphs are processed by a gated graph convolution operator to capture spatial dependencies, and then the node information of the p-clusters is pooled according to the node sequence S. T Ranking regression is performed, and the time pattern is captured by the gated recurrent unit of RNN. Conv2d extracts and learns features through the local receptive field. Finally, the multi-scale spatiotemporal information is weighted by the Hadamard product of the learnable parameter matrix.
[0016] Step 5: Design Output and Training Strategies: Skip connections to connect the important information streams within the model. The skip connections yield... Then, a regression layer is formed using fully connected layers and two-dimensional convolutions to generate the predicted state. Given the true value We use MAE to calculate the loss and optimize the model.
[0017] Furthermore, step one includes the following specific steps:
[0018] Introduce the total traffic flow input into the STD Module. Extracted daily and weekly periodic feature matrices These features are continuous real-valued vectors transformed from two randomly initialized learnable time-slot embedding matrices, thus using matrices. and Let represent the temporal features of node i at time step t; then, use a node embedding matrix initialized with learnable parameters. To capture the semantic information and feature representation of each node in the traffic network, where the feature representation at node i is: For the original traffic flow The formula for weighted segmentation into P types of traffic mode features 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 By semantically preserving high-dimensional spatiotemporal features and mapping them to a low-dimensional space, and then introducing nonlinear activation functions ReLU and Sigmoid to enhance the model's expressive power, we obtain Ω. (t,i) Ω (t,i) This represents the output of the proportion of a specific flow pattern of node i relative to the total flow at time step t, expressed as a weight matrix obtained through Hadamard product. Broadcast to traffic For all channels, obtain the feature space of the nth traffic mode. Finally, subtract the traffic flow features of the first p-1 traffic modes from the original traffic flow to obtain the remaining traffic flow features. Furthermore, step two includes the following steps:
[0021] First, construct a clustering feature space based on the input p types of traffic modes:
[0022]
[0023] Among them, W i ∈R D×1 For i = 1, 2, ..., p, the rich high-dimensional features are mapped to one dimension, and then T is... h Connecting the traffic pattern features within a time window and dividing them element-wise by the embedded traffic flow yields the result. For T h Average pooling is performed at time steps to obtain the ratio tensor R∈R N×PThen find the maximum value of R in P dimensions and denote it as the limiting particle matrix C∈R. P Limiting particle C p This represents the maximum limit state of the original traffic features represented by feature 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 limiting particle C in P-dimensional space. N×P The types of node i, T i ∈R 1 This refers to the type of limiting particle with the closest Euclidean distance, where i is placed in type T. i Node sequence pool S T In the middle, it is used for subsequent node placement, and the time complexity of this clustering algorithm is O(N).
[0027] Furthermore, step three includes the following specific steps:
[0028] First, generate the spatial map using the following calculation formula:
[0029]
[0030] Node embedding matrix and This represents the node embedding matrix randomly initialized for cluster P. and The parameter matrix represents the fully connected layer, where α is a parameter that adjusts the saturation rate. The activation function and subtraction terms are regularized to generate an adjacency matrix containing the p-space relationships of the clusters. Extract daily and weekly time feature matrices from the original total traffic features. and Features are selected from the time matrix based on the node numbers in the clusters, and then the time information is fused to construct a matrix:
[0031]
[0032] in, By capturing the periodic temporal features of day and week, average pooling and nonlinear transformation are used to obtain clusters p in T. h Node-to-time information matrix fused within the time window A simplified graph containing spatiotemporal heterogeneous information is constructed based on the sparsed spatial graph and the fused temporal information matrix:
[0033]
[0034] β is a learnable saturation adjustment factor. The temporal and spatial graphs tanh and ReLU restrict the edge weights to the range [0,1]. Then, the spatiotemporal fusion graph is sparsified, retaining only the spatiotemporal relationships of the Top-K nearest nodes to reduce computational complexity.
[0035] Furthermore, step four includes the following specific steps:
[0036] The MHGNet model introduces a gating mechanism in graph convolution operations:
[0037]
[0038]
[0039] In the formula, It is an adjacency matrix with self-connection, and a degree matrix. satisfy k represents the propagation depth, and the parameter γ represents the input node H that needs to be retained during node updates. p The proportion is adjusted to ensure the preservation of local characteristics and facilitate in-depth exploration.
[0040]
[0041]
[0042] Among them, X h It is the result of convolution of subgraphs in shuffled order, S N It is a continuous permutation from 0 to N, S T It is a pool of node sequences generated in NodeClusterer. The Sort Module regresses the node order, and then an RNN captures long-term temporal dependencies.
[0043]
[0044]
[0045] The model will T c The inputs at different time steps are superimposed to form the output tensor.
[0046]
[0047] The spatiotemporal information extracted from the subgraph is weighted using two-dimensional convolution and a learnable parameter matrix W:
[0048]
[0049] Where W∈R N×(M×D) We can improve the model's generalization ability by weighting different channels of the feature map after dimensionality reduction from 2D convolution.
[0050] Furthermore, step five includes the following specific steps:
[0051] Connect important information flows within the model in a skip-and-connect manner:
[0052] H = {H out ||X out ||X in ||T D ||T W}
[0053] The obtained tensor H is input into the regression layer, and feature integration and nonlinear transformation are performed to obtain the predicted state.
[0054]
[0055] Given the true value The formula for optimizing the model by calculating the loss using MAE is as follows:
[0056]
[0057] Furthermore, step six includes the following specific steps:
[0058] Datasets PEMS03, PEMS04, PEMS07, and PEMS08 were divided into training, validation, and test sets in a 6:2:2 ratio. The models were trained using the Adam optimization algorithm with a weight decay of wdecay of 1.0e-5 and epsilon of 1.0e-8. A learning rate scheduler was used to automatically adjust the learning rate, with a decay rate of 0.5. A warm-up strategy was employed for the first 20 training epochs, followed by a course learning approach. The course learning length increased every three epochs until it reached 12, with a patience value set to 100. Model parameters across the four datasets included node embedding dimension N, temporal embedding dimension D, top-k dimensions k_s and k_t of the spatial and temporal adjacency matrices, and the number of decoupled traffic patterns G. The performance of all baseline models was evaluated using three metrics in traffic prediction: MAE, RMSE, and MAPE, as shown in the following formula:
[0059]
[0060] Among them, MAE reflects prediction accuracy, RMSE is sensitive to larger errors, and MAPE is more concerned with relative errors. i Let Ω represent the i-th predicted value, and let Ω represent the length of the predicted sequence.
[0061] The method for constructing a multi-heterogeneous graph neural network for traffic prediction according to the present invention has the following advantages:
[0062] 1. A novel method for decoupling spatiotemporal information is proposed:
[0063] This invention proposes a novel spatiotemporal information decoupling method. This method utilizes a similarity adjacency matrix generated by temporal embedding and a spatial graph generated by spatial information embedding. It combines this with a node embedding matrix initialized with learnable parameters to capture the semantic information and feature representation of each node in the traffic network. The weight matrix is broadcast to all channels of the traffic flow through Hadamard product to obtain a specific traffic pattern feature space. Finally, the remaining traffic flow features are obtained by subtracting the previous traffic pattern traffic features from the original traffic flow.
[0064] 2. A novel node clustering module is proposed:
[0065] This invention proposes a novel node clustering module. A high-dimensional feature space is constructed by inputting p types of traffic pattern features for node clustering. This method effectively processes heterogeneous multigraphs. Extensive ablation experiments demonstrate that our node clustering module has a substantial positive impact on traffic flow prediction.
[0066] 3. A novel method for generating spacetime graphs is proposed:
[0067] This invention proposes a novel method for generating spatial graphs. This method utilizes a similarity adjacency matrix generated by temporal embedding and a spatial graph generated by embedding spatial information, thus forming a highly adaptive spatiotemporal graph. This method not only assigns unique dynamic spatiotemporal graphs to different traffic modes but also comprehensively considers the correlation between nodes and the dynamic changes in traffic flow between different traffic modes.
[0068] 4. A novel method for clustering features and dynamically fusing spatiotemporal patterns in subgraphs is proposed:
[0069] This invention proposes a novel approach to clustering features and spatiotemporal patterns in dynamic fusion subgraphs. The core of this approach is capturing spatiotemporal features of clustering and repositioning multi-scale information. The p-node clusters and their generated fusion subgraphs are processed by a gated graph convolution operator to capture spatial dependencies. Then, the node information of the p-clusters is pooled according to the node sequence S. T Ranking regression is performed, using gated recurrent units (RNNs) to capture temporal patterns. Conv2d extracts and learns features through local receptive fields. Finally, the Hadamard product of the learnable parameter matrix is used to weight multi-scale spatiotemporal information. Extensive ablation experiments demonstrate that our clustering features and the method of dynamically fusing spatiotemporal patterns in subgraphs have a substantial positive impact on traffic flow prediction. Attached Figure Description
[0070] Figure 1 This is a model architecture diagram of the present invention.
[0071] Figure 2 This is a schematic diagram of the node clustering module of the present invention.
[0072] Figure 3 This is a schematic diagram of the SIE module of the present invention. Detailed Implementation
[0073] To better understand the purpose, structure, and function of this invention, the following detailed description of a method for constructing a multi-heterogeneous graph neural network for traffic prediction is provided in conjunction with the accompanying drawings.
[0074] For problems one and two, the MHGNet model employs a Spatiotemporal Decoupling Module. This module uses feature mapping of timestamp embedding matrices and node embedding matrices to decouple single traffic data into multimodal traffic data, capturing dynamic high-dimensional spatiotemporal information within the traffic pattern structure. For problem three, a node clusterer is used. This clusterer calculates the Euclidean distance between nodes and different types of extreme particles in the high-dimensional feature space, storing the node sequence numbers in a node sequence pool. A dynamic spatiotemporal graph generation module generates a weighted fusion of spatiotemporal relationships for each node cluster. This performs small, simple isomorphic graph convolution operations on large, complex, multi-heterogeneous graphs, effectively reducing time complexity and computational resource usage. Finally, we regress the node features after subgraph convolution using the clustered node sequence numbers from the node sequence pool. Two-dimensional convolution and a learnable parameter matrix are used to adjust the weights of the subgraph convolution results at different scales, aggregating the output results to iteratively update sequence dependencies.
[0075] To effectively handle traffic pattern structures while fully considering high-dimensional spatiotemporal relationships and heterogeneous multigraphs, we propose a spatiotemporal modeling method for traffic prediction using heterogeneous multigraphs. This method decouples low-dimensional traffic data and maps it to a high-dimensional feature space. A node clusterer and a dynamic spatiotemporal graph generation module are used to transform the heterogeneous multigraph into a simple isomorphic graph. A subgraph information extraction module is designed for gated spatiotemporal information extraction from subgraphs and weight adjustment of convolutional blocks at different scales. Finally, the positions of the clustered nodes after information extraction are restored to their original positions.
[0076] To capture the high-dimensional spatiotemporal relationships of different traffic pattern structures, this invention proposes a multi-heterogeneous graph neural network for traffic prediction. First, a novel spatiotemporal decoupling module is proposed, followed by a new node clustering module and a novel spatiotemporal graph generation method. Finally, a new clustering feature and a method for dynamically fusing spatiotemporal patterns in subgraphs are proposed.
[0077] To achieve the above-mentioned objectives, the present invention adopts the following technical solution:
[0078] Step 1: Construct a spatiotemporal decoupling module.
[0079] In addressing the problem of modeling the spatiotemporal relationship of traffic patterns, we introduce a spatiotemporal decoupling module. Its goal is to decouple low-dimensional traffic flow data into p types of traffic pattern data, thereby increasing the feature dimension.
[0080] To obtain heterogeneous spatiotemporal feature mappings for different traffic modes, we introduced a feature in the STD Module based on the total traffic flow input. Extracted daily and weekly periodic feature matrices These features are continuous real-valued vectors transformed from two randomly initialized learnable time-slot embedding matrices, thus using matrices. and Let represent the temporal features of node i at time step t. Then, we utilize a node embedding matrix initialized with learnable parameters. To capture the semantic information and feature representation of each node in the traffic network, where the feature representation at node i is: For the original traffic flow The formula for weighted segmentation into P types of traffic mode features 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 By semantically preserving high-dimensional spatiotemporal features and mapping them to a low-dimensional space, and then introducing nonlinear activation functions ReLU and Sigmoid to enhance the model's expressive power, we obtain Ω. (t,i) Ω (t,i) This represents the output indicating the proportion of a specific flow pattern at node i relative to the total flow at time step t. The weight matrix is then expressed using the Hadamard product. Broadcast to traffic For all channels, obtain the feature space of the nth traffic mode. Finally, subtract the traffic flow features of the first p-1 traffic modes from the original traffic flow to obtain the remaining traffic flow features.
[0083] Step 2: Construct the node clustering module.
[0084] like Figure 2As shown, the node clustering module constructs a high-dimensional feature space by inputting p traffic mode features to perform node clustering. This step faces two challenges: (1) how to select the appropriate clustering based on the p features of the node; (2) how to reduce the time complexity of the traditional clustering algorithm as the number of nodes N increases exponentially.
[0085] First, construct a clustering feature space based on the input p types of traffic modes:
[0086]
[0087] C j =Max(R) j ), j = 1, 2, ..., p
[0088] Among them, W i ∈R D×1 For i = 1, 2, ..., p, the rich high-dimensional features are mapped to one dimension, and then T is... h Connecting the traffic pattern features within a time window and dividing them element-wise by the embedded traffic flow yields the result. For T h Average pooling is performed at time steps to obtain the ratio tensor R∈R N×P Then find the maximum value of R in P dimensions and denote it as the limiting particle matrix C∈R. P Limiting particle C p This represents the maximum limit state of the original traffic features occupied by feature 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 limiting particle C in P-dimensional space. N×P The types of node i, T i ∈R 1 This refers to the type of limiting particle with the closest Euclidean distance, where i is placed in type T. i Node sequence pool S T The data is used for subsequent node placement. This clustering algorithm has a time complexity of O(N), which greatly saves computational resources compared to traditional clustering algorithms.
[0092] Step 3: Build the DSTGG module
[0093] We introduce the STGG Module to model the potential spatiotemporal relationships between pairs of node subsets, generating a simple subgraph containing spatiotemporal fusion relationships. First, we apply an efficient method to generate the spatial graph, calculated as follows:
[0094]
[0095] Node embedding matrix and This represents the node embedding matrix randomly initialized for cluster P. and The parameter matrix represents the fully connected layer, where α is a parameter that adjusts the saturation rate. The activation function and subtraction terms are regularized to generate an adjacency matrix containing the p-space relationships of the clusters.
[0096] The key step in constructing a timeline is capturing the temporal relationships between node pairs to build a dynamic timeline. We extract daily and weekly time feature matrices from the original total traffic features. and Features are selected from the time matrix based on the node numbers in the clusters, and then the time information is fused to construct a matrix:
[0097]
[0098] in, By capturing the periodic temporal features of day and week, average pooling and nonlinear transformation are used to obtain clusters p in T. h Node-to-time information matrix fused within the time window A simplified graph containing spatiotemporal heterogeneous information is constructed based on the sparsed spatial graph and the fused temporal information matrix:
[0099]
[0100]
[0101] β is a learnable saturation adjustment factor. The temporal and spatial graphs tanh and ReLU restrict the edge weights to the range [0,1]. Then, the spatiotemporal fusion graph is sparsified, retaining only the spatiotemporal relationships of the Top-K nearest nodes to reduce computational complexity.
[0102] Step 4: Build the SIE module
[0103] like Figure 3As shown, we introduce the SIE Module to capture clustering features and spatiotemporal patterns in the dynamically fused subgraphs. Its core is how to capture the spatiotemporal features of clustering and reposition multi-scale information. The p-node clusters and their generated fused subgraphs are processed by a gated graph convolution operator to capture spatial dependencies. Then, the node information of the p-cluster is pooled according to the node sequence S. T Ranking regression is performed, and the time pattern is captured by the gated recurrent unit of RNN. Conv2d extracts and learns features through the local receptive field. Finally, the multi-scale spatiotemporal information is weighted by the Hadamard product of the learnable parameter matrix.
[0104] To achieve information control and learn long-term dependencies, the MHGNet model introduces a gating mechanism in graph convolution operations:
[0105]
[0106] In the formula, It is an adjacency matrix with self-connection, and a degree matrix. satisfy k represents the propagation depth, and the parameter γ represents the input node H that needs to be retained during node updates. p The ratio is adjusted to ensure the preservation of local characteristics and facilitate in-depth exploration.
[0107]
[0108] Among them, X h It is the result of convolution of subgraphs in shuffled order, S N It is a continuous permutation from 0 to N, S T It is a pool of node sequences generated in NodeClusterer. The Sort Module regresses the node order, and then the RNN captures long-term time dependencies.
[0109]
[0110] The model will T c The inputs at different time steps are superimposed to form the output tensor.
[0111]
[0112] The spatiotemporal information extracted from the subgraph is weighted using two-dimensional convolution and a learnable parameter matrix W:
[0113]
[0114] Where W∈R N×(M×D)We can improve the model's generalization ability by weighting different channels of the feature map after dimensionality reduction from 2D convolution.
[0115] Step 5: Design output and training strategies
[0116] We will make skip connections to the important information flow 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, and feature integration and nonlinear transformation are performed to obtain the predicted state.
[0119]
[0120] Given the true value The formula for optimizing the model by calculating the loss using MAE is as follows:
[0121]
[0122] Step Six: Model Training
[0123] The experiments were conducted on a system equipped with an NVIDIA GeForce RTX 4090 GPU. Datasets PEMS03, PEMS04, PEMS07, and PEMS08 were divided into training, validation, and test sets in a 6:2:2 ratio. 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. Furthermore, a learning rate scheduler was used to automatically adjust the learning rate, with a decay rate of 0.5. A warm-up strategy was employed for the first 20 training epochs, followed by course learning, where the course length increased every three epochs until it reached 12. An early stopping mechanism was used to prevent overfitting, with a patience value set to 100. The configurations of the model's relevant parameters on the four datasets are shown in Table 2, including the node embedding dimension N, the temporal 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 patterns G.
[0124] We used three metrics commonly used in traffic forecasting 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 shown in the following formulas:
[0125]
[0126] Among them, MAE reflects prediction accuracy, RMSE is sensitive to larger errors, and MAPE is more concerned with relative errors. i Let Ω represent the i-th predicted value, and let Ω represent the length of the predicted sequence. In our experiment, Ω = 12.
[0127] Step 7: Experimental Results
[0128] The table below compares the mean absolute error (MAE), root mean square error (RMSE), and mean absolute percentage error (MAPE) for all methods across 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 traffic networks, and thus have poor performance.
[0132] (2) Graph-based algorithms such as GraphWaveNet perform superiorly, demonstrating the effectiveness of graphs. However, DCRNN, by capturing spatial features using a predefined graph, is limited by the representation of inter-node correlations. In contrast, STGODE and STG-NCD proposed ODE and NCDE to increase their spatial receptive domains. However, they failed to mine global spatial correlations, and therefore performed worse than DSTAGNN.
[0133] (3) In addition to the MAPE metric on the PEMS03 dataset, our MHGNet achieved the best results on other metrics of the four datasets, demonstrating that the spatiotemporal fusion graph generated by our MHGNet using periodic features and spatial embedding has a good global spatiotemporal feature capture capability and performs well on different datasets.
[0134] It is understood that the present invention has been described through some embodiments, and those skilled in the art will recognize that various changes or equivalent substitutions can be made to these features and embodiments without departing from the spirit and scope of the invention. Furthermore, under the teachings of the present invention, these features and embodiments can be modified to adapt to specific situations and materials without departing from the spirit and scope of the invention. Therefore, the present invention is not limited to the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application are within the protection scope of the present invention.
Claims
1. A method for constructing a multi-heterogeneous graph neural network for traffic prediction, comprising: Comprising the following steps: Step one: construct the space-time decoupling module; first, obtain the heterogeneous space-time feature mapping of different traffic modes, and second, capture the semantic information and feature representation of each node in the traffic network; 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 ; Step two: construct the node clustering module; the node clustering module constructs a high-dimensional feature space by inputting P traffic mode features to perform node clustering; Step three: Constructing DSTGG module; Introducing STGG Module to model the potential spatio-temporal relationships between pairs of node subsets, generating simple subgraphs containing spatio-temporal fusion relationships, first, generate a spatial graph: extract the day and week time feature matrix from the original total traffic characteristics and Select features from the time matrix according to the node number in the cluster; According to the sparse spatial graph and the fusion time information matrix, a simple graph containing space-time heterogeneous information is constructed; then the space-time fusion graph is sparsified, and only the Top-K nearest node pairs are retained for space-time relationship; Step four: constructing SIE module; P node clusters and their generated fusion sub-graphs capture spatial dependencies through the gating graph convolution operator, and then the node information of p clusters is pooled according to the node sequence container S T The sorting regression captures the time pattern through the gating cycle unit of the RNN, the Conv2d extracts and learns the features through the local receptive field, and finally the Hadamard product of the learnable parameter matrix is used to weight the multi-scale space-time information. Step five: design output and training strategy: connect the important information flow inside the model with skip connections, and the skip connections get Then form the regression layer through full connection and two-dimensional convolution to generate the predicted state Given the true value We optimize the model by calculating the loss through MAE.
2. The multi-heterographic neural network construction method for traffic prediction according to claim 1, wherein, The step one comprises the following specific steps: Introduce the total traffic flow input into the STD Module. Extracted daily and weekly periodic feature matrices These features are continuous real-valued vectors transformed from two randomly initialized learnable time-slot embedding matrices, thus using matrices. and This represents the temporal characteristics 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, where the feature representation at node i is: For the original traffic flow The formula for weighted segmentation into P types of traffic mode features 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 By semantically preserving high-dimensional spatiotemporal features and mapping them to a low-dimensional space, and then introducing nonlinear activation functions ReLU and Sigmoid to enhance the model's expressive power, we obtain Ω. (t,i) Ω (t,i) This represents the output of the proportion of a specific flow pattern of node i relative to the total flow at time step t, expressed as a weight matrix obtained through Hadamard product. Broadcast to traffic For all channels, obtain the feature space of the nth traffic mode. Finally, subtract the traffic flow features of the first p-1 traffic modes from the original traffic flow to obtain the remaining traffic flow features.
3. The multi-heterographic neural network construction method for traffic prediction according to claim 1, wherein, The step two comprises the following steps: First, construct a clustering feature space according to the input p traffic modes: C j = Max(R j ), j = 1, 2,..., p where W i ∈R D×1 , i = 1, 2…p, the rich high-dimensional features are mapped to one dimension, and then T h The traffic mode features of the step time window are connected, and the element is divided by the embedded flow to obtain T h Average pooling is performed on the time step to obtain the ratio tensor R ∈ R N×P Then find the maximum value of R in P dimensions, denoted as the limit particle matrix C ∈ R P The limit particle C p represents the maximum limit state of the original traffic feature occupied by the feature 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 limiting particle C in P-dimensional space. N×P The types of node i, T i ∈R 1 This refers to the type of limiting particle with the closest Euclidean distance, where i is placed in type T. i Node sequence pool S T In this context, the clustering algorithm is used for subsequent node placement, and its time complexity is O(N).
4. The multi-heterographic neural network construction method for traffic prediction according to claim 1, wherein, The step three comprises the following specific steps: First, generate a spatial graph, and the calculation formula is as follows: node embedding matrix and denotes the node embedding matrix initialized randomly to the clusters P, and denotes the parameter matrix of the fully connected layer, a is a parameter that regulates the saturation rate, the activation function and the subtraction term are regularized, generating an adjacency matrix containing the spatial relationships of the clusters P extracting day and week time feature matrix from raw total traffic features and select features from time matrix according to node number in cluster, then fuse time information to construct matrix: wherein, Capturing periodic temporal features of the day and week, average pooling and non-linear transformations yield T h Fused node pair temporal information matrix within a time window Constructing a simple graph containing spatio-temporal heterogeneous information from the sparsified spatial graph and the fused temporal information matrix: Where β is a learnable saturation adjustment factor, and the tanh and ReLU of the time graph and the spatial graph limit the edge weight in the range of [0, 1]; then the space-time fusion graph is sparsified, and only the Top-K nearest node pairs are retained for space-time relationship, so as to reduce the computational complexity.
5. The multi-heterographic neural network construction method for traffic prediction according to claim 1, wherein, The step four comprises 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 satisfies k represents the propagation depth, and the parameter γ represents the proportion of input nodes H p that need to be preserved during node update to ensure the preservation of local characteristics and the convenience of depth exploration. where X h is the shuffled subgraph convolution result, S N is the continuous arrangement from 0 to N, S T is the node sequence pool generated in Node Clusterer, the node order is returned by Sort Module, and then the long-term time dependence is captured by RNN, The model will T c The input at a time step is stacked together to form the output tensor The two-dimensional convolution and the learnable parameter matrix W are used to configure the weight of the space-time information extracted by the subgraph: where W ∈ R N×(M×D) The feature map after two-dimensional convolution dimension reduction is weighted in different channels to improve the model generalization ability. 6.The method for constructing a multi-heterographic neural network for traffic prediction according to claim 1, wherein, The step five comprises the following specific steps: The important information flow inside the model is connected by jumping: H = {H out ||X out ||X in ||T D ||T W} The obtained tensor H is input back to the regression layer to integrate the features and nonlinear transformation to obtain the predicted state Given the true values We compute the loss by MAE to optimize the model's formula as follows:
7. The multi-heterographic neural network construction method for traffic prediction according to claim 1, characterized in that, It also comprises step six, which comprises the following specific steps: The datasets PEMS03, PEMS04, PEMS07 and PEMS08 are divided into training, validation and test sets according to the ratio of 6:2:2, the model is trained using the Adam optimization algorithm, the weight decay wdecay is 1.0e-5, the epsilon is 1.0e-8, the learning rate is automatically adjusted using the learning rate scheduler, the decay rate is 0.5, the warm-up strategy is used in the first 20 training periods, and then the curriculum learning is used, wherein the curriculum learning length is increased once every three periods until it reaches 12, wherein the patience value is set to 100, and the related parameters of the model on the four datasets include node embedding dimension N, time embedding dimension D, space and time adjacency matrix top-k dimension k_s and k_t, decoupling traffic mode number G, The MAE, RMSE and MAPE three indicators in traffic prediction are used to evaluate the performance of all baseline models, and the formulas are as follows: Among them, MAE reflects the prediction accuracy, RMSE is sensitive to large errors, MAPE pays more attention to relative error, x i represents the ith prediction value, and Ω represents the length of the prediction 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