Complex traffic flow prediction method based on dynamic graph convolution and interactive learning

By using dynamic graph convolution and interactive learning methods in traffic flow prediction, the DGCINet model is constructed, which solves the problem of insufficient space-time dependence capture in the existing technology, and achieves more accurate traffic flow prediction.

CN119784195AInactive Publication Date: 2025-04-08QUZHOU HAIYI TECHNOLOGY CO LTD +1

Patent Information

Application Number
CN202510282387.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-11
Publication Date
2025-04-08
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing traffic flow prediction methods cannot accurately capture the spatial and temporal dependence of traffic flow data dynamics, it is difficult to fully understand the impact of real-time interactions between different geographical locations, and it is difficult to effectively integrate dynamic data on long-term scales.

Method used

Using a complex traffic flow prediction method based on dynamic graph convolution and interactive learning, the DGCINet model is constructed, combined with graph convolution network and interactive learning structure, time and spatial dependencies are captured, and dynamic graphs are generated through adaptive and learnable adjacency matrix to capture the spatial correlation of dynamic changes in the traffic network.

Benefits of technology

It realizes accurate capture of dynamic spatiotemporal characteristics of traffic flow data, improves the ability to understand the real-time interaction impact of different geographical locations, can more effectively integrate dynamic data on long-term scales, and improves the accuracy of traffic flow prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119784195A_ABST
    Figure CN119784195A_ABST
Patent Text Reader

Abstract

The invention discloses a complex traffic flow prediction method based on dynamic graph convolution and interactive learning, and belongs to the technical field of intelligent traffic, and the method achieves the effective long-term traffic flow prediction through embedding a graph convolution network into an interactive learning structure, and capturing the time and space dependence at the same time. A new dynamic graph convolution method is used, a combined graph generated from an adaptive and learnable adjacent matrix in real time is used to capture spatial correlation changing in real time in a traffic network, then a space-time adaptive converter is integrated, global and local features can be extracted, and the spatial correlation is obtained. According to the method, the challenge of traffic flow prediction aiming at complex correlation and nonlinearity of urban traffic flow in time and space can be solved, the advantages of dynamic graph convolution and interactive learning are combined, a new efficient model of dynamic graph convolution and interactive network is provided, the dynamic spatial and temporal characteristics of the traffic flow are reflected, and the traffic flow prediction efficiency is improved. Therefore, traffic flow prediction can be realized more accurately.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of intelligent transportation technology, and specifically relates to a complex traffic flow prediction method based on dynamic graph convolution and interactive learning. Background Art

[0002] Urban traffic flow data refers to a series of data points that record the changes in urban public transportation systems or road traffic flow over time. It usually contains daily, weekly or monthly data for different periods of time, such as passenger flow, traffic volume, vehicle speed, etc. Traffic flow forecasting involves the use of historical traffic data sets, real-time indicators and complex analytical methods to estimate the future status of the transportation network. It is a core component of the intelligent transportation system, which helps city managers, transportation planners and drivers make better decisions by dynamically monitoring and simulating the transportation network.

[0003] In recent years, research has paid more and more attention to the temporal and spatial dependencies inherent in traffic flow prediction. There are some methods that capture temporal and spatial correlations separately and connect them in series or in parallel, such as Graph WaveNet and STFGNN. However, these methods tend to weaken the temporal and spatial correlations in traffic data, and sometimes even amplify less important features.

[0004] Models such as STSGCN and ST-3DGMR make positive contributions to traffic flow prediction by incorporating spatial modules into the temporal framework and encapsulating spatiotemporal dependencies in parallel. However, these models only rely on the spatiotemporal information between traffic data for interactive learning, which affects the perception of the periodicity and trend of the sequence.

[0005] In order to enhance the detection of dynamic spatial dependencies in traffic networks, studies such as MTGNN and DMSTGCN have proposed adaptive adjacency matrices or a combination of multiple adjacency matrices to reveal potential spatial dependencies. These methods cannot fully utilize historical traffic data. Although the adaptive adjacency matrix can discover implicit relationships between graph nodes and improve the model's ability to capture spatial heterogeneity, it is static when model training stops and cannot reflect the dynamic relationship between graph nodes over time.

[0006] Due to the complex correlation and nonlinearity of urban traffic flow in time and space, the existing traffic flow prediction methods still have the following shortcomings:

[0007] 1. Unable to accurately capture the spatiotemporal dependencies of traffic flow data dynamics;

[0008] 2. Most existing methods may have difficulty in fully understanding the impact of real-time interactions between different geographical locations and effectively integrating dynamic data over long time scales. Summary of the invention

