CN113420835A - Short-term traffic congestion index prediction method based on CPSO-LSTM - Google Patents

Short-term traffic congestion index prediction method based on CPSO-LSTM Download PDF

Info

Publication number
CN113420835A
CN113420835A CN202110827152.9A CN202110827152A CN113420835A CN 113420835 A CN113420835 A CN 113420835A CN 202110827152 A CN202110827152 A CN 202110827152A CN 113420835 A CN113420835 A CN 113420835A
Authority
CN
China
Prior art keywords
particle
chaotic
optimal
cpso
dimension
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110827152.9A
Other languages
Chinese (zh)
Inventor
陈成斌
胡宇飞
徐春萍
叶智慧
苏胜林
马军亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhongruixin Digital Technology Co ltd
Original Assignee
Zhongruixin Digital Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhongruixin Digital Technology Co ltd filed Critical Zhongruixin Digital Technology Co ltd
Priority to CN202110827152.9A priority Critical patent/CN113420835A/en
Publication of CN113420835A publication Critical patent/CN113420835A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/004Artificial life, i.e. computing arrangements simulating life
    • G06N3/006Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/049Temporal neural networks, e.g. delay elements, oscillating neurons or pulsed inputs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Computing Systems (AREA)
  • Molecular Biology (AREA)
  • General Health & Medical Sciences (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Traffic Control Systems (AREA)

Abstract

The invention provides a short-term traffic congestion index prediction method based on CPSO-LSTM, which comprises the following steps: acquiring traffic data, and normalizing the traffic data to obtain standard data serving as an initial particle group; training a CPSO-LSTM model based on the initial particle population to obtain an optimal CPSO-LSTM model; predicting and adjusting the traffic congestion index according to the optimal CPSO-LSTM model; according to the invention, the optimal CPSO-LSTM model is obtained, so that the situation that the traffic congestion index is trapped into a local optimal solution is avoided, a global optimal solution is obtained, the accuracy of the prediction of the traffic congestion index is ensured, and the traffic congestion index is more accurate by adjusting according to interference factors after the prediction result is obtained through the model.

Description

Short-term traffic congestion index prediction method based on CPSO-LSTM
Technical Field
The invention relates to the field of intelligent traffic, in particular to a short-term traffic congestion index prediction method based on CPSO-LSTM.
Background
The traffic jam index has strong uncertainty, is complex and variable, is easily disturbed by random factors, and has unobvious regularity. Through improvement of a genetic algorithm or a genetic algorithm, the method is easy to fall into a local optimal solution, so that the prediction of the traffic jam index is inaccurate, and secondly, the traffic jam index obtained through prediction of a model algorithm is possibly not considered comprehensively, so that the prediction of the traffic jam index is also inaccurate.
Disclosure of Invention
The invention provides a short-term traffic congestion index prediction method based on CPSO-LSTM, which avoids trapping in a local optimal solution by obtaining an optimal CPSO-LSTM model, obtains a global optimal solution, ensures the accuracy of traffic congestion index prediction, and adjusts the traffic congestion index according to interference factors after obtaining a prediction result through the model, so that the obtained traffic congestion index is more accurate.
The invention provides a short-term traffic jam index prediction method based on CPSO-LSTM, which comprises the following steps:
step 1: acquiring traffic data, and normalizing the traffic data to obtain standard data;
step 2: training the CPSO-LSTM model based on the standard data to obtain an optimal CPSO-LSTM model;
and step 3: and predicting and adjusting the traffic congestion index according to the optimal CPSO-LSTM model.
In one possible way of realisation,
in the step 1, acquiring traffic data, and normalizing the traffic dimension data to obtain standard data, including:
utilizing a bayonet vehicle-passing record at a preset road intersection, collecting a picture of the preset road intersection at a preset sampling point, and processing and extracting the picture to obtain initial traffic data;
intercepting a data point set of the initial traffic data in a preset time period as dimension characteristic data;
normalizing the dimension characteristic data according to the following formula;
Figure BDA0003174158450000021
wherein, x'i,jA value, x, representing the ith sample of the jth dimension in the normalized dimension characteristic datai,jA value, x, representing the ith sample of the jth dimension in the dimension feature data before normalizationmin,jMinimum value, x, of all samples in the j dimension of the dimensional feature datamax,jRepresenting the maximum value of all samples in the j dimension in the dimension characteristic data;
and acquiring a numerical value corresponding to the normalized dimension characteristic data to obtain standard data.
In one possible way of realisation,
in step 2, training the CPSO-LSTM model based on the initial particle population to obtain an optimal CPSO-LSTM model comprises:
initially setting the number of neurons of an input layer, the number of neurons of an output layer, an activation function and dropout of an LSTM neural network in the CPSO-LSTM model;
setting initial matrix weights and initial bias items of an input gate, a forgetting gate and an output gate of the LSTM neural network respectively;
initializing the particle position and the particle speed of the initial particle group in the CPSO-LSTM model to obtain the initial particle position and the initial particle speed;
inputting the initial particle group into a CPSO-LSTM model with set parameters to obtain chaotic particles;
obtaining the particle fitness of each chaotic particle, selecting an optimal chaotic particle from the chaotic particles, taking the particle fitness of the optimal chaotic particle as the global optimal particle fitness, and taking the particle position of the optimal chaotic particle as the optimal position;
updating the initial particle speed, and starting iteration by adopting a self-adaptive adjustment strategy;
in the iterative process, chaotic disturbance is carried out on the chaotic particles according to the following formula;
uj=4(1-u0),j=1,2,..,n
u=(u1,u2,…un)
wherein u represents a component set of chaotic particles after chaotic disturbance, and u1Representing a component, u, of the chaotic particle in a first dimension2Representing a component of the chaotic particle in a second dimension, unRepresenting a component of the chaotic particle in an nth dimension; u. ofjRepresenting the component, u, of the chaotic particle in the j-th dimension0Representing a preset component, n representing a spatial dimension;
according to the following formula, each component carrier in the component set of the chaotic particles subjected to chaotic disturbance is brought into a chaotic disturbance range [ -beta, beta ];
Δx=(Δx1,Δx2,…Δxn)
Δxj=-β+2βuj,j=1,2,..,n
where Δ x represents a set of disturbance variables, Δ x1Representing the disturbance quantity, Deltax, of chaotic particles in a first dimension1Representing the disturbance quantity, Deltax, of chaotic particles in a first dimension2Representing the disturbance quantity, Deltax, of chaotic particles in a second dimensionnRepresenting the disturbance quantity of chaotic particles in the nth dimension, deltaxjRepresenting the disturbance quantity of the chaotic particles in the j dimension;
updating the position of the chaotic particle according to the particle speed and the disturbance quantity;
calculating the particle fitness of the chaotic particles at the updated particle positions, and if the particle fitness is superior to the original particle position fitness, setting the updated particle positions as optimal positions, wherein the particle fitness of the updated particle positions is the optimal particle fitness;
judging whether the optimal particle fitness is better than global optimal fitness, if so, taking the optimal particle fitness as the global optimal fitness, and taking the optimal position as a global optimal position;
and when the maximum iteration times is reached, exiting the iteration, and storing the optimal parameters of the CPSO-LSTM model to obtain the optimal CPSO-LSTM model.
In one possible way of realisation,
the particle fitness of the chaotic particles takes the root mean square error of the chaotic particles as a fitness evaluation index, and the smaller the root mean square error is, the better the particle fitness of the chaotic particles is;
wherein the root mean square error of the chaotic particles is calculated as follows:
Figure BDA0003174158450000041
rmse represents the root mean square error, y, of the chaotic particleaA real label y 'representing the a-th sample in the chaotic particles'aA prediction tag representing the a-th sample in the chaotic particle, and m represents the total number of samples in the chaotic particle.
In one possible way of realisation,
updating the position of the chaotic particle according to the particle velocity and the disturbance quantity comprises:
calculating the position of the chaotic particle according to the particle speed and the disturbance quantity and the following formula;
Figure BDA0003174158450000042
wherein x isk+1Representing the position value, x, of the chaotic particle, obtained from the velocity of the particlekRepresenting an initial position value, v, of the chaotic particlek+1Represents a particle velocity, x 'of the chaotic particle update'k+1Representing the position value of the chaotic particles after the chaotic disturbance, deltax representing the disturbance quantity set of the chaotic particles,t represents the motion time of the chaotic particle.
In one possible way of realisation,
when the maximum iteration times are reached, exiting the iteration, and storing the optimal parameters of the CPSO-LSTM model to obtain the optimal CPSO-LSTM model, the method further comprises the following steps:
after iteration quits, obtaining the optimal chaotic particles, and calculating the mean square error, the root mean square error and the symmetric average percentage error corresponding to the optimal chaotic particles;
judging whether the mean square error, the root mean square error and the symmetric average percentage error corresponding to the optimal chaotic particles are within a preset requirement range;
if so, storing the optimal parameters of the CPSO-LSTM model to obtain an optimal CPSO-LSTM model;
otherwise, resetting the iteration times, updating the particle speed, and performing iteration again until the mean square error, the root mean square error and the symmetric average percentage error corresponding to the optimal chaotic particles obtained by iteration are within the preset requirement range.
In one possible way of realisation,
in step 3, predicting and adjusting the traffic congestion index according to the optimal CPSO-LSTM model comprises the following steps:
inputting processed traffic data to be detected of a target road section into the optimal CPSO-LSTM model to obtain a first short-term traffic congestion index;
the traffic data to be detected is obtained in a preset time period before prediction of the target road section;
acquiring a historical traffic congestion index of the target road section;
the short-term traffic congestion index and the historical traffic congestion index comprise congestion indexes of all sub-road sections in the target road section, and the historical traffic congestion indexes are obtained by the target road section in different dates and in the same time with a prediction time period;
judging whether the difference value between the congestion index of each sub-road section in the short-term traffic congestion index and the historical congestion index of each sub-road section in the historical traffic congestion index is within a preset range or not;
if so, determining that the congestion index prediction of the sub-road section is reasonable;
otherwise, determining that the congestion index prediction of the sub-road section is unreasonable;
extracting the unreasonable predicted sub-road sections, and setting correction weight values for the unreasonable sub-road sections according to the difference values;
according to the correction weight, correcting the congestion index of the unreasonable sub-road section to obtain a new congestion index;
acquiring a second short-term traffic jam index of the corrected target road section;
determining a prediction influence index between the preset time period before prediction and a prediction time period;
and fine-tuning the second short-term traffic jam index based on the predicted influence index to obtain a third short-term traffic jam index.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
The technical solution of the present invention is further described in detail by the accompanying drawings and embodiments.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings:
FIG. 1 is a flow chart of a CPSO-LSTM-based short-term traffic congestion index prediction method according to an embodiment of the present invention;
FIG. 2 is a flow chart of the CPSO-LSTM model according to an embodiment of the present invention;
FIG. 3 is a graph of the tanh activation function in an embodiment of the present invention;
fig. 4 is a diagram of an LSTM network architecture in an embodiment of the present invention.
Detailed Description
The preferred embodiments of the present invention will be described in conjunction with the accompanying drawings, and it will be understood that they are described herein for the purpose of illustration and explanation and not limitation.
The embodiment of the invention provides a short-term traffic congestion index prediction method based on CPSO-LSTM, as shown in FIG. 1, comprising the following steps:
step 1: acquiring traffic data, and normalizing the traffic data to obtain standard data;
step 2: training the CPSO-LSTM model based on the standard data to obtain an optimal CPSO-LSTM model;
and step 3: and predicting and adjusting the traffic congestion index according to the optimal CPSO-LSTM model.
In this embodiment, the CPSO refers to a chaotic particle swarm optimization algorithm; the LSTM refers to a long-short term memory network structure.
In this embodiment, the flow chart of the CPSO-LSTM model is shown in FIG. 2.
In this embodiment, initial particles are understood as a set of parameters, and the initial population of particles, which is essentially data, appears as particles in the CPSO-LSTM model, constitutes a network.
In this embodiment, the essence of training the CPSO-LSTM model is to optimize the LSTM structure using CPSO.
The beneficial effect of above-mentioned design is: the CPSO-LSTM model is trained through standard data to obtain an optimal CPSO-LSTM model, the situation that the model is trapped in a local optimal solution is avoided, a global optimal solution is obtained, accuracy of traffic jam index prediction is guaranteed, and the traffic jam index is more accurate by adjusting according to interference factors after a prediction result is obtained through the model.
Example 2
Based on embodiment 1, an embodiment of the present invention provides a short-term traffic congestion index prediction method based on CPSO-LSTM, where in step 1, traffic data is obtained and normalized to obtain standard data, and the method includes:
utilizing a bayonet vehicle-passing record at a preset road intersection, collecting a picture of the preset road intersection at a preset sampling point, and processing and extracting the picture to obtain initial traffic data;
intercepting a data point set of the initial traffic data in a preset time period as dimension characteristic data;
normalizing the dimension characteristic data according to the following formula;
Figure BDA0003174158450000071
wherein, x'i,jA value, x, representing the ith sample of the jth dimension in the normalized dimension characteristic datai,jA value, x, representing the ith sample of the jth dimension in the dimension feature data before normalizationmin,jMinimum value, x, of all samples in the j dimension of the dimensional feature datamax,jRepresenting the maximum value of all samples in the j dimension in the dimension characteristic data;
and acquiring a numerical value corresponding to the normalized dimension characteristic data to obtain standard data.
In this embodiment, the dimension feature data may be, for example, one sampling point in 5 minutes and 24 sampling points in 2 hours, so that 24-dimensional feature data is obtained.
The beneficial effect of above-mentioned design is: and normalizing the traffic data to obtain standard data so as to eliminate the problem of model precision reduction caused by different dimensions among different dimensions, ensure the precision of the model and better predict the traffic jam index.
Example 3
Based on embodiment 1, the embodiment of the present invention provides a short-term traffic congestion index prediction method based on CPSO-LSTM, and the training of the CPSO-LSTM model based on the initial particle population to obtain an optimal CPSO-LSTM model includes:
initially setting the number of neurons of an input layer, the number of neurons of an output layer, an activation function and dropout of an LSTM neural network in the CPSO-LSTM model;
setting initial matrix weights and initial bias items of an input gate, a forgetting gate and an output gate of the LSTM neural network respectively;
initializing the particle position and the particle speed of the initial particle group in the CPSO-LSTM model to obtain the initial particle position and the initial particle speed;
inputting the initial particle group into a CPSO-LSTM model with set parameters to obtain chaotic particles;
obtaining the particle fitness of each chaotic particle, selecting an optimal chaotic particle from the chaotic particles, taking the particle fitness of the optimal chaotic particle as the global optimal particle fitness, and taking the particle position of the optimal chaotic particle as the optimal position;
updating the initial particle speed, and starting iteration by adopting a self-adaptive adjustment strategy;
in the iterative process, chaotic disturbance is carried out on the chaotic particles according to the following formula;
uj=4(1-u0),j=1,2,..,n
u=(u1,u2,…un)
wherein u represents a component set of chaotic particles after chaotic disturbance, and u1Representing a component, u, of the chaotic particle in a first dimension2Representing a component of the chaotic particle in a second dimension, unRepresenting a component of the chaotic particle in an nth dimension; u. ofjRepresenting the component, u, of the chaotic particle in the j-th dimension0Representing a preset component, n representing a spatial dimension;
according to the following formula, each component carrier in the component set of the chaotic particles subjected to chaotic disturbance is brought into a chaotic disturbance range [ -beta, beta ];
Δx=(Δx1,Δx2,…Δxn)
Δxj=-β+2βuj,j=1,2,..,n
where Δ x represents a set of disturbance variables, Δ x1Representing the disturbance quantity, Deltax, of chaotic particles in a first dimension1Representing the disturbance quantity, Deltax, of chaotic particles in a first dimension2Representing the disturbance quantity, Deltax, of chaotic particles in a second dimensionnRepresenting the disturbance quantity of chaotic particles in the nth dimension, deltaxjRepresenting the disturbance quantity of the chaotic particles in the j dimension;
updating the position of the chaotic particle according to the particle speed and the disturbance quantity;
calculating the particle fitness of the chaotic particles at the updated particle positions, and if the particle fitness is superior to the original particle position fitness, setting the updated particle positions as optimal positions, wherein the particle fitness of the updated particle positions is the optimal particle fitness;
judging whether the optimal particle fitness is better than global optimal fitness, if so, taking the optimal particle fitness as the global optimal fitness, and taking the optimal position as a global optimal position;
and when the maximum iteration times is reached, exiting the iteration, and storing the optimal parameters of the CPSO-LSTM model to obtain the optimal CPSO-LSTM model.
In this embodiment, the settings for the LSTM neural network may be, for example: the number of neurons in the input layer of the network structure is set to 24; the number of neurons in the output layer is set to 1, the activation function is set to be a tanh activation function, and the curve of the tanh activation function is shown in fig. 3; the neurons in the middle layer were set to 12; and dropout is set to 0.1, the structure diagram of the LSTM neural network is shown in fig. 4;
the updating of the gate is entered. Input door itThe calculation formula of (a) is as follows:
it=σ(Wxixi+Whiht-1+Wcict-1+bi)
forget the update of the door. Forget door ftThe calculation formula of (a) is as follows:
ft=σ(Wxfxi+Whfht-1+Wcfct-1+bf)
and updating the state. State ctThe response is the intermediate state of the neuron, and the calculation formula is as follows:
ct=ftct-1+ittanh(Wxcxt+Whcht-1+bf)
and updating the output gate. Output gate ftThe calculation formula of (a) is as follows:
ft=σ(Wxfxi+Whfht-1+Wcfct-1+bf)
wherein, the sum is a weight matrix and a bias item respectively; for the activation function, a tanh activation function is often selected.
In this embodiment, a chaotic particle is understood to be a set of parameters, and the population of particles forms a network. The particle has two attributes of speed and position, and the position and speed of the particle are continuously updated in the fitting process. So that the whole population obtains the optimal solution.
In the embodiment, the chaotic disturbance operation enlarges the search range of the particles, then compares the adaptive values before and after disturbance, selects the optimal part to enter the next step, and improves the convergence speed of the algorithm.
The beneficial effect of above-mentioned design is: the LSTM structure is optimized according to the CPSO, the CPSO-LSTM model is trained, chaotic disturbance is carried out on the chaotic particle swarm, the model is prevented from falling into a local optimal solution, a global optimal solution is obtained, and accuracy of traffic jam index prediction is guaranteed.
Example 4
On the basis of embodiment 3, the embodiment of the invention provides a short-term traffic congestion index prediction method based on CPSO-LSTM, wherein the particle fitness of the chaotic particles takes the root mean square error of the chaotic particles as a fitness evaluation index, and the smaller the root mean square error is, the better the particle fitness of the chaotic particles is;
wherein the root mean square error of the chaotic particles is calculated as follows:
Figure BDA0003174158450000101
rmse represents the root mean square error, y, of the chaotic particleaA real label y 'representing the a-th sample in the chaotic particles'aA prediction tag representing the a-th sample in the chaotic particle, and m represents the total number of samples in the chaotic particle.
In this embodiment, the real tag and the predicted tag are an actual traffic congestion index and a predicted traffic congestion index.
The beneficial effect of above-mentioned design is: the root mean square error is used as the fitness evaluation index of the chaotic particles, so that the evaluation index is provided for the evaluation of the model effect, and the reliability of the model is ensured.
Example 5
Based on embodiment 3, an embodiment of the present invention provides a short-term traffic congestion index prediction method based on CPSO-LSTM, where updating the position of the chaotic particle according to the particle speed and the disturbance amount includes:
calculating the position of the chaotic particle according to the particle speed and the disturbance quantity and the following formula;
Figure BDA0003174158450000111
wherein x isk+1Representing the position value, x, of the chaotic particle, obtained from the velocity of the particlekRepresenting an initial position value, v, of the chaotic particlek+1Represents a particle velocity, x 'of the chaotic particle update'k+1And expressing the position value of the chaotic particles after chaotic disturbance, wherein delta x expresses the disturbance quantity set of the chaotic particles, and t expresses the motion time of the chaotic particles.
In this embodiment, the position value of the chaotic particle after the chaotic disturbance is the sum of the position value of the chaotic particle and the disturbance amount of the chaotic particle after the chaotic disturbance in each dimension.
The beneficial effect of above-mentioned design is: and determining the position change of the chaotic particles after chaotic disturbance, and providing a basis for determining the optimal position.
Example 6
Based on embodiment 3, the embodiment of the present invention provides a short-term traffic congestion index prediction method based on CPSO-LSTM, and when the maximum number of iterations is reached, the iteration is exited, and the optimal parameters of the CPSO-LSTM model are stored, so as to obtain the optimal CPSO-LSTM model, the method further includes:
after iteration quits, obtaining the optimal chaotic particles, and calculating the mean square error, the root mean square error and the symmetric average percentage error corresponding to the optimal chaotic particles;
judging whether the mean square error, the root mean square error and the symmetric average percentage error corresponding to the optimal chaotic particles are within a preset requirement range;
if so, storing the optimal parameters of the CPSO-LSTM model to obtain an optimal CPSO-LSTM model;
otherwise, resetting the iteration times, updating the particle speed, and performing iteration again until the mean square error, the root mean square error and the symmetric average percentage error corresponding to the optimal chaotic particles obtained by iteration are within the preset requirement range.
In this embodiment, the mean square error and the root mean square error are used to represent the difference degree between the predicted value and the actual value; the average percentage error average absolute error is the average of the absolute values of the deviations of all the single predicted values and the arithmetic mean, so that the problem of mutual offset of errors can be avoided, and the size of the actual predicted error can be accurately reflected.
The beneficial effect of above-mentioned design is: judging whether the iteration requirement of prediction is met or not by utilizing the mean square error, the root mean square error and the symmetric average percentage error, if not, carrying out re-iteration, ensuring the optimization effect of the CPSO-LSTM model, and improving the model foundation for traffic congestion index prediction.
Example 7
Based on implementation 1, the embodiment of the invention provides a short-term traffic congestion index prediction method based on CPSO-LSTM, and in step 3, predicting and adjusting a traffic congestion index according to the optimal CPSO-LSTM model comprises the following steps:
inputting processed traffic data to be detected of a target road section into the optimal CPSO-LSTM model to obtain a first short-term traffic congestion index;
the traffic data to be detected is obtained in a preset time period before prediction of the target road section;
acquiring a historical traffic congestion index of the target road section;
the short-term traffic congestion index and the historical traffic congestion index comprise congestion indexes of all sub-road sections in the target road section, and the historical traffic congestion indexes are obtained by the target road section in different dates and in the same time with a prediction time period;
judging whether the difference value between the congestion index of each sub-road section in the short-term traffic congestion index and the historical congestion index of each sub-road section in the historical traffic congestion index is within a preset range or not;
if so, determining that the congestion index prediction of the sub-road section is reasonable;
otherwise, determining that the congestion index prediction of the sub-road section is unreasonable;
extracting the unreasonable predicted sub-road sections, and setting correction weight values for the unreasonable sub-road sections according to the difference values;
according to the correction weight, correcting the congestion index of the unreasonable sub-road section to obtain a new congestion index;
acquiring a second short-term traffic jam index of the corrected target road section;
determining a prediction influence index between the preset time period before prediction and a prediction time period;
and fine-tuning the second short-term traffic jam index based on the predicted influence index to obtain a third short-term traffic jam index.
In this embodiment, for example, the traffic congestion index of the target link in the 18 th-20 th time period at 5/18/2020 is predicted this time, the traffic data to be detected is obtained in the 8 th-10 th time period at 5/18/2020, and the historical traffic congestion index of the target link is obtained in the 18 th-20 th time period from 5/10 th to 5/17 th day 2020.
In this embodiment, the predicted impact indicators include weather impact indicators, time impact indicators.
The working principle of the design scheme is as follows: inputting processed traffic data to be detected of a target road section into the optimal CPSO-LSTM model to obtain a first short-term traffic congestion index; acquiring a historical traffic congestion index of the target road section; according to the difference between a first short-term traffic jam index and a historical traffic jam index, correcting the first short-term traffic jam index to obtain a second short-term traffic jam index, wherein the first short-term traffic jam index is 5.00, and the corresponding second short-term traffic jam index is 2.00 (the second short-term traffic jam index is an average jam index in detection days) exceeds a preset range [ -2, 2]And then the first short-term traffic jam index 5 is corrected according to the difference value 3, and the correction method is
Figure BDA0003174158450000131
Then, fine adjustment is performed based on the predicted influence index (weather influence index, time influence index), and for example, if the value of the weather influence index is 0.7 based on weather change, the method of fine adjustment is 3.75 × 1+0.7 × 10% to 4.01, and the third short-term traffic congestion index is obtained to be 4.01.
The beneficial effect of above-mentioned design is: the short-term traffic jam index obtained under the optimal CPSO-LSTM model is corrected according to the historical traffic jam index, the rationality of the short-term traffic jam index is guaranteed, and then the short-term traffic jam index is finely adjusted according to the predicted influence index, so that the influence of actual factors is considered in prediction, and the obtained short-term traffic jam index is more accurate.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (7)

1. A short-term traffic congestion index prediction method based on CPSO-LSTM is characterized by comprising the following steps:
step 1: acquiring traffic data, and normalizing the traffic data to obtain standard data;
step 2: training the CPSO-LSTM model based on the standard data to obtain an optimal CPSO-LSTM model;
and step 3: and predicting and adjusting the traffic congestion index according to the optimal CPSO-LSTM model.
2. The method as claimed in claim 1, wherein the step 1 of obtaining traffic data and normalizing the traffic dimension data to obtain standard data includes:
utilizing a bayonet vehicle-passing record at a preset road intersection, collecting a picture of the preset road intersection at a preset sampling point, and processing and extracting the picture to obtain initial traffic data;
intercepting a data point set of the initial traffic data in a preset time period as dimension characteristic data;
normalizing the dimension characteristic data according to the following formula;
Figure FDA0003174158440000011
wherein, x'i,jA value, x, representing the ith sample of the jth dimension in the normalized dimension characteristic datai,jA value, x, representing the ith sample of the jth dimension in the dimension feature data before normalizationmin,jAll samples in the j dimension in the dimension characteristic dataMinimum number in this text, xmax,jRepresenting the maximum value of all samples in the j dimension in the dimension characteristic data;
and acquiring a numerical value corresponding to the normalized dimension characteristic data to obtain standard data.
3. A CPSO-LSTM-based short-term traffic congestion index prediction method as claimed in claim 1, wherein the step 2 of training the CPSO-LSTM model based on the standard data to obtain the optimal CPSO-LSTM model comprises:
initially setting the number of neurons of an input layer, the number of neurons of an output layer, an activation function and dropout of an LSTM neural network in the CPSO-LSTM model;
setting initial matrix weights and initial bias items of an input gate, a forgetting gate and an output gate of the LSTM neural network respectively;
taking the standard data as an initial particle population in the CPSO-LSTM model, and initializing the particle position and the particle speed of the initial particle population to obtain the initial particle position and the initial particle speed;
inputting the initial particle group into a CPSO-LSTM model with set parameters to obtain chaotic particles;
obtaining the particle fitness of each chaotic particle, selecting an optimal chaotic particle from the chaotic particles, taking the particle fitness of the optimal chaotic particle as the global optimal particle fitness, and taking the particle position of the optimal chaotic particle as the optimal position;
updating the initial particle speed, and starting iteration by adopting a self-adaptive adjustment strategy;
in the iterative process, chaotic disturbance is carried out on the chaotic particles according to the following formula;
uj=4(1-u0),j=1,2,..,n
u=(u1,u2,…un)
wherein u represents a component set of chaotic particles after chaotic disturbance, and u1Representing the chaotic particle in a first dimensionComponent of (a), u2Representing a component of the chaotic particle in a second dimension, unRepresenting a component of the chaotic particle in an nth dimension; u. ofjRepresenting the component, u, of the chaotic particle in the j-th dimension0Representing a preset component, n representing a spatial dimension;
according to the following formula, each component carrier in the component set of the chaotic particles subjected to chaotic disturbance is brought into a chaotic disturbance range [ -beta, beta ];
Δx=(Δx1,Δx2,…Δxn)
Δxj=-β+2βuj,j=1,2,..,n
where Δ x represents a set of disturbance variables, Δ x1Representing the disturbance quantity, Deltax, of chaotic particles in a first dimension1Representing the disturbance quantity, Deltax, of chaotic particles in a first dimension2Representing the disturbance quantity, Deltax, of chaotic particles in a second dimensionnRepresenting the disturbance quantity of chaotic particles in the nth dimension, deltaxjRepresenting the disturbance quantity of the chaotic particles in the j dimension;
updating the position of the chaotic particle according to the particle speed and the disturbance quantity;
calculating the particle fitness of the chaotic particles at the updated particle positions, and if the particle fitness is superior to the original particle position fitness, setting the updated particle positions as optimal positions, wherein the particle fitness of the updated particle positions is the optimal particle fitness;
judging whether the optimal particle fitness is better than global optimal fitness, if so, taking the optimal particle fitness as the global optimal fitness, and taking the optimal position as a global optimal position;
and when the maximum iteration times is reached, exiting the iteration, and storing the optimal parameters of the CPSO-LSTM model to obtain the optimal CPSO-LSTM model.
4. The CPSO-LSTM-based short-term traffic congestion index prediction method according to claim 3, wherein the particle fitness of the chaotic particles is a fitness evaluation index based on a root mean square error of the chaotic particles;
wherein the root mean square error of the chaotic particles is calculated as follows:
Figure FDA0003174158440000031
rmse represents the root mean square error, y, of the chaotic particleaA real label y 'representing the a-th sample in the chaotic particles'aA prediction tag representing the a-th sample in the chaotic particle, and m represents the total number of samples in the chaotic particle.
5. A CPSO-LSTM based short-term traffic congestion index prediction method as claimed in claim 3, wherein updating the position of the chaotic particle according to the particle velocity and the disturbance quantity comprises:
calculating the position of the chaotic particle according to the particle speed and the disturbance quantity and the following formula;
Figure FDA0003174158440000032
wherein x isk+1Representing the position value, x, of the chaotic particle, obtained from the velocity of the particlekRepresenting an initial position value, v, of the chaotic particlek+1Represents a particle velocity, x 'of the chaotic particle update'k+1And expressing the position value of the chaotic particles after chaotic disturbance, wherein delta x expresses the disturbance quantity set of the chaotic particles, and t expresses the motion time of the chaotic particles.
6. The method as claimed in claim 3, wherein when the maximum number of iterations is reached, the iteration is exited, the optimal parameters of the CPSO-LSTM model are stored, and in the process of obtaining the optimal CPSO-LSTM model, the method further comprises:
after iteration quits, obtaining the optimal chaotic particles, and calculating the mean square error, the root mean square error and the symmetric average percentage error corresponding to the optimal chaotic particles;
judging whether the mean square error, the root mean square error and the symmetric average percentage error corresponding to the optimal chaotic particles are within a preset requirement range;
if so, storing the optimal parameters of the CPSO-LSTM model to obtain an optimal CPSO-LSTM model;
otherwise, resetting the iteration times, updating the particle speed, and performing iteration again until the mean square error, the root mean square error and the symmetric average percentage error corresponding to the optimal chaotic particles obtained by iteration are within the preset requirement range.
7. A CPSO-LSTM-based short-term traffic congestion index prediction method as claimed in claim 1, wherein the step 3 of predicting and adjusting the traffic congestion index according to the optimal CPSO-LSTM model comprises:
inputting processed traffic data to be detected of a target road section into the optimal CPSO-LSTM model to obtain a first short-term traffic congestion index;
the traffic data to be detected is obtained in a preset time period before prediction of the target road section;
acquiring a historical traffic congestion index of the target road section;
the short-term traffic congestion index and the historical traffic congestion index comprise congestion indexes of all sub-road sections in the target road section, and the historical traffic congestion indexes are obtained by the target road section in different dates and in the same time with a prediction time period;
judging whether the difference value between the congestion index of each sub-road section in the short-term traffic congestion index and the historical congestion index of each sub-road section in the historical traffic congestion index is within a preset range or not;
if so, determining that the congestion index prediction of the sub-road section is reasonable;
otherwise, determining that the congestion index prediction of the sub-road section is unreasonable;
extracting the unreasonable predicted sub-road sections, and setting correction weight values for the unreasonable sub-road sections according to the difference values;
according to the correction weight, correcting the congestion index of the unreasonable sub-road section to obtain a new congestion index;
acquiring a second short-term traffic jam index of the corrected target road section;
determining a prediction influence index between the preset time period before prediction and a prediction time period;
and fine-tuning the second short-term traffic jam index based on the predicted influence index to obtain a third short-term traffic jam index.
CN202110827152.9A 2021-07-21 2021-07-21 Short-term traffic congestion index prediction method based on CPSO-LSTM Pending CN113420835A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110827152.9A CN113420835A (en) 2021-07-21 2021-07-21 Short-term traffic congestion index prediction method based on CPSO-LSTM

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110827152.9A CN113420835A (en) 2021-07-21 2021-07-21 Short-term traffic congestion index prediction method based on CPSO-LSTM

Publications (1)

Publication Number Publication Date
CN113420835A true CN113420835A (en) 2021-09-21

Family

ID=77718143

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110827152.9A Pending CN113420835A (en) 2021-07-21 2021-07-21 Short-term traffic congestion index prediction method based on CPSO-LSTM

Country Status (1)

Country Link
CN (1) CN113420835A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117037499A (en) * 2023-10-09 2023-11-10 腾讯科技(深圳)有限公司 Congestion road segment prediction method, device, computer equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102353380A (en) * 2011-06-30 2012-02-15 福建慧翰信息技术有限公司 Road condition prediction and query system and method
CN103177570A (en) * 2012-12-25 2013-06-26 北京交通发展研究中心 Method for predicting traffic jam indexes for rush hours in morning and evening
CN108305459A (en) * 2018-02-05 2018-07-20 北京交通大学 A kind of road network operation index forecasting method based on data-driven
CN108986470A (en) * 2018-08-20 2018-12-11 华南理工大学 The Travel Time Estimation Method of particle swarm algorithm optimization LSTM neural network
CN111709549A (en) * 2020-04-30 2020-09-25 东华大学 Navigation reminding method for short-time traffic flow prediction based on SVD-PSO-LSTM

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102353380A (en) * 2011-06-30 2012-02-15 福建慧翰信息技术有限公司 Road condition prediction and query system and method
CN103177570A (en) * 2012-12-25 2013-06-26 北京交通发展研究中心 Method for predicting traffic jam indexes for rush hours in morning and evening
CN108305459A (en) * 2018-02-05 2018-07-20 北京交通大学 A kind of road network operation index forecasting method based on data-driven
CN108986470A (en) * 2018-08-20 2018-12-11 华南理工大学 The Travel Time Estimation Method of particle swarm algorithm optimization LSTM neural network
CN111709549A (en) * 2020-04-30 2020-09-25 东华大学 Navigation reminding method for short-time traffic flow prediction based on SVD-PSO-LSTM

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
YANG ZHANG等: "Dynamic Optimization Long Short-Term Memory Model Based on Data Preprocessing for Short-Term Traffic Flow Prediction", 《IEEE ACCESS》 *
何承等: "《城市道路交通状态指数研究》", 31 January 2018, 上海:上海科学技术出版社 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117037499A (en) * 2023-10-09 2023-11-10 腾讯科技(深圳)有限公司 Congestion road segment prediction method, device, computer equipment and storage medium
CN117037499B (en) * 2023-10-09 2024-01-05 腾讯科技(深圳)有限公司 Congestion road segment prediction method, device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN111563706A (en) Multivariable logistics freight volume prediction method based on LSTM network
CN111310965A (en) Aircraft track prediction method based on LSTM network
CN114006826B (en) Network traffic prediction method fusing traffic characteristics
CN111860989B (en) LSTM neural network short-time traffic flow prediction method based on ant colony optimization
CN109143408B (en) Dynamic region combined short-time rainfall forecasting method based on MLP
CN115271186B (en) Reservoir water level prediction and early warning method based on delay factor and PSO RNN Attention model
CN113469426A (en) Photovoltaic output power prediction method and system based on improved BP neural network
CN112766603A (en) Traffic flow prediction method, system, computer device and storage medium
CN115016040B (en) Sea fog prediction method, device, equipment and medium based on multi-model intelligent selection
CN112257847A (en) Method for predicting geomagnetic Kp index based on CNN and LSTM
CN113449905A (en) Traffic jam early warning method based on gated cyclic unit neural network
CN111723909A (en) Optimization method and system of fuzzy neural network model
CN113205698A (en) Navigation reminding method based on IGWO-LSTM short-time traffic flow prediction
CN113420835A (en) Short-term traffic congestion index prediction method based on CPSO-LSTM
CN116720620A (en) Grain storage ventilation temperature prediction method based on IPSO algorithm optimization CNN-BiGRU-Attention network model
CN115097548A (en) Sea fog classification early warning method, device, equipment and medium based on intelligent prediction
CN116303786B (en) Block chain financial big data management system based on multidimensional data fusion algorithm
CN116522065A (en) Coal mill health degree assessment method based on deep learning
CN116663404A (en) Flood forecasting method and system coupling artificial intelligence and Bayesian theory
CN115794805A (en) Medium-low voltage distribution network measurement data supplementing method
CN115238789A (en) Financial industry special data prediction method and system based on improved GRU
Kotenko et al. Supervised Machine Learning Models for Forecasting Fuel Consumption by Vehicles During the Grain Crops Delivery
CN113408183A (en) Vehicle base short-term composite prediction method based on prediction model
CN112434847A (en) Express delivery quantity prediction method, device, equipment and storage medium based on LSTM model
Herzallah et al. Robust control of nonlinear stochastic systems by modelling conditional distributions of control signals

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210921