Traffic flow prediction method based on graph convolutional network

By introducing time-related external information and self-attention mechanisms in traffic flow prediction, combined with graph convolution network and gated time-sequence convolution network, the traffic flow prediction in the prior art is solved. The difficulty in dealing with time-dependent and complex global features is solved. Problem, achieving more efficient and accurate traffic flow forecasts.

CN119479300APending Publication Date: 2025-02-18HEILONGJIANG UNIV
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202411670115.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-02-18

Smart Images

  • Figure CN119479300A_ABST
    Figure CN119479300A_ABST
Patent Text Reader

Abstract

The invention provides a traffic flow prediction method based on a graph convolutional network, and the method comprises the steps: training a space-time cluster prediction model through the traffic flow data of historical specific time steps of all traffic nodes in a traffic network graph, so as to predict the traffic flow of a future target time step, and specifically, carrying out the training of a time-space cluster prediction model through employing a convolutional layer, mapping the preprocessed traffic flow data to a feature space to obtain original features and an original feature map of the traffic flow data; extracting a spatial dependency relationship implied in the traffic flow data by using a self-attention-based space-time diagram cluster convolution module to obtain a corresponding feature representation; capturing a time dependency relationship of the traffic flow data by using a gating timing sequence convolutional network based on a gating mechanism and expansion convolution to obtain a corresponding feature representation; and predicting the traffic flow of a future target time step based on the feature representation of the spatial dependency relationship and the time dependency relationship of the historical specific time step. According to the method, external information related to time is introduced, so that the prediction accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of traffic flow prediction, and in particular, relates to a traffic flow prediction method based on a graph convolutional network. Background Art

[0002] With the development of Internet of Things technology and the acceleration of urbanization, traffic flow prediction has become a key research area in intelligent transportation systems, aiming to improve traffic management efficiency, reduce congestion and enhance travel safety. Due to the highly nonlinear and dynamic spatiotemporal dependencies of traffic flow, timely and accurate prediction, especially long-term prediction, remains a major challenge. With the development of big data technology, deep learning algorithms and computing resources, graph neural networks (GCNs) have developed rapidly. GCNs improve the accuracy and reliability of traffic flow prediction by modeling complex spatiotemporal dependencies in traffic networks, showing strong application potential in traffic flow prediction. However, they face the limitations of global dependencies and challenges in dealing with long-distance dependencies and complex global features. The high computational cost and data requirements also limit their application in large-scale and complex tasks. In order to overcome these limitations, attention mechanisms and Transformer models have emerged.

[0003] By dynamically adjusting the model's attention to important parts of the input data, it helps to handle long-distance dependencies and global feature extraction, thereby improving the accuracy and efficiency of the model. Among them, the Transformer model achieves effective capture of the global information of sequence data through the self-attention mechanism, which not only has made breakthrough progress in natural language processing, but also shows great potential in the field of traffic forecasting. In many forecasting models, researchers often only focus on the performance of the model itself, while ignoring the impact of external factors on the forecast results. However, external factors (exogenous variables) play a vital role in many practical applications. For example, in financial market forecasting, external factors such as economic indicators and policy changes can significantly affect market trends; in traffic forecasting, external factors such as weather and holidays can also affect demand changes. Summary of the invention

[0004] In view of this, the purpose of this application is to provide a traffic flow prediction method based on graph convolutional networks. Based on the significant time dependence of traffic flow, time-related external information is introduced, such as the specific time of the day and the specific date of the week, to help the model identify periodic changes such as peak hours, weekdays and weekends, thereby improving the accuracy of the prediction.

[0005] The present application provides a traffic flow prediction method based on a graph convolutional network, the method comprising:

[0006] Use the historical traffic flow data of each traffic node in the traffic network diagram at a specific time step to train the spatiotemporal cluster prediction model to predict the traffic flow at the future target time step. Specifically:

[0007] Using the convolution layer, the preprocessed traffic flow data is mapped to the feature space to obtain the original features and original feature graph of the traffic flow data; wherein the original feature graph is based on the traffic network graph and is composed of the original features of the traffic flow data of each traffic node;