[0009] In order to solve the problems raised in the above background technology, the present invention provides a complex traffic flow prediction method based on dynamic graph convolution and interactive learning to solve the problems that the existing traffic flow prediction method cannot accurately capture the dynamic spatiotemporal dependence of traffic flow data, it is difficult to fully understand the impact of real-time interactions between different geographical locations, and it is difficult to effectively integrate dynamic data over a long time scale.

[0010] To achieve the above object, the present invention provides the following technical solutions:

[0011] The complex traffic flow prediction method based on dynamic graph convolution and interactive learning includes the following steps:

[0012] S1: Collect the sequence data of traffic flow and preprocess the sequence data;

[0013] S2: Divide the sequence data into training set, validation set and test set according to the preset ratio;

[0014] S3: Build the DGCINet model for traffic flow prediction. The DGCINet model includes the first fully connected layer, three DGCI modules, three DGCN modules, a diffusion graph convolution module, a temporal transformer, a spatial transformer, and a second fully connected layer.

[0015] The sequence data input into the DGCINet model first enters the first fully connected layer, and then is processed by the first fully connected layer and sent to a DGCI module combined with a DGCN module for downsampling, decomposing to obtain two sub-feature sequences with temporal and spatial correlations. The two sub-feature sequences are respectively input into the other two DGCI modules combined with DGCN modules for the same decomposition to obtain four sub-feature sequences. The four sub-feature sequences are reassembled in the order of time index and sent to the diffusion graph convolution module for global spatiotemporal feature capture, and then the traffic relationship and flow relationship along the time axis and space axis are captured through the time converter and the space converter, and finally input into the second fully connected layer for processing and output;

[0016] S4: The DGCINet model is trained with a preset learning strategy and a preset number of iterations using the training set. The mean square loss function is used as the loss function during training, and the Adam optimizer is used to perform back propagation optimization of the DGCINet model parameters.

[0017] S5: Input the traffic flow data into the trained DGCINet model to obtain the traffic flow prediction results.

[0018] Preferably, in S1, a Z-scores method is used to pre-process the traffic flow data.

[0019] Preferably, the DGCN module includes:

[0020] A first diffusion map convolution layer and a second diffusion map convolution layer;

[0021] A graph generator; the graph generator is connected to the first diffusion graph convolution layer, and the graph generator is used to generate a matrix with spatiotemporal features according to input data;

[0022] Adaptive fusion layer; the input end of the adaptive fusion layer is connected to the output end of the graph generator, and the output end of the adaptive fusion layer is connected to the second diffusion graph convolution layer.

[0023] Preferably, in S3, the DGCI module decomposes the input original sequence X into two subsequence features X by using the DGCN module and interactive downsampling. odd2 and X even2 , specifically:

[0024] S3.1: Let X∈R C×N×T is the input of the DGCI module, R C×N×T Represents a three-dimensional tensor containing N samples, each with C feature dimensions and observed at T time steps. The DGCI module downsamples the original sequence X into two subsequences X by separating odd and even elements. odd ∈R C×N×T / 2 and X even ∈R C×N×T / 2 ;

[0025] S3.2: Let the one-dimensional convolution operation be represented by conv1, conv2, conv3, and conv4, respectively, using conv1 and conv2 from X odd and X even Extract features from the output X after the first interactive learning odd1 ∈R C×N×T / 2 , X even1 ∈R C ×N×T / 2 ;

[0026] S3.3: Use conv3 and conv4 to extract the X odd1 ∈R C×N×T / 2 , X even1 ∈R C×N×T / 2 Extract features and get the output X after the second interactive learning odd2 ∈R C×N×T / 2 and X even2 ∈R C×N×T / 2 ;

[0027] The interactive learning operation is defined as:

[0028] ;

[0029] ;

[0030] ;

[0031] ;

[0032] ;

[0033] Among them, ⊙ represents the Hadamard product, tanh is the activation function, Splitting() represents the splitting operation, and Splitting(X) represents splitting the original sequence X into X odd and X even .

[0034] Preferably, in the DGCN module, the graph generator takes the predefined initial adjacency matrix A∈R N×N And the hidden feature H∈R obtained after one-dimensional convolution operation C×N×T As input, the input matrix A and hidden features H are sent to the multi-layer perceptron MLP after being processed by the first diffusion graph convolution layer, generating a matrix A1∈R with spatiotemporal characteristics N×N , R N×N represents a set of N×N matrices consisting of real numbers, where N is the number of samples processed by the model at one time. The matrix A1 is expressed as:

