Traffic demand day-to-day evolution prediction method based on neural network
Technical Field
The invention relates to the technical field of urban traffic, in particular to a traffic demand day-to-day evolution prediction method based on a neural network.
Background
The traffic demand prediction is to build a model according to the traffic conditions and characteristics of the past and the present situation and predict the future traffic flow change. The key to solve the urban traffic problem lies in realizing the balance of traffic supply and demand, and the accurate analysis of traffic demand is the basis for solving the contradiction between supply and demand.
Travel generation prediction is the basis of traffic demand prediction in urban traffic planning, and important support is provided for an effective and accurate dynamic traffic distribution model. However, the existing traffic demand prediction model is mainly based on the traditional manual survey mode and a large amount of relevant data such as economy and population, so that huge manpower and material resources are consumed, the result of the model is lack of accuracy and timeliness, and the dynamic and real-time management requirements on a large-scale traffic network in an intelligent traffic system cannot be met.
In summary, the existing traffic demand prediction method has many defects; the traditional traffic generation prediction research based on the four-stage traffic demand prediction method ignores the space-time internal relevance of a traffic network, and further cannot realize the dynamic real-time analysis of a large-range traffic network in a short time.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a traffic demand day-by-day evolution prediction method based on a neural network, and data mining is performed by using a mobile phone signaling resource, so that the defects of the traditional traffic demand prediction method in the field of traffic planning in the aspects of precision and efficiency are overcome, the road network performance of each day in the traffic network day-by-day dynamic evolution process is fully considered, and the method has strong applicability.
In order to solve the technical problem, the invention provides a traffic demand day-to-day evolution prediction method based on a neural network, which comprises the following steps:
(1) dividing specific partitions of the urban traffic network and numbering;
(2) determining a cell set during neural network model training and a cell set during model verification based on the traffic network partition established in the step (1);
(3) grouping the obtained data sets according to the travel generation cells and the small time segments, and performing data preprocessing;
(4) establishing a cyclic neural network model and a feature level fusion neural network model for predicting traffic demands, wherein the cyclic neural network model and the feature level fusion neural network model are used for function estimation and weight updating of each cell under different time states;
(5) inputting the travel generated quantity of each cell as a training sample, and completing weight determination of the recurrent neural network model and the feature level fusion neural network model; when prediction is carried out, tested community traffic demand data is input into the trained cyclic neural network model and the trained feature level fusion neural network model for calculation, and finally the predicted traffic demand of the region is obtained.
Preferably, in the step (3), the data preprocessing specifically includes the following steps:
(31) filling missing data, replacing the missing data by using the average value of data of two adjacent time periods when single data is missing, and replacing the missing data by using data of the same time period in the next day when a plurality of data are missing;
(32) extracting features by using a sliding time window with the size of r and the step value of 1;
(33) the data of the requirements is standardized and the data of the requirements is,
x=(x-mean)/std
where std is the standard deviation of the data.
Preferably, in the step (4), the establishing of the recurrent neural network model and the feature level fusion neural network model for predicting the traffic demand specifically includes the following steps:
(41) constructing a cyclic neural network model and a feature level fusion neural network model, and determining the forward propagation process of an RNN (neural network) model, wherein the RNN model consists of an input unit, an output unit and a cyclic hidden layer, and xtIs an input value at time t, stIs the hidden layer state at time t
st=f(Uxt+Wst-1)
Wherein, the function f is a nonlinear function such as tanh or ReLU, and U and W are corresponding weights respectively;
(42) determining the input value in the neural network model and the calculation mode of a hidden layer, and for a hidden unit:
the input sequence x with the length of T is provided with I input units, H hidden units and K output units;
representing the value of the input quantity i at time t,
and
the input quantity and the excitation value omega of the whole traffic network to the hidden unit h at the time t
ihAnd ω
h′hTo adjust the weight, θ
hIs composed of
To
The excitation function of (a);
(43) for the feature level fusion neural network model, taking OD matrix data, the average temperature and weather condition of the region and 5 corresponding variables of date and time as input quantities to train;
(44) the weights in the model are derived using the BPTT algorithm.
Preferably, in step (44), the weight in the model obtained by using the BPTT algorithm is specifically:
(a) in the interval
Inner random initialization weights (U, V, W), where n is the previous level incomings connections;
(b) let epoch be 1;
(c) running a forward propagation process in the neural network model;
(d) calculating a loss function L and a state gradient
And
(e) training an RNN model by using a random gradient descent and backward propagation process, and adding 1 to an epoch count value;
(f) if epoch is equal to M, the loop is stopped, at which point (U, V, W) is the weight value sought, otherwise (c) is returned.
The invention has the beneficial effects that: the method can dynamically predict the travel demand of a large-scale traffic network in real time, provides a recurrent neural network model and a feature level fusion neural network model, and has high flexibility and accuracy for predicting the short-term dynamic traffic demand.
Drawings
FIG. 1 is a schematic flow chart of the method of the present invention.
Fig. 2 is a schematic diagram of traffic cell division of the present invention.
Fig. 3(a) is a schematic diagram of the prediction result of the deep neural network model according to the present invention.
FIG. 3(b) is a schematic diagram of the prediction result of the recurrent neural network model of the present invention.
Fig. 3(c) is a schematic diagram of the prediction result of the feature level fusion neural network model of the present invention.
Detailed Description
As shown in fig. 1, a traffic demand day-to-day evolution prediction method based on a neural network constructs a generation attraction OD matrix of traffic travel in a certain time period according to mobile phone signaling data between cells in a demand prediction region, and establishes a recurrent neural network model and a feature level fusion neural network model by using a deep learning method in machine learning, thereby predicting a dynamic traffic demand of the region day-to-day evolution, the method comprising the following steps:
the method comprises the following steps: and dividing specific partitions of the urban traffic network and numbering.
The analysis area is divided into 1261 inner areas (1-3999) and 6 outer areas (4000-;
step two: determining a cell set during neural network model training based on the traffic network partition established in the first step, wherein the cell set is OD (optical density) quantities generated by an external cell with the number 4000-4004 and an internal cell 1261; the cell set during model verification is the OD quantity generated by the external cell with the number 4005 and the internal cell 1261;
step three: in order to solve the problems of data loss, too short time period and the like of the mobile phone signaling data, the obtained data sets are grouped according to the travel generation cell and the small time period, and data preprocessing is carried out, and the method specifically comprises the following steps:
3.1 filling missing data, when single data is missing, replacing by using the data average value of two time slices adjacent to the data, and when a plurality of data are missing, replacing by using the data of the same time slice on the next day;
3.2, extracting features by using a sliding time window with the size of r and the step value of 1;
3.3 the demand data is standardized,
x=(x-mean)/std
wherein std is the standard deviation of the data;
step four: establishing a cyclic neural network model and a feature level fusion neural network model for predicting traffic demands, and using the cyclic neural network model and the feature level fusion neural network model for function estimation and weight updating of each cell under different time states, wherein the specific steps are as follows:
4.1 constructing a recurrent neural network model and a feature level fusion neural network model, and determining the forward propagation process of the RNN model, wherein the RNN model consists of an input unit, an output unit and a recurrent hidden layer, and xtAnd otRespectively input and output values at time t, stIs the hidden layer state at time t
st=f(Uxt+Wst-1)
Wherein the function f is a non-linear function such as tanh or ReLU;
4.2 determining the input value in the neural network model and the calculation mode of the hidden layer, and for the hidden unit:
the input sequence x with length T has I input units, H hidden units and K output units.
Representing the value of the input quantity i at time t,
and
the input quantity and the excitation value of the whole traffic network to the hidden unit h at the time t;
4.3 for the feature level fusion neural network model, taking OD matrix data and 5 variables such as the average temperature, the weather condition, the corresponding date and the corresponding time of the region as input quantities to train;
4.4 use BackPropassivation through Time (BPTT) algorithm to get the weights in the model.
Further, in the inventive method, the BPTT algorithm flow in step 4.4 is:
a) in the interval
Internal random initialization weights (U, V, W), where n is the previous level of incoming connections
b) Let epo equal to 1
c) Running forward propagation processes in neural network models
d) Calculating loss value
e) Training an RNN model by using a random gradient descent and backward propagation process, and adding 1 to an epoch count value;
f) if the epoch is equal to M, stopping the circulation, wherein (U, V, W) is the weight value, otherwise, returning to c);
step five: inputting the travel generated quantity of each cell as a training sample, and completing weight determination of the recurrent neural network model and the feature level fusion neural network model; secondly, when prediction is carried out, the tested community traffic demand data is input into the trained cyclic neural network model and the trained feature level fusion neural network model for calculation, and finally the predicted traffic demand of the region is obtained.
Fig. 3(a), 3(b) and 3(c) show the output results of three models for the day-by-day dynamic traffic demand prediction problem. The experimental results prove that the cyclic neural network (RNN) is superior to the Deep Neural Network (DNN) in daily traffic demand prediction, and the characteristic-level fusion neural network model performs best in the three models, and the average relative error is lower than 18%.