[0008] The spatial dependency implicit in traffic flow data is extracted using a spatiotemporal graph cluster convolution module based on self-attention, and the feature representation of the spatial dependency is obtained;

[0009] The time dependency of traffic flow data is captured by a gated temporal convolutional network based on a gating mechanism and dilated convolution, and the feature representation of the time dependency is obtained.

[0010] Based on the feature representation of spatial dependencies at a specific historical time step and the feature representation of temporal dependencies, the traffic flow at a future target time step is predicted.

[0011] Furthermore, the traffic network graph is jointly represented by a set of traffic nodes and a set of edges connecting the traffic nodes.

[0012] Furthermore, the traffic flow data includes: original traffic information data, node geographic information and traffic status data;

[0013] The original traffic information data is collected by sensors installed at the traffic nodes, the node geographic information is the distance-based adjacency matrix and weight matrix between each traffic node, and the traffic status data is represented by the relative time of the current timestamp in a day and the day of the week.

[0014] Furthermore, the spatiotemporal graph cluster convolution module includes: a self-attention layer and a spatiotemporal graph cluster convolution layer;

[0015] The method uses the self-attention-based spatiotemporal graph cluster convolution module to extract the implicit spatial dependency in the traffic flow data and obtain the feature representation of the spatial dependency, including:

[0016] The original feature map is input into the spatiotemporal graph cluster convolution module, and based on the feature representations output by the self-attention layer and the spatiotemporal graph cluster convolution layer respectively, residual fusion is performed after gating to obtain the feature representation of the spatial dependency relationship;

[0017] The spatiotemporal graph cluster convolution layer includes three levels of graph convolution operations, including feature graph convolution, regional cluster feature graph convolution and global cluster feature graph convolution.

[0018] Furthermore, the feature map convolution operation is performed in the following way:

[0019] Using the adjacency matrix of the original feature graph to perform high-order convolution operations on the node features, and gradually aggregate the node features at long distances; wherein the node features are the original features of the traffic flow data of any traffic node in the traffic network graph;

[0020] Use multi-layer perceptron to capture the global relationship of aggregated node features through linear transformation;

[0021] The Dropout layer is used to randomly discard some neuron outputs to reduce the dependency on specific neurons and obtain the feature representation of each traffic node.

[0022] Furthermore, the regional cluster feature map convolution operation is performed in the following way:

[0023] Using the depth-first search and backtracking strategy of the Tarjan algorithm, based on the feature representation of each traffic node, the biconnected components in the adjacency matrix of the original feature graph are identified, and the traffic nodes in the biconnected components are combined to form regional clusters from a local perspective.

[0024] By judging the mapping of each traffic node in the original feature graph that can be merged into a certain regional cluster node, a mapping matrix from each traffic node to the regional cluster is generated;

[0025] Generate a feature matrix of the regional cluster based on the mapping matrix aggregation to reflect the node attributes of the regional cluster; wherein the node attributes are used to characterize different traffic areas or functional areas in the traffic network;

[0026] Based on the mapping matrix and the adjacency matrix of the original feature map, the adjacency matrix of the region cluster is generated to describe the connection relationship between the region clusters;

[0027] Cluster graph convolution is performed on the feature matrix of the region cluster on the adjacency matrix of the region cluster to capture the dependencies within the region cluster and generate feature representations between the region clusters.

[0028] Furthermore, the global cluster feature map convolution operation is performed in the following way:

[0029] Based on the adjacency matrix of the regional clusters, the adjacency matrix of the global clusters is generated using the soft mapping matrix;

[0030] A convolution operation is performed on the adjacency matrix of the global cluster to extract global features and generate a feature representation of the global cluster.

[0031] Furthermore, the feature representations of the three levels are residually fused using cross-layer information enhancement technology to obtain feature representations of spatial dependencies. Specifically:

[0032] The feature representation of the global cluster is propagated to the regional cluster, the ReLU activation function is used to retain the effective information, and it is fused with the feature representation of the regional cluster to enhance the feature representation of the regional cluster;

[0033] The feature representation of the enhanced regional cluster is propagated to each traffic node of the original feature map through dot product, and the Relu activation function is used to retain the effective information and fuse it with the feature representation of each traffic node to enhance the feature representation of each traffic node.

