A traffic flow prediction method and system based on a bidirectional space-time expansion graph convolution network

The traffic flow prediction method based on bidirectional spatiotemporal extended graph convolutional networks solves the problems of existing models in extracting spatial features of edge nodes and handling outliers and missing data, achieving more efficient traffic flow prediction and improving prediction accuracy and response speed.

CN119832727BActive Publication Date: 2025-11-18CHANGSHA UNIVERSITY OF SCIENCE AND TECHNOLOGY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411716096.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-27
Publication Date
2025-11-18
Estimated Expiration
2044-11-27

AI Technical Summary

Technical Problem

Existing traffic flow prediction models have limitations in extracting spatial features, especially those of edge nodes, and cannot effectively handle outliers and missing data, resulting in limited prediction accuracy and long response times.

Method used

A traffic flow prediction method based on bidirectional spatiotemporal extended graph convolutional network is adopted. Traffic flow data is processed through feature fusion and causal convolution. Spatiotemporal features are extracted by the extended graph convolution operation of ARMA filter. Attention aggregation is used to optimize the model structure, thereby reducing the number of parameters and training time.

Benefits of technology

It improves the accuracy and robustness of traffic flow forecasting, and can provide timely and accurate traffic guidance to meet the needs of real-time traffic flow forecasting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119832727B_ABST
    Figure CN119832727B_ABST
Patent Text Reader

Abstract

The application discloses a traffic flow prediction method and system based on a bidirectional space-time expansion graph convolution network, and the method comprises the following steps: acquiring historical traffic flow data of each node in a road network in real time and taking the data as initial traffic flow features; sequentially performing feature fusion and causal convolution on the initial traffic flow features to obtain traffic flow data with time sequence features; calculating a bidirectional normalized adjacency matrix corresponding to the road network; performing expansion graph convolution operation on the traffic flow data and the normalized adjacency matrix of each direction with an ARMA filter to obtain information of each layer of the expansion graph convolution of each direction; and aggregating the information of each layer of the expansion graph convolution of the same direction to obtain layer aggregation features of the expansion graph convolution of each direction, and then performing attention aggregation on the layer aggregation features to obtain final output. The application improves the prediction accuracy, reduces the model parameter quantity and training time, and meets the demand of real-time traffic flow prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to traffic flow prediction technology, specifically to a traffic flow prediction method and system based on a bidirectional spatiotemporal extended graph convolutional network. Background Technology

[0002] Traffic flow prediction technology is a core area within Intelligent Transportation Systems (ITS). With accelerating urbanization, traffic congestion and accidents are becoming increasingly severe, leading to a growing demand for real-time and accurate traffic flow prediction. Intelligent Transportation Systems, by innovating traffic management models, improve the utilization efficiency of transportation networks and have become a core component of smart city construction.

[0003] Various methods have emerged in traffic flow prediction research. Early studies were mainly based on mathematical statistics, such as Autoregressive (AR) models, History Average (HA) models, Autoregressive Integrated Moving Average (ARIMA) models, and Kalman Filter (KFM) models. With the development of deep learning technology, neural network-based prediction models have gradually become a research hotspot, including BP neural network models, Stacked AutoEncoders (SAE) models, and Recurrent Neural Networks (RNN) models.

[0004] In recent years, researchers have begun to explore deep learning models that incorporate spatiotemporal features. For example, some studies have proposed applying Convolutional Neural Networks (CNNs) to data with spatiotemporal attributes to extract richer features. Furthermore, Graph Convolutional Networks (GCNs) have demonstrated powerful capabilities in processing graph-structured data, particularly irregular structures like traffic networks. Spatio-Temporal Graph Convolutional Networks (STGCNs), by extending spatial graph convolutions to spatiotemporal graph convolutions, can better capture spatiotemporal information. Summary of the Invention

[0005] The technical problem to be solved by this invention:

[0006] (1) First, existing models have limitations in extracting spatial features, especially the spatial features of edge nodes, which limits the prediction accuracy.

[0007] (2) Second, outliers and missing data in traffic flow data were not effectively processed, which affected the accuracy and robustness of the model;

[0008] (3) Third, the existing models have very limited prediction accuracy and long response time, which makes it impossible to provide accurate and timely guidance for travelers and traffic management departments.

