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 PDF

Info

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
Application number
CN202010529619.7A
Other languages
Chinese (zh)
Other versions
CN111915881B (en
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.)
Shenzhen Wanzhida Technology Co ltd
Original Assignee
Xian University of Technology
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 Xian University of Technology filed Critical Xian University of Technology
Priority to CN202010529619.7A priority Critical patent/CN111915881B/en
Publication of CN111915881A publication Critical patent/CN111915881A/en
Application granted granted Critical
Publication of CN111915881B publication Critical patent/CN111915881B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G08SIGNALLING
    • G08GTRAFFIC CONTROL SYSTEMS
    • G08G1/00Traffic control systems for road vehicles
    • G08G1/01Detecting movement of traffic to be counted or controlled
    • G08G1/0104Measuring and analyzing of parameters relative to traffic conditions
    • 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/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G08SIGNALLING
    • G08GTRAFFIC CONTROL SYSTEMS
    • G08G1/00Traffic control systems for road vehicles
    • G08G1/01Detecting movement of traffic to be counted or controlled
    • G08G1/0104Measuring and analyzing of parameters relative to traffic conditions
    • G08G1/0125Traffic data processing
    • GPHYSICS
    • G08SIGNALLING
    • G08GTRAFFIC CONTROL SYSTEMS
    • G08G1/00Traffic control systems for road vehicles
    • G08G1/065Traffic 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
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine 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

Small sample traffic flow prediction method based on variational automatic encoder
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 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.
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):
Figure BDA0002534917980000031
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):
Figure BDA0002534917980000041
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):
Figure BDA0002534917980000042
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:
Figure BDA0002534917980000051
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 z
Figure BDA0002534917980000052
And variance
Figure BDA0002534917980000053
By 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):
Figure BDA0002534917980000054
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 distribution
Figure BDA0002534917980000055
Under 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):
Figure BDA0002534917980000061
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 value
Figure BDA0002534917980000071
Wherein 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:
Figure BDA0002534917980000072
wherein the content of the first and second substances,
Figure BDA0002534917980000073
indicates the current time T + TfThe predicted value of the traffic flow of (a),
Figure BDA0002534917980000074
represents the last time T + Tf-1 a traffic flow prediction value,
Figure BDA0002534917980000075
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 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 an implicit variable z through a VAE network, and specifically implementing 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):
Figure BDA0002534917980000091
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):
Figure BDA0002534917980000092
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):
Figure BDA0002534917980000093
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:
Figure BDA0002534917980000101
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 z
Figure BDA0002534917980000111
And variance
Figure BDA0002534917980000112
By 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):
Figure BDA0002534917980000113
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 distribution
Figure BDA0002534917980000114
Under 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):
Figure BDA0002534917980000115
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 layer
Figure BDA0002534917980000131
Wherein 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:
Figure BDA0002534917980000132
wherein the content of the first and second substances,
Figure BDA0002534917980000133
indicates the current time T + TfThe predicted value of the traffic flow of (a),
Figure BDA0002534917980000134
represents the last time T + Tf-1 a traffic flow prediction value,
Figure BDA0002534917980000135
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):
Figure FDA0002534917970000011
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):
Figure FDA0002534917970000021
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):
Figure FDA0002534917970000022
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:
Figure FDA0002534917970000031
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 z
Figure FDA0002534917970000032
And variance
Figure FDA0002534917970000033
By 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):
Figure FDA0002534917970000034
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 distribution
Figure FDA0002534917970000035
Under 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):
Figure FDA0002534917970000041
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 layer
Figure FDA0002534917970000051
Wherein 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:
Figure FDA0002534917970000052
wherein the content of the first and second substances,
Figure FDA0002534917970000053
indicates the current time T + TfThe predicted value of the traffic flow of (a),
Figure FDA0002534917970000054
represents the last time T + Tf-1 a traffic flow prediction value,
Figure FDA0002534917970000055
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.
CN202010529619.7A 2020-06-11 2020-06-11 Small sample traffic flow prediction method based on variational automatic encoder Active CN111915881B (en)

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 (3)

* Cited by examiner, † Cited by third party
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

Citations (10)

* Cited by examiner, † Cited by third party
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

Patent Citations (10)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
Title
GUILLEM BOQUET.ETC: "A variational autoencoder solution for road traffic forecasting systems: Missing data imputation", 《TRANSPORTATION RESEARCH》 *
张文刚: "基于深度学习的交通预测技术及其在通信中的应用研究", 《中国优秀硕士学位论文全文数据库》 *
黑新宏等: "基于二元决策图的故障树底事件排序", 《西安理工大学学报》 *

Cited By (4)

* Cited by examiner, † Cited by third party
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

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
CN111832814A (en) Air pollutant concentration prediction method based on graph attention machine mechanism
CN108133295B (en) Motor vehicle exhaust concentration continuous time prediction method for target road section
CN114299723B (en) Traffic flow prediction method
CN110738355A (en) urban waterlogging prediction method based on neural network
CN102109619A (en) System and method for predicting typhoon surge based on artificial intelligence
CN113762338B (en) Traffic flow prediction method, equipment and medium based on multiple graph attention mechanism
CN112330951A (en) Method for realizing road network traffic data restoration based on generation of countermeasure network
CN104408915A (en) Traffic state parameter estimation method and system
CN111275962A (en) Vehicle track data aggregation effect prediction method and device
CN114202120A (en) Urban traffic travel time prediction method aiming at multi-source heterogeneous data
CN115147819A (en) Driver fixation point prediction method based on fixation point prediction model
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
CN115204618A (en) CCMVS regional carbon source convergence inversion evaluation system
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
CN113627676A (en) Traffic prediction method and system based on multi-attention causal relationship
CN117371571A (en) Regional air quality prediction model based on multi-scale dynamic synchronous diagram mechanism
CN116699731A (en) Tropical cyclone path short-term forecasting method, system and storage medium
CN117237475A (en) Vehicle traffic track generation method and device based on diffusion generation model
CN113949880B (en) Extremely-low-bit-rate man-machine collaborative image coding training method and coding and decoding method
CN114385619B (en) Multi-channel ocean observation time sequence scalar data missing value prediction method and system
CN116824851A (en) Path-based urban expressway corridor traffic jam tracing method

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