[0034] Using the back propagation technology, the enhanced feature representation of each traffic node is propagated to the regional cluster to obtain the feature representation of the regional cluster with secondary enhancement, and then propagated to the global cluster to obtain the feature representation of the global cluster with secondary enhancement;

[0035] Among them, the enhanced feature representation of each traffic node, the feature representation of the secondary enhanced regional cluster and the feature representation of the secondary enhanced global cluster have a spatial dependency relationship.

[0036] Furthermore, the self-attention layer outputs feature representation in the following way:

[0037] Project the original features of traffic flow data into a high-dimensional subspace to obtain query vectors, key vectors, and value vectors;

[0038] Based on the query vector, key vector and value vector, get the attention score;

[0039] The obtained attention score is input into the feedforward neural network layer. After two linear transformations, the attention weight matrix of the original feature map is obtained to output the corresponding feature representation.

[0040] Furthermore, the gated temporal convolutional network based on the gating mechanism and the dilated convolution is used to capture the temporal dependency of the traffic flow data, and obtain the feature representation of the temporal dependency, including:

[0041] The original feature map is input into the gated temporal convolutional network, and two dilated convolutions are performed on the original features of the traffic flow data;

[0042] The result of an expanded convolution is passed through a tanh activation function to generate the output of the filter part;

[0043] The result of another dilated convolution is passed through a sigmoid activation function to generate the output of the gated part;

[0044] The output of the filter part and the output of the gate part are multiplied element by element to obtain a Hadamard product matrix that can dynamically adjust the information flow in the traffic flow data;

[0045] The noise and irrelevant information in the traffic flow data are filtered out through the Hadamard product matrix to obtain the feature representation of the time dependency.

[0046] The traffic flow prediction method based on graph convolutional network provided in this application is based on the fact that traffic flow has significant time dependence. By introducing time-related external information, such as the specific time of the day and the specific date of the week, it helps the model identify periodic changes such as peak hours, weekdays and weekends, thereby improving the accuracy of the prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 A flow chart of a traffic flow prediction method based on a graph convolutional network provided in an embodiment of the present application is shown;

[0048] Figure 2 A schematic diagram of the structure of the spatiotemporal cluster prediction model provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical solution and advantages of the technical solution more clear, the technical solution is further described in detail below in conjunction with specific implementation methods. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the technical solution.

[0050] First, the traffic flow prediction problem to be solved by this application is mathematically described. The traffic network can be represented by a graph G = (V, E, A), where V represents the set of all sensor nodes in the city used to collect traffic information data, E represents the set of edges connected to the sensor nodes, and A represents the adjacency matrix of the entire road network structure graph, which is also used to characterize the connectivity of the entire road network structure graph. Given a traffic network graph G, based on the historical data of H time steps observed by N sensor nodes, a traffic flow prediction model F is learned to predict the traffic flow of T time steps in the future.

[0051] In view of the above problem description, an embodiment of the present application provides a traffic flow prediction method based on a graph convolutional network, including: using the traffic flow data of each traffic node in the traffic network graph at a specific historical time step, training a spatiotemporal cluster prediction model to predict the traffic flow at a future target time step.

[0052] The traffic network diagram is represented by a set of traffic nodes and a set of edges connecting the traffic nodes; the traffic flow data includes: original traffic information data, node geographic information and traffic status data.

[0053] The original traffic information data is collected by sensors installed at the traffic nodes, the node geographic information is the distance-based adjacency matrix and weight matrix between each traffic node, and the traffic status data is represented by the relative time of the current timestamp in a day and the day of the week.

[0054] Here, the geographic information collected by the sensor records the detailed information of each traffic node, and the distance-based adjacency matrix and weight matrix between traffic nodes are generated according to the relationship information between traffic nodes to enhance the richness of traffic flow data. In addition, the prediction ability of the subsequent spatiotemporal cluster prediction model is improved by introducing external information, namely traffic status data. The traffic status data is divided into two dimensions: the relative time of the current timestamp in a day and the day of the week. The following explanation is given for the traffic status data in the two dimensions:

