Traffic flow prediction method and system based on spatiotemporal progressive fusion
By using a spatiotemporal progressive fusion method combined with a cross-attention mechanism for feature fusion, the problems of static spatial dependency modeling and shallow spatiotemporal feature fusion in traffic flow prediction are solved, thus achieving high-precision traffic flow prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- QUFU NORMAL UNIV
- Filing Date
- 2026-02-04
- Publication Date
- 2026-04-10
AI Technical Summary
Existing traffic flow prediction methods suffer from problems such as static spatial dependency modeling and shallow spatiotemporal feature fusion when dealing with complex spatiotemporal dependencies, resulting in low prediction accuracy and high computational complexity.
A spatiotemporal progressive fusion approach is adopted. By acquiring the operational status and periodic features of traffic data, combined with adaptive embedding representation, and using a cross-attention mechanism to perform two-stage feature fusion, a time-aware spatial dependency learning and deep interaction are achieved, generating high-quality spatiotemporal collaborative feature representations.
It improves the accuracy and robustness of traffic flow prediction, accurately depicts the spatiotemporal propagation patterns of traffic data, and is applicable to a variety of complex traffic scenarios.
Smart Images

Figure CN121640720B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of traffic flow prediction, and particularly relates to a traffic flow prediction method and system based on time-space progressive fusion. BACKGROUND
[0002] Traffic flow prediction is a core technology for urban traffic management and optimization, which realizes accurate estimation of future traffic flow in a specific period, road section or region by mining the rules of historical traffic data, road network topology and related factors, and provides support for traffic control decision and travel path planning. However, traffic data has complex time-space characteristics, showing multi-level periodicity in the time dimension, such as intra-day and intra-week, and complex dependent relationships in the spatial dimension, such as road congestion diffusion and upstream and downstream flow interaction, making it a key challenge for traffic flow prediction to accurately model time-space dependence.
[0003] Traditional prediction methods such as autoregressive integrated moving average model (ARIMA) and Kalman filter are based on linear time series analysis framework, which can only handle stationary linear data and ignore the spatial dependence brought by road network topology, and have the defects of high computational complexity and low prediction accuracy when facing large-scale data. In recent years, the Transformer model has been widely used in traffic flow prediction due to its excellent sequence modeling ability and parallel computing advantage. Some studies have captured local and global spatial dependence through spatial mask self-attention mechanism, and fused time-space features through concatenation and linear projection. Some have modeled static and dynamic spatial dependence through spectral graph convolution and self-attention mechanism, respectively, and input them into the time attention module to extract time sequence features. Some have adaptively captured spatial dependence through self-attention and graph convolution, and independently extracted time features before weighted fusion of time-space features.
[0004] Although existing methods based on Transformer have made some progress, there are still two major problems: first, the spatial dependence modeling is static, and existing methods mostly calculate the spatial dependence between nodes independently within a single time step, ignoring the dynamic propagation characteristics of traffic flow, which makes the spatial attention score unable to accurately reflect the actual traffic flow propagation rule; second, the time-space feature fusion is shallow, and existing methods mostly use serial or parallel architecture to model time and spatial dependence respectively, lack of deep interaction mechanism, and are difficult to fully integrate the complementary information of time-space features, limiting the learning ability of complex time-space patterns and affecting the prediction performance. SUMMARY
[0005] To solve the problems in the background art, the application provides a traffic flow prediction method and system based on time-space progressive fusion.
[0006] The technical solution of the application is as follows:
[0007] The application provides a traffic flow prediction method based on spatiotemporal progressive fusion, comprising:
[0008] S1: obtaining the running state features of the traffic data, performing feature mapping and dimension transformation to obtain the running state embedding representation;
[0009] obtaining the periodic features of the traffic data, encoding through a preset learnable periodic embedding dictionary to obtain the periodic feature embedding representation;
[0010] The running state embedding representation, the periodic feature embedding representation and the adaptive embedding representation are spliced along the feature dimension to obtain the spatiotemporal feature representation;
[0011] S2: taking the basic observation unit of the traffic data as a node, calculating the feature similarity of the node in the time dimension based on the spatiotemporal feature representation, taking the feature similarity as the attention weight, and weightedly aggregating the historical T time step features of the node to generate the time feature representation of the node; =1, 2,..., N, N is the total number of nodes, the feature similarity is calculated based on the spatiotemporal feature representation, the feature similarity is taken as the attention weight, the historical T time step features of the node are weightedly aggregated, and the time feature representation of the node is generated;
[0012] The time feature representation with a time window of T is spliced to construct the historical time sequence feature of the node;
[0013] After the historical time sequence feature of the node is processed by three independent feedforward neural networks, the similarity between nodes is calculated, and the time sequence perception spatial feature representation of the node is generated;
[0014] The time feature representation and the time sequence perception spatial feature representation of each node are aggregated according to the node dimension to obtain the overall time feature and time sequence perception spatial feature;
[0015] S3: the time sequence perception spatial feature and the time feature are fused through a two-stage cross-attention mechanism to obtain the spatiotemporal collaborative feature representation; after full connection processing, the traffic flow prediction result of the future T' time steps is obtained.
[0016] Based on the above prediction method, the spatiotemporal collaborative feature representation is obtained by fusing the time sequence perception spatial feature and the time feature through the two-stage cross-attention mechanism, specifically as follows:
[0017] In the first stage, the time feature is taken as the query, the time sequence perception spatial feature is taken as the key and the value, the cross-attention mechanism is processed, and the enhanced time feature is obtained;
[0018] In the second stage, the time sequence perception spatial feature is taken as the query, and the enhanced time feature is taken as the key and the value, the cross-attention mechanism is processed, and the spatiotemporal collaborative feature representation is obtained.
[0019] Based on the above prediction method, the node historical time sequence feature is processed by three independent feedforward neural networks, and the similarity between nodes is calculated to generate the time sequence perception space feature representation of the node, specifically:
[0020] After the node historical time sequence feature is processed by three independent feedforward neural networks, the query vector, key vector and value vector are obtained, the similarity between nodes is calculated by weighted fusion and aggregation with other nodes, and the time sequence perception space feature representation of the node is generated.
[0021] Further, the query vector , , The key vector and the value vector are obtained.
[0022] In the formula, , the node historical time sequence feature is represented; , , Three independent feedforward neural networks are represented.
[0023] Based on the above prediction method, the running state feature of the traffic data in S1 includes traffic flow, vehicle speed and road occupancy.
[0024] Based on the above prediction method, the adaptive embedding representation in S1 is obtained by iteratively updating the adaptive embedding matrix based on the spatiotemporal distribution characteristics of the traffic data.
[0025] Based on the above prediction method, the time feature representation of the spliced time window T in S2 is used to construct the node historical time sequence feature, which is realized by the formula: ; in the formula, , the time feature representation of the th node at the th time step is represented.
[0026] The application also provides a traffic flow prediction system based on spatiotemporal progressive fusion, comprising:
[0027] The spatiotemporal feature representation construction module is used to obtain the running state feature of the traffic data, and the running state embedding representation is obtained by feature mapping and dimension transformation;
[0028] The periodic feature embedding representation is obtained by encoding the periodic feature of the traffic data through a preset learnable periodic embedding dictionary;
[0029] The running state embedding representation, the periodic feature embedding representation and the adaptive embedding representation are spliced along the feature dimension to obtain the spatiotemporal feature representation.
[0030] Feature extraction module: taking the basic observation unit of traffic data as a node, calculating the feature similarity of the node in the time dimension based on the space-time feature representation, taking the feature similarity as the attention weight, weighting and aggregating the historical T time step features of the node to generate the time feature representation of the node; =1,2,...,N, N is the total number of nodes, based on the space-time feature representation, calculating the feature similarity of the node in the time dimension, taking the feature similarity as the attention weight, weighting and aggregating the historical T time step features of the node to generate the time feature representation of the node;
[0031] Splicing the time feature representation of the time window T to construct the historical time sequence feature of the node;
[0032] After the historical time sequence feature of the node is processed by three independent feedforward neural networks, the similarity between nodes is calculated to generate the time sequence perception space feature representation of the node;
[0033] The time feature representation and the time sequence perception space feature representation of each node are aggregated in the node dimension to obtain the overall time feature and time sequence perception space feature;
[0034] Feature fusion and prediction module: used for fusing the time sequence perception space feature and the time feature through a two-stage cross-attention mechanism to obtain a space-time collaborative feature representation; after full connection processing, the traffic flow prediction result of the future T' time steps is obtained.
[0035] Based on the above prediction system, the feature fusion and prediction module fuses the time sequence perception space feature and the time feature through a two-stage cross-attention mechanism to obtain a space-time collaborative feature representation, specifically:
[0036] In the first stage, the time feature is taken as the query, the time sequence perception space feature is taken as the key and the value, and the enhanced time feature is obtained through the cross-attention mechanism processing;
[0037] In the second stage, the time sequence perception space feature is taken as the query, and the enhanced time feature is taken as the key and the value, and the space-time collaborative feature representation is obtained through the cross-attention mechanism processing.
[0038] Based on the above prediction system, the feature extraction module calculates the similarity between nodes after the historical time sequence feature of the node is processed by three independent feedforward neural networks to generate the time sequence perception space feature representation of the node, specifically:
[0039] After the historical time sequence feature of the node is processed by three independent feedforward neural networks, the query vector, the key vector and the value vector are obtained, the similarity between nodes is calculated through weighted fusion and aggregation with other nodes to generate the time sequence perception space feature representation of the node.
[0040] Beneficial effects
[0041] The application overcomes the defect that the spatial feature of a single time step is difficult to depict dynamic spatial dependence by taking the historical time sequence mode of the node itself as the context of spatial dependence learning, realizes a time sequence perception spatial dependence learning mechanism, effectively learns the spatial dependence between traffic nodes changing over time by a method without a graph structure, accurately depicts the space-time propagation rule of traffic data in the road network, and provides high-quality spatial representation for traffic flow prediction.
[0042] The application realizes progressive interaction and mutual enhancement of time features and space features through a two-stage cross-attention mechanism, fully integrates the complementary information of time features and space features, can more accurately capture the complex space-time dependence in traffic data, provides feature representation with stronger expression ability for traffic flow prediction, and further improves the accuracy of traffic flow prediction. BRIEF DESCRIPTION OF DRAWINGS
[0043] Figure 1 A schematic diagram of the framework of the traffic flow prediction method based on time-space progressive fusion of embodiment 1.
[0044] Figure 2 A comparison diagram of 5-minute prediction values and true values of the traffic flow prediction method based on time-space progressive fusion of embodiment 1.
[0045] Figure 3 A comparison diagram of 1-hour prediction values and true values of the traffic flow prediction method based on time-space progressive fusion of embodiment 1. DETAILED DESCRIPTION
[0046] The following examples are intended to illustrate the application, but not further limit the application.
[0047] Embodiment 1
[0048] As shown in Figure 1 , the embodiment provides a traffic flow prediction method based on time-space progressive fusion, comprising:
[0049] S1: Obtain the running state feature of the traffic data, and obtain the running state embedding representation through feature mapping and dimension transformation.
[0050] Obtain the weekly and daily cycle features of the traffic data, encode through a preset learnable cycle embedding dictionary, and obtain the periodic feature embedding representation.
[0051] The running state embedding representation, the periodic feature embedding representation and the adaptive embedding representation are spliced along the feature dimension to obtain the space-time feature representation.
[0052] The specific operation is as follows:
[0053] S11: Obtain a running state feature of the traffic data, the running state feature being a numerical feature reflecting a traffic running state, including traffic flow, vehicle driving speed, and road occupancy rate. The running state feature of the traffic data is extracted by feature mapping and dimension transformation of the running state feature through a feature mapping network, to obtain a running state embedding representation.
[0054] A weekly and daily period feature of the traffic data is obtained, and the period feature is encoded through a preset learnable period embedding dictionary to obtain a period embedding representation. The period feature is used to represent a period change rule of the traffic data in a time dimension, including a period change rule in a week and a period change rule in a day.
[0055] An adaptive embedding representation is obtained, which is obtained by iteratively updating an adaptive embedding matrix based on a spatiotemporal distribution characteristic of the traffic data in a training process of a prediction model corresponding to the prediction method.
[0056] The spatiotemporal distribution characteristic of the traffic data includes a spatial distribution difference of the running state feature at different nodes, a differentiated adaptation rule of the weekly or daily period feature at each node, a dynamic fluctuation feature of the running state at different time steps of the same node, and an evolution rule of spatial correlation between nodes over time. The updating process is coordinated with the feature interaction logic of the spatiotemporal perception and spatial feature extraction and the two-stage cross-attention fusion in S2, so that the adaptive embedding representation can dynamically adapt to the spatiotemporal evolution characteristic of the traffic flow, and realize dynamic adaptive optimization of feature representation.
[0057] S12: The running state embedding representation, the period embedding representation, and the adaptive embedding representation are spliced along a feature dimension to obtain a spatiotemporal feature representation.
[0058] S2: Taking a basic observation unit of the traffic data as a node, a time feature representation of the node at a time step t is calculated based on the spatiotemporal feature representation. =1,2,...,N, N being a total number of nodes, a feature similarity of the node in a time dimension is calculated based on the spatiotemporal feature representation, the feature similarity is taken as an attention weight, and a time feature representation of the node is generated by weighted aggregation of historical T time steps of the node.
[0059] The time feature representation of the node at the time step t is spliced with a time window of T to construct a historical time sequence feature of the node. .
[0060] In this embodiment, the following formula is used: In the formula, represents the time feature representation of the node at the time step t.
[0061] The node historical time sequence feature is processed by three independent feedforward neural networks, the similarity between nodes is calculated, and the time sequence perception space feature representation of the node is generated, specifically as follows:
[0062] The node historical time sequence feature is processed by three independent feedforward neural networks, the similarity between nodes is calculated, and the time sequence perception space feature representation of the node is generated, specifically as follows:
[0063] In the embodiment, the query vector, the key vector and the value vector are obtained by the formula:
[0064] In the formula, represents the node historical time sequence feature; represent three independent feedforward neural networks, wherein compress the historical time sequence feature to dimensions, the feature dimension of is the same as the dimension.
[0065] The time feature representation and the time sequence perception space feature representation of each node are aggregated according to the node dimension to obtain the overall time feature and the time sequence perception space feature.
[0066] In the embodiment, the time feature representation of all nodes is fused by the formula: to obtain the time feature .
[0067] The time sequence perception space feature representation of all nodes is fused by the formula: to obtain the time sequence perception space feature .
[0068] The application overcomes the defect that the space feature of a single time step is difficult to describe dynamic space dependence by taking the historical time sequence mode of the node itself as the context of space dependence learning, realizes a time sequence perception space dependence learning mechanism, effectively learns the space dependence between traffic nodes changing with time by a method without graph structure, accurately describes the space-time propagation rule of traffic data in the road network, and provides a high-quality space representation for traffic flow prediction.
[0069] S3: The time and space features are fused by the two-stage cross-attention mechanism to obtain a spatiotemporal collaborative feature representation; and after full connection processing, the traffic flow prediction results of T' future time steps are obtained.
[0070] The specific operation is as follows:
[0071] S31: The time and space features are fused by the two-stage cross-attention mechanism to obtain a spatiotemporal collaborative feature representation, specifically as follows:
[0072] S311: The first stage takes the time feature as the query, the time and space features as the key and value, and the enhanced time feature is obtained through cross-attention mechanism processing.
[0073] S312: The second stage takes the time and space features as the query, and the enhanced time feature as the key and value, and the spatiotemporal collaborative feature representation is obtained through cross-attention mechanism processing: the similarity between the query and the key value is calculated as a weight to extract the features associated with the space features. .
[0074] S32: The spatiotemporal collaborative feature representation is mapped through full connection processing to obtain the traffic flow prediction results of T' future time steps.
[0075] The two-stage cross-attention mechanism realizes the progressive interaction and mutual enhancement of the time and space features, fully integrates the complementary information of the time and space features, can more accurately capture the complex spatiotemporal dependence in the traffic data, provides a feature representation with stronger expression ability for traffic flow prediction, and further improves the accuracy of traffic flow prediction.
[0076] Embodiment 2
[0077] The embodiment provides a traffic flow prediction system based on spatiotemporal progressive fusion, which comprises:
[0078] A spatiotemporal feature representation construction module is configured to obtain the running state features of the traffic data, and obtain a running state embedding representation through feature mapping and dimension transformation.
[0079] The intra-week and intra-day periodic features of the traffic data are obtained, and are encoded by a preset learnable periodic embedding dictionary to obtain a periodic feature embedding representation.
[0080] The running state embedding representation, the periodic feature embedding representation and the adaptive embedding representation are spliced along the feature dimension to obtain a spatiotemporal feature representation.
[0081] The feature extraction module: taking a basic observation unit of traffic data as a node, calculating a feature similarity of the node in a time dimension based on a space-time feature representation, taking the feature similarity as an attention weight, weighting and aggregating T historical time step features of the node to generate a time feature representation of the node; =1,2,...,N, N being a total number of nodes, calculating a similarity between nodes after the node historical time sequence features are processed by three independent feedforward neural networks, and generating a time sequence perception space feature representation of the node;
[0082] splicing the time feature representation of the time window T to construct the node historical time sequence features;
[0083] calculating the similarity between nodes after the node historical time sequence features are processed by three independent feedforward neural networks, and generating a time sequence perception space feature representation of the node;
[0084] aggregating the time feature representation and the time sequence perception space feature representation of each node obtained independently in a node dimension to obtain overall time features and time sequence perception space features.
[0085] Preferably, the feature extraction module calculates the similarity between nodes after the node historical time sequence features are processed by three independent feedforward neural networks, and generates a time sequence perception space feature representation of the node, specifically as follows:
[0086] obtaining a query vector, a key vector and a value vector after the node historical time sequence features are processed by three independent feedforward neural networks, calculating the similarity between nodes by weighted fusion and aggregating with other nodes to generate a time sequence perception space feature representation of the node.
[0087] The feature fusion and prediction module: used for fusing the time sequence perception space features and the time features by a two-stage cross-attention mechanism to obtain a space-time collaborative feature representation; and obtaining a traffic flow prediction result of T' future time steps after full connection processing.
[0088] Preferably, the feature fusion and prediction module fuses the time sequence perception space features and the time features by a two-stage cross-attention mechanism to obtain a space-time collaborative feature representation, specifically as follows:
[0089] the first stage takes the time features as a query, takes the time sequence perception space features as a key and a value, and processes by a cross-attention mechanism to obtain enhanced time features;
[0090] the second stage takes the time sequence perception space features as a query, takes the enhanced time features as a key and a value, and processes by a cross-attention mechanism to obtain a space-time collaborative feature representation.
[0091] The prediction system provided by the application effectively learns the spatial dependence between traffic nodes changing with time by using the time sequence mode of the historical time window and the position information of the nodes, and accurately describes the space-time propagation rule of the traffic data in the road network. The progressive interaction and mutual enhancement between the time features and the space features are realized through the multi-layer cross attention mechanism, the complex space-time dependence in the traffic data can be more accurately captured, and the accuracy of the traffic flow prediction is further improved.
[0092] Embodiment 3
[0093] In order to verify the effectiveness of the application, the performance thereof is tested from the aspect of traffic flow prediction.
[0094] 1. Data set
[0095] The application is tested on four benchmark traffic flow prediction data sets PEMS03, PEMS04, PEMS07 and PEMS08 to verify the performance thereof. The four data sets are all from the Performance Measurement System (PEMS) of the California Department of Transportation, and a unified data collection granularity is adopted, and 12 data frames are recorded per hour at an interval of 5 minutes. Table 1 shows the number of nodes, total time steps, data collection start time, data collection end time, data missing rate and recorded signal type (F represents flow, S represents speed, and O represents occupancy) of the four data sets, which provides a complete data basis for subsequent modeling and analysis work.
[0096] Table 1 Traffic flow prediction data set
[0097]
[0098] 2. Evaluation index
[0099] The application uses three indexes, mean absolute error (MAE), mean absolute percentage error (MAPE) and root mean square error (RMSE) to evaluate the effectiveness of the traffic flow prediction method. MAE calculates the average value of the errors in a group of prediction results without considering the direction of the errors; MAPE expresses the error as a percentage of the actual value, and this standardized method makes it easier to compare the errors of different data scales; RMSE is used to quantify the square root of the average value of the squared differences between the predicted values and the actual values, and gives a greater penalty to larger errors.
[0100] 3. Comparative analysis of experimental results
[0101] In order to better reflect the effect of the traffic flow prediction method (denoted as STPF) of the application, other comparative methods are compared. Among them, the comparative method adopts ASTGCN, PDFormer, MVSTT, STAEformer, DSTSPYN and ASTEGCN.
[0102] ASTGCN: This method proposes a spatio-temporal graph convolution network based on attention mechanism, which respectively models the near dependence, daily periodicity and weekly periodicity of traffic flow data through spatio-temporal attention mechanism and spatio-temporal convolution.
[0103] PDFormer: This method proposes a propagation delay perception dynamic long-range Transformer, which captures dynamic spatial dependence through long-range and short-range scales, and explicitly models the time delay of spatial information propagation.
[0104] MVSTT: This method proposes a multi-view spatial and temporal learning framework, which designs sub-modules from the time and spatial perspectives, and then performs cross-view fusion.
[0105] STAEformer: This method proposes a spatio-temporal adaptive embedding component, which enhances the performance of the Transformer in traffic flow prediction.
[0106] DSTSPYN: This method proposes a dynamic spatio-temporal similarity pyramid network, which dynamically adjusts the weights of the center, edge and global spatio-temporal features through an enhanced attention mechanism and a pyramid gating convolution structure.
[0107] ASTEGCN: This method proposes an adaptive spatio-temporal enhanced graph convolution network, which extracts spatial correlation from dual perspectives through local graph convolution and node adaptive graph convolution, and then extracts time correlation of continuous time steps and non-continuous time steps from two angles respectively.
[0108] Table 2 introduces the prediction performance of the STPF method of the application and other comparative methods on the PEMS03 dataset. The PEMS03 dataset faces unique challenges, with the mean and standard deviation of traffic flow showing a clear nonlinear and scattered relationship, and the PEMS03 dataset has unstable traffic patterns, which is in sharp contrast to the other three datasets (PEMS04, PEMS07 and PEMS08). Under this data characteristic, the STPF method of the application still achieves the optimal mean absolute error (MAE), and maintains the top three level in the root mean square error (RMSE), and is close to the optimal method ASTEGCN.
[0109] Table 2 Performance comparison of the STPF method of the application and other comparative methods on the PEMS03 dataset
[0110]
[0111] Table 3 introduces the prediction performance of the STPF method of the present application and other comparative methods on the PEMS04 dataset. For the PEMS04 dataset with a high data missing rate, the STPF method of the present application achieves the optimal results in the three indicators of mean absolute error (MAE), root mean square error (RMSE) and mean absolute percentage error (MAPE), which highlights the strong robustness of the STPF method of the present application in the presence of certain noise and data missing, which is an important advantage for actual scenarios where node data may be sporadic or unreliable. Although the dataset has a high proportion of missing data, the traffic flow still has a clear distribution as a whole, so that STPF can effectively suppress the impact of data missing through collaborative modeling of spatial and temporal features.
[0112] Table 3 Performance comparison of the STPF method of the present application and other comparative methods on the PEMS04 dataset
[0113]
[0114] Table 4 introduces the prediction performance of the STPF method of the present application and other comparative methods on the PEMS07 dataset. The PEMS07 dataset has the most nodes, but the traffic flow still shows a relatively clear distribution as a whole, so that the STPF method of the present application can still achieve the optimal performance in the mean absolute error (MAE) and reach the best level in the mean absolute percentage error (MAPE), indicating that the STPF method of the present application has an advantage in modeling mainstream traffic conditions.
[0115] Table 4 Performance comparison of the STPF method of the present application and other comparative methods on the PEMS07 dataset
[0116]
[0117] Table 5 introduces the prediction performance of the STPF method of the present application and other comparative methods on the PEMS08 dataset. The STPF method of the present application performs particularly outstanding on the PEMS08 dataset, achieving the optimal results in MAE, RMSE and MAPE. The PEMS08 dataset has fewer nodes and a low data missing rate, and the traffic flow fluctuates less, which shows that the STPF method of the present application is very suitable for datasets with stable traffic conditions.
[0118] Table 5 Performance comparison of the STPF method of the present application and other comparative methods on the PEMS08 dataset
[0119]
[0120] As can be seen from the above, the prediction method of the present application has excellent performance and robustness in multi-dataset experiments, especially on the PEMS04 dataset with high data missing rate and the PEMS07 dataset with more nodes, the MAE, RMSE, MAPE and other indicators are better or close to the existing mainstream methods, and on the PEMS08 dataset with stable traffic mode, the whole index is optimal, and is suitable for various complex traffic scenes.
[0121] In order to further verify the effectiveness of the prediction method proposed in the present application, the sensor numbered 14 in the PEMS08 dataset is selected for case study. The prediction results of the present application are evaluated within 48 hours from 00:00 on August 26, 2016 to 00:00 on August 28, 2016. Figure 2 The comparison between the real traffic flow and the 5-minute predicted traffic flow is shown, the prediction value of the model corresponding to the prediction method of the present application is in good agreement with the actual traffic flow measurement true value, and can accurately capture short-term fluctuations and subtle changes. Figure 3 The comparison between the real traffic flow and the 1-hour predicted traffic flow is shown, the model corresponding to the prediction method of the present application successfully captures the overall trend and periodic pattern within two days, and can keep reliable prediction results even in a longer time range.
[0122] This case study shows that the prediction method of the present application can realize high-precision short-term prediction, and at the same time generate reliable long-term prediction, effectively simulate traffic dynamics under multiple time scales. The results confirm that the model can closely fit the actual traffic flow, and exhibits its strong prediction performance and practicality in actual traffic prediction tasks.
Claims
1. A traffic flow prediction method based on spatiotemporal progressive fusion, characterized in that, Comprise: S1: obtain the running state feature of traffic data, get the running state embedding representation through feature mapping and dimension transformation; Obtain the periodic feature of traffic data, encode through the preset learnable period embedding dictionary, get the periodic feature embedding representation; The running state embedding representation, the periodic feature embedding representation and the adaptive embedding representation are spliced along the feature dimension to obtain the spatio-temporal feature representation; S2: taking the traffic data basic observation unit as a node, taking the first node as an example, =1,2,...,N, N is the total number of nodes, based on the space-time feature representation, calculating the feature similarity of the node in the time dimension, taking the feature similarity as the attention weight, weighting and aggregating the T time step features of the node to generate the time feature representation of the node; Splice the time feature representation of the time window T to construct the historical time sequence feature of the node; After the historical time sequence feature of the node is processed by three independent feedforward neural networks, the similarity between nodes is calculated to generate the time sequence perception space feature representation of the node; Aggregate the time feature representation and the time sequence perception space feature representation of each node according to the node dimension to obtain the overall time feature and time sequence perception space feature; S3: fuse the time sequence perception space feature and the time feature through the two-stage cross attention mechanism to obtain the spatio-temporal collaborative feature representation; After full connection processing, the traffic flow prediction result of the future T' time steps is obtained. 2.The traffic flow prediction method based on spatio-temporal progressive fusion according to claim 1, characterized in that, S3: fuse the time sequence perception space feature and the time feature through the two-stage cross attention mechanism to obtain the spatio-temporal collaborative feature representation, specifically: The first stage takes the time feature as the query, the time sequence perception space feature as the key and the value, and processes through the cross attention mechanism to obtain the enhanced time feature; The second stage takes the time sequence perception space feature as the query and the enhanced time feature as the key and the value, and processes through the cross attention mechanism to obtain the spatio-temporal collaborative feature representation. 3.The traffic flow prediction method based on spatio-temporal progressive fusion according to claim 1, characterized in that, S2: after the historical time sequence feature of the node is processed by three independent feedforward neural networks, the similarity between nodes is calculated to generate the time sequence perception space feature representation of the node, specifically: After the historical time sequence feature of the node is processed by three independent feedforward neural networks, the query vector, the key vector and the value vector are obtained, and the similarity between nodes is calculated by weighted fusion and aggregated with other nodes to generate the time sequence perception space feature representation of the node.
4. The traffic flow prediction method based on spatio-temporal progressive fusion according to claim 3, characterized in that, The query vector, the key vector and the value vector are obtained by the following formulas: , , ; wherein representing a node historical timing characteristics; , , representing three independent feedforward neural networks.
5. The traffic flow prediction method based on spatio-temporal progressive fusion according to claim 1, characterized in that, S1: the running state feature of traffic data includes traffic flow, vehicle speed and road occupancy.
6. The traffic flow prediction method based on spatio-temporal progressive fusion according to claim 1, characterized in that, S1: the adaptive embedding representation is obtained by iteratively updating the adaptive embedding matrix based on the spatio-temporal distribution characteristics of traffic data.
7. The traffic flow prediction method based on spatio-temporal progressive fusion according to claim 1, characterized in that, S2 the splicing time window is T time characteristic representation, construct this node history time sequence characteristic, for through formula: Realization; In the formula, The first The first Time characteristic representation of the first node at the first time step.
8. A traffic flow prediction system based on spatio-temporal progressive fusion, characterized in that, Comprise: Spatio-temporal feature representation construction module: used for obtaining the running state feature of traffic data, getting the running state embedding representation through feature mapping and dimension transformation; Obtain the periodic feature of traffic data, encode through the preset learnable period embedding dictionary, get the periodic feature embedding representation; The running state embedding representation, the periodic feature embedding representation and the adaptive embedding representation are spliced along the feature dimension to obtain the spatio-temporal feature representation; The feature extraction module takes a basic observation unit of traffic data as a node, calculates a feature similarity of the node in a time dimension based on a space-time feature representation, takes the feature similarity as an attention weight, aggregates a T time step feature of the node in a weighted manner, and generates a time feature representation of the node. =1,2,...,N, N is a total number of nodes, Splice the time feature representation of the time window T to construct the historical time sequence feature of the node; After the historical time sequence feature of the node is processed by three independent feedforward neural networks, the similarity between nodes is calculated to generate the time sequence perception space feature representation of the node; Aggregate the time feature representation and the time sequence perception space feature representation of each node according to the node dimension to obtain the overall time feature and time sequence perception space feature; The feature fusion and prediction module is configured to fuse the time-aware spatial features and the time features through a two-stage cross-attention mechanism to obtain a spatio-temporal collaborative feature representation, and to obtain a traffic flow prediction result of T' future time steps after full connection processing.
9. The spatio-temporal progressive fusion based traffic flow prediction system according to claim 8, wherein, The feature fusion and prediction module fuses the time-aware spatial features and the time features through a two-stage cross-attention mechanism to obtain a spatio-temporal collaborative feature representation, specifically as follows: In the first stage, the time features are taken as queries, and the time-aware spatial features are taken as keys and values, and the enhanced time features are obtained through cross-attention mechanism processing; In the second stage, the time-aware spatial features are taken as queries, and the enhanced time features are taken as keys and values, and the spatio-temporal collaborative feature representation is obtained through cross-attention mechanism processing.
10. The spatio-temporal progressive fusion based traffic flow prediction system according to claim 8, wherein, The feature extraction module is configured to calculate the similarity between nodes after processing the historical time sequence features of the node through three independent feedforward neural networks, and generate the time-aware spatial feature representation of the node, specifically as follows: After processing the historical time sequence features of the node through three independent feedforward neural networks, the query vector, the key vector and the value vector are obtained, the similarity between nodes is calculated through weighted fusion, and the time-aware spatial feature representation of the node is generated after aggregation with other nodes.
Citation Information
Patent Citations
Traffic flow prediction method and system for dynamic association information fusion space-time network
CN120766546A
Traffic flow prediction method and device based on multi-level space-time and perception fusion
CN121092937A