Modeling method for accurate traffic flow prediction
Through the spatiotemporal graph convolutional network and the adaptive attention mechanism of latent periodic patterns, the problems of traditional traffic flow prediction methods that fail to capture sudden delays and periodic features are solved, achieving more accurate and stable traffic flow prediction.
Patent Information
- Application Number
- CN202511074925.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-31
- Publication Date
- 2025-10-03
AI Technical Summary
Traditional traffic flow forecasting methods fail to effectively capture the delayed impact and periodic characteristics of traffic flow mutations, resulting in inconsistent prediction accuracy during mutations and in different time periods.
A spatiotemporal graph convolutional network is combined with an adaptive attention mechanism with latent periodic patterns. The spatiotemporal characteristics of traffic flow are captured through spatial graph convolutional layers and temporal convolutional layers. The change information of neighbor nodes is introduced, and a delayed propagation mechanism of traffic flow characteristics based on the spatiotemporal graph network is designed to capture the delayed propagation and periodic changes of traffic mutations.
The accuracy and stability of traffic flow prediction are improved, especially the prediction performance in periods of sudden changes and periodic changes is better than other models, showing high robustness and generalization ability.
Smart Images

Figure CN120748205A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of intelligent transportation technology, and in particular relates to a modeling method for accurate traffic flow prediction. Background Art
[0002] With the acceleration of urbanization and the growing demand for transportation, traffic congestion has become a major issue facing urban development. Intelligent Transportation Systems (ITS) have become an indispensable tool for solving traffic management problems. Accurate and timely traffic flow forecasting has always been a key issue in ITS research. Using historical traffic data and prediction models to predict future road traffic flows is crucial for improving road utilization efficiency, alleviating traffic congestion, and formulating traffic management policies.
[0003] Traditional forecasting methods usually use models based on time series or machine learning, such as ARIMA, regression models, or neural networks. These methods have certain limitations when dealing with sudden changes in traffic flow. Specifically, traditional methods often assume that changes in traffic flow are instantaneous and do not take into account the gradual propagation process of the impact of sudden changes. Figure 2 (a) When traffic flow at an intersection suddenly increases or decreases due to a traffic accident, this change does not immediately propagate to surrounding intersections but rather gradually diffuses. Traditional methods fail to capture this delayed effect, resulting in significantly reduced prediction accuracy when predicting traffic flow for a period of time after the sudden change.
[0004] On the other hand, traffic flow has obvious periodic characteristics, which show different regular changes in different time periods. Figure 2 (b) Traffic flow increases significantly during rush hour (commuting) and decreases significantly at night or during holidays. Existing methods typically use fixed time features or simple seasonal adjustments to model this cyclical behavior, but often fail to fully utilize this regularity. This deficiency leads to inconsistent forecasting performance across different time periods, especially at turning points or sudden changes, where models often struggle to accurately capture the sudden changes in cyclical changes. Summary of the Invention
[0005] The purpose of the present invention is to overcome the deficiencies of the prior art and provide a modeling method for accurate traffic flow prediction.
[0006] The technical solutions of the present invention are as follows:
[0007] A modeling method for accurate traffic flow prediction includes the following steps:
[0008] S1: Model all intersections and roads as a road network undirected graph G = (V, E), and define the adjacency matrix and distance matrix to capture the connectivity and distance of the road network undirected graph;
[0009] S2: Define the propagation delay of the traffic flow at the intersection, and determine the comprehensive effect of each intersection at time t by combining the propagation delay and the impact of sudden changes in traffic flow at adjacent intersections to obtain the traffic flow representation of the intersection at time t;
[0010] S3: The spatial graph convolution layer aggregates the features of each intersection through the adjacency matrix and propagation delay, and captures the temporal change characteristics of the sudden change in the traffic flow representation in step S3 through the temporal graph convolution layer. The graph convolution layer and the temporal convolution layer are combined to form a spatiotemporal graph convolution network, and the final traffic flow prediction H is output. L ;
[0011] S4: Given the final traffic flow prediction And the kernel density estimation matrix of GKDE Definition: Q = PW Q ; K=PW K ; V=H L W V ,in, are three learnable weights;
[0012] S5: The output of the feedforward neural network is:
[0013]
[0014] Furthermore, the adjacency matrix Represents the connectivity of the following, where A i,j Represents the element in the i-th row and j-th column of the adjacency matrix, whose value is:
[0015]
[0016] Furthermore, the adjacency matrix is obtained by using the Floyd algorithm to obtain the shortest path distance matrix between any two points of the road network undirected graph. in, is the element in the i-th row and j-th column of the matrix, representing the intersection v i and v j The shortest path distance between them.
[0017] Furthermore, the specific contents of step S2 include the following steps:
[0018] S21: Based on intersection v i All connected roads i,j and the propagation speed s of different roads i,j , define the propagation delay of mutation as:
[0019] S22: Based on propagation delay and intersection v i At time t0, a sudden change in traffic flow occurs Δf i (t0), confirm the intersection v j In the intersection i After the mutation is transmitted, the traffic changes to:
[0020] Δf j (t0+τ i,j )=g(Δf i (t0))
[0021] Where g(Δf i (t0))=α i,j Δf i (t0) is used to describe the mutation Δf i (t0) from v i Passed to v j The attenuation effect of α i,j ∈Λ, is the learnable attenuation coefficient, α i,j ∈[0, 1];
[0022] S23: Based on step S22, it can be known that each intersection v j At time t, all its neighbors The comprehensive effect of the propagated traffic flow mutation can be expressed as:
[0023]
[0024] S24: Intersection v j The traffic flow at time t can be expressed as:
[0025] f j (t) = f j (t-Δt)+Δf j (t).
[0026] Furthermore, step S3 specifically includes the following steps:
[0027] S31: The spatial graph convolution layer aggregates the features of each intersection through the connection relationship and propagation delay between intersections. The formula is:
[0028]
[0029] Among them H l is the hidden state of the lth layer, k is the size of the convolution kernel, D is the global distance matrix, which represents the distance between any two intersections, A is the global adjacency matrix, Λ is the attenuation coefficient matrix, is the learnable weight of layer l, σ is the activation function (ReLU);
[0030] S32: The temporal convolution layer extracts the temporal pattern of sudden changes in traffic flow data through one-dimensional convolution operations, and then confirms the flow changes at each intersection. Its formula is:
[0031]
[0032] Where: Δt is the acquisition time interval, j is the convolution kernel size, f(t) is the global flow vector at time t, σ is the activation function, W j is the weight matrix of the convolutional layer;
[0033] S33: Combine the spatial graph convolution layer and the temporal convolution layer to form a spatiotemporal graph convolution network:
[0034]
[0035] S34: After the convolution operation of the spatiotemporal graph convolutional network, the final traffic flow prediction is obtained:
[0036]
[0037] Compared with the prior art, the present invention has the following beneficial effects:
[0038] 1. This paper proposes LP-PAN based on spatiotemporal graph network for accurate traffic flow prediction, which solves the problems of delayed propagation and periodicity of traffic mutation in traffic data.
[0039] 2. In the proposed network, a latency propagation mechanism for traffic flow characteristics based on a spatio-temporal graph network (LP-STGN) is designed. By introducing the change information of neighboring nodes in the representation of node traffic, the latency propagation of traffic mutations is captured.
[0040] 3. The performance of the proposed network is evaluated on two real-world datasets. The experimental results show that LP-PAN outperforms all baseline models in all prediction ranges. The visualization of the prediction results shows that LP-PAN has better robustness to traffic mutations and periodic changes. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 FIG. 1 is an overall framework diagram of the delay propagation and periodic adaptation network of the present invention;
[0042] Figure 2These are the traffic flow trend graphs of nodes in the dataset PeMS-04 of the present invention, where (a) is the traffic flow trend graph of two adjacent nodes within one day, and (b) is the traffic flow trend graph of a single node within one week. DETAILED DESCRIPTION
[0043] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0044] like Figure 1 As shown in FIG, a modeling method for accurate traffic flow prediction includes the following:
[0045] S1. Graphical representation of road network
[0046] All intersections and roads are modeled as an undirected graph G = (V, E), where:
[0047] Vertex set V, V = {v1, v2, ...v N} is a set of vertices, each vertex represents a traffic intersection, and each intersection v i ∈V and attributes Associated, indicating the intersection v i Traffic flow at the current time t.
[0048] Undirected edge set E, E={e i,j |v i and v j Connected} is a set of edges, each edge represents a road connecting the intersection, each edge e i,j Both have attribute d i,j Indicates the length of this road.
[0049] Traffic flow f(t), given time t, the traffic flow at all intersections is represented as a vector in:
[0050] f(t)={f1(t), f2(t), ...f N (t)}
[0051] The following matrix is defined to capture the connectivity and distance of the road network:
[0052] adjacency matrix, adjacency matrix Represents the connectivity of the following, where A i,j Represents the element in the i-th row and j-th column of the adjacency matrix, whose value is:
[0053]
[0054] Distance matrix, according to Floyd algorithm, the global shortest path distance matrix between any two points can be obtained is the element in the i-th row and j-th column of the matrix, representing the intersection point v i and v j The shortest path distance between them.
[0055] S2. Delayed propagation mechanism of traffic flow characteristics based on spatiotemporal graph network
[0056] Assume that intersection v i At time t0, a sudden change in traffic flow occurs Δf i (t0), we need to consider how this mutation will be along the connecting intersection v i All roads i,j At different speeds i,j Propagate, for each adjacent intersection v i , define the propagation delay of mutation as:
[0057]
[0058] Therefore, at time t0+τ i,j When the intersection v j By the intersection v i The traffic changes due to the mutation are:
[0059] Δf j (t0+τ i,j )=g(Δf i (t0))
[0060] Where g(Δf i (t0))=α i,j Δf i (t0) is used to describe the mutation Δf i (t0) from v i Passed to v j The attenuation effect of α i,j ∈Λ is a learnable decay coefficient, α i,j ∈[0, 1].
[0061] In this way, each intersection v j At time t, all its neighbors The comprehensive effect of the propagated traffic flow mutation can be expressed as:
[0062]
[0063] Finally, the intersectionj The traffic flow at time t can be expressed as:
[0064] f j (t) = f j (t-Δt)+Δf j (t)
[0065] It is worth noting that there is a loop effect in reality, that is, from the intersection v i Pass to intersection v j The mutation will occur after a period of time. j Passed to v i , such a situation is possible, but the attenuation coefficient α twice i,j and α j,i Obviously, they are not necessarily equal, that is, the attenuation coefficient matrix Λ is not a real symmetric matrix.
[0066] Based on the above modeling, we propose a Latency Propagation Mechanism with Spatio-Temporal Graph Network (LP-STGN). The core of the LP-STGN model is to combine spatial graph convolution layers with temporal convolution layers to capture the spatiotemporal characteristics of traffic flow.
[0067] S3, the spatial graph convolution layer aggregates the features of each intersection through the adjacency matrix and propagation delay, and captures the temporal change characteristics of the sudden change in the traffic flow representation in step S3 through the temporal graph convolution layer. The graph convolution layer and the temporal convolution layer are combined to form a spatiotemporal graph convolution network, and the final traffic flow prediction H is output. L ;
[0068] S31. The spatial graph convolution layer aims to capture the spatial relationships and their impacts between different intersections in the traffic network. Specifically, the graph convolution operation aggregates the features of each intersection through the connection relationship and propagation delay between intersections. Its formula is:
[0069]
[0070] Among them H l is the hidden state of the lth layer, k is the size of the convolution kernel, D is the global distance matrix, which represents the distance between any two intersections, A is the global adjacency matrix. Because the global distance matrix D cannot reflect whether there is a road between two intersections from a numerical perspective, the adjacency matrix needs to be introduced here to play a regularization role. Λ is the attenuation coefficient matrix. is the learnable weight of the lth layer, and σ is the activation function (ReLU).
[0071] This design ensures that the spatial graph convolution layer captures the spatial dependencies between intersections. In particular, by accounting for propagation delay, it can more accurately reflect the spatial transmission process of traffic flow. The introduction of a learnable attenuation coefficient matrix allows the model to automatically adjust the propagation effects between different intersections, enhancing its adaptability and flexibility.
[0072] S32. The role of the temporal convolution layer in the LP-STGN model is to capture the temporal variation characteristics of sudden changes in traffic flow. Through one-dimensional convolution operations, the temporal convolution layer can extract the temporal pattern of sudden changes in traffic flow data, thereby affecting the flow changes at each intersection. Its formula is:
[0073]
[0074] Where: Δt is the acquisition time interval, j is the convolution kernel size, f(t) is the global flow vector at time t, σ is the activation function, W j is the weight matrix of the convolutional layer, and f is the global flow vector.
[0075] The S33 and LP-STGN models combine graph convolution layers and temporal convolution layers to form a spatiotemporal graph convolutional network:
[0076]
[0077] After the convolution operation of the spatial graph convolution and temporal convolution layers, the final traffic flow prediction is obtained:
[0078]
[0079] Where L is the total number of layers in the LP-STGN model.
[0080] S4. Adaptive Attention Mechanism Based on Latent Cycle Pattern
[0081] Traffic flows often exhibit distinct cyclical characteristics. For example, traffic volume typically increases during morning and evening rush hours and decreases during off-peak hours due to commuting patterns. This cyclical pattern is often consistent across different days and weeks.
[0082] This study introduces a latent periodic pattern-based adaptive attention mechanism (Latent Periodic Pattern-based Adaptive Attention, Lp 2 A 2 ) to effectively capture the periodic variation characteristics of traffic flow. The mechanism mainly includes Gaussian kernel density estimation (GKDE) and adaptive attention mechanism.
[0083] First, the traffic flow data of each intersection is modeled as Where N represents the number of intersections, and M represents the amount of data collected at each intersection. Fourier transforms and GKDE are used to estimate the traffic flow distribution at each intersection over different time periods. Each intersection has its own periodic pattern. Therefore, each intersection must be modeled individually to identify its traffic flow periodicity.
[0084] For each intersection v i Traffic First, use Fourier transform to get frequency domain data On the spectrum, assuming that the spectrum shows that it has Q frequencies (each frequency corresponds to a period) T = {t1, t2, ..., t Q}, the corresponding amplitude is H = {h1, h2, ..., h Q}.
[0085] In the spectrum, select the J periods with the largest amplitudes to preserve extra information with less noise, ensuring that their cumulative amplitude accounts for at least δ = 0.9 of the total amplitude:
[0086]
[0087] Next, use GKDE in the intersection v i Get each cycle t j The probability density function p i,j (x), to express its t j Traffic distribution within a period:
[0088]
[0089] Where m is the variable in the summation function, m = 1, 2, 3...M, t j is the period size, which is used as the bandwidth parameter here and determines the smoothness of the kernel function. j The period determined by Fourier analysis ensures that the kernel density estimate effectively reflects the actual traffic distribution. M is the number of data collected in a week, and K is the Gaussian kernel function, which is usually defined as:
[0090]
[0091] Among them, u represents the relative distance between the target point and the sample point.
[0092] Therefore, the intersection v i The overall probability density function p of the traffic flow at i (x) can be expressed as these individual density functions p i,j The weighted sum of (x):
[0093]
[0094] Next, in order to make the output of the LP-STGN model With such periodicity, the present invention designs an attention mechanism called Latent Periodic Pattern-based Adaptive Attention (LP 2 A 2 ).
[0095] Specifically, given the output of LP-STGN Kernel density estimation matrix of GKDE definition:
[0096] Q=PW Q ; K=PW K ; V=H L W V
[0097] in, are three learnable weights.
[0098] Finally, the output of the network is:
[0099]
[0100] Among them, FFN is a simple feedforward neural network used to further process the attention output O and the result H output by LP-STGN L It contains two hidden layers of fully connected layers with ReLU activation functions and a fully connected layer without activation function as the output layer.
[0101] experiment
[0102] Dataset
[0103] We use common real-world traffic flow data collected by the California Department of Transportation on highway sensors, including PeMS-04 and PeMS-08. The data collected by the sensors includes traffic information such as flow rate, speed, and occupancy rate. The time interval for each sensor to collect samples is 5 minutes. The detailed statistical information of the dataset is shown in Table 1.
[0104] Table 1: Statistics of real-world datasets
[0105]
[0106] In order to eliminate the impact of uneven data distribution, the original data was standardized using Z-Score and divided into training set, validation set and test set in a ratio of 6:2:2, which is consistent with the division method of most models.
[0107] Experimental setup
[0108] Baseline Model
[0109] To verify the effectiveness of the model, the LP-PAN model was compared with eight models including traditional statistical methods, deep learning methods, and graph neural network methods, including ARIMA, VAR, DCRNN, STGCN, Graph WaveNet, GMAN, STGODE, and AFDGCN.
[0110] Experimental Configuration
[0111] All experiments were run on a Linux platform equipped with an Intel(R) Xeon(R) Gold 6330 CPU, eight NVIDIA Tesla T4 GPUs, and 256GB of RAM. The LP-PAN model was implemented in Ubuntu 18.04, PyTorch 1.10.0, and Python 3.6. The LP-PAN model was trained using the AdamW optimizer (Loshchilov and Hutter 2017) with a learning rate of 0.001, a batch size of 32, and 200 epochs. For the multi-step prediction task, the history sequence was updated with time steps of T = 3, 6, and 12 (5 minutes per step) to predict future traffic conditions for the next T' = 3, 6, and 12 steps, respectively.
[0112] Evaluation indicators
[0113] Three evaluation metrics were used in the experiment: (1) Mean Absolute Error (MAE), (2) Mean Absolute Percentage Error (MAPE), and (3) Root Mean Squared Error (RMSE). RMSE and MAE are used to measure the error between the actual data and the predicted results of the sample, reflecting the accuracy of the model fitting the real sample. MAPE provides a benchmark for comparison. When the predicted results are exactly the same as the real data, MAPE tends to 0. The mathematical definitions of the three evaluation metrics are as follows:
[0114]
[0115] Among them, yi is the true value, is the predicted value. For the above three indicators, smaller values indicate better prediction performance.
[0116] Experimental results
[0117] Table 2 describes the evaluation results of the LP-PAN model and eight other models on two real-world datasets. It can be seen that the LP-PAN model outperforms the other models in terms of MAE, RMSE, and MAPE at 15-minute, 30-minute, and 60-minute prediction timescales. On PeMS-04, the LP-PAN model achieves improvements in MAE, MAPE, and RMSE over the best baseline model by (5.51%, 6.04%, 4.43%), (5.18%, 4.87%, 4.05%), and (3.04%, 2.06%, 3.88%), respectively. On PeMS-08, the LP-PAN model achieves improvements in MAE, MAPE, and RMSE over the best baseline model by (6.30%, 5.49%, 6.63%), (3.69%, 1.42%, 5.45%), and (4.39%, 4.68%, 6.30%), respectively, at the three prediction timescales. Notably, the LP-PAN model achieves the most significant performance improvement at the 15-minute prediction timescale. This demonstrates that the LP-PAN model has high accuracy in short-term forecasting and effectively mitigates the impact of sudden traffic changes. Compared with other models, LP-PAN's performance across different time scales is relatively stable, with minimal fluctuations. This indicates that the LP-PAN model maintains consistent forecasting performance across different scenarios and demonstrates strong stability. The LP-PAN model also performs well on both the PeMS-04 and PeMS-08 datasets, demonstrating its strong generalization capabilities and its ability to maintain good forecasting results across diverse scenarios.
[0118] Table2 Performance comparison of LP-PAN and other baseline models. LP-PAN achieves the best performance for all datasets.
[0119]
[0120] Table 2
[0121] As can be observed from Table 2, statistical methods such as ARIMA and VAR ignore spatial correlation when processing nonlinear time series data and cannot perform well. The good performance of the deep learning model based on the graph structure shows the importance of spatial features for traffic flow prediction.
[0122] DCRNN and STGCN model spatial features while ignoring the dynamic nature of traffic conditions. STGODE and AFDGCN are not restricted by fixed graph structures and use the adaptive or dynamic properties of spatial associations between nodes in historical data to construct graph structures. Compared with previous methods, they further improve the prediction performance. Among the nine models, the LP-PAN model is the only one that considers the delayed propagation of traffic flow changes. The result that the LP-PAN model showed the best performance among the nine models confirms the impact of delayed propagation of traffic on the prediction results. The LP-PAN model incorporates the influence of traffic flow changes transmitted from surrounding nodes in the representation of node traffic flow and introduces periodic trends for prediction, which makes the LP-PAN model have higher accuracy, stability and generalization ability in short-term traffic flow prediction, and has certain advantages over other models.
[0123] Ablation experiments
[0124] We conducted an ablation study on different modules of the LP-PAN model on a subset of the PeMS-04 dataset to find out the contribution of each module to the model's prediction performance. We extracted the periods of relatively stable traffic flow (usually 12:00-18:00) and periods of drastic traffic flow changes (usually 8:00-12:00 and 18:00-21:00) from the dataset as sub-datasets for experiments, such as Figure 2 (a). The prediction step size in the ablation experiment is the same as the above experiment, and the experimental results are shown in Table 3. ST only means that only STGCN is used to generate the prediction results, w / o LP-STGN means that the delay propagation mechanism is removed, and w / o LP 2 A 2 denotes the removal of latent period adaptive attention, and LP-PAN denotes the complete model.
[0125] Table 3 Comparison of subdataset effects based on traffic flowmutation differentiation.
[0126]
[0127] 1 is the period of relatively gentle traffic flow changes in PeMS-04, usually 12:00-18:00.
[0128] 2is the period of mutations in traffic flow in PeMS-04, usually 8:00-12:00 and 18:00-21:00.
[0129] Table 3
[0130] It can be seen from Table 3 that: (1) the prediction accuracy of the STGCN and LP-PAN models in the two datasets is improved compared with the results in Table 2 during the period of slow traffic flow changes, while the prediction accuracy of the STGCN model is significantly reduced during the period of sudden traffic flow changes, and the prediction accuracy of the LP-PAN model is close to the results in Table 2, indicating that sudden traffic flow changes are the key factor affecting the overall accuracy of the model.
[0131] (2) The prediction performance of the LP-PAN model without the delay propagation mechanism is significantly lower than that of the original model, indicating that the LP-STGN module can effectively reduce the impact of traffic mutations on prediction accuracy.
[0132] (3) The prediction accuracy of the model is improved after the latent period adaptive attention module is added, which means that explicitly modeling the periodicity of traffic flow helps to improve the performance of the model, while the contribution of the delayed propagation mechanism to the improvement of the model is relatively small.
[0133] in conclusion
[0134] This application designs a traffic flow delay propagation mechanism based on a spatiotemporal graph network, and introduces the change information of neighboring nodes in the representation of node traffic to capture the delayed propagation of traffic mutations. In addition, in order to explore the potential periodic patterns in traffic flow data, an adaptive attention mechanism based on potential periodic patterns is further designed to capture the traffic distribution characteristics of each node. This study conducted extensive experiments on four real-world datasets to demonstrate the superiority of the model performance, and the prediction results are shown to illustrate that the LP-PAN model has better robustness to sudden and periodic changes in traffic flow. In future work, it is planned to study different types of attention to cope with the various characteristics of real-world traffic flow changes.
[0135] Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments, or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A modeling method for accurate traffic flow prediction, characterized by: The steps include: S1: Model all intersections and roads as a road network undirected graph G = (V, E), and define the adjacency matrix and distance matrix to capture the connectivity and distance of the road network undirected graph; S2: Define the propagation delay of the traffic flow at the intersection, and determine the comprehensive effect of each intersection at time t by combining the propagation delay and the impact of sudden changes in traffic flow at adjacent intersections to obtain the traffic flow representation of the intersection at time t; S3: The spatial graph convolution layer aggregates the features of each intersection through the adjacency matrix and propagation delay, and captures the temporal change characteristics of the sudden change in the traffic flow representation in step S3 through the temporal graph convolution layer. The graph convolution layer and the temporal convolution layer are combined to form a spatiotemporal graph convolution network, and the final traffic flow prediction H is output. L ; S4: Given the final traffic flow prediction And the kernel density estimation matrix of GKDE Definition: Q = PW Q ; K=PW K ; V=H L W V ,in, are three learnable weights; S5: The output of the feedforward neural network is:
2. The modeling method for accurate traffic flow prediction according to claim 1, characterized in that: Adjacency Matrix Represents the connectivity of the following, where A i,j Represents the element in the i-th row and j-th column of the adjacency matrix, whose value is:
3. The modeling method for accurate traffic flow prediction according to claim 2, characterized in that: The adjacency matrix is obtained by using the Floyd algorithm to obtain the shortest path distance matrix between any two points in the road network undirected graph in, is the element in the i-th row and j-th column of the matrix, representing the intersection v i and v j The shortest path distance between them.
4. The modeling method for accurate traffic flow prediction according to claim 3, characterized in that: The specific contents of step S2 include the following steps: S21: Based on intersection v i All connected roads i,j and the propagation speed s of different roads i,j , define the propagation delay of mutation as: S22: Based on propagation delay and intersection v i At time t0, a sudden change in traffic flow occurs Δf i (t0), confirm the intersection v j In the intersection i After the mutation is transmitted, the traffic changes to: Δf j (t0+τ i,j )=g(Δf i (t0)) Where g(Δf i (t0))=α i,j Δf i (t0) is used to describe the mutation Δf i (t0) from v i Passed to v j The attenuation effect of α i,j ∈Λ, is the learnable attenuation coefficient, α i,j ∈[0, 1]; S23: Based on step S22, it can be known that each intersection v j At time t, all its neighbors The comprehensive effect of the propagated traffic flow mutation can be expressed as: S24: Intersection v j The traffic flow at time t can be expressed as: f j (t)=f j (t-Δt)+Δf j (t)。 5. The modeling method for accurate traffic flow prediction according to claim 4, characterized in that: The step S3 specifically includes the following steps: S31: The spatial graph convolution layer aggregates the features of each intersection through the connection relationship and propagation delay between intersections. The formula is: Among them H l is the hidden state of the lth layer, k is the size of the convolution kernel, D is the global distance matrix, which represents the distance between any two intersections, A is the global adjacency matrix, Λ is the attenuation coefficient matrix, is the learnable weight of layer l, σ is the activation function (ReLU); S32: The temporal convolution layer extracts the temporal pattern of sudden changes in traffic flow data through one-dimensional convolution operations, and then confirms the flow changes at each intersection. Its formula is: Where: Δt is the acquisition time interval, j is the convolution kernel size, f(t) is the global flow vector at time t, σ is the activation function, W j is the weight matrix of the convolutional layer; S33: Combine the spatial graph convolution layer and the temporal convolution layer to form a spatiotemporal graph convolution network: S34: After the convolution operation of the spatiotemporal graph convolutional network, the final traffic flow prediction is obtained:
Citation Information
Cited By
Abnormal traffic flow prediction method and system based on multi-scale spatial-temporal feature fusion
CN121583097A