[0055] 1) Relative time of the current timestamp in a day: Calculate the relative time of each timestamp in a day and add it to the traffic status data. By converting the time information into a decimal array and extending it to each node, the ability to capture time changes is enhanced.

[0056] 2) The day of the week of the current timestamp: Calculate the day of the week corresponding to each timestamp and convert it into a one-hot encoding format. This encoding extends the 7-day information of a week to the traffic status data, which helps capture periodic changes.

[0057] The traffic status data in the above two dimensions provides the subsequent spatiotemporal cluster prediction model with the ability to capture the complex spatial dependencies and dynamic changes in traffic flow data, enabling it to fully understand the impact of time and external information on traffic flow, thereby significantly improving model performance and prediction accuracy.

[0058] Next, see Figure 1 , Figure 1 The flowchart of the traffic flow prediction method based on graph convolutional network provided by the embodiment of the present application is shown. In the specific implementation, the steps are as follows:

[0059] S101. Using a convolutional layer, the preprocessed traffic flow data is mapped to a feature space to obtain original features and an original feature map of the traffic flow data.

[0060] The original feature graph is based on the traffic network graph and is composed of the original features of the traffic flow data of each traffic node.

[0061] In this step, the dimension of the traffic flow data is first adjusted, and then the traffic flow data is padded, that is, a dimension with a length of 1 is padded in front of the last dimension to ensure the consistency of the data length. The preprocessed traffic flow data is mapped to an implicit space / feature space through a convolution layer, and the convolution extracts the local features in the traffic flow data to generate the original features of the traffic flow data, thereby enhancing the understanding and processing capabilities of the spatiotemporal cluster prediction model for traffic flow data. Specifically, the convolution layer effectively captures the spatiotemporal features in the traffic flow data through the local receptive field and parameter sharing mechanism, and converts it into a feature representation suitable for subsequent analysis. Finally, based on the traffic network diagram, the original features of the traffic flow data of each traffic node constitute the original feature map.

[0062] Next, the working mechanism of the spatiotemporal cluster prediction model provided by the embodiment of the present application is introduced. Figure 2 , Figure 2 The figure shows a schematic diagram of the structure of the spatiotemporal cluster prediction model 200 provided in an embodiment of the present application, which specifically includes: a spatiotemporal graph cluster convolution layer 201, a self-attention layer 202, and a gated temporal convolution network 203.

[0063] S102. Utilize the spatiotemporal graph cluster convolution module based on self-attention to extract the spatial dependency relationship implicit in the traffic flow data and obtain the feature representation of the spatial dependency relationship.

[0064] The spatiotemporal graph cluster convolution module includes: a self-attention layer and a spatiotemporal graph cluster convolution layer.

[0065] based on Figure 2 The structure of the spatiotemporal graph cluster convolution layer 201 is shown, and the working mechanism of the spatiotemporal graph cluster convolution layer (CGCN) 201 is summarized as follows:

[0066] The original feature map is input into the spatiotemporal graph cluster convolution module, and based on the feature representations output by the self-attention layer and the spatiotemporal graph cluster convolution layer respectively, residual fusion is performed after gating to obtain the feature representation of the spatial dependency relationship;

[0067] The spatiotemporal graph cluster convolution layer includes three levels of graph convolution operations, including feature graph convolution, regional cluster feature graph convolution and global cluster feature graph convolution.

[0068] Here, the feature representation output by the self-attention layer and the feature representation output by the spatiotemporal graph cluster convolution layer are summed after linear transformation by the fully connected layer, and a gate value is generated by applying the Sigmoid activation function, ranging from [0, 1], which is used to perform a weighted summation of the feature representation of the self-attention layer and the enhanced feature representation with spatial dependency. The weight values ​​corresponding to the feature representation of the self-attention layer and the enhanced feature representation with spatial dependency can reflect the relative contribution of the two.

[0069] In the specific implementation, the feature map convolution operation is performed in the following way:

[0070] Step 301: Use the adjacency matrix of the original feature graph to perform high-order convolution operations on node features, and gradually aggregate distant node features.

[0071] The node feature is the original feature of the traffic flow data of any traffic node in the traffic network diagram.