[0035] ;

[0036] GCN represents the diffusion graph convolution operation, and the generated matrix A1 is discrete;

[0037] Reparameterize the matrix A1∈R using Gumbel N×N ,get:

[0038] ;

[0039] Where g~Gumbel(0,1) is a random variable, σ is the softmax coefficient, set to 0.5, and the adjacency matrix A lea ∈R N×N Used to simulate the dynamic relationship between nodes;

[0040] Define the adaptive adjacency matrix A adp ∈R N×N , expressed as:

[0041] ;

[0042] where M1∈R N×c and M2∈R N×c is a learnable parameter, and an adaptive fusion layer is used to transform A adp With A lea Fusion, and the resulting fusion dynamic adjacency matrix Adyn Input into the second diffusion graph convolution, the fusion operation is defined as follows:

[0043] ;

[0044] Among them, α is a learnable adaptive parameter factor.

[0045] Preferably, the input of the diffusion map convolution is uniformly defined as B in ∈R C×N×T , in the first diffuse graph convolution layer, the diffuse graph convolution used is defined as:

[0046] ;

[0047] Among them A apt ∈R N×N is the adaptive adjacency matrix, k is the diffusion step size, K is the maximum number of diffusion steps, and β∈R N×N represents the parameter matrix;

[0048] In the second diffusion graph convolution layer, A dyn is the adjacency matrix of the diffuse graph convolution input, where the diffuse graph convolution is defined as:

[0049] .

[0050] Preferably, two matrices are used in the diffusion graph convolution module, one is the predefined initial adjacency matrix A∈R N×N , and the other is a dynamic adjacency matrix A generated by interactive learning dyn ∈R N×N , use directed graphs to represent the forward and reverse transfer matrices of A respectively. The forward transfer matrix of A is A f =A / rowsum(A), the reverse transfer matrix of A is A b =A T / rowsum(A T ), where rowsum() represents the row-wise summation operation, that is, the sum of the elements of each row of the matrix is ​​calculated and used for normalization. At this time, the diffusion graph convolution module is defined as:

[0051] ;

[0052] β1, β2, β3∈R N×N represents the parameter matrix.

[0053] Preferably, in S3, a vanilla transformer is applied to capture complex traffic relations along the temporal and spatial axes, given a latent dimension d H The hidden space-time representation of , represents a batch containing N time series, each of which contains T time steps, and each time step has d H dimensional hidden feature representation, and obtain the matrix of query Q, key K, and value V through the time transformer layer:

[0054] ;

[0055] in is a learnable parameter, and the self-attention score is then calculated as:

[0056] ;

[0057] Where T represents the sequence length, L t ∈R N×T×T , tensor R N×T×T Represent a spatiotemporal graph containing N spatial nodes, the temporal relationship of each node within T time steps, capture the temporal relationship in different spatial nodes, and obtain the temporal transformer layer The output is:

[0058] Z t =L t V t ;

[0059] Similarly, the spatial transformation layer performs the following operations:

[0060] Z s =SelfAttention(Z t );

[0061] in is the output of the spatial transformer, and finally the output of the fully connected layer is used to generate predictions.

[0062] Preferably, the initial learning rate is set to 0.001, and a decaying learning rate adjustment strategy is used. After every 5 rounds of training, the learning rate is reduced to 0.7 times the original value. The batch size is set to 32, and the number of training iterations is 100.

[0063] Compared with the prior art, the present invention has the following beneficial effects:

[0064] This application achieves effective long-term traffic flow prediction by embedding graph convolutional networks into interactive learning structures while capturing temporal and spatial dependencies. A new dynamic graph convolution method is then used to capture the real-time changing spatial correlations in the traffic network using a merged graph generated in real time from an adaptive and learnable adjacency matrix. A spatiotemporal adaptive transformer is then integrated to extract global and local features. This application can address the challenges of traffic flow prediction for urban traffic flows that have complex correlations and nonlinearities in time and space. This application combines the advantages of dynamic graph convolution and interactive learning, and proposes a new efficient model of dynamic graph convolution and interactive networks that reflects the dynamic spatiotemporal characteristics of traffic flows, thereby enabling more accurate traffic flow predictions. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] Figure 1 This is a flowchart of the application;

[0066] Figure 2 This is a schematic diagram of the model structure of this application;

[0067] Figure 3 It is a bar chart comparing MAPE. DETAILED DESCRIPTION

[0068] In order to facilitate those skilled in the art to understand the technical content of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific examples. It should be understood that the specific examples described herein are only used to explain the present invention and are not used to limit the present invention.

