A traffic flow prediction method based on ISAA-VMD-GRU-RNN
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUAIYIN INSTITUTE OF TECHNOLOGY
- Filing Date
- 2023-12-12
- Publication Date
- 2026-08-07
AI Technical Summary
但是,深度学习算法在训练的过程中需要较长的时间和大量的计算资源,且模型的透明度较差,难以解释它们的决策
[0067]1、本发明考虑到样本数据的监测采集周期较长,测量设备、测量方法以及一些人为因素都有可能对数据带来一定的误差。提出ISAA-VMD对归一化后的数据先进性降维,然后进行高权重和低权重数据筛选,保证数据的准确性,最后对合适适应度值的解进行输出,提高模型的综合性能,避免模型受到超出范围的优劣解的影响从而导致模型陷入局部最优解,保证模型一定的稳定性,并且提高了模型的准确性。
Smart Images

Figure CN117912230B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of model prediction technology, and in particular to a traffic flow prediction method based on ISAA-VMD-GRU-RNN. Background Technology
[0002] Traffic flow forecasting refers to predicting traffic flow patterns on roads and transportation networks by collecting, analyzing, and utilizing traffic data. This forecasting helps traffic managers, urban planners, and drivers better understand and address traffic congestion issues. The following section introduces the background of traffic flow forecasting, including its importance, application areas, and challenges.
[0003] Traffic flow forecasting helps traffic managers better plan transportation resources. Traffic congestion not only affects drivers' travel efficiency but also increases energy consumption and environmental pollution. By accurately forecasting traffic flow, traffic managers can rationally plan road and public transportation resources and optimize traffic signal timing, thereby improving traffic efficiency and reducing congestion. Traffic flow forecasting also helps optimize urban planning. Urban planners can use traffic flow forecasting to understand future travel demand and traffic bottlenecks, thus rationally planning roads, transportation facilities, and residential areas to ensure sustainable urban development. Traffic flow forecasting is also of great significance to drivers. Avoiding congested areas during peak hours and choosing appropriate travel times can reduce waiting time and fuel consumption, improving travel efficiency and comfort.
[0004] Traffic management is one of the main application areas of traffic flow forecasting. Traffic managers can improve traffic conditions by forecasting traffic flow to optimize intersection signal timing, provide real-time traffic information, and guide traffic flow. Urban planners use traffic flow forecasting results to plan roads, public transportation routes, parking facilities, and more to meet future traffic demands. Meanwhile, driver assistance systems can also use traffic flow forecasting to help drivers make better travel decisions. These systems can provide real-time traffic information to guide drivers in choosing the best routes and avoiding congested areas.
[0005] Traffic flow forecasting also faces several challenges. Collecting and processing large amounts of traffic data is a daunting task. It requires monitoring and recording data such as traffic flow, speed, and vehicle type on roads, and then processing and analyzing this data to generate accurate forecasts. Traffic flow forecasting is influenced by many uncertainties, such as weather conditions, special events (e.g., accidents, construction), and holidays. Changes in these factors can lead to discrepancies between actual traffic flow and forecasts.
[0006] Deep learning algorithms, a branch of machine learning, possess unique advantages in handling large-scale data. Through multi-layered neural network modeling, they can efficiently capture the features of input data and build accurate predictive models. In traffic flow prediction, deep learning algorithms mainly include convolutional neural networks, recurrent neural networks, and long short-term memory networks. These algorithms can start from the temporal and spatial characteristics of traffic flow, combining traffic flow prediction with factors such as time, weather, and population, and can adapt to both real-time and non-real-time large-scale data prediction. However, deep learning algorithms require a long training time and substantial computational resources, and their models have poor transparency, making it difficult to interpret their decisions. Summary of the Invention
[0007] In order to improve the accuracy of traffic flow prediction, as mentioned in the background art, this invention proposes a traffic flow prediction method based on ISAA-VMD-GRU-RNN.
[0008] The technical solution adopted in this invention is as follows: the invention provides a traffic flow prediction method, which first preprocesses the collected data, then trains the data using an improved RNN model, and finally evaluates the prediction results using the RMSE index evaluation model.
[0009] The data preprocessing proposed in this invention employs... Standardization is used to normalize the data, and the ISAA-VMD algorithm is proposed to denoise the normalized data and generate a two-dimensional feature matrix from the denoised data.
[0010] This invention proposes an ISAA-GRU-RNN model structure for data training and incorporates an attention mechanism to capture temporal changes.
[0011] To obtain accurate prediction results, this invention proposes to use the RMSE index to evaluate the model results.
[0012] Please refer to the following steps:
[0013] Step 1: The data sources for this invention include highway ETC gantry transaction data and map software crawled data. Before analyzing the data, it is first normalized to eliminate the influence of different indicator units.
[0014] This invention adopts The standardization method maps the raw data to intervals through linear transformation. superior, The calculation formula for the standardization method is as follows:
[0015]
[0016] in, The values are after normalization. This is the original data; These are the minimum and maximum values of sample data within the same indicator;
[0017] Finally, the normalized traffic flow data was obtained.
[0018] The variational mode decomposition (VMD) algorithm is used to classify the data according to its features, and the ISSA algorithm is used to optimize the key parameters of the VMD algorithm, thereby improving the overall performance of the model, avoiding the model from getting trapped in local optima, making the model have a certain degree of stability, and improving the accuracy of model prediction.
[0019] Variational Mode Decomposition (VMD) algorithm decomposes traffic flow data into... The expression for decomposing the data for each IMF category is as follows:
[0020]
[0021] in, For the first in traffic flow data One IMF feature component; For the first The IMF characteristic components at time... The amplitude at that time.
[0022] The key parameters of the VMD algorithm are analyzed using the Improved Sparrow Search Algorithm (ISSA). Optimization is performed. The sparrow population in the ISSA algorithm. There are explorers, predators, and vigilants. Explorers are responsible for searching for the optimal individual; once the explorer finds the optimal individual, the predator preys on it; and vigilants are responsible for monitoring the surrounding area to avoid getting trapped in the optimal solution. During the denoising process of the ISSA feature matrix, the explorer's position is updated as follows:
[0023]
[0024] in, For a moment The number of updates; For data as time goes by Updated to the latest version The next time A sparrow; This represents the maximum number of iterations. and It is a random number; and These are the warning value and the safety threshold, respectively. for 1-dimensional unit vector;
[0025] The predator's location has been updated as follows:
[0026]
[0027] in, For the first The worst solution in the next iteration; For the first The optimal dimension in which the explorer is located in the next iteration; for 3D matrix ;
[0028] The location of the vigilant has been updated as follows:
[0029]
[0030] in, For the first The optimal solution in the next iteration; The fitness value of the solution ( The fitness value of the optimal solution. (The fitness value of the worst solution); and It is a random number; A random constant, and sufficiently small;
[0031] Finally, a two-dimensional feature matrix containing time and weather information is constructed based on the classified traffic flow data, as shown below:
[0032]
[0033] in, for Traffic flow data at any given time; For the first Target station exist Traffic flow data at any given time; For the first Target station In the current time period Statistical traffic flow data at specific times; for Real-time weather data; For the first Weather attributes exist The amount of data at any given moment; Weather attribute In the current time period Statistical weather data at any given time; For window size;
[0034] Step 3: In the traffic flow prediction process, the GRU algorithm is used to improve the RNN training model. GRU's reset gate... The output of the previous hidden state information in the RNN model is controlled to determine the hidden state at the previous time step. The information that can be passed to the hidden candidate state is calculated as follows:
[0035]
[0036] This is the input for the current moment; The output of the previous moment; To reset the weight matrix of the gate; For bias terms; for Activation function Reset gate input ,when When, it means that the hidden information from the previous moment is completely preserved. When this happens, it means that the information hidden in the previous moment has been completely lost;
[0037]
[0038] To update the weight matrix of the gate; For bias terms; update their output ,when When, it means that the information is completely preserved. When this happens, it means the information has been completely lost;
[0039]
[0040] in, This is the weight matrix; For bias terms;
[0041] in, .
[0042] The output of the improved RNN algorithm is as follows:
[0043]
[0044] in, Represents the first in the input data sequence One element; In order to be in The hidden state at any given moment; for Output at any moment; and This is the weight matrix; It is the bias vector; for Activation function; The activation function for the output layer;
[0045] The output results are weighted and summed using the following formula:
[0046]
[0047] in, Time period The weights; This is the previous hidden state;
[0048] Through with The comparison yields the following calculation formula:
[0049]
[0050] in, Time period The output; The calculation formula is as follows:
[0051]
[0052] in, The weights are random. for transpose;
[0053] Preserve its sequence information, last time period Output The calculation formula is as follows:
[0054]
[0055] The ISAA algorithm was used to define the objective function and fitness function of the improved RNN model. The root mean square error of the improved RNN model's output was used as the objective function, and its value was used as the fitness value. The formula for calculating the objective function is as follows:
[0056]
[0057] in, This represents the number of iterations. Input data; The output of the improved RNN model; To improve the learning efficiency of RNN models; To reset the number of doors; This refers to the number of hidden doors.
[0058] The fitness function is calculated using the following formula:
[0059]
[0060] The ISAA algorithm is used to analyze the improved RNN model. , , The parameters are globally optimized to obtain the optimal parameter values; the optimal parameters obtained are then input into the RNN model to construct the prediction model.
[0061] Finally, the preprocessed data is input for training, and the prediction results are obtained.
[0062] Step 4: This invention proposes to use the RMSE index to evaluate the model results.
[0063] The RMSE indicator is calculated using the following formula:
[0064]
[0065] in, The actual value; This is a predicted value; This represents the sample size.
[0066] The beneficial effects of this invention are:
[0067] 1. This invention considers the long monitoring and collection cycle of sample data, and the potential for errors due to measurement equipment, methods, and human factors. It proposes ISAA-VMD to perform advanced dimensionality reduction on normalized data, followed by high-weight and low-weight data filtering to ensure accuracy. Finally, it outputs solutions with appropriate fitness values, improving the overall performance of the model, preventing it from being affected by out-of-range good or bad solutions that could lead to local optima, ensuring model stability, and improving accuracy.
[0068] 2. This invention proposes to optimize the RNN model structure using GRU. Unlike conventional feedforward neural networks, the hidden layers of RNNs not only receive input data but also the hidden state from the previous time step as input, giving RNNs memory and enabling them to model sequential data. The ISAA algorithm is used to find the optimal solution for the reset gate, hidden gate, and rest efficiency in the RNN model. While preserving the performance of the RNN model, the number of model parameters can be reduced to a large extent, thus improving training efficiency. Attached Figure Description
[0069] Figure 1 A system flowchart for a traffic flow prediction method based on ISAA-VMD-GRU-RNN, provided for an embodiment of the present invention;
[0070] Figure 2 This is a flowchart of the data preprocessing process;
[0071] Figure 3 This invention proposes a network topology diagram for optimizing the RNN model structure using GRU; Detailed Implementation
[0072] The present invention and its reverse engineering will be further described below with reference to the accompanying drawings in the examples. The following examples provide a detailed and complete description of the technical solutions of the present invention, but do not limit the invention in any way. Based on the present invention, several optimizations and improvements can be made by those skilled in the art without making other inventive steps. All of the above fall within the scope of protection of the present invention.
[0073] A traffic flow prediction method based on ISAA-VMD-GRU-RNN, the specific steps of which are as follows:
[0074] Step 1: Use the trained model to predict traffic flow in the target area.
[0075] This invention collects ETC transaction data obtained from ETC gantries on highways and distance data of various road segments crawled by mobile map software to generate highway gantry topology data.
[0076] The collected data includes information such as time and weather, collected every 15 minutes, with 30,000 data points of each type. Of the collected data, 20,000 data points were used for model training, and 10,000 data points were used for model validation on the test set.
[0077] To ensure the reliability of the prediction results of this invention, the traffic flow data is normalized before analysis to eliminate the influence of different indicator units. This invention employs... The standardization method maps the raw data to intervals through linear transformation. superior, The calculation formula for the standardization method is as follows:
[0078]
[0079] in, These are the values after normalization. This is the original data; These are the minimum and maximum values of the sample data within the same indicator.
[0080] Considering the long monitoring and collection period of sample data, measurement equipment, measurement methods, and some human factors may all introduce certain errors into the data. This invention uses the Variational Mode Decomposition (VMD) algorithm to classify the data according to its time and weather characteristics, and uses the ISSA algorithm to optimize the key parameters of the VMD algorithm, thereby improving the overall performance of the model, avoiding the model from getting trapped in local optima, making the model more stable, and improving the accuracy of model predictions.
[0081] Variational Mode Decomposition (VMD) algorithm decomposes traffic flow data into... The expression for decomposing the data for each IMF category is as follows:
[0082]
[0083] in, For the first in traffic flow data One IMF feature component; For the first The IMF characteristic components at time... The amplitude at that time.
[0084] The key parameters of the VMD algorithm are analyzed using the Improved Sparrow Search Algorithm (ISSA). Optimization is performed. The sparrow population in the ISSA algorithm. There are explorers, predators, and vigilants. Explorers are responsible for searching for the optimal individual; once the explorer finds the optimal individual, the predator preys on it; and vigilants are responsible for monitoring the surrounding area to avoid getting trapped in the optimal solution. During the denoising process of the ISSA feature matrix, the explorer's position is updated as follows:
[0085]
[0086] in, For a moment The number of updates; For data as time goes by Updated to the latest version The next time A sparrow; This represents the maximum number of iterations. and It is a random number; and These are the warning value and the safety threshold, respectively. for 1-dimensional unit vector;
[0087] The predator's location has been updated as follows:
[0088]
[0089] in, For the first The worst solution in the next iteration; For the first The optimal dimension in which the explorer is located in the next iteration; for 3D matrix ;
[0090] The location of the vigilant has been updated as follows:
[0091]
[0092] in, For the first The optimal solution in the next iteration; The fitness value of the solution ( The fitness value of the optimal solution. (The fitness value of the worst solution); and It is a random number; A random constant, and sufficiently small;
[0093] Finally, a two-dimensional feature matrix containing time and weather information is constructed based on the classified traffic flow data, as shown below:
[0094]
[0095] in, for Traffic flow data at any given time; For the first Target station exist Traffic flow data at any given time; For the first Target station In the current time period Statistical traffic flow data at specific times; for Real-time weather data; For the first Weather attributes exist The amount of data at any given moment; Weather attribute In the current time period Statistical weather data at any given time; This refers to the window size.
[0096] The preprocessing flow for the above data is as follows:
[0097] Step 1: Normalize the collected data;
[0098] Step 2: Use the VMD algorithm to classify the normalized data;
[0099] Step 3: Use the ISSA algorithm to evaluate the key parameters in the VMD algorithm. To perform optimization;
[0100] Step 4: Data iteration, compare the fitness values of the best and worst solutions, and continuously update the optimal fitness value;
[0101] Step 5: Iterate until the maximum algebraic number is reached;
[0102] Step 6: Generate a two-dimensional feature matrix based on the appropriate fitness values output;
[0103] Step 2: In the process of traffic flow prediction, the GRU algorithm is used to improve the RNN training model.
[0104] RNN training models utilize a recurrent network structure to model the temporal information within the data. An RNN training model is represented as follows:
[0105]
[0106] in, It is a nonlinear function; Represents the weight matrix; The hidden layer matrix; for and The mapping matrix between them. This is the hidden state from the previous moment; Hide the current state.
[0107] Then, the two-dimensional feature matrix containing time and weather information is input into the RNN model for training, and the GRU reset gate is used. The output of the previous hidden state information in the RNN model is controlled to determine the hidden state at the previous time step. The information that can be passed to the hidden candidate state is calculated as follows:
[0108]
[0109] This is the input for the current moment; The output of the previous moment; To reset the weight matrix of the gate; For bias terms; for Activation function Reset gate input ,when When, it means that the hidden information from the previous moment is completely preserved. When this happens, it means that the information hidden in the previous moment has been completely lost;
[0110]
[0111] To update the weight matrix of the gate; For bias terms; update their output ,when When, it means that the information is completely preserved. When this happens, it means the information has been completely lost;
[0112]
[0113] in, This is the weight matrix; For bias terms;
[0114] in, .
[0115] The output of the improved RNN algorithm is as follows:
[0116]
[0117] in, Represents the first in the input data sequence One element; In order to be in The hidden state at any given moment; for Output at any moment; and This is the weight matrix; It is the bias vector; for Activation function; The activation function for the output layer;
[0118] The output results are weighted and summed using the following formula:
[0119]
[0120] in, Time period The weights; This is the previous hidden state;
[0121] Through with The comparison yields the following calculation formula:
[0122]
[0123] in, Time period The output; The calculation formula is as follows:
[0124]
[0125] in, The weights are random. for transpose;
[0126] Preserve its sequence information, last time period Output The calculation formula is as follows:
[0127]
[0128] The ISAA algorithm is used to set the objective function and fitness function for the improved RNN model. The root mean square error of the output of the improved RNN training model is used as the objective function, and its value is used as the fitness value. The formula for calculating the objective function is as follows:
[0129]
[0130] in, This represents the number of iterations. Input data; The output of the improved RNN model; To improve the learning efficiency of RNN models; To reset the number of doors; This refers to the number of hidden doors.
[0131] The fitness function is calculated using the following formula:
[0132]
[0133] The ISAA algorithm is used to train the improved RNN model. , , The parameters are globally optimized to obtain the optimal parameter values; the optimal parameters obtained are then input into the RNN model to construct the prediction model.
[0134] Finally, the preprocessed data is input for training, and the prediction results are obtained.
[0135] To obtain accurate prediction results, this invention proposes to use the RMSE index to evaluate the model results.
[0136] The RMSE indicator is calculated using the following formula:
[0137]
[0138] in, The actual value; This is a predicted value; This represents the sample size.
[0139] The specific implementation steps of the ISAA-GRU-RNN prediction model are as follows:
[0140] Step 1: Obtain raw traffic flow data and perform ISAA-VMD preprocessing to remove outliers;
[0141] Step 2: Initialize the relevant parameters of the ISAA algorithm and set them. , , The range of parameter values;
[0142] Step 3: Use the root mean square error of the RNN prediction model as the objective function, and construct its fitness function formula.
[0143] Step 4: Use the ISAA algorithm to process the GRU-RNN model. , , The parameters are globally optimized to obtain the optimal value;
[0144] Step 5: Input the optimal parameters from Step 4 into the GRU-RNN model to construct the ISAA-GRU-RNN prediction model;
[0145] Step 6: Input the preprocessed data to train the model and make predictions;
[0146] Step 7: Use the RMSE index evaluation model to assess its prediction results.
[0147] Step 3: Use the trained model to predict traffic flow in the target area and obtain traffic flow estimates.
[0148] The above embodiments are only for illustrating the technical concept and features of the present invention, and are intended to enable those skilled in the art to understand the content of the present invention and implement it accordingly. They should not be construed as limiting the scope of protection of the present invention. All equivalent transformations or modifications made in accordance with the spirit and essence of the present invention should be covered within the scope of protection of the present invention.
Claims
1. A traffic flow prediction method based on ISAA-VMD-GRU-RNN, characterized in that, Includes the following steps: Step 1: Acquire data and normalize it. Use ISAA-VMD to denoise the normalized data and output a two-dimensional feature matrix. Step 2: Input the two-dimensional feature matrix into the improved RNN model after optimizing the RNN model using the GRU algorithm; Step 3: Use the improved RNN model to predict traffic flow in the target area and obtain the traffic flow estimate; In step 1, the traffic flow data consists of two different indicator variables: time and weather. Step 1: Normalize the traffic flow data. use The standardization method maps raw traffic flow data to intervals through linear transformation. superior, The calculation formula for the standardization method is as follows: in, These are the values after normalization. This represents the original input data at time t; These are the minimum and maximum values of sample data within the same indicator; Step 2: Normalize the data Perform VMD feature decomposition to obtain The feature matrix corresponding to each eigenvalue ; Step 3: Use ISSA to analyze key parameters in VMD Solve for the optimal solution; Step 4: Analyze the characteristic matrix Perform matrix reconstruction to obtain the required two-dimensional feature matrix. The GRU algorithm is used to improve the RNN training model: The RNN training model is represented as follows: in, It is a nonlinear function; Represents the weight matrix; The hidden layer matrix; For the first The hidden state of the nth hidden unit in the layer at time t; ; For the first The hidden state of the nth hidden unit in the layer at time t; for and The mapping matrix between them The hidden state at time t-1; Let the hidden state be at time t. GRU's reset gate The output of the previous hidden state information in the RNN model is controlled to determine the hidden state at the previous time step. The information that can be passed to the hidden candidate state is calculated as follows: This represents the original input data at time t; The hidden state at time t-1; To reset the weight matrix of the gate; For bias terms; for Activation function Reset gate input ,when When, it means that the hidden information from the previous moment is completely preserved. When this happens, it means that the information hidden in the previous moment has been completely lost; To update the weight matrix of the gate; For bias terms; update their output ,when When, it means that the information is completely preserved. When this happens, it means the information has been completely lost; in, This is the weight matrix; For bias terms; in, . The output of the improved RNN training model is as follows: in, This represents the original input data at time t; The hidden state at time t; for Output at any moment; and This is the weight matrix; It is the bias vector; for Activation function; The activation function for the output layer; This is the output layer weight matrix; This is the output layer bias vector; The output results are weighted and summed using the following formula: in, Time period The weights; The hidden state at time t-1; Through with The comparison yields the following calculation formula: in, Time period The output; Time period -1 output; The calculation formula is as follows: in, The weights are random. for transpose; Preserve its sequence information, last time period Output The calculation formula is as follows: ; The ISAA algorithm is used to set the objective function and fitness function for the improved RNN model. The root mean square error of the output of the improved RNN model is used as the objective function, and its value is used as the fitness value. The formula for calculating the objective function is as follows: in, This represents the number of iterations. Input data; The output of the improved RNN model; To improve the learning efficiency of RNN models; To reset the number of doors; This refers to the number of hidden doors. The fitness function is calculated using the following formula: The ISAA algorithm is used to analyze the improved RNN model. , , The parameters are globally optimized to obtain the optimal parameter values; the optimal parameters obtained are then input into the RNN model to construct the prediction model. Finally, the preprocessed data is input for training, and the prediction results are obtained.
2. The traffic flow prediction method of ISAA-VMD-GRU-RNN according to claim 1, characterized in that, The RMSE index is used to evaluate the model results. The RMSE indicator is calculated using the following formula: in, The actual value; This is a predicted value; This represents the sample size.