CN111915881A - Small sample traffic flow prediction method based on variational automatic encoder - Google Patents
Small sample traffic flow prediction method based on variational automatic encoder Download PDFInfo
- Publication number
- CN111915881A CN111915881A CN202010529619.7A CN202010529619A CN111915881A CN 111915881 A CN111915881 A CN 111915881A CN 202010529619 A CN202010529619 A CN 202010529619A CN 111915881 A CN111915881 A CN 111915881A
- Authority
- CN
- China
- Prior art keywords
- traffic flow
- distribution
- real traffic
- hidden variable
- real
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 45
- 238000013507 mapping Methods 0.000 claims abstract description 19
- 238000012549 training Methods 0.000 claims description 21
- 238000013528 artificial neural network Methods 0.000 claims description 17
- 238000005070 sampling Methods 0.000 claims description 5
- 230000001172 regenerating effect Effects 0.000 claims description 3
- 238000001514 detection method Methods 0.000 abstract description 7
- 230000006870 function Effects 0.000 description 10
- 238000013135 deep learning Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000007619 statistical method Methods 0.000 description 2
- 206010039203 Road traffic accident Diseases 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 238000013480 data collection Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000005206 flow analysis Methods 0.000 description 1
- 230000000737 periodic effect Effects 0.000 description 1
- 230000000306 recurrent effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G08—SIGNALLING
- G08G—TRAFFIC CONTROL SYSTEMS
- G08G1/00—Traffic control systems for road vehicles
- G08G1/01—Detecting movement of traffic to be counted or controlled
- G08G1/0104—Measuring and analyzing of parameters relative to traffic conditions
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
- G06N3/084—Backpropagation, e.g. using gradient descent
-
- G—PHYSICS
- G08—SIGNALLING
- G08G—TRAFFIC CONTROL SYSTEMS
- G08G1/00—Traffic control systems for road vehicles
- G08G1/01—Detecting movement of traffic to be counted or controlled
- G08G1/0104—Measuring and analyzing of parameters relative to traffic conditions
- G08G1/0125—Traffic data processing
-
- G—PHYSICS
- G08—SIGNALLING
- G08G—TRAFFIC CONTROL SYSTEMS
- G08G1/00—Traffic control systems for road vehicles
- G08G1/065—Traffic control systems for road vehicles by counting the vehicles in a section of the road or in a parking area, i.e. comparing incoming count with outgoing count
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02T—CLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
- Y02T10/00—Road transport of goods or passengers
- Y02T10/10—Internal combustion engine [ICE] based vehicles
- Y02T10/40—Engine management systems
Landscapes
- Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Health & Medical Sciences (AREA)
- General Engineering & Computer Science (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Biomedical Technology (AREA)
- Life Sciences & Earth Sciences (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Chemical & Material Sciences (AREA)
- Analytical Chemistry (AREA)
- Traffic Control Systems (AREA)
Abstract
The invention discloses a small sample traffic flow prediction method based on a variational automatic encoder, which comprises the following steps of firstly, acquiring a real traffic flow x running in a road through a road section camera or a detector; then, encoding the real traffic flow x into a hidden variable z through a VAE network; decoding the hidden variable z into a reconstructed real traffic flow x' through a VAE network; finally, inputting the real traffic flow x and the reconstructed real traffic flow x' into an Encoder-Decoder end-to-end frame to obtain a mapping relation between the input data and an RNN unit hidden layer result in an Encoder module in the Encoder-Decoder end-to-end frame; and then the future traffic flow is predicted. The invention solves the problem of low traffic flow prediction accuracy caused by small traffic flow data detection samples in the prior art.
Description
Technical Field
The invention belongs to the technical field of traffic flow, and particularly relates to a small sample traffic flow prediction method based on a variational automatic encoder.
Background
With the development of social economy, the number of motor vehicles and non-motor vehicles on roads is increased, the traffic demand of people is increased, the contradiction between the supply and demand of traffic is increased, and the continuous traffic accidents, the traffic jam at intersections and the problem that the two sides of the roads are difficult to stop at present become obstacles in the stable development process of cities. How to obtain historical traffic flow data through detection equipment on a road section with a large traffic flow, and obtaining a traffic flow result of a current road at a future moment through a series of statistical analysis, correlation model analysis and the like, has great significance for safe and stable operation of road traffic.
In predicting the traffic flow, it is first necessary to acquire traffic flow data. At present, the collection of road traffic flow data mainly depends on a detector, a camera or an underground pressure sensor and the like. However, to improve the accuracy of the traffic transportation model, a large amount of data is needed for statistical analysis, and a large-scale traffic data acquisition process is lengthy. Moreover, if the data collection device is damaged, a loss of part of the data is caused. The deep learning method has obvious effect on the aspect of traffic flow analysis, can accurately obtain some characteristics and results on the aspect of future traffic transportation, and has the great characteristic that a large amount of data is required for network training, so that the deep learning method is contrary to the current traffic flow data acquisition aspect.
Therefore, aiming at the problems, the invention combines the early-stage short-time collected data, constructs the generated data distribution which accords with the real traffic flow data distribution through the learning of the VAE generator, enlarges the traffic flow data scale, and the road traffic flow data belongs to the time sequence data, so that the future traffic flow is predicted by utilizing an end-to-end model frame of a code-Decoder (Encoder-Decoder) to realize the sequence-to-sequence model, and the road traffic safety level is improved.
The basic idea for solving the problem of traffic flow data prediction of small samples is as follows: the current road traffic flow data are obtained through the detection equipment, the obtained historical traffic flow data of the small sample are trained through the VAE generator, the original historical traffic flow data of the small sample are expanded, and the traffic flow data prediction accuracy is improved. And then, uniformly inputting the real data and the generated data into an Encoder-Decoder model framework, wherein an Encoder mainly reads and encodes input sequence data, a Decoder mainly reads the output of the Encoder and performs multi-step prediction and output on the sequence, and a Recurrent Neural Network (RNN) model appears in the Decoder framework. At present, a generator of a mainstream mainly generates a countermeasure network (GAN) and a VAE, and the GAN network mainly utilizes an internal generator and a discriminator to carry out game, so that the error of the opposite side is maximized, data conforming to the distribution of real data is finally generated, the consumption time of the network in the training process is longer, and the training cannot be normally continued because whether the network effect is better or not cannot be judged in the training process.
Disclosure of Invention
The invention aims to provide a small sample traffic flow prediction method based on a variational automatic encoder, which solves the problem of low traffic flow prediction accuracy caused by small traffic flow data detection samples in the prior art.
The invention adopts the technical scheme that a small sample traffic flow prediction method based on a variational automatic encoder is implemented according to the following steps:
step 3, decoding the hidden variable z into a reconstructed real traffic flow x' through a VAE network;
step 4, inputting the real traffic flow x and the reconstructed real traffic flow x' into an Encoder-Decoder end-to-end frame to obtain a mapping relation between the input data and an RNN unit hidden layer result in an Encoder module in the Encoder-Decoder end-to-end frame;
and 5, predicting future traffic flow.
The present invention is also characterized in that,
the step 2 is implemented according to the following steps:
step 2.1, determining that the real traffic flow x is x1,...,xi,...,xtWherein, i is 1iRepresenting the real traffic flow when the time is i, and t represents the total time length;
step 2.2, defining a hidden variable z, wherein the corresponding distribution of the hidden variable z is p (z), the distribution of the real traffic flow x is p (x), and obtaining the relation between the distribution p (z) of the hidden variable z and the distribution p (x) of the real traffic flow x by a conditional probability formula, such as the formula (1):
wherein, p (z | x) is the distribution of a hidden variable z under the condition of the real traffic flow x, and p (x | z) is the distribution of the real traffic flow x under the condition of the hidden variable z;
step 2.3, training the real traffic flow x through a neural network, wherein the network input is traffic flow data x, and the network output is the mean value mu and the variance sigma of the real traffic flow x2So that the real traffic flow x follows a normal distribution N (mu, sigma)2) (ii) a Obtaining the distribution q (z | x) of a hidden variable z under the condition that the real traffic flow x obeys normal distribution by sampling the normal distribution;
step 2.4, calculating a distance KL (q (z | x) | p (z | x)) between the distribution p (z | x) of the hidden variable z under the condition that the real traffic flow x obeys normal distribution and the distribution q (z | x) of the hidden variable z under the condition that the real traffic flow x obeys normal distribution, as shown in formula (2):
by minimizing the formula (2), obtaining a minimum distance min (KL (q (z | x) | p (z | x))) between a distribution p (z | x) of a hidden variable z under the condition of the real traffic flow x and a distribution q (z | x) of the hidden variable z under the condition that the real traffic flow x obeys normal distribution, and taking the minimum distance min (KL (q (z | x) | p (z | x))) as a loss function in the VAE network, specifically as the formula (3):
wherein KL (q (z | x) | p (z)) corresponds to the encoding process in the VAE network, Ez~q(z|x)[logp(x|z)]Corresponding to a decoding process in a VAE network, z-q (z | x) represents the distribution of a real traffic flow x generated under the condition that a hidden variable z obeys posterior distribution q (z | x), and p (x | z) represents the distribution of the real traffic flow x generated under the condition that the hidden variable z obeys posterior distribution q (z | x);
step 2.5, assuming that the hidden variable z obeys the standard normal distribution N (0,1), namely p (z) to N (0,1), and the distribution q (z | x) of the hidden variable z obeys the normal distribution under the condition that the real traffic flow x obeys the normal distribution, namely q (z | x) to N (mu, sigma) of the hidden variable z2) Through step 2.4, a distance KL (q (z | x) | p (z))) between the distribution of the calculated hidden variable z and the distribution q (z | x) of the hidden variable z under the condition that the real traffic flow x obeys normal distribution is obtained, and the following results are obtained:
wherein the mean μ and the variance σ2Training a real traffic flow x through a neural network to obtain the real traffic flow x; and (3) obtaining the distribution q (z | x) of the hidden variable z under the condition that the real traffic flow x obeys normal distribution by utilizing a minimization formula (4), and further obtaining the distribution p (z | x) of the hidden variable z under the condition of the real traffic flow x, namely encoding the real traffic flow x into the hidden variable z.
Step 3 is specifically implemented according to the following steps:
training the encoded hidden variable z by utilizing a neural network, wherein the input of the network is the encoded hidden variable z, and the output is the mean value of the encoded hidden variable zAnd varianceBy sampling the normal distribution, the distribution p '(x | z) of the reconstructed real traffic flow x' is obtained under the condition that the coded hidden variable z obeys the normal distribution, as shown in the formula (5):
in step 2.4, the distribution p (x | z) of the real traffic flow x generated under the condition that the hidden variable z obeys the posterior distribution q (z | x) in the formula (3) is equal to the condition that the hidden variable z obeys the normal distributionUnder the condition of (a), the distribution p '(x | z) of the real traffic flow x' is reconstructed, and thus, E in the formula (3)z~q(z|x)[logp(x|z)]As shown in equation (6):
the result which is closer to the real traffic flow x, namely the reconstructed traffic flow x ' can be obtained by calculating posterior distribution p ' (x | z), and the process of regenerating the traffic flow by the process can approximate training data by using a neural network, so that the formula (3) is optimized by combining the formula (4) and the formula (6) through a back propagation method in the network training process, namely, a loss function in a VAE network is optimized, and the finally obtained reconstructed traffic flow x ' is more similar to the real traffic flow x;
definition of reconstructed traffic flow x '═ { x't+1,...,x't+i,....,x'2t},i=1,...,t,x't+iRepresenting the reconstruction intersection at time t + iThe flow rate is large, t represents the total time of the real traffic flow x, the starting time of the reconstructed traffic flow x' is t +1, and the total time is t.
The step 4 is as follows:
the real traffic flow X and the reconstructed traffic flow X' jointly form input data X ═ { X ═ X1,...,Xj,...,X T1, wherein X isjThe method comprises the following steps of representing the size of corresponding input data at the moment j, representing the total duration of the input data by T, namely T being 2T, and transmitting X to an Encoder-Decoder end-to-end framework, wherein the framework comprises two modules: the device comprises an Encoder module and a Decoder module, wherein the Encoder module and the Decoder module are both composed of a plurality of RNN units, and each RNN unit is composed of an input layer, a hidden layer and an output layer;
the RNN unit in the Encoder module receives the input data X and transmits the input data X to the hidden layer to obtain a hidden layer result h corresponding to the current momentj=f(hj-1,Xj) Wherein X isjRepresents input data of RNN cell corresponding to current time j, hj-1Is the RNN hidden layer result, h, corresponding to the previous time j-1jThe function f represents the hidden layer result at the previous moment and the mapping relation between the input data at the current moment and the hidden layer result at the current moment; the hidden layer results corresponding to different time are collected and compressed into a fixed length and transmitted to a vector C, wherein the vector C represents the input traffic flow data XTHidden layer results h corresponding to different momentsjThe relationship between the two is specifically expressed as: q (h)1,h2,...,hT) And q is a mapping relation between hidden layer results of a plurality of different RNN units and a vector C, the mapping relation is usually represented by a weighted sum of the hidden layer results, T represents the total duration of input data, and the vector C is obtained through an Encoder module so as to obtain the mapping relation between the input data X and the hidden layer results of the RNN units.
The step 5 is as follows:
transmitting the vector C obtained in the step 4 to an RNN unit in a Decoder module in an Endecoder-Decoder framework, and obtaining a traffic flow through a hidden layer and an output layerQuantitative prediction valueWherein T isfThe time length required to be predicted is represented, T represents the total time length of the input data X, and the specific relation is as follows:wherein,indicates the current time T + TfThe predicted value of the traffic flow of (a),represents the last time T + Tf-1 a traffic flow prediction value,indicates the last time T + Tf-1 hidden layer result of corresponding RNN unit, function g representing mapping relation between current time traffic flow predicted value and last time traffic flow predicted value and Encoder module output, function g obtained by nonlinear multi-layer neural network training, final prediction result Y ═ YT+1,...,YT+Tf]Where T represents the total duration of the input data X, TfIndicating the length of time to be predicted, and Y indicating the duration of time TfAnd if the corresponding traffic flow predicted value Y is larger, the situation that the road traffic is jammed at the moment in the future is shown.
The small sample traffic flow prediction method based on the variational automatic encoder has the advantages that the current road traffic flow data is obtained through the detection equipment, the small sample traffic flow data obtained by the detection equipment is reconstructed and expanded by the VAE generator, the original small sample traffic flow data is expanded, the data detection cost is reduced, and the traffic flow data prediction accuracy can be further improved. And then uniformly inputting the real data and the generated data into an Encoder-Decoder model framework, wherein an Encoder and a Decoder module adopt RNN to calculate the input data, the Encoder mainly reads an input traffic flow sequence and encodes the input traffic flow sequence into a vector C with a fixed length, and the Decoder reads the vector output of the Encoder and predicts and outputs the sequence. By using the small sample traffic flow prediction method based on the variational automatic encoder, the traffic flow prediction accuracy can be improved aiming at the disadvantage of small sample data in a neural network, the road safety level is further improved, and the traffic jam state is reduced.
Drawings
FIG. 1 is a general flow diagram of a small sample traffic flow prediction method based on a variational automatic encoder of the present invention;
FIG. 2 is a VAE generation process of a small sample traffic flow prediction method based on a variational automatic encoder according to the present invention;
fig. 3 is a traffic flow data prediction part (Encoder-Decoder end-to-end model framework) of a small sample traffic flow prediction method based on a variation automatic Encoder according to the present invention.
Detailed Description
The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
The invention discloses a small sample traffic flow prediction method based on a variational automatic encoder, which is implemented by the following steps as shown in a flow chart shown in figure 1:
step 2.1, determining that the real traffic flow x is x1,...,xi,...,xtWherein, i is 1iRepresenting the real traffic flow when the time is i, and t represents the total time length;
step 2.2, defining a hidden variable z, wherein the corresponding distribution of the hidden variable z is p (z), the distribution of the real traffic flow x is p (x), and obtaining the relation between the distribution p (z) of the hidden variable z and the distribution p (x) of the real traffic flow x by a conditional probability formula, such as the formula (1):
wherein, p (z | x) is the distribution of a hidden variable z under the condition of the real traffic flow x, and p (x | z) is the distribution of the real traffic flow x under the condition of the hidden variable z;
step 2.3, training the real traffic flow x through a neural network, wherein the network input is traffic flow data x, and the network output is the mean value mu and the variance sigma of the real traffic flow x2So that the real traffic flow x follows a normal distribution N (mu, sigma)2) (ii) a Obtaining the distribution q (z | x) of a hidden variable z under the condition that the real traffic flow x obeys normal distribution by sampling the normal distribution;
step 2.4, calculating a distance KL (q (z | x) | p (z | x)) between the distribution p (z | x) of the hidden variable z under the condition that the real traffic flow x obeys normal distribution and the distribution q (z | x) of the hidden variable z under the condition that the real traffic flow x obeys normal distribution, as shown in formula (2):
by minimizing the formula (2), obtaining a minimum distance min (KL (q (z | x) | p (z | x))) between a distribution p (z | x) of a hidden variable z under the condition of the real traffic flow x and a distribution q (z | x) of the hidden variable z under the condition that the real traffic flow x obeys normal distribution, and taking the minimum distance min (KL (q (z | x) | p (z | x))) as a loss function in the VAE network, specifically as the formula (3):
wherein KL (q (z | x) | p (z)) corresponds to the encoding process in the VAE network, Ez~q(z|x)[logp(x|z)]Corresponding to a decoding process in a VAE network, z-q (z | x) represents the distribution of a real traffic flow x generated under the condition that a hidden variable z obeys posterior distribution q (z | x), and p (x | z) represents the distribution of the real traffic flow x generated under the condition that the hidden variable z obeys posterior distribution q (z | x);
step 2.5, assuming that the hidden variable z obeys the standard normal distribution N (0,1), namely p (z) to N (0,1), and the distribution q (z | x) of the hidden variable z obeys the normal distribution under the condition that the real traffic flow x obeys the normal distribution, namely q (z | x) to N (mu, sigma) of the hidden variable z2) Through step 2.4, a distance KL (q (z | x) | p (z))) between the distribution of the calculated hidden variable z and the distribution q (z | x) of the hidden variable z under the condition that the real traffic flow x obeys normal distribution is obtained, and the following results are obtained:
wherein the mean μ and the variance σ2Training a real traffic flow x through a neural network to obtain the real traffic flow x; and (3) obtaining the distribution q (z | x) of the hidden variable z under the condition that the real traffic flow x obeys normal distribution by utilizing a minimization formula (4), and further obtaining the distribution p (z | x) of the hidden variable z under the condition of the real traffic flow x, namely encoding the real traffic flow x into the hidden variable z.
Step 3, as shown in fig. 2, decoding the hidden variable z into a reconstructed real traffic flow x' through the VAE network, specifically according to the following steps:
the distribution p (z | x) of the hidden variable z under the condition of the real traffic flow x is obtained through the step 2, namely, the real traffic flow x is coded into the hidden variable z. Ez~q(z|x)[logp(x|z)]An expected value of the real traffic flow x generated under the condition that the hidden variable z obeys the posterior distribution q (z | x). Assuming that posterior distribution p (x | z) in formula (3) of step 2.4 obeys normal distribution, the distribution p (z | x) of hidden variable z under the condition of real traffic flow x is obtained through step 2.5, that is, hidden variable z is obtained by encoding real traffic flow x, and encoded hidden variable z is trained by using a neural network, wherein the input of the network is encoded hidden variable z, and the output is the mean value of encoded hidden variable zAnd varianceBy passingSampling the normal distribution to obtain a distribution p '(x | z) of a reconstructed real traffic flow x' under the condition that the coded hidden variable z obeys the normal distribution, as shown in formula (5):
since the reconstructed traffic flow x 'is obtained by reconstructing the real traffic flow x through the VAE network, and the distribution of the reconstructed traffic flow x' is similar to the distribution of the real traffic flow x, the distribution p (x | z) of the real traffic flow x generated under the condition that the hidden variable z obeys the posterior distribution q (z | x) in the formula (3) in the step 2.4 is equal to the condition that the hidden variable z obeys the normal distributionUnder the condition of (a), the distribution p '(x | z) of the real traffic flow x' is reconstructed, and thus, E in the formula (3)z~q(z|x)[logp(x|z)]As shown in equation (6):
the result which is closer to the real traffic flow x, namely the reconstructed traffic flow x ' can be obtained by calculating posterior distribution p ' (x | z), and the process of regenerating the traffic flow by the process can approximate training data by using a neural network, so that the formula (3) is optimized by combining the formula (4) and the formula (6) through a back propagation method in the network training process, namely, a loss function in a VAE network is optimized, and the finally obtained reconstructed traffic flow x ' is more similar to the real traffic flow x;
since the traffic flow data is periodic, the total time duration of the real traffic flow x is t, and the reconstructed traffic flow x ' has the same time duration as and similar size to the real traffic flow x, the reconstructed traffic flow x ' is defined as { x 't+1,...,x't+i,....,x'2t},i=1,...,t,x't+iRepresenting the reconstructed traffic flow when the time is t + i, t representing the total time length of the real traffic flow x, the starting time of the reconstructed traffic flow x' being t +1, and the total time length beingt。
Step 4, inputting the real traffic flow x and the reconstructed real traffic flow x' into an Encoder-Decoder end-to-end frame to obtain a mapping relation between the input data and an RNN unit hidden layer result in an Encoder module in the Encoder-Decoder end-to-end frame; the step 4 is as follows:
the real traffic flow X and the reconstructed traffic flow X' jointly form input data X ═ { X ═ X1,...,Xj,...,X T1, wherein X isjThe method comprises the following steps of representing the size of corresponding input data at the moment j, representing the total duration of the input data by T, namely T being 2T, and transmitting X to an Encoder-Decoder end-to-end framework, wherein the framework comprises two modules: the device comprises an Encoder module and a Decoder module, wherein the Encoder module and the Decoder module are both composed of a plurality of RNN units, and each RNN unit is composed of an input layer, a hidden layer and an output layer; in the RNN unit, the result of the hidden layer at the current time is related to both the current time input and the previous time hidden layer result.
The RNN unit in the Encoder module receives the input data X and transmits the input data X to the hidden layer to obtain a hidden layer result h corresponding to the current momentj=f(hj-1,Xj) Wherein X isjRepresents input data of RNN cell corresponding to current time j, hj-1Is the RNN hidden layer result, h, corresponding to the previous time j-1jThe function f represents the hidden layer result at the previous moment and the mapping relation between the input data at the current moment and the hidden layer result at the current moment; as shown in fig. 3, the hidden layer results corresponding to different times are collected and compressed into a fixed length, and transmitted to the vector C, which represents the input traffic flow data XTHidden layer results h corresponding to different momentsjThe relationship between the two is specifically expressed as: q (h)1,h2,...,hT) Wherein q is a mapping relation between hidden layer results of a plurality of different RNN units and a vector C, the mapping relation is usually represented by a weighted sum of the hidden layer results, T represents the total duration of input data, and the vector C is obtained through an Encoder module so as to obtain the mapping relation between the input data X and the hidden layer results of the RNN unitsAnd (4) relationship.
Step 5, predicting future traffic flow, which is specifically as follows:
and transmitting the vector C obtained in the step 4 to an RNN unit in a Decoder module in an Encoder-Decoder framework, wherein the Decoder module is similar to the Encoder module and consists of a plurality of RNN units. Obtaining traffic flow predicted value through hidden layer and output layerWherein T isfThe time length required to be predicted is represented, T represents the total time length of the input data X, and the specific relation is as follows:wherein,indicates the current time T + TfThe predicted value of the traffic flow of (a),represents the last time T + Tf-1 a traffic flow prediction value,indicates the last time T + Tf-1 hidden layer result of corresponding RNN unit, function g representing mapping relation between current time traffic flow predicted value and last time traffic flow predicted value and Encoder module output, function g obtained by nonlinear multi-layer neural network training, final prediction result Y ═ YT+1,...,YT+Tf]Where T represents the total duration of the input data X, TfIndicating the length of time to be predicted, and Y indicating the duration of time TfAnd if the corresponding traffic flow predicted value Y is larger, the situation that the road traffic is jammed at the moment in the future is shown.
Claims (5)
1. A small sample traffic flow prediction method based on a variational automatic encoder is characterized by comprising the following steps:
step 1, collecting real traffic flow x running in a road through a road section camera or a detector;
step 2, coding the real traffic flow x into a hidden variable z through a VAE network;
step 3, decoding the hidden variable z into a reconstructed real traffic flow x' through a VAE network;
step 4, inputting the real traffic flow x and the reconstructed real traffic flow x' into an Encoder-Decoder end-to-end frame to obtain a mapping relation between the input data and an RNN unit hidden layer result in an Encoder module in the Encoder-Decoder end-to-end frame;
and 5, predicting future traffic flow.
2. The small-sample traffic flow prediction method based on the variational automatic encoder according to claim 1, wherein the step 2 is implemented according to the following steps:
step 2.1, determining that the real traffic flow x is x1,...,xi,...,xtWherein, i is 1iRepresenting the real traffic flow when the time is i, and t represents the total time length;
step 2.2, defining a hidden variable z, wherein the corresponding distribution of the hidden variable z is p (z), the distribution of the real traffic flow x is p (x), and obtaining the relation between the distribution p (z) of the hidden variable z and the distribution p (x) of the real traffic flow x by a conditional probability formula, such as the formula (1):
wherein, p (z | x) is the distribution of a hidden variable z under the condition of the real traffic flow x, and p (x | z) is the distribution of the real traffic flow x under the condition of the hidden variable z;
step 2.3, training the real traffic flow x through a neural network, wherein the network input is traffic flow data x, and the network output is the mean value mu and the variance sigma of the real traffic flow x2So that the real traffic flow x follows a normal distribution N (mu, sigma)2) (ii) a Tong (Chinese character of 'tong')Sampling the normal distribution to obtain the distribution q (z | x) of a hidden variable z under the condition that the real traffic flow x obeys the normal distribution;
step 2.4, calculating a distance KL (q (z | x) | p (z | x)) between the distribution p (z | x) of the hidden variable z under the condition that the real traffic flow x obeys normal distribution and the distribution q (z | x) of the hidden variable z under the condition that the real traffic flow x obeys normal distribution, as shown in formula (2):
by minimizing the formula (2), obtaining a minimum distance min (KL (q (z | x) | p (z | x))) between a distribution p (z | x) of a hidden variable z under the condition of the real traffic flow x and a distribution q (z | x) of the hidden variable z under the condition that the real traffic flow x obeys normal distribution, and taking the minimum distance min (KL (q (z | x) | p (z | x))) as a loss function in the VAE network, specifically as the formula (3):
wherein KL (q (z | x) | p (z)) corresponds to the encoding process in the VAE network, Ez~q(z|x)[logp(x|z)]Corresponding to a decoding process in a VAE network, z-q (z | x) represents the distribution of a real traffic flow x generated under the condition that a hidden variable z obeys posterior distribution q (z | x), and p (x | z) represents the distribution of the real traffic flow x generated under the condition that the hidden variable z obeys posterior distribution q (z | x);
step 2.5, assuming that the hidden variable z obeys the standard normal distribution N (0,1), namely p (z) to N (0,1), and the distribution q (z | x) of the hidden variable z obeys the normal distribution under the condition that the real traffic flow x obeys the normal distribution, namely q (z | x) to N (mu, sigma) of the hidden variable z2) Through step 2.4, a distance KL (q (z | x) | p (z))) between the distribution of the calculated hidden variable z and the distribution q (z | x) of the hidden variable z under the condition that the real traffic flow x obeys normal distribution is obtained, and the following results are obtained:
wherein the mean μ and the variance σ2Training a real traffic flow x through a neural network to obtain the real traffic flow x; and (3) obtaining the distribution q (z | x) of the hidden variable z under the condition that the real traffic flow x obeys normal distribution by utilizing a minimization formula (4), and further obtaining the distribution p (z | x) of the hidden variable z under the condition of the real traffic flow x, namely encoding the real traffic flow x into the hidden variable z.
3. The small-sample traffic flow prediction method based on the variational automatic encoder according to claim 2, wherein the step 3 is implemented according to the following steps:
training the encoded hidden variable z by utilizing a neural network, wherein the input of the network is the encoded hidden variable z, and the output is the mean value of the encoded hidden variable zAnd varianceBy sampling the normal distribution, the distribution p '(x | z) of the reconstructed real traffic flow x' is obtained under the condition that the coded hidden variable z obeys the normal distribution, as shown in the formula (5):
in step 2.4, the distribution p (x | z) of the real traffic flow x generated under the condition that the hidden variable z obeys the posterior distribution q (z | x) in the formula (3) is equal to the condition that the hidden variable z obeys the normal distributionUnder the condition of (a), the distribution p '(x | z) of the real traffic flow x' is reconstructed, and thus, E in the formula (3)z~q(z|x)[logp(x|z)]As shown in equation (6):
the result which is closer to the real traffic flow x, namely the reconstructed traffic flow x ' can be obtained by calculating posterior distribution p ' (x | z), and the process of regenerating the traffic flow by the process can approximate training data by using a neural network, so that the formula (3) is optimized by combining the formula (4) and the formula (6) through a back propagation method in the network training process, namely, a loss function in a VAE network is optimized, and the finally obtained reconstructed traffic flow x ' is more similar to the real traffic flow x;
definition of reconstructed traffic flow x '═ { x't+1,...,x't+i,....,x'2t},i=1,...,t,x't+iRepresenting the reconstructed traffic flow when the time is t + i, t representing the total time length of the real traffic flow x, the starting moment of the reconstructed traffic flow x' being t +1, and the total time length being t.
4. The method for predicting the traffic flow of the small sample based on the variational automatic encoder according to claim 3, wherein the step 4 is as follows:
the real traffic flow X and the reconstructed traffic flow X' jointly form input data X ═ { X ═ X1,...,Xj,...,XT1, wherein X isjThe method comprises the following steps of representing the size of corresponding input data at the moment j, representing the total duration of the input data by T, namely T being 2T, and transmitting X to an Encoder-Decoder end-to-end framework, wherein the framework comprises two modules: the device comprises an Encoder module and a Decoder module, wherein the Encoder module and the Decoder module are both composed of a plurality of RNN units, and each RNN unit is composed of an input layer, a hidden layer and an output layer;
the RNN unit in the Encoder module receives the input data X and transmits the input data X to the hidden layer to obtain a hidden layer result h corresponding to the current momentj=f(hj-1,Xj) Wherein X isjRepresents input data of RNN cell corresponding to current time j, hj-1Is the RNN hidden layer result, h, corresponding to the previous time j-1jIs the RNN hidden result corresponding to the current time j, and the function f represents the hidden layer result at the previous time toAnd the mapping relation between the input data at the current moment and the hidden layer result at the current moment; the hidden layer results corresponding to different time are collected and compressed into a fixed length and transmitted to a vector C, wherein the vector C represents the input traffic flow data XTHidden layer results h corresponding to different momentsjThe relationship between the two is specifically expressed as: q (h)1,h2,...,hT) And q is a mapping relation between hidden layer results of a plurality of different RNN units and a vector C, the mapping relation is usually represented by a weighted sum of the hidden layer results, T represents the total duration of input data, and the vector C is obtained through an Encoder module so as to obtain the mapping relation between the input data X and the hidden layer results of the RNN units.
5. The method for predicting the traffic flow of the small sample based on the variational automatic encoder according to claim 4, wherein the step 5 is as follows:
transmitting the vector C obtained in the step 4 to an RNN unit in a Decoder module in an Endecoder-Decoder framework, and obtaining a traffic flow predicted value through a hidden layer and an output layerWherein T isfThe time length required to be predicted is represented, T represents the total time length of the input data X, and the specific relation is as follows:wherein,indicates the current time T + TfThe predicted value of the traffic flow of (a),represents the last time T + Tf-1 a traffic flow prediction value,indicates the last time T + Tf-1 hidden layer result of corresponding RNN unit, function g representing mapping relation between current time traffic flow predicted value and last time traffic flow predicted value and Encoder module output, function g obtained by nonlinear multi-layer neural network training, final prediction result Y ═ YT+1,...,YT+Tf]Where T represents the total duration of the input data X, TfIndicating the length of time to be predicted, and Y indicating the duration of time TfAnd if the corresponding traffic flow predicted value Y is larger, the situation that the road traffic is jammed at the moment in the future is shown.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010529619.7A CN111915881B (en) | 2020-06-11 | 2020-06-11 | Small sample traffic flow prediction method based on variational automatic encoder |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010529619.7A CN111915881B (en) | 2020-06-11 | 2020-06-11 | Small sample traffic flow prediction method based on variational automatic encoder |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111915881A true CN111915881A (en) | 2020-11-10 |
CN111915881B CN111915881B (en) | 2022-09-02 |
Family
ID=73237651
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010529619.7A Active CN111915881B (en) | 2020-06-11 | 2020-06-11 | Small sample traffic flow prediction method based on variational automatic encoder |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111915881B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113282552A (en) * | 2021-06-04 | 2021-08-20 | 上海天旦网络科技发展有限公司 | Similarity direction quantization method and system for flow statistic log |
CN113642822A (en) * | 2020-12-04 | 2021-11-12 | 广东省建筑设计研究院有限公司 | VAE-based sample set directional expansion method for evaluating building group structure safety |
CN115017990A (en) * | 2022-06-01 | 2022-09-06 | 哈尔滨工业大学(深圳)(哈尔滨工业大学深圳科技创新研究院) | Traffic flow prediction method, device, equipment and storage medium |
CN118133029A (en) * | 2024-05-10 | 2024-06-04 | 民航成都信息技术有限公司 | Method, device, equipment and medium for generating multi-scene flight simulation data |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101025854A (en) * | 2007-02-12 | 2007-08-29 | 西安理工大学 | Concrete internal temperature detecting device based on induction princinple |
CN103366411A (en) * | 2012-03-30 | 2013-10-23 | 国际商业机器公司 | Method and device for transmitting vehicle position data residual errors by virtue of wireless network |
CN106910337A (en) * | 2017-01-19 | 2017-06-30 | 长安大学 | A kind of traffic flow forecasting method based on glowworm swarm algorithm Yu RBF neural |
US20170256162A1 (en) * | 2014-09-05 | 2017-09-07 | Tomtom Traffic B.V. | Methods and systems for generating flow data |
CN108921343A (en) * | 2018-06-26 | 2018-11-30 | 浙江工业大学 | Based on storehouse self-encoding encoder-support vector regression traffic flow forecasting method |
CN109117987A (en) * | 2018-07-18 | 2019-01-01 | 厦门大学 | Personalized street accidents risks based on deep learning predict recommended method |
CN110245380A (en) * | 2019-05-10 | 2019-09-17 | 西安理工大学 | Soft instrument training and sample compensation process |
US20190287404A1 (en) * | 2018-03-13 | 2019-09-19 | Nec Laboratories America, Inc. | Traffic prediction with reparameterized pushforward policy for autonomous vehicles |
WO2019228654A1 (en) * | 2018-06-01 | 2019-12-05 | Toyota Motor Europe | Method for training a prediction system and system for sequence prediction |
CN110599766A (en) * | 2019-08-22 | 2019-12-20 | 浙江工业大学 | Road traffic jam propagation prediction method based on SAE-LSTM-SAD |
-
2020
- 2020-06-11 CN CN202010529619.7A patent/CN111915881B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101025854A (en) * | 2007-02-12 | 2007-08-29 | 西安理工大学 | Concrete internal temperature detecting device based on induction princinple |
CN103366411A (en) * | 2012-03-30 | 2013-10-23 | 国际商业机器公司 | Method and device for transmitting vehicle position data residual errors by virtue of wireless network |
US20170256162A1 (en) * | 2014-09-05 | 2017-09-07 | Tomtom Traffic B.V. | Methods and systems for generating flow data |
CN106910337A (en) * | 2017-01-19 | 2017-06-30 | 长安大学 | A kind of traffic flow forecasting method based on glowworm swarm algorithm Yu RBF neural |
US20190287404A1 (en) * | 2018-03-13 | 2019-09-19 | Nec Laboratories America, Inc. | Traffic prediction with reparameterized pushforward policy for autonomous vehicles |
WO2019228654A1 (en) * | 2018-06-01 | 2019-12-05 | Toyota Motor Europe | Method for training a prediction system and system for sequence prediction |
CN108921343A (en) * | 2018-06-26 | 2018-11-30 | 浙江工业大学 | Based on storehouse self-encoding encoder-support vector regression traffic flow forecasting method |
CN109117987A (en) * | 2018-07-18 | 2019-01-01 | 厦门大学 | Personalized street accidents risks based on deep learning predict recommended method |
CN110245380A (en) * | 2019-05-10 | 2019-09-17 | 西安理工大学 | Soft instrument training and sample compensation process |
CN110599766A (en) * | 2019-08-22 | 2019-12-20 | 浙江工业大学 | Road traffic jam propagation prediction method based on SAE-LSTM-SAD |
Non-Patent Citations (3)
Title |
---|
GUILLEM BOQUET.ETC: "A variational autoencoder solution for road traffic forecasting systems: Missing data imputation", 《TRANSPORTATION RESEARCH》 * |
张文刚: "基于深度学习的交通预测技术及其在通信中的应用研究", 《中国优秀硕士学位论文全文数据库》 * |
黑新宏等: "基于二元决策图的故障树底事件排序", 《西安理工大学学报》 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113642822A (en) * | 2020-12-04 | 2021-11-12 | 广东省建筑设计研究院有限公司 | VAE-based sample set directional expansion method for evaluating building group structure safety |
CN113642822B (en) * | 2020-12-04 | 2024-03-01 | 广东省建筑设计研究院有限公司 | VAE-based sample set directivity extension method for evaluating building group structure safety |
CN113282552A (en) * | 2021-06-04 | 2021-08-20 | 上海天旦网络科技发展有限公司 | Similarity direction quantization method and system for flow statistic log |
CN115017990A (en) * | 2022-06-01 | 2022-09-06 | 哈尔滨工业大学(深圳)(哈尔滨工业大学深圳科技创新研究院) | Traffic flow prediction method, device, equipment and storage medium |
CN118133029A (en) * | 2024-05-10 | 2024-06-04 | 民航成都信息技术有限公司 | Method, device, equipment and medium for generating multi-scene flight simulation data |
Also Published As
Publication number | Publication date |
---|---|
CN111915881B (en) | 2022-09-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111915881B (en) | Small sample traffic flow prediction method based on variational automatic encoder | |
CN111915059B (en) | Attention mechanism-based Seq2Seq berth occupancy prediction method | |
CN108133295B (en) | Motor vehicle exhaust concentration continuous time prediction method for target road section | |
CN110163449B (en) | Motor vehicle pollution discharge monitoring node deployment method based on active space-time diagram convolution | |
CN114299723B (en) | Traffic flow prediction method | |
CN113762338B (en) | Traffic flow prediction method, equipment and medium based on multiple graph attention mechanism | |
CN110738355A (en) | urban waterlogging prediction method based on neural network | |
CN116151459B (en) | Power grid flood prevention risk probability prediction method and system based on improved Transformer | |
CN102109619A (en) | System and method for predicting typhoon surge based on artificial intelligence | |
CN108364087A (en) | A kind of spatio-temporal prediction method of urban mobile tail gas concentration | |
CN114692762A (en) | Vehicle track prediction method based on graph attention interaction mechanism | |
CN113487863A (en) | Multi-factor traffic risk real-time quantitative evaluation system and method | |
CN117371571A (en) | Regional air quality prediction model based on multi-scale dynamic synchronous diagram mechanism | |
CN116307152A (en) | Traffic prediction method for space-time interactive dynamic graph attention network | |
CN115237896A (en) | Data preprocessing method and system for forecasting air quality based on deep learning | |
CN106759546A (en) | Based on the Deep Foundation Distortion Forecast method and device for improving multivariable grey forecasting model | |
CN115054270B (en) | Sleep stage method and system for extracting sleep spectrogram characteristics based on GCN | |
CN117852701B (en) | Traffic flow prediction method and system based on characteristic attention mechanism | |
CN113627676A (en) | Traffic prediction method and system based on multi-attention causal relationship | |
CN118247953A (en) | Traffic flow prediction method and device by combining rainfall and space-time diagram convolution model | |
CN113949880B (en) | Extremely-low-bit-rate man-machine collaborative image coding training method and coding and decoding method | |
CN114091772B (en) | Multi-angle fusion road traffic flow prediction method based on encoder and decoder | |
CN116824851A (en) | Path-based urban expressway corridor traffic jam tracing method | |
CN116778709A (en) | Prediction method for traffic flow speed of convolutional network based on attention space-time diagram | |
CN116469029A (en) | Oilfield on-site violation behavior identification method based on multi-layer perceptron network |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20240220 Address after: 518000 1002, Building A, Zhiyun Industrial Park, No. 13, Huaxing Road, Henglang Community, Longhua District, Shenzhen, Guangdong Province Patentee after: Shenzhen Wanzhida Technology Co.,Ltd. Country or region after: China Address before: 710048 Shaanxi province Xi'an Beilin District Jinhua Road No. 5 Patentee before: XI'AN University OF TECHNOLOGY Country or region before: China |
|
TR01 | Transfer of patent right |