[0009] To address the aforementioned problems in existing technologies, this invention provides a traffic flow prediction method and system based on a bidirectional spatiotemporal extended graph convolutional network. This method can effectively extract the spatiotemporal features of traffic flow, improve prediction accuracy, and reduce the number of model parameters and training time, thereby meeting the needs of real-time traffic flow prediction.

[0010] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:

[0011] A traffic flow prediction method based on bidirectional spatiotemporal extended graph convolutional networks includes the following steps:

[0012] Real-time acquisition of historical traffic flow data for each node in the road network and use as initial traffic flow features;

[0013] The initial traffic flow features are sequentially processed through feature fusion and causal convolution to obtain traffic flow data with temporal features;

[0014] Calculate the bidirectional normalized adjacency matrix corresponding to the road network, and perform extended graph convolution operation with ARMA filter on the traffic flow data and the normalized adjacency matrix in each direction to obtain the information of each layer of the extended graph convolution in each direction.

[0015] Aggregate the information from each layer of the extended graph convolution in the same direction to obtain the layer aggregated features of the extended graph convolution in each direction;

[0016] The features of the convolutional layers of the extended graph in each direction are aggregated through attention to obtain the final output, which is then used as the prediction result for traffic flow data.

[0017] Furthermore, the initial traffic flow features are sequentially processed through feature fusion and causal convolution. Specifically, the initial traffic flow features are divided into paths, and each path is sequentially processed through feature fusion and causal convolution to obtain the traffic flow data corresponding to the normalized adjacency matrix of each direction.

[0018] Furthermore, when the initial traffic flow features are sequentially processed through feature fusion and causal convolution, the feature fusion steps include:

[0019] The dimensions of the data sequence of each node are expanded along the time dimension to obtain the expanded data sequence;

[0020] The data sequence after expanding the dimension of each node is then aggregated using a specified kernel width, as shown in the following expression:

[0021]

[0022] in, For the data sequence after the dimension of the i-th node is expanded, * F For feature aggregation operations, Γ κ The convolution kernel for feature aggregation, κ For kernel width, The output of the feature aggregation for the i-th node;

[0023] Repeat the above steps iteratively until the number of feature fusion operations meets the requirement.

[0024] Furthermore, when the initial traffic flow features are sequentially processed through feature fusion and causal convolution, the steps of causal convolution include:

[0025] We obtain the output of feature fusion for each node, and then compute the output of the causal convolution for each node in parallel, as shown in the following expression:

[0026]

[0027] Where F(s) represents the output of the first causal convolution layer. s One element; This represents the output of feature fusion at the i-th node, * d Γ represents the causal convolution operation. K It is a convolution kernel with a width of K. γ represents the (s+j)th element in the output of the feature fusion of the i-th node. j This represents the j-th element of the convolution kernel.

[0028] Furthermore, calculating the bidirectional normalized adjacency matrix corresponding to the road network specifically includes:

[0029] The initial adjacency matrix A is calculated based on the connection relationships of the nodes in the road network.

[0030] Determine the number of nodes that need to have edges added, and select the corresponding number of nodes as nodes that need to have edges added in ascending order of node degree. Construct a filling matrix A′ according to the nodes that need to have edges added.

[0031] The initial adjacency matrix A is expanded using the filling matrix A′ to obtain the expanded adjacency matrix A. e ;

[0032] Calculate the extended adjacency matrix A e The corresponding Laplace matrix L eThen, for the Laplace matrix L e Normalize the upper and lower triangular matrices respectively to obtain the bidirectional normalized adjacency matrix L. p and L r .

[0033] Furthermore, when constructing the filling matrix A′ according to the nodes that need to be added to the edges, it includes:

[0034] Record the position index of each node that needs to have an edge added. Calculate the difference between the median degree of all nodes and the average degree of the nodes that need to have an edge added to obtain the number of edges to be added to each node. Perform pairwise non-repeating combinations of the indices of each node that needs to have an edge added, and assign values ​​to the corresponding positions in the filling matrix A′. At the same time, increment the counter by one until the indexes of each node have been traversed or the value of the counter reaches the number of edges to be added to the node.

[0035] Furthermore, when performing extended graph convolution operations with ARMA filters on the traffic flow data and normalized adjacency matrices in different directions, the expressions are as follows:

[0036]

[0037] in, This represents the output of the l-th layer of the extended graph convolution corresponding to the m-th direction. This represents the traffic flow data corresponding to the m-th direction. This represents the normalized adjacency matrix corresponding to the m-th direction. and V m σ is a learnable parameter, and σ(·) is the ReLU activation function.

[0038] Furthermore, when aggregating information from each layer of the extended graph convolution in the same direction, the specific steps include:

[0039] Convolve the information of each layer of the extended graph corresponding to the m-th direction. The layer output information of the extended graph convolution corresponding to the m-th direction is obtained through two fully connected layer output modules, as shown in the following expression:

[0040]

[0041] in, and These are trainable parameters, and sigmoid(·) is the activation function;

[0042] After obtaining the layer output information of the convolution of the extended graph corresponding to the m-th direction, the layer information of different layers of the same extended graph convolution is aggregated to obtain the layer aggregated feature of the extended graph corresponding to the m-th direction, as shown in the following expression:

[0043]

[0044] Where ⊙ represents the Hadamard product operation. For training parameters, H m This represents the layer aggregation feature of the extended graph corresponding to the m-th direction.

[0045] Furthermore, when aggregating the features of convolutional layers of extended graphs in different directions through attention, the expression is as follows:

[0046]

[0047] Among them, H m Z represents the layer aggregation feature of the extended graph corresponding to the m-th direction. m For H m The resulting one-dimensional vector, W m Is it with Z m Training parameters of the same dimension, b m For bias, α m Z is the attention score of the extended graph corresponding to the m-th direction. o This is the final result of attention aggregation.

[0048] The present invention also proposes a traffic flow prediction system based on a bidirectional spatiotemporal extended graph convolutional network, comprising an interconnected microprocessor and a computer-readable storage medium, wherein the microprocessor is programmed or configured to execute any of the traffic flow prediction methods based on the bidirectional spatiotemporal extended graph convolutional network described in the present invention.

[0049] Compared with the prior art, the advantages of the present invention are as follows:

[0050] (1) This invention uses feature fusion technology to not only effectively process abnormal and missing data in traffic flow data and smooth the data, but also take into account the original node features and the features of nodes added after graph expansion.

[0051] (2) This invention uses extended graph convolution technology to fully extract the spatial features of traffic flow, especially the spatial features of edge nodes, thereby improving the accuracy of prediction;

[0052] (3) This invention optimizes the model structure and improves the reliability of prediction results through information aggregation and output technology;

[0053] (4) When aggregating spatial information from different layers, this invention shares graph convolution parameters and combines lightweight causal convolution design to reduce the number of parameters and training time, thereby improving the practical application value of the model. Attached Figure Description

[0054] Figure 1 This is a flowchart of a bidirectional spatiotemporal extended graph convolution model.

[0055] Figure 2 This is a schematic diagram of the feature fusion module.

[0056] Figure 3 This is a schematic diagram of the extended graph structure. Detailed Implementation

[0057] The present invention will be further described below with reference to the accompanying drawings and specific preferred embodiments, but this does not limit the scope of protection of the present invention.

[0058] Example 1

[0059] This embodiment proposes a traffic flow prediction method based on a bidirectional spatiotemporal extended graph convolutional network. To address the first drawback, a road network extended graph structure is proposed, utilizing an autoregressive moving average (ARMA) filter graph convolution as a model component to extract spatial features, especially those of edge nodes, and aggregating spatial features from different layers through bidirectional graph convolution. To address the second drawback, a feature fusion module is constructed to preprocess traffic flow data through feature reconstruction and aggregation, smoothing out abnormal and missing data while also considering the node information added after the graph extension. To address the third drawback, a bidirectional spatiotemporal extended graph convolutional model (Bi-STEGCM) is proposed. This model aggregates spatial information from different layers using feature fusion, lightweight causal convolution, and bidirectional graph convolution techniques, sharing convolution kernel parameters to effectively extract the spatiotemporal features of traffic flow, improving prediction accuracy while reducing the number of model parameters and training time, thus meeting the needs of real-time traffic flow prediction.

[0060] The method in this embodiment specifically includes the following steps:

[0061] S1) Real-time acquisition of historical traffic flow data for each node in the road network and use as initial traffic flow features;