[0072] In this step, the graph convolution operation is performed on the original feature graph, and the node features Hori are weighted and aggregated through the adjacency matrix Aori to obtain Ho*.

[0073] Step 302: Use a multi-layer perceptron to capture the global relationship of aggregated node features through linear transformation.

[0074] In this step, after the node features are aggregated by graph convolution, the node features are spliced ​​together in the feature dimension. In order to map these high-dimensional features to the target output dimension, a multi-layer perceptron with a fully connected layer is introduced to capture the global relationship between features through linear transformation.

[0075] Step 303: Use the Dropout layer to randomly discard some neuron outputs to reduce the dependency on specific neurons, so as to obtain the feature representation of each traffic node.

[0076] In this step, in order to prevent overfitting, a Dropout layer is added after the fully connected layer to randomly "discard" some neuron outputs during training, reducing the model's dependence on specific neurons and thus improving the model's generalization ability.

[0077] Through the above feature graph convolution operation, the complex relationships and high-order dependencies between nodes can be effectively captured.

[0078] In the specific implementation, the regional cluster feature map convolution operation is performed in the following way:

[0079] Step 401: Using the depth-first search and backtracking strategy of the Tarjan algorithm, based on the feature representation of each traffic node, identify the biconnected components in the adjacency matrix of the original feature graph, and combine the traffic nodes in the biconnected components to form a regional cluster from a local perspective.

[0080] In this step, different traffic areas or functional areas in the traffic network can be identified by merging traffic nodes with similar traffic flow patterns or traffic demands into a cluster. For example, some intersections may have similar congestion patterns during peak hours. These intersections are merged into a cluster, representing a traffic area that is often congested during peak hours. Some areas may be major transportation hubs that handle a large amount of traffic flow. These nodes can be merged into one cluster. Other areas may be mainly low-density residential areas with relatively stable traffic demand patterns. These nodes can be merged into another cluster.

[0081] Here, the biconnected component can be understood as follows: in a directed graph, if vertex u can reach vertex v, and vertex v can also reach vertex u, then vertices u and v belong to the same strongly connected component. A strongly connected component is a maximal strongly connected subgraph in the graph. In an undirected graph, removing any vertex will not split the graph into a maximal subgraph with multiple connected parts.

[0082] Step 402: Generate a mapping matrix from each traffic node to a regional cluster by determining whether each traffic node in the original feature graph can be merged into a mapping of a certain regional cluster node.

[0083] In this step, the mapping matrix Motr refers to whether a certain traffic node can be merged into a certain regional cluster. If Motr[i, j] = 0, it means that the traffic node i is not mapped to the regional cluster j. Otherwise, Motr[i, j] = 1, which means that the traffic node i is mapped to the regional cluster j.

[0084] In addition, in order to ensure that the proportion of each regional cluster in the matrix is ​​reasonable and avoid over- or under-representation, each column of the mapping matrix Motr is normalized so that the sum of each column is equal to 1. The normalized matrix maintains the consistency of the representation of each regional cluster.

[0085] Step 403: Generate a feature matrix of the regional cluster based on the mapping matrix aggregation to reflect the node attributes of the regional cluster.

[0086] The node attributes are used to characterize different traffic areas or functional areas in the traffic network.

[0087] In this step, based on the mapping matrix Motr, the node features Hori are aggregated to generate the feature matrix Hreg of the regional cluster to reflect the node attributes of the regional cluster.

[0088] Step 404: Generate an adjacency matrix of the region cluster based on the mapping matrix and the adjacency matrix of the original feature graph to describe the connection relationship between the nodes of the region cluster.

[0089] In this step, the adjacency matrix Areg of the region cluster is generated by aggregating the mapping matrix Motr and the adjacency matrix Aori of the original feature map to describe the connection relationship between the region clusters.

[0090] Step 405: Perform cluster graph convolution on the feature matrix of the region cluster on the adjacency matrix of the region cluster to capture the dependency relationship within the region cluster to generate feature representation between the region clusters.

[0091] In this step, cluster graph convolution is performed on the feature matrix Hreg of the region cluster on the adjacency matrix Areg of the region cluster to capture the dependencies within the region cluster to generate the feature representation Hr* between the region clusters.

