A traffic flow prediction method based on spatiotemporal Granger causality
Modeling the causal relationship of traffic flow transmission through space-time Granger causal graphs solves the problem of difficulty in capturing global dynamic spatial dependencies in the prior art, and achieves higher accuracy and effect in long-term predictions.
Patent Information
- Application Number
- CN202310244345.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-15
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2043-03-15
AI Technical Summary
The existing traffic flow prediction methods are difficult to effectively capture the global and dynamic spatial dependencies between road network nodes, especially during long-term predictions, static spatial dependencies cannot express the global transmission process of traffic information.
A traffic flow prediction method based on space-time Granger causality is proposed. The causal relationship of traffic flow transmission is modeled through space-time Granger causal graph, and the dynamic spatial dependence relationship is captured using space-time alignment algorithm and Granger causality test method. Enter it into the graph neural network for prediction.
Improve the accuracy and effectiveness of long-term predictions, especially during the 45-minute and 60-minute prediction periods, significantly improving the predictive ability of traffic system intersections, edge points and remote points.
Smart Images

Figure CN116246467B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of traffic flow prediction, and in particular relates to a traffic flow prediction method based on spatiotemporal Granger causality. Background Art
[0002] With the continuous development of intelligent transportation systems, traffic prediction, as one of the important functions of intelligent transportation systems, has received more and more attention. Traffic prediction is a kind of time series prediction task. It needs to predict the traffic data at future moments based on the historical traffic data recorded by traffic sensors, including flow prediction, flow speed prediction and peak period prediction, which can help decision-making such as urban management, traffic planning and route optimization.
[0003] The basic assumption of traffic prediction task is that there is a certain stable pattern behind the traffic data, so this pattern can be found from historical data and used for prediction in the future. In recent years, a large number of traffic prediction studies have emerged. Statistical methods were first applied, including historical average (HA), vector autoregression (VAR), autoregressive integrated moving average (ARIMA) model, Kalman filtering model, etc. With the development of deep learning, regression models such as feed forward neural network model and deep belief network (DBN) are used for traffic flow prediction, and recurrent neural network (RNN) and its variants long short-term memory network (LSTM) and gated recurrent unit (GRU) are also used to model the temporal dependency of traffic flow data. However, the above methods only model the temporal dependency of traffic flow data, but ignore the spatial dependency between different road network nodes. The existing view is generally that traffic forecasting tasks are different from general time series forecasting tasks. In addition to capturing temporal dynamic patterns such as trends and periodicity, the spatial dependencies under the constraints of the road network structure are more important.
[0004] In order to capture spatial dependencies, models based on convolutional neural networks (CNNs) are used to model the spatial dependencies of road network nodes. However, this model is only applicable to Euclidean data, not non-Euclidean road network data. Therefore, graph neural networks (GNNs) that can represent discretized irregular data are used to model complex road networks and have become the de facto classic model for traffic prediction. This type of method mainly abstracts a local connection relationship between nodes from the static road network topology and models it as a spatial graph input into the GNN structure. The flow of traffic information between nodes is realized through the message propagation mechanism of GNN, such as temporal graph convolutional networks (T-GCN), Graph wavenet, spatio-temporal graph convolutional networks (STGCN), etc. There are also methods that consider the effect of spatial dependencies on the time axis and combine the spatial graph with the time graph and input it into the GNN structure, such as STSGCN, STFGNN and STGODE.
[0005] The essence of spatial dependency is to accurately describe how traffic information is transmitted between road network nodes, that is, how the transmission of traffic information is affected by other road network nodes. However, the movement behavior of microscopic vehicles has very large uncertainties, which makes it inherently difficult to track and predict the transmission of traffic information in the road network, especially in long-term prediction. The transmission of traffic information is a global and dynamic process. The static and local spatial dependency relationship portrayed by the spatial graph cannot express the transmission of global and dynamic traffic information (Global-dynamic Traffic information, GDTi) between road network nodes. How to model the transmission of GDTi in the road network and predict traffic information at future moments through the message propagation mechanism of GNN is a key issue in long-term prediction. Summary of the invention
[0006] In view of this, the present invention proposes a new hypothesis: the transmission of GDTi has strong uncertainty at the micro level, but at the macro level it manifests itself as a stable causal relationship (Transmitting CausalRelationship, TCR) of traffic flow transmission, which is approximable in the long-term transmission of global and dynamic traffic flow, and can be modeled by spatiotemporal Granger causality. Based on this hypothesis, the present invention proposes a spatiotemporal Granger causality to approximate the long-term transmission of GDTi, thereby capturing the global and dynamic spatial dependencies required for long-term prediction. On this basis, the present invention proposes a graph neural network traffic flow prediction framework (STGC-GNNs) using spatiotemporal Granger causality graphs to make predictions based on the transmission of GDTi.
[0007] The traffic flow prediction method based on spatiotemporal Granger causality disclosed in the present invention comprises the following steps:
[0008] The global dynamic traffic information GDTi expresses the spatial dependency of the road network under long-term prediction, which is specifically manifested as the causal relationship TCR transmitted by traffic flow. The causal relationship TCR transmitted by traffic flow is modeled as a spatiotemporal Granger causality graph;
[0009] Considering the spatiotemporal coupling of global dynamic traffic information GDTi during transmission, TCR is captured according to a spatiotemporal alignment algorithm; the spatiotemporal alignment algorithm considers the time for the causal relationship in TCR to be transmitted from the cause node to the result node, aligns the time series according to the spatial distance of the starting point of the global transmission of global dynamic traffic information GDTi in the road network, and models the spatiotemporal lag of TCR transmission;
[0010] The spatiotemporal Granger causality test method is used to test which two nodes have GDTi transmission from the aligned time series, thereby capturing the stable TCR under dynamic traffic flow;
[0011] The obtained spatiotemporal Granger causality test graph is input into a GNN-based traffic prediction model to capture the temporal dependency and spatial dependency of the traffic network at the same time; the GNN-based traffic prediction model includes two modules, one for modeling temporal dependency and the other for modeling spatial dependency using GNN; wherein the GNN structure propagates and integrates traffic information between nodes with spatial dependency.
[0012] The beneficial effects of the present invention are as follows:
[0013] A spatiotemporal Granger causality is proposed to model TCR. This causal relationship can express a global and dynamic spatial dependency relationship, and can capture GDTi to improve the long-term prediction effect. The present invention first models the order and hysteresis of TCR global transmission through a spatiotemporal alignment algorithm, and on this basis uses the Granger causality test to detect TCR between nodes.
[0014] A graph neural network traffic flow prediction framework using spatiotemporal Granger causality graphs (STGC-GNNs) is proposed to improve the long-term prediction effect, which is compatible with all GNN-based traffic flow prediction models that use spatial graphs to model spatial dependencies.
[0015] A performance comparison experiment was conducted on a real-world dataset with high prediction complexity. The results showed that the method of the present invention can perform better than the backbone model in long-term predictions of 45 minutes and 60 minutes. The visualization results show that the present invention can improve the prediction of points with high prediction difficulty such as intersections, edge points and remote points in the transportation system at all prediction durations, which can further verify the effectiveness of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 Schematic diagram of the time dependence of the present invention;
[0017] Figure 2 Schematic diagram of spatial dependence of the present invention;
[0018] Figure 3 Schematic diagram of the spatiotemporal dependence of the present invention;
[0019] Figure 4 Schematic diagram of the transmission of traffic information on the time axis and space axis of the present invention;
[0020] Figure 5 The schematic diagram of the present invention when performing a 15-minute prediction on the same traffic network;
[0021] Figure 6 The schematic diagram of the present invention when performing a 30-minute prediction on the same traffic network;
[0022] Figure 7 Schematic diagram of the traffic prediction model based on GNN of the present invention;
[0023] Figure 8 Schematic diagram of the comparison before and after the time-space alignment of the present invention;
[0024] Fig. 9 Schematic diagram of the traditional Granger causality verification method;
[0025] Fig.10 Schematic diagram of the spatiotemporal Granger causality verification method of the present invention;
[0026] Fig.11 The spatiotemporal Granger causality verification method of the present invention captures a schematic diagram of long-range spatiotemporal dependence. DETAILED DESCRIPTION
[0027] The present invention is further described below in conjunction with the accompanying drawings, but the present invention is not limited in any way. Any changes or substitutions made based on the teachings of the present invention belong to the protection scope of the present invention.
[0028] For mainstream and widely used GNN-based methods, modeling of spatial dependencies is particularly important. The essence of spatial dependencies is to accurately describe the transmission of traffic information between road networks. This task is very difficult in traffic flow prediction of complex road networks, especially long-term prediction. The local and static spatial dependencies modeled by existing methods cannot describe the state of global diffusion caused by long-range and dynamic transmission of traffic information, that is, spatial graphs cannot model the transmission of global and dynamic traffic information (Global-dynamic Traffic information, GDTi) in the road network. How to model the transmission of GDTi in the road network and predict traffic information at future times through the message propagation mechanism of GNN is a key issue in long-term prediction.
[0029] In order to capture the transmission of GDTi, the present invention proposes a TCR hypothesis and further uses spatiotemporal Granger causality to express TCR to achieve modeling of global and dynamic spatial dependencies.
[0030] The modeling of spatial dependencies is essentially capturing the transmission of traffic information between different nodes in the road network. For long-term traffic prediction tasks, traffic information has global and dynamic characteristics due to long-term transmission, so it is difficult to capture it accurately. Globality describes the long-range distance spanned by this transmission on a spatial scale, while dynamicity describes its uncertainty and complexity on a temporal scale. In order to model the transmission of GDTi in space as accurately as possible, this section proposes a hypothesis, the Transmitting Causal Relationship (TCR), which holds that the key to long-term prediction lies in modeling the transmission of global and dynamic traffic information in the road network. This transmission has very strong uncertainty and complexity at the micro level, but manifests itself as a stable causal relationship at the macro level.
[0031] Since the traffic flow data observed in the real world is the result of the dynamic changes of traffic information and the complex topological constraints of the road network, and the transmission of traffic information is not independent in time and space, the existence of three dependencies can be derived, making the traffic flow prediction task more challenging. In this section, in order to make the assumptions and subsequent methods of the present invention clearer, the three dependencies and their derived lags are first redefined, and three observations in the real traffic system are described to support the basic assumptions and motivations of the method in this paper. It should be noted that when defining spatial dependency, since the present invention wants to capture a transitive spatial dependency, and this dependency is directed, the definition of target node and source node is derived, which is novel for the field of traffic flow prediction.
[0032] Definition 1: Temporal dependency refers to the influence of the traffic information of the same node at the current time step on the traffic information at the future time step.
[0033] Definition 2: Time lag is the time interval between the transmission of traffic information in two time steps of time dependence.
[0034] Definition 3: Spatial dependency represents the impact of a node’s traffic information on other nodes’ traffic information at the current time step.
[0035] Definition 4: Spatial hysteresis is the distance between two spatially dependent nodes in sending traffic information in one time step.
[0036] Definition 5: Target Node and Source Node
[0037] When a pair of nodes have a spatial dependency relationship, the present invention refers to the node that transmits traffic information as an out-node and the node that receives traffic information as an in-node. Figure 3 , node 4 is the source node, and nodes 1, 2, 3, 5, and 7 are the target nodes.
[0038] Definition 6: Spatiotemporal dependency represents the impact of a node’s traffic information at the current time step on the traffic information of other nodes at future time steps.
[0039] Definition 7: Spatiotemporal lag is the time lag consumed by different spatiotemporal dependent nodes in transmitting traffic information.
[0040] Observation 1:
[0041] Since the traffic nodes in the road network are not completely independent, but interact with other nodes as the vehicles move, which is manifested as the transmission of traffic information, there will be dependencies between the interacting nodes. This dependency exists between nodes with different spatial positions, which is called spatial dependency. In the GNN-based model, for the node to be predicted, if the spatial dependency can be correctly modeled, the information of other nodes can be correctly introduced, thereby improving its own prediction.
[0042] The present invention observes that for GNN-based models, since the spatial dependencies between nodes are modeled through the input graph, it is possible to determine whether the input graph contains valid spatial dependencies by comparing the prediction results of the input graph with different inputs and the input graph with only self-connections. On the METR_LA dataset, the prediction results of the model when the input graph is a spatial distance graph (described by the spatial weighting matrix) and a self-connection graph (described by the identity matrix).
[0043] For different GNN-based traffic prediction models, at any prediction scale (horizon), as the nodes connected to the target node in the input graph change, the model prediction results will also change. In most cases, the prediction results of the input spatial weight matrix are better than those of the input unit matrix, which shows that it is necessary and effective to consider the spatial dependencies between other nodes and the target node when making traffic predictions; however, when horizon = 45min, the prediction results of STGCN when the spatial weight matrix is input are worse than those of the input unit matrix, which shows that when the captured spatial dependencies are incorrect or redundant, the model prediction results may be worse than the prediction results using only the target node information itself. The present invention believes that the reason behind this phenomenon is caused by spatial dependency.
[0044] Therefore, for the GNN-based traffic prediction model, the construction of the input graph that models the spatial dependency will directly affect the prediction effect of the model, even if all other settings of the model remain the same. Therefore, for the GNN-based traffic prediction model, spatial dependency must be considered.
[0045] Observation 2
[0046] In the real world's traffic system, since the process of moving a vehicle from one node to another requires both crossing a spatial distance and consuming time, traffic flow can be regarded as the process of transmitting traffic information across time and space. This observation shows that the transmission of traffic information on the time axis and space axis in the traffic network is not independent, but affects each other. This is the spatial-temporal entanglement in the transmission of traffic information. Figure 4 ,The arrows between different time slices represent the transmission of traffic information on the time axis, while the arrows between different nodes represent the transmission of this part of traffic information across space.
[0047] The key to traffic prediction is to model the distribution of traffic flow on the road network over time, that is, the spatiotemporal dependency. However, due to the spatiotemporal entanglement in the transmission of traffic information, the spatiotemporal dependency is not equal to the addition or concatenation of the temporal dependency and the spatial dependency. Therefore, if you want to capture the spatial dependency of the road network from the traffic information under global transmission, you must consider the spatiotemporal lag of the cross-space transmission of traffic information. The present invention takes this observation into account in Algorithm 1.
[0048] Existing methods generally believe that the spatial distribution of road network nodes is an important indicator for measuring spatial dependencies. Therefore, traffic network topology graphs or spatial distance weighting graphs are often used as spatial graphs to input into the GNN structure. In essence, they model a local, static dependency, that is, the spatial dependency obtained by the fixed distribution of road network nodes in a certain area. However, when traffic information is transmitted over a long period of time, it will show globality in space and complex dynamics in time. The present invention calls the traffic information transmitted in this way Global-Dynamic Traffic Information (GDTi). The key to long-term prediction lies in modeling the transmission of GDTi, so it cannot be described by local, static spatial dependencies.
[0049] Figure 5 , Figure 6 The diagrams are respectively for the 15-minute and 30-minute predictions for the same traffic network. Assume that in this traffic system, it takes 15 minutes for traffic information to be transmitted between two adjacent traffic intersections. Then, when the present invention predicts the traffic characteristics (such as flow rate, flow rate, etc.) 15 minutes after the target intersection, it only needs to track the traffic characteristics of the first-order neighbor node at the current moment, because this part of the traffic characteristics will consume 15 minutes to be transmitted to the target node.
[0050] Similarly, when predicting the short-term traffic of the target node for 30 minutes, it is necessary to track the traffic characteristics of the second-order neighbor nodes. It can be inferred that when predicting a prediction time of 45 minutes or longer, the nodes that need to be tracked will be farther away from the target node. Therefore, it is necessary to capture the transmission of GDTi with a transmission time of 45 minutes, which is difficult to capture with the existing spatial graph.
[0051] TCR hypothesis
[0052] In order to capture the transmission of GDTi in the long-term prediction lower network as accurately as possible, the present invention proposes the TCR hypothesis, and based on the above observations, further hypothesizes the properties of TCR to obtain the present invention. According to Observation 1 and Observation 3, the present invention believes that the spatial dependency of the long-term prediction lower network can be expressed by the transmission of GDTi, specifically as a TCR, so the present invention attempts to capture this TCR and directly model it as a graph input into the GNN structure; according to Observation 2, in the process of capturing TCR, the present invention considers the spatiotemporal coupling of GDTi during transmission and designs a spatiotemporal alignment algorithm.
[0053] like Figure 7 As shown, the GNN-based traffic prediction model can always be formalized as a module that captures spatial dependencies and a GNN that captures spatial dependencies. Among them, the spatial dependencies are modeled as graphs and input into the GNN structure. However, the local and static spatial dependencies described by existing spatial graphs may fail in long-term predictions. The present invention proposes a spatial-temporal granger causality test method that captures a global and dynamic spatial dependency and models it as a spatial-temporal Granger causality graph and inputs it into the framework.
[0054] The essence of spatial dependency is to accurately capture the transmission of traffic information between road networks. Although the transmission uncertainty of GDTi at the micro level is very large and therefore difficult to capture, it tends to a stable pattern at the macro level. The present invention believes that this pattern can be detected from the long-term observation of the global transmission of dynamically changing traffic information. This pattern is manifested as a causal relationship (Transmitting Causal Relationship, TCR) of traffic flow transmission at the macro level. This relationship is modeled as a spatiotemporal Granger causality graph.
[0055] Based on the TCR hypothesis, the present invention further proposes a spatiotemporal Granger causality test method that can capture the global and dynamic spatial dependencies in the road network. The spatiotemporal Granger causality prediction method is further divided into two modules. The spatiotemporal alignment module considers the time for the causal relationship in TCR to be transmitted from the cause node to the result node, aligns the time series according to the spatial distance of the starting point of the global transmission of GDTi in the road network, and models the spatiotemporal lag of TCR transmission; the Granger causality test module
[0056] (Granger causality test module) can test which two nodes have GDTi transmission from the aligned time series, thereby capturing stable TCR under dynamic traffic flow.
[0057] According to the TCR hypothesis, the process of GDTi transmission can be regarded as the process in which the cause node produces a causal relationship with the result node, that is, the process of TCR. According to Observation 2, it can be derived that TCR has two significant properties:
[0058] Causal lag: There is a time difference between the occurrence of the result and the cause, which is manifested as a spatiotemporal lag between the cause node and the result node in the traffic network.
[0059] Causal order: The result always occurs or is observed after the cause. In the traffic network, it is manifested as the time when the result node receives GDTi always occurs after the cause node releases GDTi.
[0060] Therefore, the present invention designs a spatial-temporal alignment algorithm, which is divided into two steps:
[0061] 1) According to the causal lag, calculate the time consumed by the TCR to transfer from the cause node to the result node, that is, the spatiotemporal lag between the two
[0062] 2) According to the causal order, the present invention shifts the time series of the cause node along the time axis by s time steps, aligns the time when the TCR is generated on the cause node and acts on the effect node, thereby ensuring that the causal mechanism can be directly inferred from the observed results.
[0063] According to the above definition, for TCR, the source node is the cause node, and the target node is the result node. The spatial lag between nodes is the spatial distance between them, and the spatial-temporal lag is the time required for GDTi to flow from the cause node to the result node, that is, the time required for TCR to be transmitted. Since the spatial-temporal lag between nodes is not only related to the spatial distance between nodes, but also to the speed of traffic information flow, which cannot be accurately measured, the present invention uses the average speed of the source node as an approximation of the traffic information flow speed.
[0064] Algorithm 1. Spatiotemporal alignment algorithm
[0065] The spatiotemporal alignment algorithm is to shift the time series of the source node backward along the time axis with a step size equal to the spatiotemporal lag between the source node and the target node. The spatiotemporal lag is equal to the ratio of the spatial lag between the source node and the target node to the average traffic speed of the source node.
[0066] like Figure 8 , B is the source-node, A is the target-node, (a) is before alignment, and (b) is after alignment.
[0067] After the cause node and the result node are aligned in time and space, the present invention believes that the cause node and the result node contain the same part of GDTi at the same time, and whether there is a flow of GDTi can be directly inferred from the observed time series of the two. Therefore, the present invention needs to solve another important problem, how to detect TCR from a long-term observed and dynamically changing time series.
[0068] Based on the observation of real-world systems, in the process of traffic flow transmission, the traffic information of the downstream node will contain the traffic information of its upstream node, so the traffic characteristics of the upstream node can significantly improve the traffic characteristics prediction of the downstream node. The Granger causality test believes that the time series variable that can significantly improve the prediction effect after addition is the cause, and the improved one is the result, which is noticed by the present invention. Therefore, the present invention believes that the TCR in the traffic system may be manifested as the existence of Granger causality in the time series of the road network nodes. Using the Granger causality test algorithm, the starting relationship of the transmission can be detected from the time series after the two nodes are aligned. This starting relationship can express a global and dynamic spatial dependency.
[0069] Granger causality analysis is a method to determine whether there is a causal relationship between different time series. The basic idea is: if the result of predicting Y using the historical information of time series X and Y is better than the result of predicting Y using only the historical information of Y, that is, time series X helps to explain the future trend of time series Y, then time series X is the Granger cause of time series Y.
[0070] There are two important assumptions behind Granger causality analysis:
[0071] 1) Adding information about the cause variable can provide more information for restoring the result variable: If time series X is the cause of time series Y, then using the data of time series X and Y at the same time can better predict time series Y than using only the data of time series Y.
[0072] 2) When using past data to predict future data, time lag needs to be considered. Whether only using the historical information of Y to predict Y, or adding time series X to predict Y, it is necessary to consider the time series value of m steps before the current moment, where m is the time lag value set by the model.
[0073] Based on the above assumptions, the Granger causality test method establishes vector autoregression models for the above two predictions as follows:
[0074]
[0075]
[0076] Where X t-j and Y t-j Represent the values of the traffic flow data of time series X and Y at time tj, α j 、a j and b j represents the regression parameter of the autoregressive model, ε Y and ε Y|X Represent the residuals of the two autoregressive models respectively, and m represents the order of the model, which can also be understood as the temporal lag. Y|X )<υar(ε Y ), then we can judge that time series X has a statistically significant Granger causal relationship with time series Y, which can be expressed as:
[0077] X Granger-causes Y
[0078] According to the Granger causality analysis method, the time series of node A and the time series of node B When performing the Granger causality test, the present invention requires the simultaneous input of the time series X to be tested. A and X B :
[0079] H0 hypothesis:X Bdoes not Granger-cause X A
[0080] The time series of the two nodes are input into the Granger causality test. If the returned p-value is lower than the significance level, the null hypothesis is rejected, and the conclusion is that node B is the Granger cause of node A. Fig. 9 It is the traditional Granger causality test method:
[0081] The present invention inputs the time series of the two aligned nodes into the Granger causality test module, that is, uses the spatiotemporal Granger causality test method to test the TCR between the two nodes, such as Fig.10 .
[0082] The spatiotemporal Granger causality test can detect the Granger causality between two traffic nodes, which can show global and dynamic spatial dependencies. In order to model the relationship captured by the spatiotemporal Granger causality test as an input graph and input it into the GNN-based model for prediction, combined with the actual observation of traffic prediction, the present invention makes the following settings:
[0083] In order to prevent the long-range spatiotemporal dependencies from being filtered out, the present invention does not obtain the input graph through a distance threshold or topological adjacency, but models the distance between nodes as spatiotemporal hysteresis and uses the spatiotemporal Granger causality test to detect the spatial dependencies under global transmission. It should be noted that the present invention does not directly use the cost "cost" provided in the data set (indicating the spatial distance between different nodes), but calculates the shortest distance between two nodes in the road network and obtains the minimum cost. The reason is to retain the detected spatial dependencies as much as possible, because the original data set cannot provide all the costs between any two nodes, even two very close nodes. In this way, the spatiotemporal hysteresis in the long-range spatial dependencies can be obtained, because the original data set is likely not to provide the cost between very far nodes.
[0084] Directionality of causes and effects: Spatiotemporal Granger causality, as a manifestation of spatial dependencies between nodes, describes a causal relationship of traffic information transmission, which can be understood as the tracking of traffic information in the real world. Among them, the cause node corresponds to the source node of the traffic flow and the result node corresponds to the target node of the traffic flow. Therefore, unlike the undirected dependency of nodes in the spatial graph, the relationship between nodes in the spatiotemporal Granger causality test graph is directional, and the direction is from the cause node to the result node. This is not only consistent with the situation in the real world, that is, traffic information always flows from the source node to the target node, but also consistent with the message passing mechanism of GNN, that is, the information of the cause node can be transmitted to the result node and the characteristics of the result node can be updated, thereby helping the result node to make better predictions.
[0085] Finally, the present invention inputs the obtained spatiotemporal Granger causality test graph into the GNN-based traffic prediction model, which can simultaneously capture the temporal dependency and spatial dependency of the traffic network. The GNN-based traffic prediction model includes two modules, one for modeling temporal dependency such as RNN and its variable parameters, and one for modeling spatial dependency using GNN. Among them, the GNN structure can propagate and integrate traffic information between nodes with spatial dependency, which can well describe the transmission of GDTi. The present invention will evaluate the predictive traffic capability of the output results of the GNN-based traffic prediction model.
[0086] Experiments and Results
[0087] The present invention conducts experiments on the real-world dataset METR_LA, which is a Los Angeles highway dataset in the United States and one of the benchmark test sets for traffic prediction. For this dataset, the spatial graph is modeled in the form of a spatial weight graph (also known as a spatial distance graph, SD graph), that is, Gaussian filtering is used to convert the spatial distance between nodes into weights.
[0088] Based on Observation 1, the present invention compares the prediction differences of STGCN using self-connection (adjacency matrix is unit matrix) and SD graph (adjacency matrix is spatial weight matrix) as input on two highway datasets in the United States. The former represents the case where only the time dependency of nodes is used for prediction, while the latter represents the case where spatial dependency is introduced, as shown in the following table:
[0089]
[0090] It can be found that on the PEMS_BAY dataset, the prediction effect of the GNN-based model when using the self-connected graph as input is very close to that of the SD graph, while on METR_LA, the difference between the two is very significant, and the overall prediction error of PEMS_BAY is small. This shows that the METR_LA dataset has high complexity and prediction difficulty, and can more significantly compare the impact of different input graphs on model prediction, so this paper chooses this dataset for experiments and analysis.
[0091] The basic information of the METR_LA dataset is as follows.
[0092]
[0093] In order to more directly compare the effectiveness of the input graph itself in capturing spatiotemporal dependencies, the present invention selects three GNN-based models that directly use the input graph instead of performing transmission operations like the attention mechanism. This type of model can use the GNN mechanism to transmit, aggregate and update messages according to the dependencies expressed by the input graph, and can directly reflect the improvement of target node prediction by neighbor node information. Since the STGC graph of the present invention is pluggable, the present invention selects the representative GNN structure models T-GCN, STGCN and Graph Wavenet, which can be unified into the framework proposed by the present invention for comparison.
[0094] This invention uses these three types of models as the backbone model, namely the traffic prediction model based on GNN. In addition to this operation, in order to conduct a fair and effective evaluation of the effect of the method in this paper, the division of the data set, the structure of the model and the training settings are all consistent with the original model.
[0095] In order to evaluate the effect of the present invention on the traffic flow prediction task, the present invention uses the following indicators as the real traffic flow data Y t and forecast data Measures of difference:
[0096] (1) Mean Absolute Error (MAE):
[0097]
[0098] (2)Mean Absolute Percentage Error(MAPE):
[0099]
[0100] (3)Root Mean Squared Error(RMSE):
[0101]
[0102] The present invention performs performance evaluation on four prediction dimensions (horizon) of 15min, 30min, 45min and 60min, and the comparison results are as follows, where the backbone using SD graph as the input graph uses the original model name, while STGC- represents the model using the spatiotemporal Granger causality graph as the input graph.
[0103] It can be seen that for the same backbone model, in the short-term prediction of 15 minutes and 30 minutes, SD graph has better prediction effect in all indicators, while in the long-term prediction of 45 minutes and 60 minutes, the spatiotemporal Granger causality graph has better effect than SDgraph. This shows that the spatial dependency relationship constructed by local and static connection relationships can capture most of the nodes that have interactions in a short period of time for the target node, but this relationship seems to be invalid in long-term prediction. Long-term prediction needs to capture long-range dependencies, which needs to be detected in the global transmission of traffic information.
[0104]
[0105]
[0106] The comparative experiment between the space-time Granger causality graph and the SD graph under the control variable setting has been able to show that the space-time Granger causality graph is more effective than the SD graph in long-term prediction. In order to further illustrate that the effectiveness of the space-time Granger causality graph is brought by itself and not just because of the failure of the SD graph, the present invention uses the case where the input graph is a self-connected graph only (the adjacency matrix is a unit matrix) as a comparison. The experiment shows that the space-time Granger causality graph can achieve better results than the self-connected graph in long-term prediction, which shows that the space-time Granger causality graph models effective spatial dependencies. The experimental results are shown in the following table, where (-) represents the case where the input graph is a self-connected graph only.
[0107]
[0108]
[0109] At the same time, in order to prove that the effectiveness of this long-term prediction is not caused by randomness, the present invention takes STGCN as an example and adds a random group for comparison. For each prediction duration, the present invention generates 10 random graphs with the following settings: 1) The sparsity of the random graph edges is consistent with the spatiotemporal Granger causality graph; 2) For each node, the number of neighbor nodes in the random matrix and in the spatiotemporal Granger causality graph is consistent; 3) The ID of the neighbor node is randomly generated, and the final accuracy is averaged by the evaluation results of the 10 random graphs, marked as STGCN (random).
[0110] Taking the MAE indicator as an example, it can be seen that as the prediction time increases, the prediction capabilities of STGC-STGCN and STGCN (random) remain relatively stable. Among them, STGC-STGCN achieves the best results in long-term prediction, while STGCN (random) has always performed poorly. This is not surprising because it randomly introduces information from other nodes, and this randomness does not make the model have a good effect. It is worth noting that when the prediction time is 30 minutes, the random matrix achieves better results than the unit matrix, and the effect is equivalent to the unit matrix when the prediction time is 60 minutes. This shows that ignoring spatial dependencies limits the prediction ability of the model on the one hand, and on the other hand, relying on luck may achieve better results than relying on oneself alone, even if this luck is not always reliable.
[0111] The original model (STGCN) using the SD graph showed a significant decrease in ability between 30 minutes and 45 minutes, while the prediction ability using the spatiotemporal Granger causality test graph was much more stable. This also proves the observation result 2 of the present invention.
[0112] Although the method of the present invention only exceeds the original model using SD graph in the long-term prediction of 45 minutes and 60 minutes, for the 207 nodes in the METR_LA dataset, some location nodes are densely distributed, the upstream and downstream relationships are simple, and the prediction difficulty is low, while some nodes are located at intersections, the distribution is sparse, and the prediction difficulty is greater. Therefore, the prediction accuracy of each node in the present invention is statistically analyzed and visualized on OpenStreetMap.
[0113] (1) Visualization of STGC prediction accuracy
[0114] In the long-term prediction of 45 minutes and 60 minutes, the method of the present invention can achieve better results than SDgraph on most nodes. For some nodes, the method of the present invention can achieve better results than SDgraph in all prediction durations. These nodes are often located at the edge and intersection of the road network system, and have good prediction effects for remote points, which shows that the method of the present invention has better effects in all dimensions for nodes with greater prediction difficulty.
[0115] (2) STGC interpretability visualization
[0116] In order to explain the spatiotemporal Granger causality noticed by the present invention and compare it with the spatial connection relationship depicted by the SD graph, the present invention visualizes the road network and its spatial dependency: the nodes to be predicted are marked in gray, the original road network nodes are marked in light gray, the cause nodes are marked in red (with car icon), the result nodes are marked in blue (with car icon), and the adjacent nodes in the SD graph are marked in green (with car icon).
[0117] STGC directionality. Since the spatiotemporal Granger causality graph describes the causal relationship between nodes, this causal relationship is a manifestation of the spatial dependency between nodes, and can characterize a spatial dependency caused by global traffic information transmission, which corresponds to the upstream and downstream relationship of traffic flow in the real world. The causal relationship noticed by the present invention is verified with the help of the direction marked on the highway by OpenStreetMap, and the result node (target node) should be in the downstream direction of the cause node (sourcenode). It can be found that the cause (upstream) and result (downstream) detected by the present invention are consistent with the direction marked on the highway on the map.
[0118] The local connection relationship constructed in the SD graph is a static relationship generated from the unchanging road network spatial structure (node location distribution, road network topology, etc.). This relationship has no direction and cannot describe the interaction caused by dynamic traffic flow. The traffic on the highway is subject to traffic regulations. Even if the distance between nodes on roads with different traffic directions is very close, it is difficult for them to interact directly if they are not at an intersection. However, if we only judge based on spatial distance without considering the possibility of actual interaction, it is likely to introduce erroneous spatial dependencies. The spatial dependencies captured in the SD graph cannot actually generate traffic flow interactions. Introducing the information of these nodes is difficult to really help the target node make predictions. This is why spatial distance does not represent everything.
[0119] Since spatiotemporal Granger causality describes the spatial dependency caused by the global transmission of traffic flow in the road network, it can more accurately model the direction of traffic flow transmission and, in a certain sense, avoid introducing erroneous information. The spatiotemporal Granger causality node of the target node always appears on its downstream section, while the spatially connected node may appear on the road in the opposite direction of the same direction, either upstream or downstream.
[0120] STGC captures long-range spatial dependencies. In terms of capturing long-range spatial dependencies, spatiotemporal Granger causality can capture long-range spatial dependencies, while the local connection relationships modeled by SD graphs often only include nodes with relatively close spatial distances, which will not spend more time interacting with the predicted nodes. Fig.11 , the predicted node is Fig.11 On the left side of the figure above, the long-range spatial dependence captured by the space-time Granger causality can be extended to Fig.11 Right side of the picture below.
[0121] In this section, the present invention analyzes the possible reasons why spatiotemporal Granger causality can surpass SDgraph in prediction durations of 45 minutes and longer.
[0122] Spatial distance is not everything: In many traffic prediction datasets, the spatial distance between nodes is not the actual geographical distance between nodes, but the distance from one node to another along the road network. This distance needs to be measured in reality and cannot be obtained only by the longitude and latitude of the node. Therefore, in the original dataset, there may be a problem of missing data, that is, the distance value between two adjacent nodes is missing. However, the construction of the SD graph only considers the distance recorded in the dataset, so it may happen that: closer nodes are not connected in the SD graph, but farther nodes are connected, even if the closer nodes are reachable.
[0123] In addition, in a traffic system such as a highway where there are obvious physical restrictions between roads in different directions, even if the spatial distance between two nodes is very close, it may take a long time to connect. If the two nodes are judged to be spatially dependent, it may bring poor prediction results. For example, in the SDgraph generated by spatial distance filtering, two nodes on roads with opposite traffic directions are judged to be adjacent. The erroneous information in this data set may cause the prediction effect of the SD graph to deteriorate. The present invention is equivalent to making another judgment on whether there is GDTi transmission based on the direct use of this information, which can identify such erroneous connections and avoid the negative impact.
[0124] The present invention has statistically analyzed the spatiotemporal hysteresis of each pair of nodes in the road network and found an interesting phenomenon. Under ideal conditions (i.e., the interaction between nodes is planned with the shortest path and the average flow rate of the source node is maintained to be smoothly transmitted), most nodes can complete the interaction within 30 minutes (spatiotemporal hysteresis <= 6), and the farthest nodes can also complete the interaction within 45 minutes (spatiotemporal hysteresis <= 9), which is the capability boundary range of the SD graph method. In other words, when the prediction duration is > 45 minutes, a large amount of traffic flow may have left the system, and the new flow entering the system is unknown. Therefore, the overall flow in the system cannot be guaranteed to be constant. In this case, the uncertainty of traffic information transmission becomes further increased, and the spatial dependency that needs to be captured by the prediction is still the long-range dependency, but it can no longer be inferred solely based on the spatial position, and a stable association must be mined from the observed data. Therefore, the present invention conjectures that when the prediction duration exceeds the maximum transmission time in a traffic system, the local and static connection relationship is not enough to cope with this uncertainty. The present invention essentially mines a stable spatial dependency relationship from the time series of long-term observation and dynamic global transmission, which can solve the problem of long-term prediction to a certain extent. How to model this uncertainty and how to track the transmission of traffic flow are issues that can be considered and solved in the future.
[0125] Whether the spatial dependency is dynamically changing or constant: Traffic flow is actually an observable value at the macro level generated by a large number of micro-level vehicles moving in the road network. The trajectories of these micro-level vehicles have very high uncertainty, but at the macro level, they show a series of regularities / patterns. Among them, the recognition of spatial patterns is established through spatial dependencies. The construction of SD graph is essentially to establish spatial dependencies from a static road network with unchanged spatial structure. The assumption behind it is that the closer the space is, the stronger the spatial dependency is. Therefore, this spatial dependency is actually static and local. However, as observed by the present invention, traffic time series are actually dynamic and complex with time and space, and are potentially affected by multiple factors such as the environment and society. Static spatial dependencies are no longer sufficient to describe the spatial dependencies of road network changes. The method of the present invention starts with observation data, that is, the time series of all nodes in the road network generated under global transmission of traffic information, and attempts to detect the spatial dependency of the road network. The present invention assumes that although the spatial dependency of the road network is dynamically changing, there will be a balance, that is, there is a stable spatial dependency relationship, and the changing spatial dependency is always approaching this steady state, so this steady state can explain the spatial dependency of the road network to the greatest extent and is helpful for prediction. The method of the present invention detects a spatial dependency relationship from a dynamically changing traffic time series, which can approach this steady state to the greatest extent. Therefore, in certain time periods or prediction scales, the prediction effect of the present invention may deviate from the actual situation. In the future, you can choose to input in time periods, detect a spatiotemporal Granger causality diagram for each time period, and realize dynamic modeling of spatial dependencies, which may be better for complex traffic prediction problems.
[0126] What is the role of the time graph: In the GNN-based traffic prediction model, there is also a type of model that combines the spatial graph with the time graph as input. In this type of model, the time graph often chooses to connect nodes with higher time series similarity, which can make up for the shortcomings of the spatial graph that only uses static local connection relationships to a certain extent. However, when making decisions, this type of model often uses operations such as cropping or max pooling to ensure the effect, and in fact still mainly relies on the spatial graph. This article does not make comparisons and improvements on this type of model, because the method of the present invention also detects relationships from observed time series, which may be redundant with the information contained in the time graph. The present invention believes that the time graph is actually modeling the effects of spatial dependencies on the time axis, which can help model spatial dependencies more accurately, but how to play its role is an open question to be discussed.
[0127] The beneficial effects of the present invention are as follows:
[0128] The present invention proposes a spatiotemporal Granger causality verification method, which can model the spatial dependency of road networks and capture the global and dynamic transmission of traffic information in the road network. Different from the static spatial dependency of local connections generated from the spatial distribution of road networks, the spatiotemporal Granger causality verification method proposed in the present invention can capture long-range dependencies and approximate the causal relationship (TCR) of the stable traffic flow transmission behind the dynamic changes of long-term observed traffic flows, so it can perform better in long-term predictions of 45 minutes and 60 minutes. Starting from three observations in the real world, the present invention mainly makes the following improvements compared to the existing spatial dependency modeling method using SD graph:
[0129] 1) Considering the importance of spatial dependency in traffic prediction tasks, combined with the graph structure's ability to express relationships and the GNN model's ability to propagate and aggregate information, this paper attempts to construct a spatial dependency that can be embedded in the GNN-based traffic prediction model to help prediction;
[0130] 2) Considering that traffic flow transmission is a spatiotemporal interactive process, there is spatiotemporal coupling in the transmission of traffic information, which cannot be ignored especially in global transmission. Based on this, the present invention further derives the order and lag of TCR and models it using the spatial-temporal align algorithm;
[0131] 3) Considering the long-range dependencies required for long-term prediction, the present invention chooses to approximate a stable causal relationship from the dynamic changes of the globally transmitted traffic flow, rather than capturing a local relationship from the static road network structure.
[0132] Finally, the causal relationship obtained by the present invention is directional and can correspond well to the source nodes and target nodes of traffic information transmission in the real world. Experiments on the METR_LA dataset show that the method of the present invention can exceed the effect of the original model at 45min and 60min on three GNN-based traffic prediction models. At the prediction level of a single node, the model of the present invention can improve the prediction of intersections, edge points and remote points at all scales. The upstream and downstream relationships of traffic information transmission at intersection nodes are complex. Edge nodes often only rely on upstream or downstream nodes, while remote points rely more on the capture of long-range dependence. This also shows the effectiveness of the method of the present invention for GDTi transmission capture compared to spatial graphs.
[0133] As used herein, the word "preferred" is intended to be used as an example, instance, or illustration. Any aspect or design described herein as "preferred" is not necessarily to be construed as being more advantageous than other aspects or designs. On the contrary, the use of the word "preferred" is intended to present concepts in a specific way. The term "or" as used in this application is intended to mean an inclusive "or" rather than an exclusive "or". That is, unless otherwise specified or clear from the context, "X uses A or B" means any one of the naturally included permutations. That is, if X uses A; X uses B; or X uses both A and B, then "X uses A or B" is satisfied in any of the foregoing examples.
[0134] Moreover, although the present disclosure has been shown and described with respect to one or implementations, those skilled in the art will think of equivalent variations and modifications based on the reading and understanding of this specification and the accompanying drawings. The present disclosure includes all such modifications and variations, and is limited only by the scope of the appended claims. In particular, with respect to the various functions performed by the above-mentioned components (such as elements, etc.), the terms used to describe such components are intended to correspond to any component (unless otherwise indicated) that performs the specified function of the component (such as it is functionally equivalent), even if the structure is not equivalent to the disclosed structure of the function in the exemplary implementation of the present disclosure shown herein. In addition, although the specific features of the present disclosure have been disclosed with respect to only one of several implementations, such features can be combined with one or other features of other implementations that may be desired and advantageous for a given or specific application. Moreover, insofar as the terms "including", "having", "containing" or their variations are used in specific embodiments or claims, such terms are intended to be included in a manner similar to the term "comprising".
[0135] The functional units in the embodiments of the present invention may be integrated into a processing module, or each unit may exist physically separately, or multiple or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium. The above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc. The above-mentioned devices or systems may execute the storage method in the corresponding method embodiment.
[0136] To sum up, the above embodiment is an implementation mode of the present invention, but the implementation mode of the present invention is not limited by the embodiment. Any other changes, modifications, substitutions, combinations, and simplifications that deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.
Claims
1. A traffic flow prediction method based on spatiotemporal Granger causality, characterized in that: The following steps are involved: The global dynamic traffic information GDTi expresses the spatial dependency of the road network under long-term prediction, which is specifically manifested as the causal relationship TCR transmitted by traffic flow. The causal relationship TCR transmitted by traffic flow is modeled as a spatiotemporal Granger causality graph; Considering the spatiotemporal coupling of global dynamic traffic information GDTi during transmission, TCR is captured according to a spatiotemporal alignment algorithm; the spatiotemporal alignment algorithm considers the time for the causal relationship in TCR to be transmitted from the cause node to the result node, aligns the time series according to the spatial distance of the starting point of the global transmission of global dynamic traffic information GDTi in the road network, and models the spatiotemporal lag of TCR transmission; The spatiotemporal Granger causality test method is used to test which two nodes have GDTi transmission from the aligned time series, thereby capturing the stable TCR under dynamic traffic flow; The obtained spatiotemporal Granger causality test graph is input into the GNN-based traffic prediction model to capture the temporal and spatial dependencies of the traffic network. The GNN-based traffic prediction model includes two modules, one for modeling temporal dependency and the other for modeling spatial dependency using GNN; wherein the GNN structure propagates and integrates traffic information between nodes with spatial dependency.
2. The traffic flow prediction method based on spatiotemporal Granger causality according to claim 1 is characterized in that: The time-space alignment algorithm is to shift the time series of the source node backward along the time axis, with a step size equal to the time-space lag between the source node and the target node, and the time-space lag is equal to the ratio of the space lag between the source node and the target node to the average traffic speed of the source node; The spatiotemporal alignment algorithm consists of two steps: According to the causal hysteresis, the time consumed by TCR to transfer from the cause node to the result node is calculated, that is, the time and space lag between the two; According to the causal order, the time series of the cause node is shifted along the time axis by s time steps, and the time when the TCR is generated on the cause node and acts on the result node is aligned, thereby ensuring that the causal mechanism can be directly inferred from the observed results.
3. The traffic flow prediction method based on spatiotemporal Granger causality according to claim 2 is characterized in that: The causal lag is: there is a time difference between the occurrence of the result and the occurrence of the cause, which is manifested as a time and space lag between the cause node and the result node in the traffic network; The causal order is: the result always occurs or is observed after the cause, which is manifested in the traffic network as the time when the result node receives GDTi always occurs after the cause node releases GDTi.
4. The traffic flow prediction method based on spatiotemporal Granger causality according to claim 1 is characterized in that: The spatial lag between nodes is the spatial distance between nodes, and the spatiotemporal lag is the time required for GDTi to flow from the cause node to the result node, that is, the time required for TCR to be transmitted.
5. The traffic flow prediction method based on spatiotemporal Granger causality according to claim 1 is characterized in that: The two vector autoregression models established by the Granger causality test method are as follows: Where X t-j and Y t-j Represent the values of the traffic flow data of time series X and Y at time tj, α j 、a j and b j represents the regression parameter of the autoregressive model, ε Y and ε Y|X Represent the residuals of the two autoregressive models respectively, m represents the order of the model, that is, the time lag value; if υar(ε Y|X )<υar(ε Y ), then we can judge that time series X has a statistically significant Granger causal relationship with time series Y, expressed as: X Granger-causes Y According to the Granger causality analysis method, the time series of node A and the time series of node B When performing the Granger causality test, the present invention requires the simultaneous input of the time series X to be tested. A and X B : H0hypothesis:X B does not Granger-cause X A The time series of the two nodes are input into the Granger causality test. If the returned p-value is lower than the significance level, the null hypothesis is rejected, and the conclusion is that node B is the Granger causality of node A.
6. The traffic flow prediction method based on spatiotemporal Granger causality according to claim 1 is characterized in that: The time series of the two aligned nodes are input into the Granger causality test module, that is, the TCR between the two nodes is tested using the spatiotemporal Granger causality test method. The mathematical formula is as follows: Where p is the time lag, s is the space-time lag, and A t-i represents the value of the traffic flow data of time series A at time ti, B t-s-i represents the value of the traffic flow data of time series B at time tsi, a j and b j represents the regression parameters of the autoregressive model, Represents the residuals from the autoregressive model.
7. The traffic flow prediction method based on spatiotemporal Granger causality according to claim 1 is characterized in that: In order to prevent long-range spatiotemporal dependencies from being filtered out, the input graph is not obtained by distance threshold or topological proximity. Instead, the distance between nodes is modeled as spatiotemporal lag and the spatiotemporal Granger causality test is used to test the spatial dependency under global transmission. Instead of directly using the cost in the dataset, which represents the spatial distance between different nodes, the shortest distance between two nodes in the road network is calculated to obtain the minimum cost. Different from the undirected dependency relationship of nodes in spatial graphs, the relationship between nodes in spatiotemporal Granger causality test graphs is directed, and the direction is from the cause node to the result node.
Citation Information
Patent Citations
Causal network learning method based on local Granger causal analysis
CN114036736A
Medium and long term trend prediction method for highway traffic flow carbon emission
CN118735142A
Method for estimating and predicting short-term traffic circulation state of urban road network
WO2021109318A1
