A traffic flow prediction method based on multi-level feature representation of dynamic memory graph
By adopting a multi-level feature representation method based on dynamic memory graph in traffic flow prediction, the limitations of existing methods when dealing with long time series and complex features are solved, efficient traffic flow prediction is achieved, and prediction performance and practicality are improved.
Patent Information
- Application Number
- CN202411701832.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2044-11-26
AI Technical Summary
The existing traffic flow prediction methods have limitations when dealing with long time series and complex features, and the computational complexity based on the Transformer model is high, and real-time prediction applications are limited.
Using a multi-level feature representation method based on dynamic memory graph, a multi-level feature extraction unit for static detector graph and dynamic memory graph are constructed, and a multi-step feature extraction and fusion of time series is combined with U-Net, and a LSTGM spatiotemporal feature dynamic model is constructed to predict traffic flow.
It improves prediction performance, reduces computational complexity, optimizes feature fusion strategies, adapts to complex environments, improves the practicality and applicability of the model, and helps traffic management departments to predict traffic flow changes more accurately and alleviate traffic congestion.
Smart Images

Figure CN119203062B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent transportation technology, and in particular to a traffic flow prediction method based on multi-level feature representation of a dynamic memory graph. Background Art
[0002] Traffic flow prediction is a core issue in intelligent transportation systems and is of great significance for improving traffic management, alleviating traffic congestion, and improving travel efficiency. With the increasing amount of traffic data, how to effectively predict traffic flow has become the focus of current research. Existing traffic flow prediction methods are mainly divided into parametric models based on traditional statistical models and non-parametric models represented by machine learning and deep learning.
[0003] Statistical models are widely used in traffic flow forecasting, usually relying on historical data and time series analysis methods. Common statistical models include historical average method (HA), autoregressive integrated moving average model (ARIMA), structural time series model (STM) and Kalman filter (KF). These methods are more effective in dealing with short-term forecasts, especially the simple and easy-to-implement HA and ARIMA models. However, these methods are insufficient in dealing with emergencies and non-periodic changes, and they are highly dependent on a large amount of historical data. The KF model is more effective in real-time forecasting, especially when dealing with uncertainty and noisy data, but its long-term forecasting effect is limited. In general, statistical models are difficult to model complex and nonlinear traffic flow data, especially when dealing with traffic flows with strong randomness and complex spatiotemporal dependencies, and their prediction ability is insufficient.
[0004] With the development of data-driven methods, machine learning technology has gradually become one of the main means of traffic flow prediction. Machine learning methods such as support vector regression (SVR), random forest, and K nearest neighbor algorithm (KNN) predict future traffic flow by learning patterns in historical traffic data. SVR transforms nonlinear regression problems into linear regression problems through kernel functions, while random forest uses multiple features to integrate different decision trees to predict traffic flow, and KNN predicts by matching similar historical observations. Although these methods have certain nonlinear modeling capabilities, they still have limitations in capturing complex spatiotemporal dependencies.
[0005] In order to overcome the shortcomings of statistical models and traditional machine learning methods, deep learning methods have gradually been introduced into the field of traffic flow prediction. Convolutional neural networks (CNN) and recurrent neural networks (RNN) are the two most popular types of deep learning models. CNN can effectively capture the spatial features in the traffic network and is used to extract the correlation information between different road sections, while RNN and its variants such as LSTM / GRU are good at processing time series data and can capture dynamic changes in traffic flow data. Combining the advantages of these two models, researchers have proposed a hybrid model based on CNN and RNN to simultaneously process spatial and temporal dependencies in traffic data. These models have performed well in practical applications and are particularly suitable for traffic flow prediction in complex urban road networks.
[0006] In addition, hybrid models based on deep learning are also emerging. For example, the combined model based on deep belief network (DBN) and support vector regression (SVR) combines the advantages of different models through hierarchical feature extraction and regression prediction. Another study combines ARIMA and LSTM, using the ARIMA model to capture the linear characteristics of traffic flow, and the LSTM model to process nonlinear characteristics, forming a prediction framework that takes into account both linear and nonlinear characteristics.
[0007] The extraction and fusion of key features are the key to improving the performance of traffic flow prediction models. For example, the ARMA model achieves effective data processing by decomposing time series into trends, cycles, seasonality, and random factors. The combination of integrated empirical mode decomposition (EEMD) and minimum redundancy maximum relevance feature selection (mRMR) can further decompose traffic flow data and extract important features, and then train them through a deep belief network (DBN) to ultimately output accurate prediction results. In addition, the DBN model formed by multiple restricted Boltzmann machines (RBMs) also achieves more accurate traffic flow prediction by extracting features layer by layer and combining support vector regression (SVR).
[0008] In summary, existing traffic flow prediction methods have many shortcomings when facing complex nonlinear spatiotemporal dependencies, including high model complexity, insufficient feature extraction, and the trade-off between prediction accuracy and efficiency. Therefore, a traffic flow prediction method based on multi-level feature representation of dynamic memory graph is needed to solve the above problems. Summary of the invention
[0009] The content of the present invention is to provide a traffic flow prediction method based on multi-level feature representation of dynamic memory graph, which can solve the limitations of existing models in processing long time series and complex features, and overcome the problems of high computational complexity and limited real-time prediction application based on Transformer model.
[0010] A traffic flow prediction method based on multi-level feature representation of a dynamic memory graph according to the present invention comprises the following steps:
[0011] Step 1: Data collection and preprocessing: including data set division, normalization processing, and construction of static detector map A to obtain historical traffic data characteristics on the road;
[0012] Step 2: Construct a dynamic memory graph downsampling feature extraction unit LSTGM based on graph convolution and LSTM: In the feature extraction process at each level, the static detector graph A and the multi-scale time features X at different times are combined as the input of the dynamic memory graph downsampling feature extraction unit LSTGM based on LSTM, and a graph convolution operation is performed to extract spatiotemporal features at the same time;
[0013] Step 3: Multi-step feature extraction and fusion of time series based on U-Net: U-Net is used to perform multi-level extraction of traffic flow data, and then the extracted features are spliced using a multi-stage fusion module to represent the prediction;
[0014] Step 4: Construct a LSTGM spatiotemporal feature dynamics model based on U-Net:
[0015] By connecting the feature extraction model with the feature fusion model, a U-Net-based LSTGM spatiotemporal feature dynamics model is constructed to mine the spatiotemporal features of traffic flow data and predict traffic flow at future moments; the feature extraction model includes LSTGM, convolution layer, and maximum pooling layer; the feature fusion model includes convolution layer, upsampling layer, and regression layer;
[0016] Step 5: Prediction of future traffic status: Use the model constructed in step 4 to predict traffic flow at different times in the future, and input historical time data to generate predictions based on the U-Net dynamic memorable graph;
[0017] Step 6: Establish a prediction model according to steps 1 to 5, use the stochastic gradient descent algorithm, continuously optimize the model hyperparameters through training, and obtain a traffic status prediction solution.
[0018] Preferably, in step 1, the data set is divided and normalized as follows:
[0019] The missing values of the original data are filled by linear interpolation; time and traffic flow are selected as input features for traffic state prediction. Assuming that the time features of all nodes in the road network can be obtained, the data set will be divided into training set and test set according to the time order;
[0020] The Min-Max normalization method was applied to normalize the dataset.
[0021] Preferably, in step 1, the static detector map A is constructed as follows:
[0022] The road network distance between detectors is calculated and a weighted adjacency matrix of nodes is established to represent the static detector graph A:
[0023]
[0024] In the formula, side a n,n′ The weight of d n,n′ Decision;d n,n′ represents the road network distance between detectors n and n′; ∈ is the standard deviation of the distance, δ is the threshold, and exp(·) represents the natural exponential function.
[0025] Preferably, in step 2, the details are as follows:
[0026] Assume that the feature data of the node is X n ∈RN, R represents a real number, N is the number of nodes, and the constructed static detector graph A and the feature data Xn transformed by the linear layer are input into LSTGM for spatiotemporal feature mining;
[0027] The calculation formula for downsampling feature extraction based on LSTGM is as follows:
[0028]
[0029] i t =σ(H t-1 W i ) (3)
[0030]
[0031] g t =tanh(H t-1 W g ) (5)
[0032] In formulas (2), (3), (4), and (5), represents the convolution operation, σ(·) represents the sigmoid activation function, and f t 、i t , o t They are forget gate, input gate and output gate, g t is the update memory of all nodes, W f , W i , W o , W g are the weight coefficients of their respective hidden layer units, t represents the tth LSTGM unit, H t-1 Represents the output of the previous LSTGM unit. Based on this, the current memory cell state Ct and the hidden state H t It is expressed as:
[0033]
[0034] H t =tanh(C t )(⊙o t (7)
[0035] In formula (6) and (7), ⊙ is the element-by-element multiplication, C t-1 is the memory cell state of the previous moment. In order to speed up the memory update, i t and g t Perform graph convolution operations;
[0036] The output Z of the i-th layer LSTGM i It is expressed as:
[0037]
[0038] In formula (8), i represents the i-th layer, They represent the output of the last moment in the historical data of the input LSTGM unit, the state of the memory cell, and the output gate respectively.
[0039] Preferably, in step 3, the specific steps of multi-step feature extraction of time series based on U-Net are as follows:
[0040] The multi-level extraction and downsampling method is used to divide the data into 4 layers. MaxPool is used to extract trend features. The original input data is set to x. After multiple modules, four layers of input data are formed: multi-scale time feature X = [x1, x2, x3, x4]:
[0041] x1=x (9)
[0042] x2=MaxPool(x1) (10)
[0043] x3=MaxPool(x2) (11)
[0044] x4=MaxPool(x3) (12)
[0045] In the formula, x i Represents the input data of the i-th layer, and MaxPool is the maximum pooling layer function.
[0046] Preferably, in step 3, the specific steps of constructing the multi-stage fusion module are as follows:
[0047] Through the time data U-Net module, a multi-scale time feature X is formed. In order to make full use of the multi-step features of the time series, the output Z of the current feature extraction layer is used. i And the predicted value y′ of the previous layer feature fusion amplified by the upsampled feature i-1 After splicing, the final feature fusion of the current layer is realized through the convolution layer, and the fusion feature value is y i , the fusion feature is expressed as Y = [y1, y2, y3, y4], and the specific formula is as follows:
[0048] y i-1 =cat(y′ i , Z i-1 ) (13)
[0049] y′ i-1 =Conv(y i-1 ) (14)
[0050] cat represents feature concatenation, and Conv represents convolution function.
[0051] Preferably, in step 4, the specific steps of modeling the LSTGM spatiotemporal feature dynamics model based on U-Net are as follows:
[0052] Data x i First, it is transformed by the Conv layer convolution to become The static detector map A and Input them into LSTGM for spatiotemporal feature extraction and output Z i ,in Represents the data features of the first moment of the historical time series input to LSTGM at the i-th layer, and finally outputs the extracted features x through the maximum pooling function i+1 , x i+1 Then input it to the next Conv layer and repeat the above operation to loop until all U-Net layers are traversed. The formula is described as:
[0053]
[0054] x i+1 =MaxPool(Z i ) (17)
[0055] The extracted features are upsampled, amplified and fused. First, the feature Z extracted from each layer i-1 Fusion value y′ with the feature of the previous layer i The upsampled values are concatenated, and the concatenated result y i-1 Perform Conv to y′ i-1 , get the feature fusion value y′ of the current layeri-1 , and then loop through all U-Net layers. When performing the last layer of feature fusion, the fused value y′1 is input into the regression layer to obtain the final prediction value Y of the LSTGM spatiotemporal feature dynamics model based on U-Net. pre , the formula is described as follows:
[0056] Y pre =Regression(y′1) (18)
[0057] Regression represents the linear layer's regression prediction of the final result.
[0058] The beneficial effects of the present invention are as follows:
[0059] 1) Improve prediction performance: By integrating graph processing technology and LSTM’s downsampling feature extraction unit, as well as multi-level feature extraction and fusion based on U-Net, the feature extraction process is optimized to ensure that the spatiotemporal characteristics of traffic flow data can be effectively captured.
[0060] 2) Reduce computational complexity: To address the high computational overhead of existing Transformer-based models, the present invention provides a more efficient architecture to improve the applicability of real-time prediction.
[0061] 3) Optimize feature fusion strategy: Through the multi-stage fusion module, the effect of feature fusion is improved, the correlation between trend and seasonal characteristics is ensured, and the overall prediction accuracy is improved.
[0062] 4) Adaptability to complex environments: The present invention can operate effectively in complex and changing traffic environments, has strong generalization capabilities, and improves the practicality and applicability of the model.
[0063] 5) Through the improved traffic prediction method, the present invention helps traffic management departments to more accurately predict changes in traffic flow, take measures in advance to alleviate traffic congestion, and improve road utilization efficiency; it can not only reduce vehicle waiting time and fuel consumption, but also reduce carbon emissions and promote the development of sustainable urban transportation. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Figure 1 It is a flow chart of a traffic flow prediction method based on multi-level feature representation of a dynamic memory graph in an embodiment. DETAILED DESCRIPTION
[0065] In order to further understand the content of the present invention, the present invention is described in detail in conjunction with the accompanying drawings and embodiments. It should be understood that the embodiments are only for explaining the present invention and are not intended to limit it.
[0066] Example
[0067] like Figure 1 As shown, this embodiment provides a traffic flow prediction method based on multi-level feature representation of a dynamic memory graph, which includes the following steps:
[0068] Step 1: Data collection and preprocessing: including data set division, normalization processing, and construction of static detector map A to obtain historical traffic data characteristics on the road;
[0069] Step 2: Construct a dynamic memory graph downsampling feature extraction unit (LSTGM) based on graph convolution and LSTM: In the feature extraction process at each level, the static detector graph A is combined with X at different times as the input of the dynamic memory graph downsampling feature extraction unit LSTGM based on LSTM, and a graph convolution operation is performed to extract spatiotemporal features simultaneously.
[0070] Step 3: Multi-step feature extraction and fusion of time series based on U-Net: U-Net is used to perform multi-level extraction of traffic flow data, and then the extracted features are spliced using a multi-stage fusion module to represent the prediction;
[0071] Step 4: Construct a LSTGM spatiotemporal feature dynamics model based on U-Net:
[0072] By connecting the feature extraction model with the feature fusion model, a U-Net-based LSTGM spatiotemporal feature dynamics model is constructed to mine the spatiotemporal features of traffic flow data and predict traffic flow at future moments; the feature extraction model includes LSTGM, convolution layer, and maximum pooling layer; the feature fusion model includes convolution layer, upsampling layer, and regression layer;
[0073] Step 5: Prediction of future traffic status: Use the model constructed in step 4 to predict traffic flow at different times in the future, and input historical time data to generate predictions based on the U-Net dynamic memorable graph;
[0074] Step 6: Establish a prediction model according to steps 1 to 5, use the stochastic gradient descent algorithm, continuously optimize the model hyperparameters through training, and obtain a traffic status prediction solution.
[0075] In step 1, the data set is divided and normalized as follows:
[0076] The missing values of the original data are filled by linear interpolation; time and traffic flow are selected as input features for traffic state prediction. Assuming that the time features of all nodes in the road network can be obtained, the data set will be divided into training set and test set according to the time order;
[0077] The Min-Max normalization method was applied to normalize the dataset.
[0078] In step 1, the construction of the static detector map A is as follows:
[0079] The road network distance between detectors is calculated and a weighted adjacency matrix of nodes is established to represent the static detector graph A:
[0080]
[0081] In the formula, side a n,n′ The weight of d n,n′ Decision;d n,n′ represents the road network distance between detectors n and n′; ∈ is the standard deviation of the distance, δ is the threshold, and exp(·) represents the natural exponential function.
[0082] In step 2, the details are as follows:
[0083] Assume that the feature data of the node is X n ∈RN, R represents a real number, N is the number of nodes, and the constructed static detector graph A and the feature data Xn transformed by the linear layer are input into LSTGM for spatiotemporal feature mining;
[0084] The calculation formula for downsampling feature extraction based on LSTGM is as follows:
[0085]
[0086] i t =σ(H t-1 W i ) (3)
[0087]
[0088] g t =tanh(H t-1 W g ) (5)
[0089] In formulas (2), (3), (4), and (5), represents the convolution operation, σ(·) represents the sigmoid activation function, and f t 、i t , o t They are forget gate, input gate and output gate, g t is the update memory of all nodes, W f , W i , W o , W g are the weight coefficients of their respective hidden layer units, t represents the tth LSTGM unit, H t-1 Represents the output of the previous LSTGM unit. Based on this, the current memory cell state C tand the hidden state H t It is expressed as:
[0090]
[0091] H t =tanh(C t )(⊙o t (7)
[0092] In formula (6) and (7), ⊙ is the element-by-element multiplication, C t-1 is the memory cell state of the previous moment. In order to speed up the memory update, i t and g t Perform graph convolution operations;
[0093] The output Z of the i-th layer LSTGM i It is expressed as:
[0094]
[0095] In formula (8), i represents the i-th layer, They represent the output of the last moment in the historical data of the input LSTGM unit, the state of the memory cell, and the output gate respectively.
[0096] In step 3, the specific steps of multi-step feature extraction of time series based on U-Net are as follows:
[0097] The multi-level extraction and downsampling method is used to divide the data into 4 layers. MaxPool is used to extract trend features. The original input data is set to x. After multiple modules, four layers of input data are formed: multi-scale time feature X = [x1, x2, x3, x4]:
[0098] x1=x (9)
[0099] x2=MaxPool(x1) (10)
[0100] x3=MaxPool(x2) (11)
[0101] x4=MaxPool(x3) (12)
[0102] In the formula, x i Represents the input data of the i-th layer, and MaxPool is the maximum pooling layer function.
[0103] In step 3, the specific steps for constructing the multi-stage fusion module are as follows:
[0104] Through the time data U-Net module, a multi-scale time feature X is formed. In order to make full use of the multi-step features of the time series, the output Z of the current feature extraction layer is used. iAnd the predicted value y′ of the previous layer feature fusion amplified by the upsampled feature i-1 After splicing, the final feature fusion of the current layer is realized through the convolution layer, and the fusion feature value is y i , the fusion feature is expressed as Y = [y1, y2, y3, y4], and the specific formula is as follows:
[0105] y i-1 =cat(y′ i , Z i-1 ) (13)
[0106] y′ i-1 =Conv(y i-1 ) (14)
[0107] cat represents feature concatenation, and Conv represents convolution function.
[0108] In step 4, the specific steps of modeling the LSTGM spatiotemporal feature dynamics model based on U-Net are as follows:
[0109] Datax i First, it is transformed by the Conv layer convolution to become The static detector map A and Input them into LSTGM for spatiotemporal feature extraction and output Z i ,in Represents the data features of the first moment of the historical time series input to LSTGM at the i-th layer, and finally outputs the extracted features x through the maximum pooling function i+1 , x i+1 Then input it to the next Conv layer and repeat the above operation to loop until all U-Net layers are traversed. The formula is described as:
[0110]
[0111] x i+1 =MaxPool(Z i ) (17)
[0112] The extracted features are upsampled, amplified and fused. First, the feature Z extracted from each layer i-1 Fusion value y′ with the feature of the previous layer i The upsampled values are concatenated, and the concatenated result y i-1 Perform Conv to y′ i-1 , get the feature fusion value y′ of the current layer i-1, and then loop through all U-Net layers. When performing the last layer of feature fusion, the fused value y′1 is input into the regression layer to obtain the final prediction value Y of the LSTGM spatiotemporal feature dynamics model based on U-Net. pre , the formula is described as follows:
[0113] Y pre =Regression(y′1) (18)
[0114] Regression represents the linear layer's regression prediction of the final result.
[0115] experiment
[0116] In order to evaluate the effect of this embodiment, the following commonly used traditional and cutting-edge prediction methods are used as benchmark comparison models:
[0117] (a) HA: (Historical Average) Historical average is a basic forecasting model that estimates future traffic flow by averaging historical data. It calculates the average of past observations over a specific period, providing a fast and effective benchmark for forecasting.
[0118] (b) SVR: (Support Vector Regression) Support vector regression is a robust regression method derived from support vector machine (SVM). By mapping input features to a higher dimensional space, SVR enhances the model's ability to understand complex patterns, improves prediction accuracy and noise resistance.
[0119] (c) T-GCN: This model combines GCN and GRU, extracting spatial features using graph convolutional layers and capturing temporal dependencies through gated recurrent units.
[0120] (d) STGCN: This method stacks graph convolutional layers with gated one-dimensional convolutional networks for spatiotemporal correlation modeling and traffic prediction.
[0121] (e) A-GCRNN: This method combines Attention and GCRNN in an autoencoder architecture for flow prediction.
[0122] (f) Ada-stnet: This model combines an adaptive graph convolutional network with a long short-term memory network to capture the relationship between traffic flows on different road sections through a dynamic graph structure and model the temporal dependency of traffic flow changes.
[0123] (g) Trafficformer: A traffic flow prediction model based on the Transformer architecture, which uses the self-attention mechanism to capture the long-term dependencies and complex spatiotemporal relationships of traffic flow.
[0124] GMU-net: The model proposed for this embodiment, namely Graph MemoryU-net, is a multi-level feature representation network with a dynamic memory graph.
[0125] These methods aim to mine the spatiotemporal dependencies of traffic flow data and then make predictions on the complete graph.
[0126] Furthermore, the proposed traffic flow prediction model based on the dynamic memorable graph of U-Net is trained. The main modules of the proposed model structure include convolutional layer, LSTGM layer, maximum pooling layer and Linear layer. Firstly, the spatiotemporal features of the data are mined through linear connection layer and LSTGM based on the real data set, and then the model parameters are reduced by the maximum pooling function to realize multi-layer operation on the data to extract trend information of different depths; secondly, through multi-step extraction, the trend features of higher depth are integrated into the features of lower level. On this basis, the extracted features are upsampled to amplify the features, and they are fused with the features of the same level dimension through connection operation. Finally, the output of the linear layer is gradually fused, and finally the data group is formed through the regression layer to replace the original data, so as to realize the model prediction.
[0127] All neural network-based methods were implemented in Python using Pytorch 1.8.1 and trained using the Adam optimizer with learning rate annealing. Four datasets PeMSD3, PeMSD4, PeMSD7, and PeMSD8 were used for performance analysis, with the epoch set to 100 and the patience value set to 10. The hyperparameters of all models were selected by a grid search strategy on the validation set, and the mean absolute error (MAE) and root mean square error (RMSE) were used as evaluation metrics.
[0128] Finally, the experimental effect is evaluated. This embodiment mainly conducts the following three experiments to demonstrate the technical effect of the present invention:
[0129] (A) Overall prediction performance of the model
[0130] In order to analyze the impact of the model on the short-term and long-term, the traffic flow in the next 15, 30 and 45 minutes is predicted on four data sets to compare the effectiveness of the model proposed in the present invention. The results show that with the increase of the prediction step, MAE and RMSE will gradually increase. In the experimental results comparing the four data sets, the model proposed in the present invention performs better than most other models in MAE and RMSE in each prediction time period, especially in PeMSD3 and PeMSD4 data sets, with MAE of 14.37 and 15.28 respectively, showing excellent prediction ability. Although the performance of this model is still relatively outstanding in PeMSD7 and PeMSD8, the gap with other models is relatively narrowed, especially A-GCRNN and Ada-stnet also perform well in short-term prediction. Overall, this model has demonstrated its strong robustness and accuracy in different data sets and time periods, and is a powerful tool for traffic flow prediction.
[0131] The experimental results are shown in Table 1:
[0132] Table 1 Prediction performance of different methods on four datasets
[0133]
[0134] (B) Validity test of relevant modules
[0135] To analyze the effectiveness of the relevant modules that constitute the model, we compared U-Net with three variants, namely Linear-LSTGM, Conv1d-LSTGM and Linear-U-Net, under the PeMSD8 dataset. Linear-LSTGM replaces the Linear part of the model proposed by the present invention with a linear layer, and conducts a comparative experiment on the hyperparameter kenel-size value of the convolutional layer; Linear-U-Net refers to the traffic flow prediction model in which the LSTGM layer and the convolutional layer in the original model are removed. The experimental results are shown in Table 2:
[0136] Table 2 Validity test results of relevant modules
[0137]
[0138] From the results, we can see that for long-term prediction, the Conv1d module can increase the stability of the model and reduce the error, and the accuracy gradually improves as the convolution kernel increases.
[0139] (C) The impact of the number of LSTGM layers on prediction error
[0140] In order to analyze the impact of the number of LSTGM layers on the model prediction efficiency, different values of the number of LSTGM layers are taken to test the impact on the model prediction accuracy. It can be seen from Table 3 that when the number of layers increases, MAE and RMSE will gradually decrease. When the number of layers is reduced to 4, it reaches the minimum value. Later, MAE and RMSE increase with the increase of the number of layers. Therefore, when the number of LSTGM layers is 4, the model accuracy is the highest.
[0141] Table 3 The impact of the number of LSTGM layers on model prediction
[0142]
[0143] This embodiment uses the U-Net network to extract multi-level feature representation of time series and perform feature fusion, and uses the long short-term memory graph network (LSTGM) to construct fusion spatial features of dynamic graphs of different levels of features under different levels of features, which solves the limitations of existing models in processing long time series and complex features, and overcomes the high computational complexity and limited real-time prediction application problems based on the Transformer model. In addition, this embodiment focuses on the effectiveness of feature extraction and fusion, and strives to reduce computational overhead while ensuring prediction performance to meet the high efficiency requirements in practical applications.
[0144] The present invention and its embodiments are described schematically above, and the description is not restrictive. The drawings show only one embodiment of the present invention, and the actual structure is not limited thereto. Therefore, if a person skilled in the art is inspired by it and designs a structural method and an embodiment similar to the technical solution without creativity without departing from the purpose of the invention, they shall all fall within the protection scope of the present invention.
Claims
1. A traffic flow prediction method based on multi-level feature representation of dynamic memory graph, characterized by: The following steps are involved: Step 1: Data collection and preprocessing: including data set division, normalization processing, and construction of static detector map A to obtain historical traffic data characteristics on the road; Step 2: Construct a dynamic memory graph downsampling feature extraction unit LSTGM based on graph convolution and LSTM: In the feature extraction process at each level, the static detector graph A and the multi-scale time features X at different times are combined as the input of the dynamic memory graph downsampling feature extraction unit LSTGM based on LSTM, and a graph convolution operation is performed to extract spatiotemporal features at the same time; In step 2, the details are as follows: The characteristic data of the node is X n ∈R N , N is the number of nodes, and the constructed static detector graph A is compared with the feature data X transformed by the linear layer n Input them into LSTGM for spatiotemporal feature mining; The calculation formula for downsampling feature extraction based on LSTGM is as follows: I t =σ(H t-1 W i ) (3) g t =tanh(H t-1 W g ) (5) In formulas (2), (3), (4), and (5), represents the convolution operation, σ(·) represents the sigmoid activation function, and f t 、i t , o t They are forget gate, input gate and output gate, g t is the update memory of all nodes, W f , W i , W o , W g are the weight coefficients of the respective hidden layer units, H t-1 Represents the output of the previous LSTGM unit. Based on this, the current memory cell state C t and the hidden state H t It is expressed as: H t =tanh(C t )⊙o t (7) In formula (6) and (7), ⊙ is the element-by-element multiplication, C t-1 is the memory cell state of the previous moment. In order to speed up the memory update, i t and g t Perform graph convolution operations; The output Z of the i-th layer LSTGM i It is expressed as: In formula (8), i represents the i-th layer, They represent the output of the last moment in the historical data of the input LSTGM unit, the state of the memory cell, and the output gate respectively; Step 3: Multi-step feature extraction and fusion of time series based on U-Net: U-Net is used to perform multi-level extraction of traffic flow data, and then the extracted features are spliced using a multi-stage fusion module to represent the prediction; Step 4: Construct a LSTGM spatiotemporal feature dynamics model based on U-Net: By connecting the feature extraction model with the feature fusion model, a U-Net-based LSTGM spatiotemporal feature dynamics model is constructed to mine the spatiotemporal features of traffic flow data and predict traffic flow at future moments; the feature extraction model includes LSTGM, convolution layer, and maximum pooling layer; the feature fusion model includes convolution layer, upsampling layer, and regression layer; Step 5: Prediction of future traffic status: Use the model constructed in step 4 to predict traffic flow at different times in the future, and input historical time data to generate predictions based on the U-Net dynamic memorable graph; Step 6: Establish a prediction model according to steps 1 to 5, use the stochastic gradient descent algorithm, continuously optimize the model hyperparameters through training, and obtain a traffic status prediction solution.
2. The traffic flow prediction method based on multi-level feature representation of dynamic memory graph according to claim 1 is characterized by: In step 1, the data set is divided and normalized as follows: The missing values of the original data are filled by linear interpolation; time and traffic flow are selected as input features for traffic state prediction. Assuming that the time features of all nodes in the road network can be obtained, the data set will be divided into training set and test set according to the time order; The Min-Max normalization method was applied to normalize the dataset.
3. The traffic flow prediction method based on multi-level feature representation of dynamic memory graph according to claim 2 is characterized by: In step 1, the construction of the static detector map A is as follows: The road network distance between detectors is calculated and a weighted adjacency matrix of nodes is established to represent the static detector graph A: In the formula, side a n,n' The weight of d n,n' Decision;d n,n' represents the road network distance between detectors n and n'; ∈ is the standard deviation of the distance, δ is the threshold, and exp(·) represents the natural exponential function.
4. The traffic flow prediction method based on multi-level feature representation of dynamic memory graph according to claim 3 is characterized by: In step 3, the specific steps of multi-step feature extraction of time series based on U-Net are as follows: The multi-level extraction and downsampling method is used to divide the data into 4 layers. MaxPool is used to extract trend features. The original input data is set to x. After multiple modules, four layers of input data are formed: multi-scale time feature X = [x1, x2, x3, x4]: x1=x (9) x2=MaxPool(x1) (10) x3=MaxPool(x2) (11) x4=MaxPool(x3) (12) In the formula, x i Represents the input data of the i-th layer, and MaxPool is the maximum pooling layer function.
5. The traffic flow prediction method based on multi-level feature representation of dynamic memory graph according to claim 4 is characterized in that: In step 3, the specific steps for constructing the multi-stage fusion module are as follows: Through the time data U-Net module, a multi-scale time feature X is formed. In order to make full use of the multi-step features of the time series, the output Z of the current feature extraction layer is used. i And the predicted value y' of the previous layer feature fusion amplified by the upsampling feature i-1 After splicing, the final feature fusion of the current layer is realized through the convolution layer, and the fusion feature value is y i , the fusion feature is expressed as Y = [y1, y2, y3, y4], the specific formula is as follows: y i-1 =cat(y' i ,Z i-1 ) (13) and' i-1 =Conv(and i-1 ) (14) cat represents feature concatenation, and Conv represents convolution function.
6. The traffic flow prediction method based on multi-level feature representation of dynamic memory graph according to claim 5 is characterized in that: In step 4, the specific steps of modeling the LSTGM spatiotemporal feature dynamics model based on U-Net are as follows: Data x i First, it is transformed by the Conv layer convolution to become The static detector map A and Input them into LSTGM for spatiotemporal feature extraction and output Z i ,in Represents the data features of the first moment of the historical time series input to LSTGM at the i-th layer, and finally outputs the extracted features x through the maximum pooling function i+1 , x i+1 Then input it to the next Conv layer and repeat the above operation to loop until all U-Net layers are traversed. The formula is described as: x i+1 =MaxPool(Z i ) (17) The extracted features are upsampled, amplified and fused. First, the feature Z extracted from each layer i-1 Fusion value y' with the feature of the previous layer i The upsampled values are concatenated, and the concatenated result y i-1 Perform Conv to y' i-1 , get the feature fusion value y′ of the current layer i-1 , and in this way, all U-Net layers are traversed. When the last layer of feature fusion is performed, the obtained fusion value y'1 is input into the regression layer to obtain the final prediction value Y of the LSTGM spatiotemporal feature dynamics model based on U-Net. pre , the formula is described as follows: AND pre =Regression(y'1) (18) Regression represents the linear layer's regression prediction of the final result.
Citation Information
Patent Citations
Bridge damage identification method based on space-time diagram convolution attention
CN113011763A
Traffic flow prediction method based on U-shaped multi-scale space-time diagram convolutional network
CN116682271A