[0092] During the model training process, after generating feature representations between region clusters, it also includes:

[0093] The feature representation of each traffic node is reconstructed through the mapping matrix, the reconstructed adjacency matrix is ​​reconstructed using the reconstructed node feature representation, and the binary cross entropy loss is applied to calculate the reconstruction loss from the regional cluster to each traffic node to improve the prediction accuracy of the spatiotemporal cluster prediction model.

[0094] In the specific implementation, the global cluster feature map convolution operation is performed in the following way:

[0095] Step 501: Based on the adjacency matrix of the regional cluster, the adjacency matrix of the global cluster is generated using the soft mapping matrix.

[0096] In this step, based on the adjacency matrix Areg of the regional cluster, the adjacency matrix Aglo of the global cluster is generated using the soft mapping matrix Mrtg.

[0097] Step 502: Perform a convolution operation on the adjacency matrix of the global cluster to extract global features to generate a feature representation of the global cluster.

[0098] In this step, a convolution operation is performed on the adjacency matrix Aglo of the global cluster to extract the global features Hglo to generate the feature representation Hg* of the global cluster.

[0099] During the model training process, after generating the feature representation of the global cluster, it also includes:

[0100] The feature representation of the regional clusters is reconstructed through the soft mapping matrix, the adjacency matrix is ​​reconstructed using the feature representation of the reconstructed regional clusters, and the binary cross entropy loss is applied to calculate the reconstruction loss from the global cluster to the regional cluster to improve the prediction accuracy of the spatiotemporal cluster prediction model.

[0101] In the specific implementation, the feature representations of the three levels are residually fused by using the cross-layer information enhancement technology in the following way to obtain the feature representation of the spatial dependency relationship. Specifically:

[0102] Step 601: propagate the feature representation of the global cluster to the regional cluster, use the ReLU activation function to retain effective information, and fuse it with the feature representation of the regional cluster to enhance the feature representation of the regional cluster.

[0103] Step 602: propagate the enhanced feature representation of the regional cluster to each traffic node of the original feature map through dot product, use the Relu activation function to retain effective information, and fuse it with the feature representation of each traffic node to enhance the feature representation of each traffic node.

[0104] Step 603: Use the back propagation technology to propagate the enhanced feature representation of each traffic node to the regional cluster to obtain a second enhanced feature representation of the regional cluster, and then propagate it to the global cluster to obtain a second enhanced feature representation of the global cluster.

[0105] Among them, the enhanced feature representation of each traffic node, the feature representation of the secondary enhanced regional cluster and the feature representation of the secondary enhanced global cluster have a spatial dependency relationship.

[0106] Through the above two-step enhancement operation, the local regional cluster obtains the enhanced information of each traffic node that is retransmitted back, further strengthening the feature representation of the local regional cluster, so that it can better characterize the local traffic changes associated with the original feature map. The global cluster obtains the enhanced information from the regional cluster and can better capture the local traffic patterns and changes summarized by the regional cluster. This information enhancement enables the global cluster to have a more comprehensive representation of the overall traffic status.

[0107] In a specific implementation, the self-attention layer outputs feature representation in the following way:

[0108] Step 701: Project the original features of the traffic flow data into a high-dimensional subspace to obtain a query vector, a key vector, and a value vector.

[0109] In this step, the original features Hori of the traffic flow data are projected into a high-dimensional subspace to obtain the query vector Q, key vector K and value vector V.

[0110] Step 702: Get an attention score based on the query vector, the key vector, and the value vector.

[0111] In this step, the attention weights Wq, Wk, and Wv are calculated by dot product based on the query vector Q, key vector K, and value vector V, and the attention weights are used for weighted summation to obtain the attention score.

[0112] Step 703: Input the obtained attention score into the feedforward neural network layer. After two linear transformations, the attention weight matrix of the original feature map is obtained to output the corresponding feature representation.

[0113] In this step, the obtained attention is input into the feedforward neural network layer. After the first linear transformation, the Relu activation function introduces nonlinear characteristics. After the second linear transformation, the attention weight matrix of the original feature map is obtained, which is used as the feature representation of the self-attention layer.

