Traffic flow prediction method based on feature attention decomposition and graph convolution network
By using the feature attention decomposition and graph convolutional network of the DFAGCN model, the problem of spatiotemporal dependence of traffic data is solved, and high-precision traffic flow prediction is achieved.
Patent Information
- Application Number
- CN202410587767.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-13
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2044-05-13
AI Technical Summary
Existing technologies struggle to effectively capture the nonlinear, complex, and dynamic spatiotemporal dependencies of traffic data, and lack effective time series decomposition methods, resulting in unsatisfactory traffic prediction results.
The DFAGCN model, based on feature attention decomposition and graph convolutional network, is adopted. The feature attention decomposition module decomposes traffic data into seasonal, trend and residual terms. The spatiotemporal multi-head attention module captures dynamic spatiotemporal correlations, and the spatiotemporal convolution module extracts neighborhood information for prediction.
It improves the accuracy and stability of traffic flow prediction, effectively captures the inherent attributes and spatiotemporal correlations of traffic data, and enhances the model's learning ability and predictive performance.
Smart Images

Figure CN118470968B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of transportation, and particularly relates to a traffic flow prediction method based on feature attention decomposition and graph convolution network. BACKGROUND
[0002] The continuous development of big data, artificial intelligence and Internet of Things technology provides more abundant and reliable data sources for traffic flow prediction. The wide application of various sensors, intelligent transportation devices and mobile terminals makes it possible to predict traffic flow with high precision and high timeliness. Early intervention based on traffic prediction is considered as the key to improving the efficiency of the transportation system and alleviating traffic-related problems.
[0003] In view of the nonlinear, complex and dynamic spatiotemporal dependence of traffic data, there is a lack of effective methods to capture the intrinsic properties and overall profile of traffic data, which has become a bottleneck to improve the traffic prediction capability of the model.
[0004] Time series decomposition has been proven to be able to untangle the intertwined time patterns and reveal the inherent properties of time series. Real traffic data includes seasonal terms, trends and residuals. Accurate decomposition of these elements and separate modeling of the three parts can reveal the intrinsic characteristics of traffic data, thereby improving the final traffic prediction results. There is a dynamic spatiotemporal correlation between traffic data. First, traffic data from the same sensor at different times interact and dynamically change over time, representing the time dependence of traffic data. Second, traffic data from different sensors interact and dynamically change over time, indicating the spatial dependence of traffic data. Finally, traffic data from different sensors interact and dynamically change at different times, indicating the spatiotemporal dependence between traffic data.
[0005] Traffic flow prediction mainly includes four types of methods: traditional time series modeling, time series decomposition-based, attention mechanism-based and external factor-increasing flow prediction. The assumptions of traditional time series modeling are not suitable for complex, nonlinear and dynamically changing traffic data, so the traffic prediction results are not ideal. At the same time, using RNN network for time series prediction will encounter challenges such as gradient disappearance or explosion, especially in deeper network architecture. These problems limit the potential improvement of the accuracy of traffic data prediction using RNN network. Existing time series decomposition-based methods have difficulty in effectively filtering out the remaining part, so that the model is easily affected by noise and outliers. The lack of effective time series decomposition methods to capture the overall profile of traffic data has become a bottleneck to enhance the traffic prediction capability. The attention mechanism-based method cannot capture global information and highlight the inherent properties of complex traffic data. The method of using external factors for flow prediction faces the challenge of obtaining external factors, which limits their wider applicability.
[0006] In summary, in order to solve the above technical problems, the present application provides a traffic flow prediction method based on feature attention decomposition and graph convolution network (Decomposition with Feature Attention and Graph Convolution Network for Traffic Forecasting, DFAGCN). SUMMARY
[0007] Therefore, the present application aims to provide a traffic flow prediction method based on feature attention decomposition and graph convolution network. The present application aims to solve the following problems: how to capture the intrinsic properties of traffic data, i.e. nonlinearity, complexity, dynamic spatio-temporal dependence; how to capture the spatio-temporal correlation of traffic data; how to extract local information of traffic data and capture the dependence between adjacent nodes in the spatial and temporal context.
[0008] The present application provides a traffic flow prediction method based on feature attention decomposition and graph convolution network, comprising the following steps:
[0009] S1. Collecting vehicle GPS data and traffic sensor data in the past period of time, determining the traffic network and traffic data;
[0010] Traffic network: represented as a graph G=(V,E,A), where V represents a set of N traffic sensors; E represents a set of edges connecting each sensor; A∈R N×N represents an adjacency matrix, where each element a ij represents the distance between the i-th sensor v i and the j-th sensor v j .
[0011] Traffic data: the observed traffic state at time t is represented as a graph signal where, represents the traffic state recorded by the i-th sensor at time t; N represents the number of sensors; F represents the number of traffic states;
[0012] S2. Building a DFAGCN model, which includes a feature attention decomposition module, a spatio-temporal multi-head attention module and a spatio-temporal convolution module;
[0013] S3. Inputting traffic data, decomposing the flow data into seasonal terms, trends and residuals through the feature attention decomposition module;
[0014] S4. Capturing the dynamic spatio-temporal correlation between traffic data through the spatio-temporal multi-head attention module;
[0015] S5. Further utilize the proximity information in traffic data through the spatiotemporal convolution module to predict traffic flow.
[0016] Furthermore, step S3 includes the following sub-steps:
[0017] S3.1 filters out redundant terms using feature attention;
[0018] Feature attention employs a soft threshold and a sigmoid function to implement a gating mechanism, which is expressed as follows:
[0019] r f =sigmoid(N U (ReLU(N D (g p ))))
[0020] In the formula, Indicates gating mechanism; N D and N U These are the feature dimensionality reduction and feature dimensionality increase operators, respectively; global average pooling g p Global average pooling is used to represent statistical information from the entire traffic data, reducing the size from... Reduce to as follows:
[0021] X = Linear(X) P )
[0022]
[0023] In the formula, X f (i, j) is the feature value of the nth sensor in the traffic data X at time t; T represents the input time length.
[0024] Get the remaining items
[0025] X r =Xr f ×X=XX ts
[0026] In the formula, This indicates a combination of trend and seasonal items;
[0027] S3.2 Adaptive sensing trend;
[0028] Using a set Average pooling of convolutional kernels to extract trends
[0029] X t′ =(AvgPool1(X ts ), AvgPool2(X ts),..., AvgPool k (X ts ))
[0030] Obtain query value Q corresponding to trend long-tailed attention t , key value K t and value value V t ;
[0031]
[0032]
[0033]
[0034] In the formula, is a learnable parameter; is the reshaped output; Obtain trend long-tailed attention score
[0035]
[0036] In the formula, d represents the hidden dimension, which is a hyperparameter;
[0037] Finally, obtain trend
[0038]
[0039] In the formula, ⊙ represents element-wise Hadamard product;
[0040] S3.3 Remove the residual and trend from the traffic data to obtain the seasonal term
[0041] X s = X - X r - X t .
[0042] Further, the step S4 includes the following sub-steps:
[0043] S4.1 Spatial multi-head attention;
[0044] Input data (X s + X), obtain spatial multi-head attention score A spa ∈ R K×N×N ;
[0045]
[0046] In the formula, K is the number of spatial attention heads; is a learnable parameter.
[0047] S4.2 Time multi-head attention;
[0048] acquisition time multi-head attention score
[0049]
[0050] where H is the number of time attention heads; are learnable parameters;
[0051] computing time attention
[0052]
[0053] X s1 = LayerNorm(Linear(T att ))
[0054] where, are learnable parameters;
[0055] Finally, we get
[0056] X s1 = LayerNorm(Linear(T att ))
[0057] where X s1 represents the value after time attention calculation.
[0058] Further, the step S5 comprises the following sub-steps:
[0059] S5.1 spatial graph convolution;
[0060] The graph convolution based on the spectral graph theory is used to directly process the signal and mine the local spatial dependence of the traffic data in the spatial dimension, and the properties of the graph structure are obtained by analyzing the Laplacian matrix and its eigenvalues;
[0061] In spectral analysis, the graph convolution is expressed as:
[0062] g θ *GX s1 = gθ(L)X s1
[0063] where g θ and *G represent the approximate convolution kernel and the convolution operation respectively; L represents the Laplacian matrix;
[0064] When the graph is large, it is expressed by K Chebyshev polynomials:
[0065]
[0066] In the formula, θ k denotes the kth Chebyshev polynomial coefficient; denotes the scaled Laplacian matrix of Chebyshev polynomials; I N denotes the unit matrix; denotes the kth Chebyshev polynomial; denotes the spatial attention score of the kth head; Lambda max denotes the largest eigenvalue of the Laplacian matrix;
[0067] S5.2 Time Convolution;
[0068] The information of adjacent time slices is integrated using a convolution layer followed by an activation function:
[0069] X s′ = ReLU (* Phi (g θ * Gx s1 ))
[0070] X t′ = ReLU (* Phi (X t ))
[0071] X r′ = ReLU (X r )
[0072] In the formula, * Phi denotes a convolution operation;
[0073] Local information of adjacent elements in the spatio-temporal context is extracted using convolution, the dependency relationship between adjacent elements in the spatio-temporal context is captured, and the final prediction result of the fusion processing is represented as:
[0074] X (t+1:t+Q) = Linear (X s′ + X t′ + X r′ )
[0075] In the formula, X (t+1:t+Q) = X Q , represents the traffic data of all sensors at future Q time.
[0076] Advantages:
[0077] 1. The application proposes a traffic flow prediction method based on feature attention decomposition and graph convolution network, and constructs a DFAGCN model, which includes a feature attention decomposition module, a spatio-temporal multi-head attention module and a spatio-temporal convolution module. The feature attention decomposition module decomposes the traffic data into seasonal terms, trends and residuals, aiming to effectively capture global information and highlight the inherent properties of complex traffic data; the spatio-temporal multi-head attention module captures the dynamic spatio-temporal correlation between traffic data; and the spatio-temporal convolution module further utilizes the neighboring information in traffic data to extract the local dependency of the spatio-temporal domain in traffic data and predict traffic flow.
[0078] 2. The decomposition method DFA proposed by the application can decompose internal properties in complex time series data, which provides guarantee for improving the learning ability of the whole model DFAGCN, provides a new idea and method for time series analysis, and can be applied in the field of time series analysis such as short-term and long-term prediction, interpolation, classification and anomaly detection.
[0079] Other advantages, objects and features of the application will be set forth in part in the following specification, and in part will become apparent to those skilled in the art from the examination of the following specification, or can be learned from practice of the application. The objects and other advantages of the application can be realized and attained by the methods and instrumentalities described in the following specification. BRIEF DESCRIPTION OF DRAWINGS
[0080] Figure 1 is a DFAGCN architecture diagram;
[0081] Figure 2 is a DFAGCN model diagram;
[0082] Figure 3 is a visualization diagram of sensor node decomposition results;
[0083] Figure 4 is the performance of different prediction steps on PEMS03 and PEMS07;
[0084] Figure 5 is the different size and number of convolution kernels on PEMS08. DETAILED DESCRIPTION
[0085] In order to make the technical solutions, advantages and purposes of the application clearer, the technical solutions of the embodiments of the application will be described clearly and completely below in combination with the drawings of the embodiments of the application. Obviously, the described embodiments are part of the embodiments of the application, not all the embodiments. Based on the described embodiments of the application, all other embodiments obtained by those skilled in the art without creative labor are within the protection scope of the application.
[0086] Definitions of traffic network, traffic data and traffic flow prediction are as follows:
[0087] Traffic network: represented as a graph G=(V, E, A), where V represents a set of N traffic sensors; E represents a set of edges connecting each sensor; A∈R N×N represents an adjacency matrix, where each element a ij represents the distance between the i-th sensor v i and the j-th sensor v j Each traffic sensor v records traffic status such as traffic flow, vehicle speed and road occupancy;
[0088] Traffic data: the observed traffic status at time t is represented as a graph signal X where, represents the traffic status recorded by the i-th sensor at time t; N represents the number of sensors; F represents the number of traffic status;
[0089] Traffic flow prediction: the goal of traffic flow prediction is to predict the traffic data X P = X (t-p+1:t) ∈R N×F×P of all sensors at future Q time points using historical P time points of traffic data X Q = X (t+1:t+q) ∈R N×F×Q The process of traffic flow prediction can be represented as:
[0090]
[0091] where represents a mapping function. In this embodiment, the predicted vehicle flow is selected, i.e. F=1.
[0092] As shown in Figure 1 and Figure 2 The application provides a traffic flow prediction method based on feature attention decomposition and graph convolution network, comprising the following steps:
[0093] S1. Collect vehicle GPS data and traffic sensor data in the past period of time, and determine the traffic network and traffic data;
[0094] S2. Construct a DFAGCN model, which includes a feature attention decomposition module, a spatio-temporal multi-head attention module and a spatio-temporal convolution module;
[0095] S3. Input the traffic data, and decompose the flow data into seasonal term, trend and residual term through the feature attention decomposition module;
[0096] The time series decomposition is represented as follows:
[0097]
[0098] wherein X represents traffic data; denotes trend; denotes seasonal term; denotes residual term;
[0099] S3.1 filtering residual term by feature attention;
[0100] In order to highlight the inherent characteristics of complex traffic data, a novel time series decomposition module is proposed, so that the model is more targeted when processing traffic data. This embodiment proposes to use a method called feature attention, which effectively filters out the residual part, which can make the model less susceptible to noise and possible outliers when mining spatio-temporal correlations later. In order to utilize and learn the correlation between traffic data features, the invention focuses on the relationship between features rather than treating them equally.
[0101] Feature attention adopts soft threshold and Sigmoid function to realize gating mechanism, which is expressed as:
[0102] r f =sigmoid(N U (ReLU(N D (g p ))))
[0103] In the formula, denotes gating mechanism; N D and N U are feature dimension reduction and feature dimension increase operators respectively; global average pooling g p is used to represent the statistical information of the entire traffic data, and the global average pooling reduces the size from to as follows:
[0104] X=Linear(X P )
[0105]
[0106] In the formula, X f (i, j) is the feature value of the nth sensor in traffic data X at time t; T represents the length of time input;
[0107] Obtain residual term
[0108] X r =X-r f ×X=X-X ts
[0109] where, denotes the combination of trend and seasonal terms;
[0110] S3.2 Adaptive sensing of trends;
[0111] As real-world traffic data has complex trend elements, the common approach of using fixed window average pooling to extract trends can be difficult. The present invention uses average pooling with a set of convolutional kernels to extract trends
[0112] X t′ = (AvgPool1(X ts ), AvgPool2(X ts ),..., AvgPool k (X ts ))
[0113] The present invention utilizes a multi-head attention mechanism to dynamically capture the ability of multiple convolutional kernels in extracting data trends. This allows different sized convolutional kernels to adaptively extract trends. The present invention obtains query values Q t , key values K t and value values V t corresponding to the trend multi-head attention;
[0114]
[0115]
[0116]
[0117] where, are learnable parameters; is the reshaped output; obtains trend multi-head attention scores
[0118]
[0119] where d denotes the hidden dimension, which is a hyperparameter;
[0120] Finally, the trend
[0121]
[0122] where denotes the element-wise Hadamard product;
[0123] S3.3 Removing the residual and trend from traffic data to obtain the seasonal term
[0124] X s = X - X r - X t
[0125] Overall, the model of the present application decomposes traffic data through a novel DFA module. This module plays a key role in capturing the overall profile of traffic data and improving the intrinsic characteristics of complex traffic data.
[0126] S4. Capture dynamic spatio-temporal correlations between traffic data through a spatio-temporal multi-head attention module;
[0127] S4.1 Spatial multi-head attention;
[0128] Input data (X s + X), get spatial multi-head attention score A spa ∈ R K×N×N ;
[0129]
[0130] In the formula, K is the number of spatial attention heads; is a learnable parameter.
[0131] S4.2 Temporal multi-head attention;
[0132] Get temporal multi-head attention score
[0133]
[0134] In the formula, H is the number of temporal attention heads; is a learnable parameter;
[0135] Calculate temporal attention
[0136]
[0137] X s1 = LayerNorm(Linear(T att ))
[0138] In the formula, is a learnable parameter;
[0139] Finally, get
[0140] X s1 = LayerNorm(Linear(T att ))
[0141] In the formula, Xs1 denotes the value after time attention calculation.
[0142] The corresponding spatial and temporal multi-head attention scores are calculated from the space-time dimension, thereby dynamically capturing the space-time correlation of the traffic data.
[0143] S5. Further utilize the adjacent information in the traffic data through the space-time convolution module to predict the traffic flow;
[0144] Spatial graph convolution (SGC) and temporal convolution (TC) are used to extract local information and capture the dependency between adjacent elements in the space-time context.
[0145] S5.1 Spatial graph convolution;
[0146] In order to fully utilize the topological structure information of the traffic network, the present application directly processes the signal and mines the local spatial dependency of the traffic data in the spatial dimension based on the spectral graph theory graph convolution, and obtains the properties of the graph structure by analyzing the Laplacian matrix and its eigenvalues;
[0147] In spectral analysis, the graph convolution is represented as:
[0148] g θ *GX s1 =g θ (L)X s1
[0149] In the formula, g θ and *G represent the approximate convolution kernel and the convolution operation respectively; L represents the Laplacian matrix;
[0150] When the graph is large, the computational cost of directly performing eigenvalue decomposition of the Laplacian matrix is high, therefore, K Chebyshev polynomials are used to approximate and efficiently solve this problem:
[0151]
[0152] In the formula, θ k represents the kth Chebyshev polynomial coefficient; represents the scaled Laplacian matrix of the Chebyshev polynomial; I N represents the unit matrix; represents the kth Chebyshev polynomial; represents the spatial attention score of the kth head; λ max represents the maximum eigenvalue of the Laplacian matrix;
[0153] The application of Chebyshev polynomials simplifies the calculation of graph convolution. At the same time, the idea of using residual adds the normalized Laplacian matrix to the spatial attention, effectively solving the problem of becoming difficult to train as the network grows.
[0154] S5.2 Temporal Convolution;
[0155] Similar to capturing the spatial dependency of neighboring sensor nodes, the present application uses a convolutional layer to fuse the information of adjacent time steps, thereby further improving the extraction of temporal dependencies in traffic data. Specifically, the present application uses a convolutional layer followed by an activation function to integrate the information of adjacent time slices.
[0156] X s′ = ReLU(*Φ(g θ *GX s1 ))
[0157] X t′ = ReLU(*Φ(X t ))
[0158] X r′ = ReLU(X r )
[0159] where *Φ denotes a convolution operation;
[0160] In general, the present application uses convolution to extract local information of adjacent elements in the spatio-temporal context, capture the dependencies between adjacent elements in the spatio-temporal context, and fuse the final prediction results of the processing, represented as:
[0161] X (t+1:t+Q) = Linear(X s′ +X t′ +X r′ )
[0162] where X (t+1:t+Q) = X Q , represents the traffic data of all sensors at future Q time steps.
[0163] Experimental Setup
[0164] (1) Datasets
[0165] The proposed DFAGCN model is evaluated mainly through four experiments. Experiments are conducted on four real traffic data benchmarks: PEMS03, PEMS04, PEMS07, and PEMS08. These datasets are divided into training, validation, and test sets in the ratio of 6:2:2. The original traffic data of these four datasets is sampled at 5-minute intervals. Table 1 shows more details about these datasets. In addition, the spatial adjacency matrix of each dataset is constructed based on the actual road network.
[0166] Table 1. Dataset details
[0167]
[0168] The input data is standardized by the Z-score standardization method:
[0169]
[0170] In the formula, mean(·) represents the mean of the training data; std(·) represents the standard deviation of the training data.
[0171] (2) Comparative model
[0172] In order to evaluate the effectiveness of the DVCAE model, the DFAGCN of the application is compared with the following ten methods and models:
[0173] VAR (1994) is a classic time series model that can extract pairwise correlations from traffic data.
[0174] LSTM (1997) is a long short-term memory network, which represents a special recurrent neural network model.
[0175] DCRNN (2017) is a deep learning framework for traffic prediction, which combines spatial and temporal dependencies in traffic data.
[0176] STGCN (2019) integrates graph convolution and gated temporal convolution through a spatio-temporal convolution block.
[0177] ASTGCN(r) (2019) introduces a spatio-temporal attention mechanism into the model. In order to compare fairly, only the most recent components of the model period are used.
[0178] STG2Seq (2019) models multi-step passenger demand at the city level based on a graph model, and uses a hierarchical graph convolution structure to capture spatio-temporal correlations simultaneously.
[0179] STSGCN (2020) captures complex local spatio-temporal correlations through a carefully designed spatio-temporal synchronization modeling mechanism.
[0180] GMSDR (2022) is a novel recurrent neural network variant for learning from multiple time steps to capture long-range spatio-temporal dependencies.
[0181] ST-WA (2022) is a data-driven, model-agnostic method that converts spatio-temporal agnostic models into spatio-temporal aware models.
[0182] HSTGCNT (2023) designs new long-term temporal attention networks and spatio-temporal graph convolution networks.
[0183] (3) Model setting and evaluation index
[0184] All experiments were performed on a Linux server (Intel(R) Xeon(R) Gold 6133 CPU@2.50GHz, GPU: NVIDIA GeForce GTX 3090). In the embodiments, the mean absolute error (MAE) was selected as the loss function. The model was trained using the Adam optimizer with a learning rate dynamically adjusted in the range of {0.01, 0.002}. It started from the initial value 0.01 and reduced to 0.002 if patience exceeded 5, and other hyperparameter settings are shown in Table 2.
[0185] Table 2 Hyperparameter settings of DFAGCN model
[0186]
[0187] We used the mean absolute error (MAE), root mean square error (RMSE), and mean absolute percentage error (MAPE%) to evaluate the predictive performance of the model, whose calculation formulas are shown as follows, respectively:
[0188]
[0189]
[0190]
[0191] Here, Ω represents a set of time lengths.
[0192] Experimental result analysis
[0193] The present application reports the experimental results of DFAGCN and other comparative methods. Table 3 shows the experimental results of the model and other comparative models on four public data sets. From the above experimental results, it can be seen that:
[0194] (1) The model of the present application showed excellent performance in most indicators on all four data sets. Although GMSDR and SW-TA still provided competitive results on PEMS03 and PEMS04, respectively, DFAGCN starting from time series decomposition performed well in capturing global information and intrinsic data properties. This indicates that DFAGCN has stable and optimal predictive performance.
[0195] (2) After decomposing the flow data, DFAGCN successfully reconstructed the inherent temporal patterns in the original complex time series data, including seasonal terms, trends, and residuals. By filtering out the rest (including noise and potential outliers), the two prominent features, seasonal terms and trends, became more apparent. This full decomposition and restoration of data made it easier for DFAGCN to predict flow data, ultimately improving the predictive ability of the DFAGCN model.
[0196] (3) Subsequently, DFAGCN uses multi-head attention to explore the spatio-temporal correlation in traffic data, thereby improving the prediction results as a whole. The final experimental results show that DFAGCN significantly improves the accuracy of traffic data prediction.
[0197] Table 3 Performance comparison of different models on PEMS dataset.
[0198]
[0199] Method component effectiveness analysis
[0200] To test the effectiveness of each component of the method of the present application, four groups of ablation experiments are set. In order to further evaluate the effect of different components in DFAGCN, the present application conducts ablation experiments on DFAGCN from the decomposition dimension and the spatio-temporal dimension and analyzes the experimental results on the PEMS04 and PEMS08 datasets.
[0201] Decomposition dimension
[0202] (1) noFA: Delete the feature attention used to filter out the rest.
[0203] (2) noTaA: Replace the trend-aware adaptive block with a mixture of decomposition blocks used in Fedformer.
[0204] (3) noDFA: Delete the feature attention decomposition module.
[0205] Spatio-temporal dimension
[0206] (4) noSpa: Delete the spatial multi-head attention mechanism.
[0207] (5) noTem: Delete the temporal multi-head attention mechanism.
[0208] In addition to the above differences, all variant models have the same settings as DFAGCN. As shown in Table 4. First, the ablation experiments conducted on PEMS04 and PEMS08 demonstrate that the main modules used in DFAGCN are effective. At the same time, the results of noFA, noTaA, and noDFA variants highlight the importance of the decomposition module, which is a key component for DFAGCN to maintain high prediction accuracy. This is particularly evident when analyzing the PEMS08 dataset. The lack of a complete decomposition module (as shown in noFA and noTaA) or no decomposition module at all (as shown in noDFA) results in the worst prediction performance. In addition, the results of noSpa and noTem variants provide insights into the role of time and space attention mechanisms in extracting spatiotemporal correlations in traffic data from a spatiotemporal perspective. This means that the spatiotemporal attention mechanism plays a role in improving the mining of spatiotemporal correlations and the accuracy of flow prediction. The variants of the ablation experiment are as follows:
[0209] Table 4 Performance comparison of different variants on PEMS04 and PEMS08 datasets.
[0210]
[0211] Visualization experiment
[0212] In order to better visually reflect the effect of the feature attention decomposition module, this embodiment selects the decomposition results of specific sensor nodes in the PEMS04 test set during February 28, as shown in Figure 3 In order to improve the clarity of the results, this embodiment selects the flow data predicted for the next 12 hours and adds a sin periodic function with a period of 12 (one hour). After applying feature attention to filter out the remainder, the trend and seasonal terms are accurately captured. The identified trend reveals the linear characteristics of the system, representing the evolving trend of the flow data. The seasonal term mainly emphasizes the periodic patterns in the flow data. In addition, as shown in Figure 3 Although some nodes (e.g., node #2, node #4, node #26, and node #66) exhibit less obvious flow periodicity, our DFA can still extract the underlying periodic patterns inherent in the data of individual nodes. At the same time, due to the presence of noise and potential outliers, the remainder exhibits more obvious and irregular peak changes compared to the seasonal term. This result shows that DFA effectively decomposes the dataset into seasonal terms, trends, and remainders, consistent with the expected results. The visualization results clearly illustrate the effectiveness of DFA in capturing global information and revealing the inherent properties of flow data.
[0213] Parameter sensitivity experiment
[0214] To verify the parameter sensitivity of the present application, different prediction ranges were experimented in this embodiment to explore the influence of different sizes and numbers of convolution kernels on the prediction results.
[0215] (1) Prediction results of different prediction ranges
[0216] Figure 4 The prediction results corresponding to different prediction steps on the PEMS03 and PEMS07 datasets are described. It can be seen from Figure 4 that the closer the prediction time is to the input historical time, the higher the prediction accuracy is, and vice versa. Subsequent ablation experiments were conducted to verify the effectiveness of the relevant modules.
[0217] (2) Convolution kernels with different sizes and numbers
[0218] This embodiment verifies the influence of different sizes and numbers of convolution kernels on the prediction results of traffic data on PEMS08, and finds that when the number of convolution kernels is too small or too large, the results are not ideal. As shown in Figure 5 , insufficient convolution kernels can weaken the influence of TaA, resulting in poor results. On the contrary, due to the computational complexity, too many convolution kernels can hinder the ability of TaA to effectively capture the extraction trends related to different sizes of convolution kernels, thereby impairing the overall performance.
[0219] Finally, it is pointed out that the above embodiments are only used to illustrate the technical solutions of the present application and are not limiting. Although the present application has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that the technical solutions of the present application can be modified or replaced equivalently without departing from the purpose and scope of the technical solutions, which should be covered within the protection scope of the present application.
Claims
1. A traffic flow prediction method based on feature attention decomposition and graph convolutional networks, characterized in that, Includes the following steps: S1. Collect vehicle GPS data and traffic sensor data over a period of time to determine the traffic network and traffic data; Traffic network: Represented as graph G = (V, E, A), where V represents the set of N traffic sensors; E represents the set of edges connecting each sensor; A ∈ R. N×N Let a be an adjacency matrix, where each element a ij′ It represents the i-th sensor v i and the j′-th sensor v j′ The distance between them; Traffic data: Representing the observed traffic conditions at time t as a graphical signal. in, This represents the traffic state recorded by the i-th sensor at time t; N represents the number of sensors; F represents the number of traffic states. S2. Construct the DFAGCN model, which includes a feature attention decomposition module, a spatiotemporal multi-head attention module, and a spatiotemporal convolution module; S3. Input traffic data, and decompose the traffic data into seasonal, trend and residual items through the feature attention decomposition module; S3.1 filters out redundant terms using feature attention; Feature attention employs a soft threshold and a sigmoid function to implement a gating mechanism, which is expressed as follows: r f =sigmoid(N U (ReLU(N D (g p )))) In the formula, Indicates gating mechanism; N D and N U These are the feature dimensionality reduction and feature dimensionality increase operators, respectively; global average pooling g p Global average pooling is used to represent statistical information from the entire traffic data, reducing the size from... Reduce to as follows: X=Linear(X P ) In the formula, X f (i,j) is the feature value of the nth sensor in the traffic data X at time t; T represents the input time length. Get the remaining items X r =X-r f ×X=X-X ts In the formula, This indicates a combination of trend and seasonal items; S3.2 Adaptive sensing trend; Trend extraction is achieved using average pooling with a set of c-convolutional kernels. X t′ =(AvgPool1(X ts ),AvgPool2(X ts ),...,AvgPool k (X ts )) Retrieve the query value Q corresponding to the trend bullish attention. t Key value K t Sum value V t ; In the formula, These are learnable parameters; It is the reshaped output; obtaining the trend bullish attention score. In the formula, d represents the hidden dimension, which is a hyperparameter; Finally, obtain the trend. In the formula, ⊙ represents the element-wise Hadamard product; S3.3 Removes residuals and trends from traffic data to obtain seasonal terms. X S =X-X r -X t S4. Capture the dynamic spatiotemporal correlation between traffic data through a spatiotemporal multi-head attention module; S4.1 Spatial Multi-Head Attention; Input data (X) S +X), obtain the spatial multi-head attention score A spa ∈R K×N×N ; In the formula, K is the number of spatial attention heads; These are learnable parameters; S4.2 Time-based Multi-Head Attention; Acquire time-based multi-head attention score In the formula, H is the number of time attention heads; These are learnable parameters; Computational attention In the formula, These are learnable parameters; Ultimately, we obtained X s1 =LayerNorm(Linear(T att )) In the formula, X s1 This represents the value calculated using time-attention techniques. S5. Further utilize the proximity information in traffic data through the spatiotemporal convolution module to predict traffic flow; S5.1 Spatial Graph Convolution; We use graph convolution based on spectral graph theory to directly process signals and mine local spatial dependencies of traffic data in the spatial dimension. By analyzing the Laplacian matrix and its eigenvalues, we obtain the properties of the graph structure. In spectral analysis, graph convolution is represented as: g θ *GX s1 =g θ (L)X s1 In the formula, g θ *G and *G represent the approximate convolution kernel and convolution operation, respectively; L represents the Laplacian matrix; When the graph is large, it can be represented using K Chebyshev polynomials: In the formula, θ k Denotes the coefficients of the k-th Chebyshev polynomial; I represents the scaled Laplace matrix of a Chebyshev polynomial; N Represents the identity matrix; This represents the k-th Chebyshev polynomial; λ represents the spatial attention score of the k-th head; max This represents the largest eigenvalue of the Laplacian matrix; S5.2 Temporal Convolution; Use convolutional layers followed by activation functions to integrate information from adjacent time slices: X s′ =ReLU(*Φ(g θ *GX s1 )) X t′ =ReLU(*Φ(X t )) X r′ =ReLU(X r ) In the formula, *Φ represents the convolution operation; By utilizing convolution to extract local information of adjacent elements in the spatiotemporal context and capturing the dependencies between adjacent elements in the spatiotemporal context, the final prediction result of the fusion process is represented as follows: X (t+1:t+Q) =Linear(X s′ +X t′ +X r′ ) In the formula, X (t+1:t+Q) =X Q , representing the traffic data from all sensors at time Q in the future.
Citation Information
Patent Citations
Space-time convolution short-time traffic flow prediction method for improving complementary integrated empirical mode decomposition
CN115631624A
Traffic flow prediction method based on combination of multiple attention and adaptive graph convolution
CN116911460A