[0062] S2) The initial traffic flow features are sequentially processed through feature fusion and causal convolution to obtain traffic flow data with temporal features;

[0063] S3) Calculate the bidirectional normalized adjacency matrix corresponding to the road network, and perform extended graph convolution operation with ARMA filter on the traffic flow data and the normalized adjacency matrix of each direction respectively to obtain the information of each layer of the extended graph convolution in each direction.

[0064] S4) Aggregate the information of each layer of the extended graph convolution in the same direction to obtain the layer aggregation feature of the extended graph convolution in each direction.

[0065] S5) The layer aggregation features of the extended graph convolution in each direction are aggregated through attention to obtain the final output, which is used as the prediction result of traffic flow data.

[0066] The following provides a detailed explanation of each step.

[0067] In this embodiment, before step S1, a road network traffic flow prediction problem is defined. The road network structure is composed of the locations of sensors (nodes) and the connectivity of the sensors. In this embodiment, the road network graph structure is defined as an undirected graph G = (V, E, A), where... Let E represent the set of road network nodes and E represent the set of edges. If two sensors are reachable from each other in the road network and there are no other sensors between them, then the two sensors form an edge in the road network graph structure. It is an adjacency matrix, which can be obtained through the set of edges E.

[0068] Traffic flow data involves various variables such as traffic speed and traffic volume; this embodiment focuses on traffic speed prediction. Therefore, the traffic characteristics of node i at time t can be expressed as follows: For the current time t, the traffic characteristics of node i in the next T time steps can be represented as follows: The traffic characteristics of all nodes at time t can be represented as follows: The traffic prediction problem in this embodiment can be defined as follows: for the current time t, using P historical observations of traffic speed over P time steps... Predict traffic speeds at the next Q time steps Let f(·) represent the mapping relationship, which can be expressed by formula (1):

[0069]

[0070] Therefore, in step S1 of this embodiment, the historical traffic flow data of each node specifically refers to the sequence of historical observed traffic flow data P time steps before the current time t of each node.

[0071] This embodiment constructs a bidirectional spatiotemporal extended graph convolutional model through steps S2 to S5. To simulate the highly complex nonlinear representation of traffic flow, the model uses causal convolution to capture temporal features and extended graph convolution to capture spatial features, such as... Figure 1 As shown, the original features first enter the feature fusion layer to reconstruct new features. This process can mitigate the impact of missing data and outliers on the model. Then, temporal features are extracted through causal convolution. Next, the data with temporal features is input into the extended graph convolutional layer. Considering the directionality of traffic flow, the model uses a pair of twin networks with bidirectional adjacency matrices as extended graph convolutional layers. To better extract spatial features, the spatial extended graph convolution of each layer needs to enter the layer output module. Simultaneously, the output models of the same layers in the twin networks are aggregated into the information aggregation layer. Finally, the results of the information aggregation layer from different layers are input into the output model to obtain the final result.

[0072] In step S2 of this embodiment, the initial traffic flow features are sequentially processed through feature fusion and causal convolution. The feature fusion step mitigates the impact of missing data and unconventional traffic (weather effects, traffic accidents) on traffic flow prediction. Simultaneously, considering the subsequent extended graph convolution, the extended node features reuse the internal graph network node features. Through feature fusion, both internal node features and extended node features can be considered simultaneously. The specific steps are as follows:

[0073] S21) Expand the dimension of the data sequence of each node along the time dimension to obtain the data sequence after dimension expansion, such as... Figure 2 As shown, the data is doubled along the time dimension through the feature reconstruction layer, using the features of node i. For example, we can obtain This operation doubles the dimension of the node sequence, enriching the sequence features and simultaneously meeting the needs of subsequent feature aggregation and causal convolution operations to reduce sequence dimensionality. In a road network of N nodes, this is represented by X. t:(t+P) →X t:(t+2P) ;

[0074] S22) Perform feature aggregation on the data sequence after expanding the dimension of each node using the specified kernel width. Figure 2 The middle layer is a feature aggregation layer with a kernel width of 3. Taking node i as an example, the expression is as follows:

[0075]

[0076] in, The input to the original road network information in feature aggregation is the data sequence after the dimension of the i-th node is expanded. * F For feature aggregation operations, Γ κ The convolution kernel for feature aggregation is κ, where κ is the kernel width. After feature aggregation, the output is reduced by 2(κ-1) in the time dimension. The resulting output of feature aggregation is...