[0114] S103. Use a gated temporal convolutional network based on a gating mechanism and dilated convolution to capture the temporal dependency of traffic flow data and obtain a feature representation of the temporal dependency.

[0115] In this step, a gating mechanism is used to selectively retain information flows that contribute more to the prediction task by dynamically adjusting information. This mechanism enables the network to adaptively adjust information flows, thereby accurately identifying key time points or time periods, improving the ability to fit time dependencies, and more effectively handling complex periodic fluctuations and trend changes in traffic flow data.

[0116] In the specific implementation, the feature representation of the time dependency is obtained through the following steps:

[0117] Step 1031: Input the original feature map into the gated temporal convolutional network, and perform two dilated convolutions on the original features of the traffic flow data.

[0118] Step 1032: The result of an expanded convolution is passed through a tanh activation function to generate an output of the filter part.

[0119] Step 1033, the result of another dilated convolution is passed through a sigmoid activation function to generate the output of the gated part.

[0120] Step 1034: multiply the output of the filter part and the output of the gate part element by element to obtain a Hadamard product matrix that can dynamically adjust the information flow in the traffic flow data.

[0121] Step 1035: Filter the noise and irrelevant information in the traffic flow data through the Hadamard product matrix to obtain a feature representation of the time dependency.

[0122] S104. Based on the feature representation of the spatial dependency relationship and the feature representation of the temporal dependency relationship at the specific historical time step, predict the traffic flow at the future target time step.

[0123] The above contents are only preferred embodiments of the present invention. For ordinary technicians in this field, many changes can be made in the specific implementation methods and application scopes based on the ideas of the present technical content. As long as these changes do not deviate from the concept of the present invention, they all fall within the scope of protection of this patent.

Claims

1. A traffic flow prediction method based on graph convolutional network, characterized in that: The method comprises: Use the historical traffic flow data of each traffic node in the traffic network diagram at a specific time step to train the spatiotemporal cluster prediction model to predict the traffic flow at the future target time step. Specifically: Using the convolution layer, the preprocessed traffic flow data is mapped to the feature space to obtain the original features and original feature graph of the traffic flow data; wherein the original feature graph is based on the traffic network graph and is composed of the original features of the traffic flow data of each traffic node; The spatial dependency implicit in traffic flow data is extracted using a spatiotemporal graph cluster convolution module based on self-attention, and the feature representation of the spatial dependency is obtained; The time dependency of traffic flow data is captured by a gated temporal convolutional network based on a gating mechanism and dilated convolution, and the feature representation of the time dependency is obtained. Based on the feature representation of spatial dependencies at a specific historical time step and the feature representation of temporal dependencies, the traffic flow at a future target time step is predicted.

2. The method according to claim 1, characterized in that The traffic network graph is jointly represented by a set of traffic nodes and a set of edges connecting the traffic nodes.

3. The method according to claim 1, characterized in that The traffic flow data includes: original traffic information data, node geographic information and traffic status data; The original traffic information data is collected by sensors installed at the traffic nodes, the node geographic information is the distance-based adjacency matrix and weight matrix between each traffic node, and the traffic status data is represented by the relative time of the current timestamp in a day and the day of the week.

4. The method according to claim 1, characterized in that The spatiotemporal graph cluster convolution module includes: a self-attention layer and a spatiotemporal graph cluster convolution layer; The method uses the self-attention-based spatiotemporal graph cluster convolution module to extract the implicit spatial dependency in the traffic flow data and obtain the feature representation of the spatial dependency, including: The original feature map is input into the spatiotemporal graph cluster convolution module, and based on the feature representations output by the self-attention layer and the spatiotemporal graph cluster convolution layer respectively, residual fusion is performed after gating to obtain the feature representation of the spatial dependency relationship; The spatiotemporal graph cluster convolution layer includes three levels of graph convolution operations, including feature graph convolution, regional cluster feature graph convolution and global cluster feature graph convolution.

