Bidirectional traffic flow dynamic modeling method based on deep space-time diagram neural network
Through the two-way traffic flow dynamic modeling method based on deep spatio-temporal graph neural network, the problem of insufficient modeling of two-way traffic flow in the existing technology is solved, and more efficient and accurate traffic flow prediction is achieved, improving the applicability of the model and adaptability to complex traffic scenarios.
Patent Information
- Application Number
- CN202411813552.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-12-10
AI Technical Summary
The prior art ignores the modeling of two-way traffic flows in traffic flow prediction, and lacks the capture of the correlation between dual-flow data, resulting in poor adaptability of the model in complex traffic scenarios.
The two-way traffic flow dynamic modeling method based on the deep spatiotemporal graph neural network is adopted. By constructing the traffic flow dynamic graph, local spatiotemporal dependence is captured, and time and spatial characteristics are extracted using the time convolution layer and composite graph convolution module, the two-way flow is fused, and the traffic prediction results are finally obtained through the prediction layer.
It improves the accuracy of traffic flow prediction and the applicability of the model, can more effectively capture the dependence between two-way traffic data, and improves the ability to predict multi-directional flow and the dynamic relationship of traffic flow patterns.
Smart Images

Figure CN119694117A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent transportation and data mining technology, and in particular to a two-way traffic flow dynamic modeling method based on a deep spatiotemporal graph neural network. Background Art
[0002] Intelligent transportation systems (ITS) are often used to analyze, manage and improve traffic conditions. With the acceleration of urbanization in recent years, the status of ITS in modern urban traffic management has been increasing year by year. Traffic prediction, as the core technology of ITS, has been widely studied in recent years and used to predict future traffic conditions through real-time traffic conditions of road section sensors. Although predicting real-time dynamic changes in traffic and the occurrence of abnormal road conditions is still a challenging topic, according to research, current traffic flow prediction can be used in various traffic-related applications, such as route selection, congestion reduction and traffic scheduling.
[0003] The challenges of traffic prediction are mainly divided into two points, namely, capturing the spatiotemporal correlation of data and distinguishing the correlation and heterogeneity of data. These complex feature properties lead to many difficulties in feature extraction. In the past decade, the application of convolutional neural networks (CNN) and recurrent neural networks (RNN) to traffic prediction has provided new ideas for solving the problem. However, this method still has defects, and it cannot learn non-Euclidean data in urban systems. Later, graph neural networks (GNNs) were widely used in traffic prediction due to their excellent performance and the basic graph structure that is more suitable for modeling traffic data.
[0004] With the extensive development of traffic data and the increasing maturity of the field of artificial intelligence, a spatiotemporal graph neural network (STGNN) was proposed to extract the features of traffic data and capture temporal and spatial dependencies. STGNN is a combination of diffuse graph convolution and time series model in structure. In effect, STGNN models the traffic system as a diffusion process, uses diffuse graph convolution to extract spatial correlation, and uses time series model to extract temporal correlation. Diffused graph convolution is a variant of graph convolution network (GCN) and is more suitable for processing traffic data. Sequence models such as GRU, LSTM, and TCN are also often used as the temporal module of graph neural networks to model temporal dependencies.
[0005] Although these methods have achieved outstanding results, they all focus on predicting the overall traffic flow or one-way traffic flow, ignoring the modeling of two-way traffic flow and lacking the capture of the correlation between the two-flow data. Modeling the spatiotemporal correlation of traffic flow with partial data may have a negative impact on the model. Moreover, most of the work on dynamic spatial dependency modeling is also limited to exploring dynamic spatial dependencies using one-way data.
[0006] Based on this, the present invention provides a two-way traffic flow dynamic modeling method based on deep spatiotemporal graph neural network. Summary of the invention
[0007] The purpose of this invention is to provide a two-way traffic flow dynamic modeling method based on a deep spatiotemporal graph neural network, to provide efficient and accurate traffic prediction solutions for scenarios such as path planning, congestion management, and risk assessment in smart cities, so as to improve the operating efficiency of the transportation system and the scientific nature of management decisions.
[0008] To achieve the above object, the present invention provides a two-way traffic flow dynamic modeling method based on a deep spatiotemporal graph neural network, comprising the following steps:
[0009] S1. Construct a traffic flow dynamic graph to capture the local spatiotemporal dependencies of traffic flow;
[0010] S2. After obtaining the local spatiotemporal dependencies, the temporal features are extracted using the temporal convolutional layer;
[0011] S3, after obtaining the time feature, uses the selection gate to filter the valid information obtained in S2 to obtain the final output;
[0012] S4. After obtaining the result in S3, use the composite graph convolution module to extract spatial features;
[0013] S5, merge the bidirectional traffic and obtain the final prediction result through the prediction layer;
[0014] S6. Calculate the loss of the model to determine whether the model meets the requirements.
[0015] Preferably, the process of constructing a traffic flow dynamic graph in S1 to capture the local spatiotemporal dependency of traffic flow is as follows:
[0016] S11, using a dynamic graph construction module to construct IO graphs and OI graphs of different flow directions;
[0017] S12. After obtaining the IO graph and OI graph of different flow directions, the static and dynamic information in the traffic spatiotemporal data is integrated to construct a dynamic embedding matrix for each node that changes over time. The process is as follows:
[0018]
[0019] in, Represents the dynamic embedding feature matrix of the incoming traffic, Represents the dynamic embedding feature matrix of outflow traffic, and By D and t W It is expanded through the broadcast mechanism. t Dand t W Indicates two time features: time in day and day in week. t represents the static spatial embedding matrix, X in =X[:,:,0] T ∈R N×T represents the dynamic characteristics of the inflow flow, X out =X[:,:,1] T ∈
[0020] R N×T represents the dynamic characteristics of outflow traffic, FC() represents a nonlinear fully connected layer;
[0021] S13. After obtaining the two dynamic embedding matrices in S12, the graph attention mechanism is used to calculate the correlation between different nodes. The process is as follows:
[0022]
[0023] in, and represents the attention matrix of OI and IO at time t, is the parameter matrix of OI’s attention mechanism, is the parameter matrix of IO’s attention mechanism, They are the dynamic diagrams used by OI and IO in the time range [t-T+1:t], represents a constant, Softmax() represents a normalization function, P f represents a static matrix;
[0024] S14. After obtaining the correlation, aggregate the traffic data for a longer period of time and expand the number of nodes to k. t ×N, and define a joint spatiotemporal distribution graph at the same time. The local spatiotemporal dependency is obtained through the joint spatiotemporal distribution graph. The joint spatiotemporal distribution graph is as follows:
[0025]
[0026] in, and Represents the elements in the spatiotemporal joint distribution graph, with dependency A ST [i,j+k'N](k'=0,1,...,k t -1), indicating the influence of point j at time t+k' on node i at current time t.
[0027] Preferably, the process of extracting the time feature in S2 is as follows:
[0028] S21, using parallel computing of the time convolution layer, expanding the convolution layer by the expansion factor to increase the model's perception field of view, where the input time convolution layer of the lth layer It is expressed as:
[0029]
[0030] Where tanh() represents the activation function, σ(·) is the sigmoid function, ★ is the dilated convolution operation, ⊙ is the element-wise multiplication, Θ1 and Θ2 are the self-learnable parameters of the convolutional layer, represents the output of the lth layer;
[0031] S22. Pad the input to the temporal convolutional layer with zeros to preserve the temporal causal order.
[0032] Preferably, the process of screening valid information in S3 is as follows:
[0033] Use the selection gate to filter out the coupled same-direction traffic, and the remaining traffic is the uncoupled opposite-direction traffic. The process is as follows:
[0034]
[0035] Among them, T D ∈R D×d , T W ∈R W×d , T D and T W represents two time embedding matrices, D represents the number of time slots in a day, W = 7 represents the number of days in a week, and E u and E d Denotes two node embeddings, S∈R T×N×1 Indicates the coupled directional flow that is screened out, 1-S indicates the uncoupled anisotropic flow, S t ∈R N×1 represents the selection matrix at each time step t, Indicates that the hidden feature is the final output of the selection gate.
[0036] Preferably, the process of extracting spatial features using the composite graph convolution module in S4 is as follows:
[0037] S41. In the dynamic graph convolution process of the composite graph convolution module, a feature matrix of local time combination is constructed, and each local feature segment in [t-T+1:t] is and To define it, do the following:
[0038]
[0039] Among them, H p+kis the hidden feature of traffic inflow and outflow The eigenvalue at time t+k, p=(t-T+1,t-T+2,...,t), is the local time feature matrix, W k is the learnable parameter matrix σ1(·) is the ReLU activation function;
[0040] S42, aggregate the local information of high-order adjacent nodes to obtain local features, use hidden states and dynamic graphs to summarize the hidden states of adjacent nodes, then update the hidden states of the nodes, and multiply the dynamic graph by itself to obtain a higher-order dynamic graph. The process is as follows:
[0041]
[0042] in, is the local output of the dynamic graph convolution part of the composite graph convolution module, represents the partial hidden state of the inflow and outflow traffic, W k is the k-th order parameter matrix, k s represents the maximum diffusion step length, It represents the spatial relationship between the outflow node and the inflow node in the time period t-T+1:t. It represents the spatial relationship between the traffic flow from inflow node to outflow node in the time period t-T+1:t;
[0043] S43, concatenate the local features obtained in S42 to obtain the final hidden state, the process is as follows:
[0044]
[0045] in, Represents the final output of the heterogeneous traffic of the dynamic graph convolution part of the composite graph convolution module;
[0046] S44. In the same-direction flow graph convolution process of the composite graph convolution module, the same method as the dynamic graph convolution is used to obtain the same-direction flow hidden features.
[0047] S45. The final output of the out-of-direction traffic of the dynamic graph convolution module is merged with the in-direction traffic to obtain an aggregation function that is differentiable and maintains high representation capabilities. and The process is as follows:
[0048]
[0049] Among them, Fusion represents the fusion function.
[0050] Preferably, the process of obtaining the final result through the prediction layer in S5 is as follows:
[0051] S51, get the output F of the first layer of the hybrid graph convolution module 1,t , save it, and take it as input to the next layer to get F 1,t The process is as follows:
[0052]
[0053] Where W represents the parameter matrix, X represents the original input data, and b represents the offset;
[0054] S52. After obtaining the results of the first layer, the second layer starts. A residual connection is added after the mixed graph convolution module of each layer, and the final result is saved and used as the input of the next layer. The process is as follows:
[0055]
[0056] Among them, F l,t represents the output of the lth layer, H l,t represents the residual of the lth layer;
[0057] S53, after each layer of the temporal convolution module, add a skip connection to the output layer, pass the output of each layer to the fully connected layer to obtain the final prediction result. The process is as follows:
[0058]
[0059] in, is the final inflow flow prediction result; is the final outflow flow prediction result. The reshape(·) function is a dimension change method to connect the results of different layers.
[0060] Preferably, in S6, MAE is used as the objective function and the model is trained end-to-end. The final model is as follows:
[0061]
[0062] in Represents the loss of the model.
[0063] Preferably, the same-direction flow graph convolution in S44 is implemented by matrix multiplication of the adaptive graph, the same-direction flow hidden state and the learnable parameters.
[0064] Therefore, the present invention adopts the above-mentioned structure of the two-way traffic flow dynamic modeling method based on the deep spatiotemporal graph neural network, which solves the problems faced by the prior art in traffic flow prediction, such as insufficient two-way traffic modeling, insufficient capture of dynamic dependencies, and poor adaptability to complex traffic scenarios, thereby improving the accuracy of traffic flow prediction and the applicability of the model, and at the same time providing efficient and accurate traffic prediction solutions for scenarios such as path planning, congestion management, and risk assessment in smart cities, thereby improving the operating efficiency of the transportation system and the scientific nature of management decisions.
[0065] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] Figure 1 It is an overall model diagram of the two-way traffic flow dynamic modeling method based on the deep spatiotemporal graph neural network of the present invention;
[0067] Figure 2 It is a model diagram of a composite graph convolution module of a two-way traffic flow dynamic modeling method based on a deep spatiotemporal graph neural network of the present invention;
[0068] Figure 3 This is a process diagram for capturing spatiotemporal dependencies of the two-way traffic flow dynamic modeling method based on the deep spatiotemporal graph neural network of the present invention. DETAILED DESCRIPTION
[0069] Example
[0070] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0071] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0072] like Figure 1-Figure 3 As shown, the bidirectional traffic flow dynamic modeling method based on the deep spatiotemporal graph neural network of the present invention includes the following steps:
[0073] S1. Construct a traffic flow dynamic graph to capture the local spatiotemporal dependencies of traffic flow;
[0074] S11, using a dynamic graph construction module to construct IO graphs and OI graphs of different flow directions;
[0075] S12. After obtaining the IO graph and OI graph of different flow directions, the static and dynamic information in the traffic spatiotemporal data is integrated to construct a dynamic embedding matrix for each node that changes over time. The process is as follows:
[0076]
[0077]
[0078] in, Represents the dynamic embedding feature matrix of the incoming traffic, Represents the dynamic embedding feature matrix of outflow traffic, and By D and t W It is expanded through the broadcast mechanism. t D and t W Indicates two time features: time in day and day in week. t represents the static spatial embedding matrix, X in =X[:,:,0] T ∈R N×T represents the dynamic characteristics of the inflow flow, X out =X[:,:,1] T ∈
[0079] R N×T represents the dynamic characteristics of outflow traffic, FC() represents a nonlinear fully connected layer;
[0080] S13. After obtaining the two dynamic embedding matrices in S12, the graph attention mechanism is used to calculate the correlation between different nodes. The process is as follows:
[0081]
[0082] in, and represents the attention matrix of OI and IO at time t, is the parameter matrix of OI’s attention mechanism, is the parameter matrix of IO’s attention mechanism, They are the dynamic diagrams used by OI and IO in the time range [t-T+1:t], represents a constant, Softmax() represents a normalization function, P frepresents a static matrix;
[0083] S14. After obtaining the correlation, aggregate the traffic data for a longer period of time and expand the number of nodes to k. t ×N, and define a joint spatiotemporal distribution graph at the same time. The local spatiotemporal dependency is obtained through the joint spatiotemporal distribution graph. The joint spatiotemporal distribution graph is as follows:
[0084]
[0085] in, and Represents the elements in the spatiotemporal joint distribution graph, with dependency A ST [i,j+k'N](k'=0,1,...,k t -1), indicating the influence of point j at time t+k' on node i at current time t.
[0086] S2. After obtaining the local spatiotemporal dependencies, the temporal features are extracted using the temporal convolutional layer;
[0087] S21, using parallel computing of the time convolution layer, expanding the convolution layer by the expansion factor to increase the model's perception field of view, where the input time convolution layer of the lth layer It is expressed as:
[0088]
[0089] Where tanh() represents the activation function, σ(·0 is the sigmoid function, ★ is the dilated convolution operation, ⊙ is the element-wise multiplication, Θ1 and Θ2 are the self-learnable parameters of the convolution layer, represents the output of the lth layer;
[0090] S22. Pad the input to the temporal convolutional layer with zeros to preserve the temporal causal order.
[0091] S3, after obtaining the time feature, uses the selection gate to filter the valid information obtained in S2 to obtain the final output. The process is as follows:
[0092] Use the selection gate to filter out the coupled same-direction traffic, and the remaining traffic is the uncoupled opposite-direction traffic. The process is as follows:
[0093]
[0094] Among them, T D ∈R D×d , T W ∈R W×d , T D and T W represents two time embedding matrices, D represents the number of time slots in a day, W = 7 represents the number of days in a week, and Eu and E d Denotes two node embeddings, S∈R T×N×1 Indicates the coupled directional flow that is screened out, 1-S indicates the uncoupled anisotropic flow, S t ∈R N×1 represents the selection matrix at each time step t, Indicates that the hidden feature is the final output of the selection gate.
[0095] S4. After obtaining the result in S3, use the composite graph convolution module to extract spatial features;
[0096] S41. In the dynamic graph convolution process of the composite graph convolution module, a feature matrix of local time combination is constructed, and each local feature segment in [t-T+1:t] is and To define it, do the following:
[0097]
[0098] Among them, H p+k is the hidden feature of traffic inflow and outflow The eigenvalue at time t+k, p=(t-T+1,t-T+2,...,t), is the local time feature matrix, W k is the learnable parameter matrix σ1(·0 is the ReLU activation function;
[0099] S42, aggregate the local information of high-order adjacent nodes to obtain local features, use hidden states and dynamic graphs to summarize the hidden states of adjacent nodes, then update the hidden states of the nodes, and multiply the dynamic graph by itself to obtain a higher-order dynamic graph. The process is as follows:
[0100]
[0101] in, is the local output of the dynamic graph convolution part of the composite graph convolution module, represents the partial hidden state of the inflow and outflow traffic, W k is the k-th order parameter matrix, k s represents the maximum diffusion step length, It represents the spatial relationship between the outflow node and the inflow node in the time period t-T+1:t. It represents the spatial relationship between the traffic flow from inflow node to outflow node in the time period t-T+1:t;
[0102] S43, concatenate the local features obtained in S42 to obtain the final hidden state, the process is as follows:
[0103]
[0104] in, Represents the final output of the heterogeneous traffic of the dynamic graph convolution part of the composite graph convolution module;
[0105] S44. In the convolution process of the same-direction flow graph in the composite graph convolution module, the same-direction flow hidden state and the matrix multiplication of the learnable parameters are realized by the adaptive graph, and the same-direction flow hidden features are obtained using the same method as the dynamic graph convolution.
[0106] S45. The final output of the out-of-direction traffic of the dynamic graph convolution module is merged with the in-direction traffic to obtain an aggregation function that is differentiable and maintains high representation capabilities. and The process is as follows:
[0107]
[0108] Among them, Fusion represents the fusion function
[0109] S5, merge the bidirectional traffic and obtain the final prediction result through the prediction layer;
[0110] S51, get the output F of the first layer of the hybrid graph convolution module 1,t , save it, and take it as input to the next layer to get F 1,t The process is as follows:
[0111]
[0112] Where W represents the parameter matrix, X represents the original input data, and b represents the offset;
[0113] S52. After obtaining the results of the first layer, the second layer starts. A residual connection is added after the mixed graph convolution module of each layer, and the final result is saved and used as the input of the next layer. The process is as follows:
[0114]
[0115] Among them, F l,t represents the output of the lth layer, H l,t represents the residual of the lth layer;
[0116] S53, after each layer of the temporal convolution module, add a skip connection to the output layer, pass the output of each layer to the fully connected layer to obtain the final prediction result. The process is as follows:
[0117]
[0118] in, is the final inflow flow prediction result; is the final outflow flow prediction result. The reshape(·) function is a dimension change method to connect the results of different layers.
[0119] S6. Calculate the loss of the model to determine whether the model meets the requirements. The process is as follows:
[0120] Using MAE as the objective function, the model is trained end-to-end, and the final model is as follows:
[0121]
[0122] in Represents the loss of the model.
[0123] In the experiment, we first select data and conduct the experiment on four large real data sets. These data sets contain traffic inflow and outflow data collected by sensors. Each data set contains hundreds of such sensor nodes and thousands of time steps. The four data sets are divided into two types: traffic data sets of taxi trajectories and traffic data sets of bicycle payment records. BIKEDC is a traffic data set of bicycle payment records, and the rest are traffic data sets of taxi trajectories. See Table 1 for details.
[0124] Table 1
[0125]
[0126] After that, the model is trained and the parameters are set, and the dataset is divided into training set, validation set and test set in the ratio of 7:1:2. In addition, the data of the past 6 time steps are used to predict the traffic inflow and outflow of the next time step.
[0127] The Adam optimizer is used for training, with the learning rate set to 0.0001, the batch size set to 32, the step size set to 1, and the expansion factor set to 2. An early stopping strategy with a patience of 50 is used during the training process. During the training process, the accuracy of the validation set is calculated after each round. If the accuracy of the validation set does not improve after consecutive rounds, the training is stopped. During the training process, the changes in the training loss and validation loss are recorded. For example, in the early stage of training, the training loss drops rapidly, indicating that the model is learning the data features quickly, but there may be a risk of overfitting; as the number of training rounds increases, the loss gradually stabilizes and the model gradually converges.
[0128] Then we evaluate the model and analyze the results using three metrics: mean absolute error (MAE), mean absolute percentage error (MAPE), and root mean square error (RMSE). When calculating these metrics, we filter out samples with a flow value of 0 and treat them as missing values, excluding them from the calculation. We repeated all the experiments ten times and finally obtained the average results. The formula is as follows:
[0129]
[0130] By comparing the results with those collected by other models, it is found that the performance of the model of the present invention reaches the state-of-the-art level in all datasets, which demonstrates the effectiveness of our model.
[0131] Finally, the model is processed in three different ways: without the dynamic graph convolution part of the heterogeneous flow fusion and heterogeneous flow, without the selection gate, and without the dynamic graph constructor. The overall role of each component and strategy in the proposed model is verified, and the complex interdependencies in the traffic prediction model are emphasized, which must be carefully captured to optimize the performance.
[0132] Therefore, the present invention adopts the above-mentioned structure of the two-way traffic flow dynamic modeling method based on the deep spatiotemporal graph neural network, and uses the inflow and outflow traffic data in combination with time embedding and node embedding to generate two unique spatiotemporal joint dynamic graphs (IO and OI) for each sequence to construct a more detailed spatial relationship, thereby improving the prediction performance of the model. At the same time, the two-way traffic data is modeled to capture the dependency between traffic in different directions, improve the prediction accuracy, and enhance the prediction ability of multi-directional traffic. It also utilizes the dynamic relationship of two-way traffic, propagates the node state through the dynamic graph generator and the integrated graph convolution unit, to learn the dynamic spatial correlation, and improves the adaptability to the dynamic relationship of traffic flow patterns. Finally, by generating a dynamic graph based on traffic flow transformation, the relationship between different-directional traffic flows is refined, the feature extraction of different-directional traffic flows is enhanced, and the traffic flow conversion pattern is clarified.
[0133] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solution of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solution to deviate from the spirit and scope of the technical solution of the present invention.
Claims
1. A method for dynamic modeling of bidirectional traffic flow based on deep spatiotemporal graph neural network, characterized in that: The following steps are involved: S1. Construct a traffic flow dynamic graph to capture the local spatiotemporal dependencies of traffic flow; S2. After obtaining the local spatiotemporal dependencies, the temporal features are extracted using the temporal convolutional layer; S3, after obtaining the time feature, uses the selection gate to filter the valid information obtained in S2 to obtain the final output; S4. After obtaining the result in S3, use the composite graph convolution module to extract spatial features; S5, merge the bidirectional traffic and obtain the final prediction result through the prediction layer; S6. Calculate the loss of the model to determine whether the model meets the requirements.
2. The method for dynamic modeling of bidirectional traffic flow based on deep spatiotemporal graph neural network according to claim 1 is characterized in that: The process of constructing a traffic flow dynamic graph in S1 to capture the local spatiotemporal dependencies of traffic flow is as follows: S11, using a dynamic graph construction module to construct IO graphs and OI graphs of different flow directions; S12. After obtaining the IO graph and OI graph of different flow directions, the static and dynamic information in the traffic spatiotemporal data is integrated to construct a dynamic embedding matrix for each node that changes over time. The process is as follows: in, Represents the dynamic embedding feature matrix of the incoming traffic, Represents the dynamic embedding feature matrix of outflow traffic, and By D and t W It is expanded through the broadcast mechanism. t D and t W Indicates two time features: time in day and day in week. t represents the static spatial embedding matrix, X in =X[:,:,0] T ∈R N×T represents the dynamic characteristics of the inflow flow, X out =X[:,:,1] T ∈ R N×T represents the dynamic characteristics of outflow traffic, FC() represents a nonlinear fully connected layer; S13. After obtaining the two dynamic embedding matrices in S12, the graph attention mechanism is used to calculate the correlation between different nodes. The process is as follows: in, and represents the attention matrix of OI and IO at time t, is the parameter matrix of OI’s attention mechanism, is the parameter matrix of IO’s attention mechanism, They are the dynamic diagrams used by OI and IO in the time range [t-T+1:t], represents a constant, Softmax() represents a normalization function, P f represents a static matrix; S14. After obtaining the correlation, aggregate the traffic data for a longer period of time and expand the number of nodes to k. t ×N, and define a joint spatiotemporal distribution graph at the same time. The local spatiotemporal dependency is obtained through the joint spatiotemporal distribution graph. The joint spatiotemporal distribution graph is as follows: in, and Represents the elements in the spatiotemporal joint distribution graph, with dependency A ST [i,j+k'N](k'=0,1,...,k t -1), indicating the influence of point j at time t+k' on node i at current time t.
3. The method for dynamic modeling of bidirectional traffic flow based on deep spatiotemporal graph neural network according to claim 2 is characterized in that: The process of extracting temporal features in S2 is as follows: S21, using parallel computing of the time convolution layer, expanding the convolution layer by the expansion factor to increase the model's perception field of view, where the input time convolution layer of the lth layer It is expressed as: Where tanh() represents the activation function, σ(·) is the sigmoid function, ★ is the dilated convolution operation, ⊙ is the element-wise multiplication, Θ1 and Θ2 are the self-learnable parameters of the convolutional layer, represents the output of the lth layer; S22. Pad the input to the temporal convolutional layer with zeros to preserve the temporal causal order.
4. The method for dynamic modeling of bidirectional traffic flow based on deep spatiotemporal graph neural network according to claim 3 is characterized in that: The process of filtering valid information in S3 is as follows: Use the selection gate to filter out the coupled same-direction traffic, and the remaining traffic is the uncoupled opposite-direction traffic. The process is as follows: Among them, T D ∈R D×d , T W ∈R W×d , T D and T W represents two time embedding matrices, D represents the number of time slots in a day, W = 7 represents the number of days in a week, and E u and E d Denotes two node embeddings, S∈R T×N×1 Indicates the coupled directional flow that is screened out, 1-S indicates the uncoupled anisotropic flow, S t ∈R N×1 represents the selection matrix at each time step t, Indicates that the hidden feature is the final output of the selection gate.
5. The method for dynamic modeling of bidirectional traffic flow based on deep spatiotemporal graph neural network according to claim 4 is characterized in that: The process of extracting spatial features using the composite graph convolution module in S4 is as follows: S41. In the dynamic graph convolution process of the composite graph convolution module, a feature matrix of local time combination is constructed, and each local feature in [t-T+1:t] is and To define it, do the following: Among them, H p+k is the hidden feature of traffic inflow and outflow The eigenvalue at time t+k, p=(t-T+1,t-T+2,...,t), is the local time feature matrix, W k is the learnable parameter matrix σ1(·) is the ReLU activation function; S42, aggregate the local information of high-order adjacent nodes to obtain local features, use hidden states and dynamic graphs to summarize the hidden states of adjacent nodes, then update the hidden states of the nodes, and multiply the dynamic graph by itself to obtain a higher-order dynamic graph. The process is as follows: in, is the local output of the dynamic graph convolution part of the composite graph convolution module, represents the partial hidden state of the inflow and outflow traffic, W k is the k-th order parameter matrix, k s represents the maximum diffusion step length, It represents the spatial relationship between the outflow node and the inflow node in the time period t-T+1:t. It represents the spatial relationship between the traffic flow from inflow node to outflow node in the time period t-T+1:t; S43, concatenate the local features obtained in S42 to obtain the final hidden state, the process is as follows: in, Represents the final output of the out-of-directional traffic of the dynamic graph convolution part of the composite graph convolution module; S44. In the same-direction flow graph convolution process of the composite graph convolution module, the same method as the dynamic graph convolution is used to obtain the same-direction flow hidden features. S45. The final output of the out-of-direction traffic of the dynamic graph convolution module is merged with the in-direction traffic to obtain an aggregation function that is differentiable and maintains high representation capabilities. and The process is as follows: Among them, Fusion represents the fusion function.
6. The method for dynamic modeling of bidirectional traffic flow based on deep spatiotemporal graph neural network according to claim 5 is characterized in that: The process of obtaining the final result through the prediction layer in S5 is as follows: S51, get the output F of the first layer of the hybrid graph convolution module 1,t , save it, and take it as input to the next layer to get F 1,t The process is as follows: Where W represents the parameter matrix, X represents the original input data, and b represents the offset; S52. After obtaining the results of the first layer, the second layer starts. A residual connection is added after the mixed graph convolution module of each layer, and the final result is saved and used as the input of the next layer. The process is as follows: Among them, F l,t represents the output of the lth layer, H l,t represents the residual of the lth layer; S53, after each layer of the temporal convolution module, add a skip connection to the output layer, pass the output of each layer to the fully connected layer to obtain the final prediction result. The process is as follows: in, is the final inflow flow prediction result; is the final outflow flow prediction result. The reshape(·) function is a dimension change method to connect the results of different layers.
7. The method for dynamic modeling of bidirectional traffic flow based on deep spatiotemporal graph neural network according to claim 6 is characterized in that: In S6, MAE is used as the objective function and the model is trained end-to-end. The final model is as follows: in Represents the loss of the model.
8. The method for dynamic modeling of bidirectional traffic flow based on deep spatiotemporal graph neural network according to claim 7 is characterized in that: The same-direction flow graph convolution in S44 is implemented by matrix multiplication of the adaptive graph, the same-direction flow hidden state and the learnable parameters.
Citation Information
Patent Citations
Traffic flow prediction method and system based on trend space-time diagram convolution, and medium
CN116895157A
Space-time heterogeneous decoupling method based on multi-mode traffic flow prediction
CN117558125A
Traffic flow prediction method based on space-time neural network
CN118430231A
One-way traffic classification system and method based on convolutional neural network, program, equipment and storage medium
CN118433119A
Traffic flow forecasting method based on multi-mode dynamic residual graph convolution network
US20230334981A1
Cited By
Multi-scale space-time fusion traffic flow prediction method based on coupling graph
CN120319030A