[0077] Iteratively execute the above steps until the required number of feature fusion operations is met, and you will obtain: in For the input features, i.e., the initial traffic flow features in step S1, FF m For the m-th feature fusion operation, Let T be the output of the m-th feature fusion operation, where T F =2P-2(κ-1).

[0078] In step S2 of this embodiment, when the initial traffic flow features are sequentially processed through feature fusion and causal convolution, the step of causal convolution specifically includes: obtaining the output of feature fusion for each node, and then calculating the output of causal convolution for each node in parallel.

[0079] At road network node i, the causal convolutional model uses the temporal traffic flow velocity information of the corresponding node. The input is processed by a convolution kernel and output to the next layer (in the case of no padding operation, the information dimension will be reduced by the kernel width -1 dimension), and its specific calculation is shown in formula (3):

[0080]

[0081] Where F(s) represents the s-th element output after one causal convolution layer; This represents the output of feature fusion at the i-th node, * d Γ represents the causal convolution operation. K It is a convolution kernel with a width of K; This represents the (s+j)th element of the input feature vector, i.e., the (s+j)th element in the output of the feature fusion at the i-th node, γ. j This represents the j-th element of the convolution kernel. During this process, N nodes in the road network compute in parallel.

[0082] By feeding the feature-fused road network information into a causal convolutional model, we can obtain: The channel is D C A causal convolution kernel with a width of K, The output of the causal convolution is T, where T is the output of the causal convolution. C =2P-2κ-K+3.

[0083] In step S3 of this embodiment, calculating the bidirectional normalized adjacency matrix corresponding to the road network includes:

[0084] S31) Calculate the extended graph:

[0085] Based on the connection relationships of the nodes in the road network, the initial adjacency matrix A is calculated. Specifically, the connection relationships of the road network can be obtained through the distance between its nodes, and the road network adjacency matrix can be obtained through the node connection relationships. Before expanding the graph, the initial adjacency matrix is ​​first obtained through equation (4).

[0086]

[0087] Among them, A ij Dist(v) represents the element in the i-th row and j-th column of the adjacency matrix A. i ,v j ) represents node v in the road networki to node v j The distance, σ 2 δ represents the variance of the distances between all nodes in the road network, with δ being the threshold. In a traffic path network, the connectivity between nodes contains adjacency information, which has a substantial impact on the evolution of traffic flow-related information within the road network.

[0088] The graph is further extended because traffic flows in any graph network are not isolated. Some traffic flows in the dataset are obtained from external structures, and similarly, they can flow out to external structures.

[0089] Figure 3 (a) It can be seen that the degree of edge nodes (non-filled nodes) in the road network diagram is less than that of internal nodes. Therefore, the edge nodes can be basically determined by their degree values, thus allowing the graph to be expanded. The graph expansion method is as follows:

[0090] The number of nodes that need to have edges added is determined by the following expression:

[0091] M = N × τ, (5)

[0092] Where N is the number of road network nodes, τ is a hyperparameter that determines the proportion of nodes with newly added edges in the expanded graph, and M is the number of nodes that need to add edges.

[0093] Select the corresponding number of nodes as nodes to be added edges in ascending order of node degree, as shown in the following expression:

[0094]

[0095] in, Given a one-dimensional vector of nodes sorted in ascending order of degree, extract the degree of the first M nodes, denoted as [M]. The position index corresponding to its node is denoted as D. in .

[0096] Construct a filling matrix A′ according to the nodes on which edges need to be added, specifically including:

[0097] After recording the position index of each node that needs an edge added, the difference between the median degree of all nodes and the average degree of the nodes that need an edge added is used to obtain the number of edges to be added to each node. The expression is as follows:

[0098] d m =d mode -d ne (7)

[0099] Where, d m d is the median degree of all nodes. mode And the average degree d of the nodes that need to have their edges increased neThe difference;

[0100] For each node whose index needs to be added, perform pairwise non-repeating combinations of indices and assign the corresponding position in the filling matrix A′ to the value ε. Simultaneously, increment the counter by one until the indexes of each node have been traversed or the counter value reaches the number of edges to be added to the node. The expression for assigning ε is as follows:

[0101]

[0102] Where dist is the average distance of all nodes in the road network.

[0103] The pseudocode for the algorithm to construct the filling matrix A′ based on the nodes for which edges need to be added is as follows:

[0104]

[0105]

[0106] After obtaining the filling matrix A′, the initial adjacency matrix A is expanded using the filling matrix A′ to obtain the expanded adjacency matrix A. e As in formula (9):

[0107] A e =A+A′, (9)

[0108] Among them, A e To expand the adjacency matrix, this process ensures that the degree of internal nodes in the road network graph is the same as the degree of edge nodes. Figure 3 (c) It can be seen that the road network map will be expanded by one circle.

[0109] Further calculate the extended adjacency matrix A e The corresponding Laplace matrix L e Specifically, this refers to the extended adjacency matrix A. e conduct Normalization, where D e For A e The degree matrix.

[0110] S32) Calculate the bidirectional extended adjacency matrix

[0111] After obtaining the extended adjacency matrix A e The Laplace matrix L is obtained through symmetric normalization. e Then, the Laplace matrix L e Normalize the upper and lower triangular matrices respectively to obtain the bidirectional normalized adjacency matrix L. p and L r The symmetric matrix represents the undirected graph. Two asymmetric normalized matrices are obtained through equations (10) and (11) to characterize the directionality of traffic flow in the road network.