5. The method according to claim 4, characterized in that The feature map convolution operation is performed in the following way: Using the adjacency matrix of the original feature graph to perform high-order convolution operations on the node features, and gradually aggregate the node features at long distances; wherein the node features are the original features of the traffic flow data of any traffic node in the traffic network graph; Use multi-layer perceptron to capture the global relationship of aggregated node features through linear transformation; The Dropout layer is used to randomly discard some neuron outputs to reduce the dependency on specific neurons and obtain the feature representation of each traffic node.

6. The method according to claim 5, characterized in that The regional cluster feature map convolution operation is performed in the following way: Using the depth-first search and backtracking strategy of the Tarjan algorithm, based on the feature representation of each traffic node, the biconnected components in the adjacency matrix of the original feature graph are identified, and the traffic nodes in the biconnected components are combined to form regional clusters from a local perspective. By judging the mapping of each traffic node in the original feature graph that can be merged into a certain regional cluster node, a mapping matrix from each traffic node to the regional cluster is generated; Generate a feature matrix of the regional cluster based on the mapping matrix aggregation to reflect the node attributes of the regional cluster; wherein the node attributes are used to characterize different traffic areas or functional areas in the traffic network; Based on the mapping matrix and the adjacency matrix of the original feature map, the adjacency matrix of the region cluster is generated to describe the connection relationship between the region clusters; Cluster graph convolution is performed on the feature matrix of the region cluster on the adjacency matrix of the region cluster to capture the dependencies within the region cluster and generate feature representations between the region clusters.

7. The method according to claim 6, characterized in that The global cluster feature map convolution operation is performed in the following way: Based on the adjacency matrix of the regional clusters, the adjacency matrix of the global clusters is generated using the soft mapping matrix; A convolution operation is performed on the adjacency matrix of the global cluster to extract global features and generate a feature representation of the global cluster.

8. The method according to claim 7, characterized in that The feature representations of the three levels are residually fused using cross-layer information enhancement technology to obtain the feature representation of spatial dependency in the following way: The feature representation of the global cluster is propagated to the regional cluster, the ReLU activation function is used to retain the effective information, and it is fused with the feature representation of the regional cluster to enhance the feature representation of the regional cluster; The feature representation of the enhanced regional cluster is propagated to each traffic node of the original feature map through dot product, and the Relu activation function is used to retain the effective information and fuse it with the feature representation of each traffic node to enhance the feature representation of each traffic node. Using the back propagation technology, the enhanced feature representation of each traffic node is propagated to the regional cluster to obtain the feature representation of the regional cluster with secondary enhancement, and then propagated to the global cluster to obtain the feature representation of the global cluster with secondary enhancement; Among them, the enhanced feature representation of each traffic node, the feature representation of the secondary enhanced regional cluster and the feature representation of the secondary enhanced global cluster have a spatial dependency relationship.

9. The method according to claim 4, characterized in that The self-attention layer outputs feature representations in the following way: Project the original features of traffic flow data into a high-dimensional subspace to obtain query vectors, key vectors, and value vectors; Based on the query vector, key vector and value vector, get the attention score; The obtained attention score is input into the feedforward neural network layer. After two linear transformations, the attention weight matrix of the original feature map is obtained to output the corresponding feature representation.

10. The method according to claim 1, characterized in that The method uses a gated temporal convolutional network based on a gating mechanism and dilated convolution to capture the temporal dependency of the traffic flow data and obtain a feature representation of the temporal dependency, including: The original feature map is input into the gated temporal convolutional network, and two dilated convolutions are performed on the original features of the traffic flow data; The result of an expanded convolution is passed through a tanh activation function to generate the output of the filter part; The result of another dilated convolution is passed through a sigmoid activation function to generate the output of the gated part; The output of the filter part and the output of the gate part are multiplied element by element to obtain a Hadamard product matrix that can dynamically adjust the information flow in the traffic flow data; The noise and irrelevant information in the traffic flow data are filtered out through the Hadamard product matrix to obtain the feature representation of the time dependency.

Citation Information

Cited By

  • Time sequence prediction method and device, program product, storage medium and application of time sequence prediction method and device

    CN119939396A

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

    CN120014840A

  • Traffic flow prediction method, system and terminal

    CN121415597A

  • Network traffic prediction method based on multi-representation space-time diagram convolution and related equipment

    CN121418309A