A traffic flow prediction method based on multi-factor graph neural network and differential decomposition
Through a method based on multi-factor graph neural network and differential decomposition, the characteristics of traffic flow data are extracted and external factors are combined, and the problem of existing models ignore traffic flow data characteristics and external factors is solved, which significantly improves the accuracy of traffic flow prediction.
Patent Information
- Application Number
- CN202410924670.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-11
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2044-07-11
AI Technical Summary
The existing traffic flow prediction model focuses more on space-time correlation, ignoring the influence of the traffic flow data itself and its external factors on the prediction results, resulting in a decrease in the prediction effect.
Using a method based on multi-factor graph neural network and differential decomposition, the trend, seasonality and residual characteristics of traffic flow data are extracted through the differential decomposition module, combined with the external factor fusion module to introduce meteorological conditions, and the space-time attention module is used to capture complex space-time correlations. and fuse these features in graph neural networks to improve prediction accuracy.
Enhanced the data's own characteristic representation, deeply explore its trend and seasonal characteristics, and improve the prediction effect through the integration of external factors, so that the prediction model can better capture the complex spatial and temporal correlations in traffic flow, significantly improving the accuracy of traffic flow prediction .
Smart Images

Figure CN118506580B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of intelligent transportation technology, and in particular relates to a traffic flow prediction method based on multi-factor graph neural network and differential decomposition. Background Art
[0002] In recent years, traffic data such as vehicle trajectories, traffic flow, and road sensors have grown exponentially. Accurate and timely traffic flow prediction is the basis and prerequisite of smart transportation and has become one of the key issues that researchers focus on.
[0003] Traffic flow data has temporal and spatial correlations. How to effectively mine the temporal and spatial relationships between data is the key to traffic flow prediction. In recent years, more and more researchers have introduced deep learning into intelligent transportation systems. Some researchers predict traffic flow based on graph neural networks, that is, modeling the traffic network as a grid and using convolutional neural networks (CNNs) to learn the spatial interactions between different grids to capture spatial correlations. However, most models focus more on modeling the temporal and spatial associations between traffic nodes, ignoring the inherent characteristics of traffic flow data and the impact of external factors on the prediction results, resulting in reduced prediction results. Summary of the invention
[0004] The main purpose of the present invention is to provide a traffic flow prediction method based on multi-factor graph neural network and differential decomposition, which can improve the accuracy of traffic flow prediction results.
[0005] The technical solution provided by the present invention is:
[0006] A traffic flow prediction method based on multi-factor graph neural network and differential decomposition, comprising:
[0007] Construct a traffic flow prediction network model, which includes: differential decomposition module, external factor fusion module, spatiotemporal attention module and graph neural network module;
[0008] Each traffic sensor in the road network is taken as a node, and the road sections connecting adjacent traffic sensors are taken as edges to construct a weighted undirected graph G = (V, E, A); and the traffic information collected by the traffic sensor is taken as the attribute feature of the node, which is expressed as a traffic information feature matrix: ;
[0009] Among them, V is the node set of the weighted undirected graph G, E represents the edge set of the weighted undirected graph G, and A is the weighted adjacency matrix; P represents the length of the historical time series, express t Traffic information data collected by all traffic sensors at all times, N is the number of traffic sensors, expressN OK P A matrix of columns, express N A matrix with 1 row and 1 column;
[0010] Inputting the traffic information feature matrix into the difference decomposition module to obtain a first-order difference matrix, a second-order difference matrix, a trend matrix, a seasonal matrix and a residual matrix;
[0011] Obtaining a meteorological condition sequence with the same dimension as the traffic information feature matrix and inputting it into the external factor fusion module, the external factor fusion module converts the meteorological condition sequence encoding into a numerical sequence representing the weather, which is recorded as an external feature matrix;
[0012] The traffic information feature matrix, the first-order difference matrix, the second-order difference matrix, the trend matrix, the seasonal matrix, the residual matrix and the external feature matrix are combined into a multi-channel tensor,
[0013] Inputting the multi-channel tensor into the spatiotemporal attention module to obtain a spatiotemporal attention matrix;
[0014] The multi-channel tensor, weighted adjacency matrix and spatiotemporal attention matrix are input into the graph neural network module to obtain traffic flow prediction results.
[0015] Preferably, the differential decomposition module calculates the differential matrix using a differential algorithm: traverses each node in the traffic information feature matrix, calculates the difference under each node and then splices it into a differential matrix of the same dimension as the feature matrix traffic information feature matrix;
[0016] Among them, the first-order difference calculation formula is: ;
[0017] In the formula, y(n) represents the nth value of the node sequence, and y(n-1) represents the n-1th value of the node sequence; Represents the difference between the nth value and the n-1th value.
[0018] Preferably, the differential decomposition module decomposes the traffic information feature matrix using an STL decomposition method.
[0019] Preferably, the external factor fusion module uses one-hot encoding to convert the meteorological condition sequence into a numerical sequence.
[0020] Preferably, the weighted adjacency matrix is subjected to Chebyshev polynomial calculation, and the calculation result, the multi-channel tensor and the spatiotemporal attention matrix are input into the graph neural network module to obtain a traffic flow prediction result.
[0021] Preferably, the spatiotemporal attention module adopts a dot product attention mechanism.
[0022] Preferably, the traffic flow prediction network model also includes a convolutional neural network, which fuses the information output by the graph neural network module and outputs the traffic flow prediction result.
[0023] Preferably, the meteorological conditions include: temperature, weather conditions and wind speed.
[0024] Preferably, the graph neural network module includes: a graph convolutional neural network GCN, a temporal convolutional neural network Conv and a residual connection network Res connected in sequence.
[0025] The beneficial effects of the present invention are:
[0026] The traffic flow prediction method based on multi-factor graph neural network and differential decomposition provided by the present invention enhances the representation of the data's own characteristics and deeply mines the data's own trends, seasonality and other characteristics; by incorporating external factors, the prediction effect is better improved; the correlation coefficient is incorporated into spatial attention, so that the prediction model can better capture the complex spatiotemporal correlations in traffic flow, and the traffic flow prediction effect is steadily improved compared to other models. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1(a) shows the traffic flow diagram of one detector in two months.
[0028] Figure 1 (b) Traffic flow diagram of two detectors in one day.
[0029] Figure 2 This is a flow chart of the traffic flow prediction method based on multi-factor graph neural network and differential decomposition described in the present invention. DETAILED DESCRIPTION
[0030] The present invention is further described in detail below in conjunction with the accompanying drawings so that those skilled in the art can implement the invention with reference to the description.
[0031] The characteristics of traffic data streams are seasonal, periodic, trendy, sudden and noisy. As shown in Figure 1 (a), the traffic flow of a detector in two months is periodic. In addition to the daily rush hour, there are also periodic changes within a week, and a strong sudden change is shown on one day in February. As shown in Figure 1 (b), the traffic flow of two detectors in one day is seasonal. The traffic flow will increase during the rush hour on weekdays, and the traffic flow will decrease during holidays or late at night. Among them, the horizontal axis in Figure 1 (a) and Figure 1 (b) represents time, and the vertical axis represents traffic flow.
[0032] like Figure 2As shown, the present invention provides a traffic flow prediction method based on multi-factor graph neural network and differential decomposition, which comprehensively considers the inherent characteristics of traffic flow data in terms of seasonality, periodicity, trend, mutation and noise, as well as external factors (meteorological conditions) that affect traffic flow data, and helps to establish a more accurate traffic flow prediction model. In the figure, Value represents traffic flow, time represents time, Weather represents meteorological conditions, input represents input, output represents output, and Pearson represents the Pearson correlation coefficient.
[0033] The network model used in the present invention is mainly composed of four modules: differential decomposition module, spatiotemporal attention module, external factor fusion module and graph neural network module.
[0034] The differential decomposition module first extracts the characteristics of the traffic flow data itself, and the first-order and second-order differences of the traffic flow data can be extracted through differential analysis. By performing differential analysis, non-stationary factors such as volatility and suddenness in traffic data can be removed, and noise data can be removed to a certain extent, making the prediction more accurate. The traffic flow data is then decomposed into three parts: trend, seasonality, and residual. By mining the characteristics of the data itself through time series decomposition, we can better understand the components of the traffic flow data and the correlation between them. The external factor fusion module converts the acquired meteorological condition information into the external factor characteristics of the traffic flow data, and inputs it into the model together with the traffic flow data as a multivariate to improve the prediction model. The spatiotemporal attention module uses the spatiotemporal attention mechanism to capture the dynamic spatiotemporal nature of traffic data. Time attention is used to capture the dynamic time correlation between different times, and spatial attention is used to simulate the complex spatial correlation between different locations. At the same time, the correlation matrix obtained by calculating the Pearson correlation coefficient is introduced into the spatial attention to express its static spatiality and better reflect the spatial correlation of each node. The graph neural network module inputs the original traffic flow data and its first-order difference, second-order difference, trend, seasonality, residual and external weather characteristics as multivariate features, aiming to capture the characteristics of the traffic flow data itself. The weather data is input as an external feature to better reflect the relationship between traffic data. Then, the adjacency matrix is calculated using Chebyshev polynomials, and the input sequence and spatiotemporal attention mechanism are used as inputs in the graph neural network to predict the output results.
[0035] The specific implementation process is as follows:
[0036] S1: Establish a weighted undirected graph G = (V, E, A) to describe the topological structure of the road network. Each traffic sensor in the road network is considered as a node V, and the road segments connecting adjacent sensors are considered as edges E. V = {v1, v2, ..., vN} represents the set of nodes in the road segment, N represents the number of nodes, and E represents the set of edges between nodes. Use the weighted adjacency matrix Represents the proximity between nodes. By using the distance between nodes as the weight of the edge, if there is no proximity between two nodes, the corresponding element of the adjacency matrix is 0, and if there is proximity between two nodes, the corresponding element of the adjacency matrix is 1.
[0037] S2: The traffic information collected by traffic sensors on the road network is used as the attribute characteristics of the road network nodes and represented as a traffic information feature matrix ,in, represents the length of the historical time series, then express Traffic information data collected by all sensors at all times. The attribute characteristics of the node can be traffic flow, traffic speed, traffic density and other traffic information.
[0038] S3: Input the feature matrix X into the difference and decomposition module. The difference and decomposition module performs first-order and second-order differences according to the characteristics of the traffic flow data. After the difference, the autocorrelation needs to be evaluated. If the difference is found to be the second order, no higher-order difference is required. The trend, seasonality and residual parts are obtained by time series decomposition through traffic flow related information, so as to deeply explore the characteristics of the traffic flow itself.
[0039] The specific processing process of the differential decomposition module is as follows:
[0040] S3.1 takes the characteristic matrix X as input and uses the difference algorithm to calculate the first-order difference matrix Diff1 and the second-order difference matrix Diff2.
[0041] The specific process of calculating the difference matrix using the difference algorithm is as follows:
[0042] By looping through each node in X one by one, the difference under each node is calculated and then concatenated into a difference matrix of the same size as the feature matrix X.
[0043] For example, for a node in the feature matrix X , and its first-order difference calculation formula is:
[0044] Where y(n) represents the nth value of the sequence, and △y(n) represents the difference between the nth value and the n-1th value.
[0045] The first-order difference matrix Diff1 is obtained by operating the difference calculation formula, and the second-order difference matrix Diff2 can be obtained by performing the first-order difference operation on the first-order difference matrix Diff1 again.
[0046] The second-order difference matrix Diff2 is obtained by difference. By using autocorrelation to judge, it is found that the second-order difference has achieved stability. The judgment method is the autocorrelation coefficient acf and the partial correlation coefficient pacf, and the calculation formula is:
[0047]
[0048] In the formula, is the sequence mean, express t The value of the moment, k is its lag order.
[0049]
[0050] In the formula, is the sequence expectation, express The value of the moment, is its lag order.
[0051] After calculating the autocorrelation coefficient acf and the partial correlation coefficient pacf, the values of the coefficients are observed. If the coefficient fluctuates around 0 with a small amplitude and no obvious trend, the time series data is considered to have reached stability.
[0052] S3.2 Take the characteristic matrix X as input and use the STL decomposition method in the time series decomposition algorithm to decompose the characteristics of the traffic flow itself to obtain the trend matrix Tra, seasonal matrix Sea and residual matrix Res.
[0053] The STL decomposition method in the time series decomposition algorithm is used to decompose the characteristics of the traffic flow itself, and the specific processing process of obtaining the trend matrix Tra, the seasonal matrix Sea and the residual matrix Res is as follows:
[0054] The feature matrix X is taken as input and decomposed by STL:
[0055]
[0056] in, express t Traffic flow information at the moment, Tra(t), Sea(t), Res(t) are Trend component, seasonal component and residual component at each moment.
[0057] Smooth the input feature matrix X to remove noise and outliers in the original data. The smoothing process uses Loess (local weighted regression).
[0058] Define a Loess at time t:
[0059]
[0060] in, is the coefficient of local weighted regression, d is the order of polynomial fitting, Span represents the time span, and degree represents the order.
[0061] The smoothed data is decomposed periodically to calculate the seasonal component. Each subsequence is subjected to the Loess process, extending one time point forward and backward, and the combined time series is (N+2*n(p)) in length. , it is necessary to select the smoothing parameter n(s), where n(p) represents the number of samples in one period.
[0062] right Perform three sliding averages with lengths of n(p), n(p), and 3, and perform one Loess process to obtain a time series with a length of N. , to remove periodic differences, a smoothing parameter n(1) needs to be selected.
[0063] Remove the trend and obtain the seasonal component Sea.
[0064]
[0065] Subtract the seasonal component from the original feature matrix X, and then perform the Loess process to obtain the trend component Tra.
[0066]
[0067] From the smoothed data, the seasonal component and trend component are extracted to obtain the residual component Res.
[0068]
[0069] in, Indicates The time series of the vth node after smoothing, represents the time series of the vth node after k+1 smoothing, represents the seasonal component of the vth node after k+1 smoothing, represents the periodic component of the vth node after k+1 smoothing, represents the residual component under the v node, Represents the original component under the v node, Indicates the seasonal component under the v node, Represents the periodic component under the v node.
[0070] S4: The external information fusion module constructs an external feature matrix based on the acquired meteorological conditions. The specific processing process is as follows:
[0071] Meteorological conditions include: temperature, weather conditions and wind speed; weather conditions include: cloudy, sunny, rainy and snowy. Since there are non-numerical records in meteorological conditions, it is difficult to calculate. The external information fusion module converts them into numerical values through one-hot encoding, that is, for the converted weather data set: , where the time dimension of the weather dataset is every day, while the time dimension of the original traffic flow data is every 5 minutes, the weather dataset needs to be converted into the same time dimension and input into the multivariate model together with the traffic flow data. The specific processing process is as follows:
[0072] For the weather dataset First, we need to distribute the weather data of each day to each node, and extend the weather data set by N dimensions to obtain .
[0073] For the feature matrix X, its rows correspond to the traffic information of all nodes in a time series, and its columns represent the traffic information of a node in the entire time series. The time dimension is 5 minutes, so there are 288 time nodes with a time dimension of 5 minutes in a day. By The feature time dimension of each node is converted into 5 minutes a day, which can be decomposed into 288 time points to obtain the external feature matrix .
[0074] By combining the first-order difference matrix Diff1, the second-order difference matrix Diff2, the trend matrix Tra, the seasonal matrix Sea, the residual matrix Res and the external characteristic matrix With the original feature matrix X Concatenate into a new 7-dimensional tensor matrix As the input of the subsequent model. In order to avoid the influence of dimension on subsequent calculations, its matrix Perform normalization.
[0075] Combining external information can better reflect traffic flow changes, thereby improving the performance of traffic flow prediction and reducing prediction lag.
[0076] S5: Convert the input multi-channel tensor matrix The spatiotemporal attention module calculates the temporal correlation and spatial correlation of the time series, and introduces the correlation matrix in its spatial attention to better reflect the traffic space correlation.
[0077] Spatiotemporal attention captures the spatiotemporal correlation between traffic information. The specific processing process is as follows:
[0078] S5.1 Common attention mechanisms include additive attention and dot-product attention. The present invention uses the dot-product attention mechanism, that is, for a given query value Q and a set of key-value pairs (K, V), the attention mechanism outputs a result O. The result O is the weighted sum of all input values V, and the weight of each value V is determined by the query Q and its corresponding key K, reflecting the strength of the association between the query value and its key, and its expression is:
[0079] ;
[0080] Where Q is the query matching other units, K is the key matched by other units, V is the value containing the extracted information, and d is the dimension of K.
[0081] For the input feature matrix In the time dimension, there is a correlation between traffic conditions at different time slices, and the correlation will also change under different circumstances. Therefore, the present invention uses the attention mechanism to adaptively assign different importance to traffic data:
[0082] ;
[0083] In the formula, is an input of time length h, The number of channels entered for this duration, is a learnable parameter, sigmoid As the activation function, represents the dependency between time i and time j, Represents normalization processing. Time correlation matrix Determined by different inputs. Medium Element The value of semantically represents the time i With time j The strength of the dependency relationship between We directly apply the normalized temporal attention matrix to the input and obtain , dynamically adjust the input by combining relevant information. represents the feature matrix after time attention adjustment, They represent the feature vectors after time attention adjustment, is the feature matrix The feature vector in represents the original feature; express The matrix obtained after normalization.
[0084] In the spatial dimension, traffic conditions at different locations affect each other, and this influence is highly dynamic. Therefore, the present invention uses the attention mechanism to adaptively capture the dynamic correlation between nodes in the spatial dimension. The correlation coefficient matrix is calculated by the Pearson correlation coefficient to perform a static spatial description between nodes. The Pearson correlation coefficient method is defined as follows:
[0085] ;
[0086] in, and They are two node features respectively. and is the standard deviation of the corresponding node, and is the expectation of the corresponding node. The correlation coefficient matrix AC is obtained by calculating the Pearson correlation coefficient. Then, the correlation coefficient matrix is integrated into the attention , which can better reflect the spatial correlation between nodes. Input into the attention mechanism to obtain the spatiotemporal correlation matrix SE, and merge the spatiotemporal correlation matrix SE obtained through traffic information with the correlation coefficient matrix AC between traffic nodes to obtain the spatiotemporal correlation matrix :
[0087] ;
[0088] In the formula, is the characteristic matrix of time correlation, express The matrix obtained after normalization, C is the number of input channels, is a learnable parameter, sigmoid As the activation function, Representation Node i and nodes j The strength of the association between represents normalization processing, AC is the correlation coefficient matrix. The attention matrix is dynamically calculated based on the current input of the duration. SE . SE Medium Element The value of semantically represents the node i and nodes j The strength of the association between them. Then the softmax function is used to ensure that the sum of the attention weights of the nodes is 1. When executing the graph neural network, the adjoint composite matrix AW is combined with the spatiotemporal attention matrix To dynamically adjust the influence weights between nodes.
[0089] S6: Combine the feature matrix X, the first-order difference matrix Diff1, the second-order difference matrix Diff2, the trend matrix Tra, the seasonal matrix Sea, the residual matrix Res and the external feature matrix The concatenated multi-channel tensor ( ), as well as the adjacency matrix A and the spatiotemporal attention matrix Together with multiple inputs into the graph neural network module, the graph neural network module outputs the final prediction result, where P is the length of the time series, N is the number of traffic information nodes, and F is the input feature dimension. For the differential decomposition matrix, external feature matrix, and spatiotemporal attention matrix The role of graph neural networks is: on the one hand, it can mine the characteristics of the original traffic data through differential decomposition, and through the external feature matrix it can better capture the correlation between the data and improve its prediction accuracy; on the other hand, it can be extracted from the original traffic information and the node correlation coefficient analysis to reflect the static spatiality between the nodes, thereby strengthening the learning of the spatiotemporal correlation between traffic data.
[0090] The specific processing process of the graph neural network learning module is as follows:
[0091] The graph neural network module described in S6.1 includes a graph convolutional neural network (GCN), a temporal convolutional neural network (Conv), and a residual connection network (Res). The output dimension of the graph convolution layer in the graph convolutional network is set to 64, and the output dimension of the temporal convolution layer in the temporal convolutional network is set to 64. For the temporal convolutional neural network, the convolution kernel is 1x3, the step size is 1x1, and the padding is (0, 1). The convolution kernel of the residual connection network is 1x1, and the step size is also 1x1.
[0092] The Chebyshev polynomial calculation can be performed on the adjacency matrix A to reduce the computational complexity. First, the Laplacian matrix is calculated. The Laplacian matrix definition, i.e., its normalized form, is as shown in the following formula:
[0093]
[0094] Where A is the adjacency matrix, is the identity matrix, is a degree matrix and is a diagonal matrix consisting of the matrix node degrees, By calculating the maximum eigenvalue λmax of the Laplacian matrix, the Laplacian matrix is redefined as , where λmax is the maximum eigenvalue of the Laplacian matrix, L is the Laplacian matrix, is the identity matrix. Using the recursive definition of the first kind Chebyshev polynomial, the formula is as follows:
[0095]
[0096]
[0097] In the formula k is the order of the Chebyshev polynomial, x For the current k The polynomial of order, is the identity matrix, for k -1 degree polynomial, for k Polynomials of degree -2. is to redefine the Laplacian matrix. The order of the Chebyshev polynomial is k Set to 3.
[0098] S6.2 Multi-channel Tensor , combining Chebyshev polynomials and spatiotemporal attention matrices They are input into the graph convolutional neural network together. The graph convolutional neural network captures the spatial dependency of traffic information and the output tensor is expressed as , where B represents the batch size, N represents the traffic information node, F represents the input feature dimension, and T represents the prediction duration. Input into the temporal convolutional neural network, which captures the temporal dependency of traffic information and obtains the output tensor , where B represents the batch size, N represents the traffic information node, F represents the input feature dimension, and T represents the prediction duration. In order to prevent the gradient vanishing or gradient exploding problem during the deep neural network training process, Input into the residual connection network to get the output tensor , where B represents the batch size, N represents the traffic information node, F represents the input feature dimension, and T represents the prediction duration.
[0099] S6.2 finally uses a convolutional neural network to fuse the information on each channel and output the prediction result. The input of the convolutional neural network is 12, the output is 1, and the convolution kernel is 1x64.
[0100] Test example
[0101] This test case selects the dataset PeMSD4 as the traffic information dataset. This dataset refers to the traffic data of the San Francisco Bay Area, which contains 3848 detectors on 29 roads, and the detectors are summarized every 5 minutes. The time span of this dataset is from January to February 2018. The dataset includes an adjacency matrix and a feature matrix. The adjacency matrix is calculated by the distance between sensors in the traffic network. The external factor data uses the Weather_PeMSD4 dataset, which refers to the meteorological dataset of the San Francisco Bay Area, which contains relevant factors such as the highest temperature, the lowest temperature, weather conditions, and wind level. The data span of this dataset is from January to February 2018.
[0102] The input data are normalized to the [0,1] interval. 60% of the data are used as training sets, 20% as validation sets, and 20% as test sets to predict traffic data for the next 60 minutes.
[0103] The ASTGCN and FEDformer related baselines are selected to compare the prediction method with the traffic flow prediction method proposed in this invention to verify the improvement of the traffic flow prediction by this method.
[0104] The mean absolute error (MAE), root mean square error (RMSE) and mean absolute percentage error (MAPE) are used to evaluate the prediction performance of the model. MAE calculates the average value of the absolute error of the prediction result to reflect the actual error of the prediction value; RMSE calculates the square value of the error between the true value and the predicted value, which is more sensitive to extreme errors; MAPE calculates the ratio of the absolute error value to the true value, which can estimate the accuracy of the prediction model.
[0105] The test results are shown in Table 1:
[0106] Table 1 Comparison of prediction results
[0107]
[0108] On the real dataset PeMSD4, when the prediction time step is 1h, the three evaluation indicators of the model of the present invention are all lower than those of the comparison methods ASTGCN and FEDformer. Among them, compared with the ASTGCN model, the MAE, RMSE and MAPE of the prediction method of the present invention are increased by 7.46%, 6.28% and 1% respectively; compared with the FEDformer model, MAE and RMSE are increased by 4.42% and 2.82% respectively, while MAPE remains the same. Therefore, the traffic flow prediction method provided by the present invention effectively reduces the error of long-term traffic flow speed prediction, and has higher accuracy and better effect in large-scale long-term traffic flow speed prediction.
[0109] Although the embodiments of the present invention have been disclosed as above, they are not limited to the applications listed in the specification and the implementation modes, and they can be fully applied to various fields suitable for the present invention. For those familiar with the art, additional modifications can be easily implemented. Therefore, without departing from the general concept defined by the claims and the scope of equivalents, the present invention is not limited to the specific details and the illustrations shown and described herein.
Claims
1. A traffic flow prediction method based on multi-factor graph neural network and differential decomposition, characterized in that: include: Construct a traffic flow prediction network model, which includes: differential decomposition module, external factor fusion module, spatiotemporal attention module and graph neural network module; Each traffic sensor in the road network is taken as a node, and the road sections connecting adjacent traffic sensors are taken as edges to construct a weighted undirected graph G = (V, E, A); and the traffic information collected by the traffic sensor is taken as the attribute feature of the node, which is expressed as a traffic information feature matrix: ; Among them, V is the node set of the weighted undirected graph G, E represents the edge set of the weighted undirected graph G, and A is the weighted adjacency matrix; P represents the length of the historical time series, express Traffic information data collected by all traffic sensors at all times, N is the number of traffic sensors, express N OK P A matrix of columns, express N A matrix with 1 row and 1 column; Inputting the traffic information feature matrix into the difference decomposition module to obtain a first-order difference matrix, a second-order difference matrix, a trend matrix, a seasonal matrix and a residual matrix; Obtaining a meteorological condition sequence with the same dimension as the traffic information feature matrix and inputting it into the external factor fusion module, the external factor fusion module converts the meteorological condition sequence encoding into a numerical sequence representing the weather, which is recorded as an external feature matrix; Combining the traffic information feature matrix, the first-order difference matrix, the second-order difference matrix, the trend matrix, the seasonal matrix, the residual matrix and the external feature matrix into a multi-channel tensor; The multi-channel tensor is input into the spatiotemporal attention module to obtain the spatiotemporal correlation matrix SE, the correlation coefficient matrix AC between traffic nodes is calculated by the Pearson correlation coefficient, and the spatiotemporal correlation matrix SE is combined with the correlation coefficient matrix AC between traffic nodes to obtain the spatiotemporal attention matrix ; ; In the formula, is the characteristic matrix of time correlation, T represents the prediction duration, C is the number of input channels, is a learnable parameter, is the activation function, SE Medium Element The value of represents the node and nodes The strength of the association between Indicates normalization processing; ; is the time correlation matrix, Elements in The value represents the time With time The dependencies between Indicates normalization processing; is a learnable parameter, is a multi-channel tensor matrix of length h, are the eigenvectors in the multi-channel tensor matrix respectively; The Pearson correlation coefficient method is defined as follows: ; in, and They are two node features respectively; and is the standard deviation of the corresponding node, and is the expectation of the corresponding node; Inputting the multi-channel tensor, weighted adjacency matrix and spatiotemporal attention matrix into the graph neural network module to obtain a traffic flow prediction result; Among them, the graph neural network module includes: a graph convolutional neural network GCN, a temporal convolutional neural network Conv and a residual connection network Res connected in sequence.
2. The traffic flow prediction method based on multi-factor graph neural network and differential decomposition according to claim 1 is characterized in that: The difference decomposition module calculates the difference matrix using a difference algorithm: traverses each node in the traffic information feature matrix, calculates the difference under each node and then splices it into a difference matrix of the same dimension as the feature matrix traffic information feature matrix; Among them, the first-order difference calculation formula is: ; In the formula, Represents the node sequence values, Represents a sequence of nodes values; Indicates The value and The difference between the values.
3. The traffic flow prediction method based on multi-factor graph neural network and differential decomposition according to claim 2 is characterized in that: The differential decomposition module decomposes the traffic information feature matrix using the STL decomposition method.
4. The traffic flow prediction method based on multi-factor graph neural network and differential decomposition according to claim 3 is characterized in that: The external factor fusion module uses one-hot encoding to convert the meteorological condition sequence into a numerical sequence.
5. The traffic flow prediction method based on multi-factor graph neural network and differential decomposition according to claim 4 is characterized in that: The weighted adjacency matrix is subjected to Chebyshev polynomial calculation, and the calculation result, the multi-channel tensor and the spatiotemporal attention matrix are input into the graph neural network module to obtain a traffic flow prediction result.
6. The traffic flow prediction method based on multi-factor graph neural network and differential decomposition according to any one of claims 1 to 5, characterized in that: The spatiotemporal attention module adopts a dot-product attention mechanism.
7. The traffic flow prediction method based on multi-factor graph neural network and differential decomposition according to claim 6 is characterized in that: The traffic flow prediction network model also includes a convolutional neural network, which fuses the information output by the graph neural network module and outputs the traffic flow prediction result.
8. The traffic flow prediction method based on multi-factor graph neural network and differential decomposition according to claim 7 is characterized in that: The meteorological conditions include: temperature, weather conditions and wind speed.
Citation Information
Patent Citations
Dynamic graph convolution traffic flow prediction method based on spatial-temporal characteristics
CN117037491A
Traffic flow prediction method and system based on multi-time-sequence convolutional gated graph neural network
CN117238135A
Traffic control method and system, storage medium and electronic equipment
CN117894196A