[0069] Example 1

[0070] First, given a road network, represented as a graph G=(V,E,A), assuming that V represents vertices, E represents edges, and A represents the adjacency matrix, the task of traffic flow prediction is to use the historical sequence A sequence of predicted future traffic flows ,in Represents the observed value of graph G at time step t, c represents the number of feature channels, T represents the length of the given historical time series, and T` represents the length of the traffic volume time series to be predicted. Based on the above tasks, it can be seen that complex traffic flow prediction methods based on dynamic graph convolution and interactive learning, such as Figure 1 As shown, the following steps are included:

[0071] S1: Collect traffic flow data. In order to reduce the adverse effects of large or small values ​​in traffic time series data on feature learning, the Z-scores method is used to preprocess the traffic flow data.

[0072] In this embodiment, four real publicly available traffic flow datasets are selected, namely PEMS03, PEMS04, PEMS07 and PEMS08. These four datasets are collected in real time every 30 seconds by Caltrans Performance Measurement System (PeMS). They are finally aggregated into a 5-minute observation period, thus forming a 12-hour observation period. The goal of this application is to predict the traffic data for the next hour. The statistics of these datasets are shown in Table 1: Table 1

[0073] S2: Divide the sequence data into training set, validation set and test set in a ratio of 6:2:2.

[0074] S3: Build the DGCINet model for traffic flow prediction. The DGCINet model includes the first fully connected layer, three Figure 2 (b) shows the interactive learning module DGCI, three Figure 2 (c) shows the cascade fusion module DGCN, diffusion graph convolution module, time transformer, spatial transformer and second fully connected layer;

[0075] In order to compensate for the information loss in the downsampling process, interactive dynamic graph convolution (DGCI) learning is added between the two subsequences, and interactive downsampling is used to divide the input sequence into two subsequences. Figure 2 As shown in (b) of Figure 2, while capturing temporal correlation, the dynamic graph convolutional network (DGCN) module is embedded in the interactive learning structure to generate a dynamic graph by integrating an adaptive and learnable adjacency matrix to capture the dynamically changing spatial correlation in the traffic network, as shown in Figure 2. Figure 2 As shown in (c) of Figure 1, after being processed by the DGCI module, the technology outputs two sequences, rearranges the extracted features into a new sequence representation, adds it to the original traffic time series, and then feeds it into the dynamic graph convolution module DGCN for global spatiotemporal feature capture, and the spatiotemporal transformer layer captures traffic relationships (see Figure 2 (d) in the figure, and finally output the predicted sequence.

[0076] exist Figure 2 In (a), the spatiotemporal features obtained from the learned structure of the DGCI module are reassembled in the order of time index and sent to the diffusion graph convolution module, as shown in Figure 2 As shown in (b) in the figure, the sequence data can be downsampled to achieve multi-resolution analysis and expand the receptive field. For most traffic time series data, due to trend and proximity, the interactive downsampled sequence still retains most of the information of the original sequence, such as Figure 2 As shown in the figure, this module decomposes the input feature X into two sub-features X through splitting and interactive learning operations.odd2 and X even2 .

[0077] The splitting process downsamples the original sequence X into two subsequences X by separating the odd and even elements odd and X even , these two subsequences have a coarser temporal resolution, but retain most of the information of the original sequence. Next, different convolution kernels are used to extract the subsequences from X odd and X even Extract features from .

[0078] In order to compensate for the potential information loss caused by downsampling and capture the hidden spatiotemporal features, an efficient interactive dynamic graph convolution learning strategy is proposed. By mutually learning affine transformation parameters, information exchange between two convolutions is achieved, thereby better capturing complex temporal and dynamic spatial correlations.

[0079] Let X∈R C×N×T is the input of the interactive learning structure, and the subsequence of X after interval segmentation (based on odd-even index intervals) is represented as X odd ∈R C×N×T / 2 and X even ∈R C×N×T / 2 , the one-dimensional convolution operation in the interactive learning structure is represented by conv1, conv2, conv3 and conv4, and the output after the first interactive learning is X odd1 ∈R C×N×T / 2 , X even1 ∈R C×N×T / 2 , X odd1 and X even1 After interactive learning, the final subsequence output is X odd2 ∈R C×N×T / 2 and X even2 ∈R C×N×T / 2 , the operations in the interactive learning structure are defined as:

[0080] ;

[0081] ;

[0082] ;

[0083] ;

[0084] ;

[0085] Among them, ⊙ represents the Hadamard product, tanh is the activation function, and Splitting() represents the splitting operation, which means dividing the dataset X into two subsets so that the model can be trained and evaluated on the two subsets.

[0086] Compared to the dilated convolutions used in the TCN architecture, the proposed DGCI architecture achieves greater receptivity at each convolutional layer and allows the spatiotemporal features of each other to be captured between successive layers. More importantly, unlike TCN that uses a single shared convolutional filter at each layer, the DGCI module aggregates essential information extracted from two sub-sampled sequences that have both local and global views of the entire time series.

[0087] This technique uses two matrices in the diffusion graph convolution module, one is the predefined initial adjacency matrix A∈R N ×N , and the other is a dynamic adjacency matrix A generated by an interactive learning structure dyn ∈R N×N , we use directed graphs to represent the forward and reverse transfer matrices of A respectively. The forward transfer matrix of A is A f =A / rowsum(A), the reverse transfer matrix of A is A b =A T / rowsum(A T ), where rowsum() represents the row-wise summation operation, that is, the sum of the elements of each row of the matrix is ​​calculated and used for normalization. In this case, the diffusion graph convolution module is defined as:

[0088] ;

[0089] β1, β2, β3∈R N×N represents the parameter matrix.

[0090] The DGCN module exploits its generated graph structure to better explore deeper spatial correlations and improve the performance of the model to capture spatial heterogeneity. Figure 2 In (c), the graph generator takes the predefined initial adjacency matrix A∈R N×N and hidden features H∈R C×N×T As input, the input matrix A and the hidden features H are sent to the MLP after the convolution process of the diffusion map to generate a matrix A1∈R with spatiotemporal characteristics N×N :

[0091] ;

[0092] Where MLP stands for multi-layer perceptron, the Softmax function refers to taking the exponent of each element of the input vector and then dividing it by the sum of all these exponents, which is often used as the activation function of the last layer, GCN stands for the diffusion graph convolution operation, and the generated matrix A1 is discrete. Since this variable needs to be sampled during the training process to ensure that the sampling process is differentiable, it is reparameterized using Gumbel:

[0093] ;

[0094] Where g~Gumbel(0,1) is a random variable, σ is the softmax coefficient, set to 0.5, and the adjacency matrix A lea ∈R N×N Used to simulate the dynamic relationship between nodes;

[0095] In addition, we also define the adaptive adjacency matrix A adp ∈R N×N , which is expressed as:

[0096] ;

[0097] Among them, Relu is an activation function widely used in neural networks. Compared with activation functions such as Sigmoid and Tanh, the gradient of Relu in the positive interval is always 1, which avoids the gradient disappearance problem and helps network acceleration. N×c and M2∈R N×c is a learnable parameter, A adp The initial value is the adjacency matrix A predefined by the prior graph, and then the adaptive fusion structure A is used adp With A lea Fusion, and the resulting adjacency matrix A dyn Input into the diffusion graph convolution to dynamically model the relationship between nodes and explore invisible node connections in the road network. The fusion operation is defined as follows:

[0098] ;

[0099] Among them A dyn is the fused dynamic adjacency matrix, and α is a learnable adaptive parameter factor.

[0100] The three modules of graph generator, fused graph convolution and cascade fusion all use diffuse graph convolution. We define the input of diffuse map convolution as B in ∈R C×N×T , in the graph generator, the diffusion graph convolution used is defined as:

[0101] ;

[0102] Among them A apt ∈R N×N is the adaptive adjacency matrix, k is the diffusion step size, K is the maximum number of diffusion steps, and β∈R N×N Represents the parameter matrix. In the fusion graph convolution module, A dyn is the adjacency matrix of the diffuse graph convolution input, where the diffuse graph convolution is defined as:

[0103] .

[0104] This technique also applies the vanilla transformer to capture complex traffic relationships along the time and space axes, given a H The hidden space-time representation of , we obtain the matrix of query Q, key K and value V through the time transformation layer:

[0105] ;

[0106] in is a learnable parameter, and the self-attention score is then calculated as:

[0107] ;

[0108] Where T represents the sequence length, L t ∈R N×T×T , tensor R N×T×T Represent a spatiotemporal graph containing N spatial nodes, the temporal relationship of each node within T time steps, capture the temporal relationship in different spatial nodes, and obtain the temporal transformer layer The output is:

[0109] Z t =L t V t ;

[0110] Similarly, the spatial transformer layer performs the following operations:

[0111] Z s =SelfAttention(Z t );

[0112] in is the output of the spatial transformer. It is worth noting that we also apply layer normalization, residual connections, and multi-head mechanisms. Finally, we use the output of the fully connected layer to generate predictions.

[0113] S4: The length of the time series of the model input is 12, and the length of the future time series predicted by the model is 12, that is, the traffic flow data of the past hour is used to predict the traffic flow data of the next hour. The initial learning rate is set to 0.001. In order to speed up the convergence of the model, the attenuated learning rate adjustment strategy is used. After every 5 rounds of training, the learning rate is reduced to 0.7 times the original. The batch size is set to 32, the number of training iterations is 100, and the mean square loss function (MSE) is used as the loss function during training. The Adam optimizer is used for back-propagation optimization of the neural network parameters.

[0114] S5: Input the traffic network spatial diagram, the traffic flow data one hour ago, the traffic flow data one day ago, and the traffic flow data one week ago of the prediction period into the trained traffic flow prediction model to obtain the traffic flow prediction result.

[0115] In order to evaluate the performance of the model proposed in the present invention, the present invention uses three indicators: mean absolute error (MAE), root mean square error (RMSE), and mean absolute percentage error (MAPE) for evaluation. The specific calculation method is as follows:

[0116] ;

[0117] ;

[0118] ;

[0119] Where N represents the number of samples, Y i represents the true value, and Represents the predicted value.

[0120] In order to evaluate the prediction performance of the model proposed in this invention, the following models are selected for comparison, including traditional prediction methods, traditional machine learning models, and the recently popular deep learning models:

[0121] SVR: Support Vector Regression method, selects an appropriate kernel function, and obtains an optimized model by minimizing the total loss and maximizing the interval. The present invention uses radial basis function as the kernel function for prediction.

[0122] VAR: Vector Autoregression, regresses all current variables in the model on several lagged versions of all variables.

[0123] LSTM: A neural network model for processing sequence data that captures long-term dependencies in sequences through gating mechanisms and memory units.

[0124] TCN: Temporal Convolutional Neural Network is a time series prediction model based on convolutional neural network, which effectively captures the correlation of time series through stacked causal dilation convolution.

[0125] STFGNN: A data-driven approach is used to fuse spatial, temporal, and time series information to capture hidden spatiotemporal correlations. The present invention sets the number of temporal convolution channels to 32, the number of spatial convolution channels to 16, the batch size to 32, and the temporal convolution kernel size to 1×3.

[0126] STD-MAE: A new self-supervised pre-training framework that uses two decoupled masked autoencoders to reconstruct along the spatial and temporal dimensions. The present invention sets the number of temporal convolution channels to 32, the number of spatial convolution channels to 16, and the batch size to 32.

[0127] STSGCN: Use the spatiotemporal synchronous modeling mechanism to effectively capture complex local spatiotemporal correlations. The present invention sets the number of spatial convolution channels to 32, the batch size to 32, and each spatiotemporal network sequence contains 3 spatiotemporal networks.

[0128] GWN: Combining gated TCN and spatial GCN, an adaptive adjacency matrix is ​​proposed to learn dynamic spatial correlation. The present invention sets the number of spatial convolution channels to 32 and the batch size to 32.

[0129] SCINet: Sample Convolutional and Interaction Networks proposes a hierarchical down-sampling convolutional interaction framework for time series prediction.

[0130] The experimental results are shown in Table 2 and Table 3: Table 2

[0131] Table 3

[0132] from Figure 3 As can be seen from Table 2 and Table 3, compared with the existing models, the experimental results of this model on 4 real data sets are as follows:

[0133] From Table 2, we can see that our model achieves consistent state-of-the-art performance in all baseline model tests.

[0134] Table 2 shows the prediction results of the proposed model for the next hour (12 time steps) on four real traffic flow test sets and the comparison models. The average improvement on the PEMS03 dataset is 5.69%, 7.06%, and 5.59% over other methods. The average increase on the PEMS04 dataset is 5.95%, 6.35%, and 4.88%. The average increase on the PEMS07 dataset is 8.47%, 9.79%, and 5.59%. The average increase on the PEMS08 dataset is 3.95%, 7.89%, and 4.48%. The results in Table 2 show that the statistical method VAR, the traditional machine learning method SVR, LSTM and TCN perform poorly because these models only consider temporal correlation and ignore the complex spatial correlation in traffic data. Other spatiotemporal models have better performance due to considering spatiotemporal correlation. It is worth mentioning that SCINet achieves good performance even without considering spatial correlation. It also demonstrates the effectiveness of interactive learning and the importance of spatial modeling of traffic data. Our proposed model uses an interactive learning strategy to capture correlations synchronously. Its DGCN module is used to explore invisible node connections in road networks to capture hidden spatial correlations and simulate dynamic correlations between nodes that change over time.

[0135] Table 3 shows the impact of using dynamic graph convolution and interaction on the model.

[0136] DGCINet-woInteraction replaces the interactive learning structure with TCN, DGCINet-woconv removes the one-dimensional convolution module from the interactive learning structure, and DGCINet-woDGCN replaces the DGCN module with a normal diffused GCN. Table 3 shows that the synchronous function capture in interactive learning is more effective than the concatenated capture in TCN, and the DGCN model is crucial to improving model performance.

[0137] It can also be seen from Table 3 that the two adjacency matrices defined in the DGCN module are crucial to the model.

[0138] DGCINet-woadp is the adaptive adjacency matrix without the DGCN module, and DGCINet-wolea removes the graph generator structure and retains the adaptive adjacency matrix. Table 3 shows that the two adjacency matrices play an important role in the model. The full DGCINet achieves the best results on different ablations, indicating that all components contribute to the effectiveness and robustness of our model.

[0139] Figure 3A bar chart of the MAPE results of this model and nine baseline models in four data set experiments is drawn for intuitive comparison. This model performs best on all four data sets and can better predict traffic flow data for the next hour.

Claims

1. A complex traffic flow prediction method based on dynamic graph convolution and interactive learning, characterized by: The following steps are involved: S1: Collect the sequence data of traffic flow and preprocess the sequence data; S2: Divide the sequence data into training set, validation set and test set according to the preset ratio; S3: Build the DGCINet model for traffic flow prediction. The DGCINet model includes the first fully connected layer, three DGCI modules, three DGCN modules, a diffusion graph convolution module, a temporal transformer, a spatial transformer, and a second fully connected layer. The sequence data input into the DGCINet model first enters the first fully connected layer, and then is processed by the first fully connected layer and sent to a DGCI module combined with a DGCN module for downsampling, decomposing to obtain two sub-feature sequences with temporal and spatial correlations. The two sub-feature sequences are respectively input into the other two DGCI modules combined with DGCN modules for the same decomposition to obtain four sub-feature sequences. The four sub-feature sequences are reassembled in the order of time index and sent to the diffusion graph convolution module for global spatiotemporal feature capture, and then the traffic relationship and flow relationship along the time axis and space axis are captured through the time converter and the space converter, and finally input into the second fully connected layer for processing and output; S4: The DGCINet model is trained with a preset learning strategy and a preset number of iterations using the training set. The mean square loss function is used as the loss function during training, and the Adam optimizer is used to perform back propagation optimization of the DGCINet model parameters. S5: Input the traffic flow data into the trained DGCINet model to obtain the traffic flow prediction results.

2. The complex traffic flow prediction method based on dynamic graph convolution and interactive learning according to claim 1 is characterized in that: In S1, the Z-scores method is used to preprocess the traffic flow data.

3. The complex traffic flow prediction method based on dynamic graph convolution and interactive learning according to claim 1 is characterized in that: The DGCN module includes: A first diffusion map convolution layer and a second diffusion map convolution layer; A graph generator; the graph generator is connected to the first diffusion graph convolution layer, and the graph generator is used to generate a matrix with spatiotemporal features according to input data; Adaptive fusion layer; the input end of the adaptive fusion layer is connected to the output end of the graph generator, and the output end of the adaptive fusion layer is connected to the second diffusion graph convolution layer.

4. The complex traffic flow prediction method based on dynamic graph convolution and interactive learning according to claim 3 is characterized in that: In S3, the DGCI module decomposes the input original sequence X into two subsequence features X through the DGCN module and interactive downsampling. odd2 and X even2 , specifically: S3.1: Let X∈R C×N×T is the input of the DGCI module, R C×N×T Represents a three-dimensional tensor containing N samples, each with C feature dimensions and observed at T time steps. The DGCI module downsamples the original sequence X into two subsequences X by separating odd and even elements. odd ∈R C×N×T / 2 and X even ∈R C×N×T / 2 ; S3.2: Let the one-dimensional convolution operation be represented by conv1, conv2, conv3, and conv4, respectively, using conv1 and conv2 from X odd and X even Extract features from the output X after the first interactive learning odd1 ∈R C×N×T / 2 , X even1 ∈R C×N×T / 2 ; S3.3: Use conv3 and conv4 to extract the X odd1 ∈R C×N×T / 2 , X even1 ∈R C×N×T / 2 Extract features and get the output X after the second interactive learning odd2 ∈R C×N×T / 2 and X even2 ∈R C×N×T / 2 ; The interactive learning operation is defined as: ; ; ; ; ; Among them, ⊙ represents the Hadamard product, tanh is the activation function, Splitting() represents the splitting operation, and Splitting(X) represents splitting the original sequence X into X odd and X even .

5. The complex traffic flow prediction method based on dynamic graph convolution and interactive learning according to claim 4 is characterized in that: In the DGCN module, the graph generator takes the predefined initial adjacency matrix A∈R N×N And the hidden feature H∈R obtained after one-dimensional convolution operation C×N×T As input, the input matrix A and hidden features H are sent to the multi-layer perceptron MLP after being processed by the first diffusion graph convolution layer, generating a matrix A1∈R with spatiotemporal characteristics N×N , R N×N represents a set of N×N matrices consisting of real numbers, where N is the number of samples processed by the model at one time. The matrix A1 is expressed as: ; GCN represents the diffusion graph convolution operation, and the generated matrix A1 is discrete; Reparameterize the matrix A1∈R using Gumbel N×N ,get: ; Where g~Gumbel(0,1) is a random variable, σ is the softmax coefficient, set to 0.5, and the adjacency matrix A lea ∈R N ×N Used to simulate the dynamic relationship between nodes; Define the adaptive adjacency matrix A adp ∈R N×N , expressed as: ; where M1∈R N×c and M2∈R N×c is a learnable parameter, and an adaptive fusion layer is used to transform A adp With A lea Fusion, and the resulting fusion dynamic adjacency matrix A dyn Input into the second diffusion graph convolution, the fusion operation is defined as follows: ; Among them, α is a learnable adaptive parameter factor.

6. The complex traffic flow prediction method based on dynamic graph convolution and interactive learning according to claim 5 is characterized in that: The input of the diffusion map convolution is uniformly defined as B in ∈R C×N×T , in the first diffuse graph convolution layer, the diffuse graph convolution used is defined as: ; Among them A apt ∈R N×N is the adaptive adjacency matrix, k is the diffusion step size, K is the maximum number of diffusion steps, and β∈R N×N represents the parameter matrix; In the second diffusion graph convolution layer, A dyn is the adjacency matrix of the diffuse graph convolution input, where the diffuse graph convolution is defined as: 。 7. The complex traffic flow prediction method based on dynamic graph convolution and interactive learning according to claim 6 is characterized in that: Two matrices are used in the diffusion graph convolution module, one is the predefined initial adjacency matrix A∈R N×N , and the other is a dynamic adjacency matrix A generated by interactive learning dyn ∈R N×N , use directed graphs to represent the forward and reverse transfer matrices of A respectively. The forward transfer matrix of A is A f =A / rowsum(A), the reverse transfer matrix of A is A b =A T / rowsum(A T ), where rowsum() represents the row-wise summation operation, that is, the sum of the elements of each row of the matrix is ​​calculated and used for normalization. At this time, the diffusion graph convolution module is defined as: ; β1, β2, β3∈R N×N represents the parameter matrix.

8. The complex traffic flow prediction method based on dynamic graph convolution and interactive learning according to claim 7 is characterized in that: In S3, a vanilla transformer is applied to capture complex traffic relationships along the temporal and spatial axes, given a H The hidden space-time representation of , represents a batch containing N time series, each of which contains T time steps, and each time step has d H dimensional hidden feature representation, and obtain the matrix of query Q, key K, and value V through the time transformer layer: ; in is a learnable parameter, and the self-attention score is then calculated as: ; Where T represents the sequence length, L t ∈R N×T×T , tensor R N×T×T Represent a spatiotemporal graph containing N spatial nodes, the temporal relationship of each node within T time steps, capture the temporal relationship in different spatial nodes, and obtain the temporal transformer layer The output is: From t =L t In t ; Similarly, the spatial transformation layer performs the following operations: WITH s =SelfAttention(Z t ); in is the output of the spatial transformer, and finally the output of the fully connected layer is used to generate predictions.

9. The complex traffic flow prediction method based on dynamic graph convolution and interactive learning according to claim 1 is characterized in that: The initial learning rate was set to 0.001, and a decaying learning rate adjustment strategy was used. After every 5 rounds of training, the learning rate was reduced to 0.7 times the original value. The batch size was set to 32, and the number of training iterations was 100.

Citation Information

Patent Citations

  • Traffic flow prediction method based on interactive dynamic graph convolution and probability sparse attention

    CN117290707A

  • Traffic flow prediction method

    CN118968756A

Cited By

  • Distribution transformer voltage prediction method and system based on multivariable space-time diagram neural network

    CN121840599A