[0112] L p =softmax(triu(L) e (10)

[0113] L r =softmax(tril(L) e (11)

[0114] Here, triu(·) and tril(·) are used to obtain the upper and lower triangular matrices, respectively, and softmax(·) is the normalization operation. The final result is the bidirectional normalized adjacency matrix L. p and L r .

[0115] In step S2 of this embodiment, the initial traffic flow features are sequentially processed through feature fusion and causal convolution. Specifically, the initial traffic flow features are divided into paths, and each path is sequentially processed through feature fusion and causal convolution to obtain the traffic flow data corresponding to the normalized adjacency matrix of each direction.

[0116] After fusing the initial traffic flow features using their respective features, we obtain... and After further processing through causal convolution, traffic flow data with temporal characteristics is obtained. and Therefore, in step S3 of this embodiment, when performing extended graph convolution operation with ARMA filter on the traffic flow data and the normalized adjacency matrix of each direction, the expression is as follows:

[0117]

[0118] in, This represents the output of the l-th layer of the extended graph convolution corresponding to the m-th direction. This represents the traffic flow data corresponding to the m-th direction. This represents the normalized adjacency matrix corresponding to the m-th direction. and V m Here are the learnable parameters, where σ(·) is the ReLU activation function. By taking m=1, And take m=2, This can result in bidirectional extended graph convolution.

[0119] In step S4 of this embodiment, when aggregating the information of each layer of the extended graph convolution in the same direction, the following steps are included:

[0120] Convolve the information of each layer of the extended graph corresponding to the m-th direction. Output and convert the 3D tensor into a dimension of N×(T)C ×D l The matrix is ​​then used to obtain the layer output information of the extended graph convolution corresponding to the m-th direction through two fully connected layer output modules, as shown in the following expression:

[0121]

[0122] in, and The parameters are trainable, and the layer output information of the extended graph convolution corresponding to the m-th direction can be obtained through a fully connected layer. sigmoid(·) is the activation function.

[0123] After obtaining the layer output information of the convolution of the extended graph corresponding to the m-th direction, the layer information of different layers of the same extended graph convolution is aggregated by formula (14) to obtain the layer aggregation feature of the extended graph corresponding to the m-th direction, as shown in the following expression:

[0124]

[0125] Where ⊙ represents the Hadamard product operation. For training parameters, H m The layer aggregation feature of the extended graph corresponding to the m-th direction.

[0126] Through the above operations, layer aggregation features of spatiotemporal expansion map convolutions in different directions were obtained. In order to select the information that is relatively important to the current prediction task, in step S5 of this embodiment, the feature information H in different directions is... m The final output is obtained through attention aggregation, which is the prediction result of traffic flow data. The specific operation can be defined as follows:

[0127]

[0128] Among them, Z m For H m The resulting one-dimensional vector, W m Is it with Z m Training parameters of the same dimension, b m For bias. α m Z is the attention score of the extended graph corresponding to the m-th direction. o The final result of attention aggregation,

[0129] Following step S5 in this embodiment, model training is performed. In this embodiment, the model parameters are set as follows: feature fusion stride κ = 3; causal convolution kernel width K = 3; and number of channels D. C=16. When constructing the initial adjacency matrix A, δ=3 is set in datasets PEMS03 and PEMS07, and δ=0.5 is set in datasets PEMS04 and PEMS08. In the expanded graph, τ=0.2 is set, which means adding edges to the 20% of nodes with the lowest degree. In the bidirectional graph convolution, n=4 is set to obtain a 4-layer graph convolution, and D is set to... l =64, obtain the dimension of the training parameters, and set the number of neurons D in the two fully connected layers. F1 =64, D F2 =12. The initial learning rate was set to 0.01, and it decayed to 0.7 times the original rate every 15 batches. The number of iterations was 200, the batch size was 32, the dropout rate was 0.2, the optimizer was AdamW, and the loss function was Huber loss.

[0130] Example 2

[0131] This embodiment proposes a traffic flow prediction system based on a bidirectional spatiotemporal extended graph convolutional network, including interconnected microprocessors and computer-readable storage media. The microprocessors are programmed or configured to execute the traffic flow prediction method based on a bidirectional spatiotemporal extended graph convolutional network as described in Embodiment 1.

[0132] In summary, this invention proposes a traffic flow prediction method based on a bidirectional spatiotemporal extended graph convolutional network and a system for implementing this method. Addressing the complex spatiotemporal dependencies of road network traffic flow and the inability to fully extract spatial features of road network edge nodes, this invention proposes a bidirectional spatiotemporal extended graph convolutional model (Bi-STEGCM). The feature fusion of model components better addresses the problem of missing data. This component uses a sliding window approach to smooth traffic flow data without disrupting the temporal characteristics of traffic flow. While road network traffic structure can be characterized using graph structures, the spatial structure of edge nodes is very limited. Extending the graph structure of edge nodes using an extended graph enriches the spatial structure of the road network. Considering the directional nature of road network traffic flow, constructing a bidirectional extended graph convolution can more effectively leverage the advantages of extended graphs in extracting spatial topology. Combined with causal convolution of the temporal model, it fully mines the spatiotemporal features of traffic flow, achieving better results in traffic flow prediction.

[0133] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.

Claims

1. A traffic flow prediction method based on a bidirectional spatiotemporal extended graph convolutional network, characterized in that, Includes the following steps: Real-time acquisition of historical traffic flow data for each node in the road network and use as initial traffic flow features; The initial traffic flow features are sequentially processed through feature fusion and causal convolution to obtain traffic flow data with temporal features; Calculating the bidirectional normalized adjacency matrix corresponding to the road network specifically includes: The initial adjacency matrix is ​​calculated based on the connection relationships of the nodes in the road network. The formula is as follows: in, Representing the adjacency matrix The Middle Line 1 Column elements, Represents nodes in the road network To the node distance, It is the variance of the distances between all nodes in the road network. For threshold; Determine the number of nodes for which edges need to be added, and select the corresponding number of nodes as the nodes for which edges need to be added in ascending order of node degree. Construct a filling matrix based on the nodes for which edges need to be added. Construct a filling matrix by adding nodes with added edges as needed. At that time, including: Record the position index of each node that needs an edge added. Calculate the difference between the median degree of all nodes and the average degree of the nodes that need an edge added to obtain the number of edges to be added to each node. Perform unique pairwise combinations of the indices of each node that needs an edge added, and fill the matrix accordingly. Assign values ​​to the corresponding positions Simultaneously, increment the counter by one until the index of each node has been traversed or the counter value reaches the number of edges added to the node, then assign a new value. The expression is as follows: in, This is the average distance across all nodes in the road network; Use the fill matrix For the initial adjacency matrix The adjacency matrix is ​​then expanded to obtain the extended adjacency matrix. ; Calculate the extended adjacency matrix The corresponding Laplace matrix Then, for the Laplace matrix Normalize the upper and lower triangular matrices respectively to obtain bidirectional normalized adjacency matrices. and ; The traffic flow data is then subjected to an extended graph convolution operation with an ARMA filter on the normalized adjacency matrix for each direction to obtain the information of each layer of the extended graph convolution for each direction. Aggregate the information from each layer of the extended graph convolution in the same direction to obtain the layer aggregated features of the extended graph convolution in each direction; The features of the convolutional layers of the extended graph in each direction are aggregated through attention to obtain the final output, which is then used as the prediction result for traffic flow data.

2. The traffic flow prediction method based on bidirectional spatiotemporal extended graph convolutional network according to claim 1, characterized in that, The initial traffic flow features are sequentially processed through feature fusion and causal convolution. Specifically, the initial traffic flow features are divided into paths, and each path is sequentially processed through feature fusion and causal convolution to obtain the traffic flow data corresponding to the normalized adjacency matrix of each direction.

3. The traffic flow prediction method based on bidirectional spatiotemporal extended graph convolutional network according to claim 1, characterized in that, When the initial traffic flow features are sequentially processed through feature fusion and causal convolution, the feature fusion steps include: The dimensions of the data sequence of each node are expanded along the time dimension to obtain the expanded data sequence; The data sequence after expanding the dimension of each node is then aggregated using a specified kernel width, as shown in the following expression: in, The data sequence after the dimension of the i-th node is expanded. For feature aggregation operations, The convolution kernel for feature aggregation, For kernel width, The output of the feature aggregation for the i-th node; Repeat the above steps iteratively until the number of feature fusion operations meets the requirement.

4. The traffic flow prediction method based on bidirectional spatiotemporal extended graph convolutional network according to claim 1, characterized in that, When the initial traffic flow features are sequentially processed through feature fusion and causal convolution, the steps of causal convolution include: We obtain the output of feature fusion for each node, and then compute the output of the causal convolution for each node in parallel, as shown in the following expression: in, This represents the output after one layer of causal convolution. One element; This represents the output of feature fusion at the i-th node. This indicates a causal convolution operation. The width is convolution kernel, The i-th node represents the output of the feature fusion of the i-th node. One element, The convolution kernel is represented by the first... Each element.

5. The traffic flow prediction method based on bidirectional spatiotemporal extended graph convolutional network according to claim 1, characterized in that, When performing extended graph convolution operations with ARMA filters on the traffic flow data and normalized adjacency matrices in different directions, the expressions are as follows: in, Indicates the first The first direction corresponds to the extended graph convolution of the first direction. The output of the layer, , Indicates the first Traffic flow data for each direction Indicates the first The normalized adjacency matrix corresponding to each direction and For learnable parameters, for Activation function.

6. The traffic flow prediction method based on bidirectional spatiotemporal extended graph convolutional network according to claim 1, characterized in that, When aggregating information from each layer of extended graph convolutions in the same direction, the specific steps include: The first The information from each layer of the extended graph convolution corresponding to each direction is obtained by passing the output module of two fully connected layers. The output information of the convolutional layers corresponding to each direction of the extended graph is expressed as follows: in, and For trainable parameters, For activation functions; Get the first After obtaining the layer output information of the extended graph convolution corresponding to the i-th direction, the layer information of different layers with the same extended graph convolution is aggregated to obtain the i-th... The layer aggregation features of the extended graph corresponding to each direction are expressed as follows: in, For the Hadamard operation, For training parameters, For the first Layer aggregation features of the extended graph corresponding to each direction.

7. The traffic flow prediction method based on bidirectional spatiotemporal extended graph convolutional network according to claim 1, characterized in that, When aggregating features from convolutional layers of extended graphs in different directions using attention, the expression is as follows: in, For the first Layer aggregation features of the extended graph corresponding to each direction, for The resulting one-dimensional vector Is and Training parameters of the same dimension For bias, For the first Attention scores for the extended graphs corresponding to each direction. The final result of attention aggregation.

8. A traffic flow prediction system based on a bidirectional spatiotemporal extended graph convolutional network, characterized in that, The device includes an interconnected microprocessor and a computer-readable storage medium, the microprocessor being programmed or configured to perform the traffic flow prediction method based on a bidirectional spatiotemporal extended graph convolutional network as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Hypergraph-based space-time hypergraph convolution traffic flow prediction method and system

    CN115565369A

  • Short-term traffic flow prediction method based on causal gated-low-pass graph convolutional network

    US20240029556A1