CN116029407A - Taxi travel demand prediction method based on ConvLSTM - Google Patents
Taxi travel demand prediction method based on ConvLSTM Download PDFInfo
- Publication number
- CN116029407A CN116029407A CN202210908815.4A CN202210908815A CN116029407A CN 116029407 A CN116029407 A CN 116029407A CN 202210908815 A CN202210908815 A CN 202210908815A CN 116029407 A CN116029407 A CN 116029407A
- Authority
- CN
- China
- Prior art keywords
- traffic data
- convlstm
- predicted
- taxi
- travel demand
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 48
- 238000012360 testing method Methods 0.000 claims abstract description 28
- 239000011159 matrix material Substances 0.000 claims abstract description 20
- 238000012549 training Methods 0.000 claims abstract description 19
- 238000010234 longitudinal analysis Methods 0.000 claims abstract description 16
- 238000010606 normalization Methods 0.000 claims abstract description 10
- 238000012545 processing Methods 0.000 claims abstract description 9
- 238000007781 pre-processing Methods 0.000 claims abstract description 6
- 230000006870 function Effects 0.000 description 20
- 238000013528 artificial neural network Methods 0.000 description 15
- 238000013527 convolutional neural network Methods 0.000 description 11
- 230000029305 taxis Effects 0.000 description 11
- 238000004458 analytical method Methods 0.000 description 9
- 230000015654 memory Effects 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 238000013459 approach Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 2
- 230000008901 benefit Effects 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 230000007787 long-term memory Effects 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 238000005065 mining Methods 0.000 description 2
- 230000006403 short-term memory Effects 0.000 description 2
- 238000012876 topography Methods 0.000 description 2
- NLHHRLWOUZZQLW-UHFFFAOYSA-N Acrylonitrile Chemical compound C=CC#N NLHHRLWOUZZQLW-UHFFFAOYSA-N 0.000 description 1
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000004913 activation Effects 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 230000000739 chaotic effect Effects 0.000 description 1
- 238000004140 cleaning Methods 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 239000006185 dispersion Substances 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 239000013589 supplement Substances 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
Images
Classifications
-
- 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
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Traffic Control Systems (AREA)
Abstract
The invention discloses a taxi travel demand prediction method based on ConvLSTM, which comprises the following steps: acquiring historical traffic data of a region to be predicted and preprocessing the data; dividing the area to be predicted according to the longitude and latitude directions, acquiring unit historical traffic data of each unit interval, and carrying out normalization processing; acquiring a test set and a training set; inputting the space transverse and longitudinal analysis matrix into a taxi travel demand prediction model based on ConvLSTM; acquiring a loss function; acquiring accuracy between the test predicted traffic data and the real traffic data; and outputting the predicted traffic data within the future time threshold range. According to the invention, through carrying out standardization and normalization processing on the historical traffic data of each unit interval, the operation amount is reduced, and the prediction efficiency is improved. And the time sequence relationship can be established like an LSTM, so that the accuracy of taxi track prediction is greatly improved.
Description
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to a taxi departure demand prediction method based on ConvLSTM.
Background
In recent years, along with the rapid increase of the quantity of the motor vehicles and the continuous increase of the quantity of taxis, convenience of resident traveling is also improved continuously, and taxis not only provide convenient door-to-door service for resident traveling, but also are important supplements of conventional buses. However, the expansion of the existing road network is limited by a plurality of factors, and the expansion of the existing road network is not limited. According to the history and the existing taxi quantity increasing condition, the taxi quantity does not have great increasing change, so that the increasingly-excited contradiction between the resident trip demand and the taxi service supply occurs. It is important to predict the future travel demand of the taxi based on the historical travel demand data of the taxi.
The urban intelligent traffic system is a multidimensional complex system integrating computing, network and physical environment. To our knowledge, the previous research methods for predicting taxi travel needs are generally divided into the following two types: the method is to predict by adopting a traditional method, such as a Markov chain-based prediction method, namely, carrying out data statistics on historical data and calculating the transition probability of the historical data, wherein the prediction accuracy is poor, and in addition, the method cannot predict when traffic is smaller; the second type is to predict each road section by using a neural network, for example, WU et al uses the neural network to assign the same weight to each road section, so that clustering of each road section is predicted, but the method is not only based on the prediction of the known road section, but also the network model is too complex and has a certain limitation. Che et al used a predictive approach to LSTM based on attention mechanism traffic prediction plus the inclusion of attention mechanisms, however this approach model was also complex and lacking in its mobility.
Disclosure of Invention
The invention provides a taxi travel demand prediction method based on ConvLSTM, which aims to overcome the technical problems.
A taxi travel demand prediction method based on ConvLSTM comprises the following steps:
s1: establishing a taxi travel demand prediction model based on ConvLSTM:
s2, acquiring historical traffic data of a region to be predicted of a historical time range threshold, and preprocessing the historical traffic data to acquire standard historical traffic data; the historical traffic data comprises a taxi license plate number, a passenger carrying state, a passenger carrying time, a longitude of a taxi position, a latitude of the taxi position and a kilometer speed per hour;
s3, dividing the area to be predicted according to the longitude and latitude directions to obtain a plurality of unit areas, and obtaining unit historical traffic data of each unit area within the historical time range threshold according to the standard historical traffic data;
s4, carrying out normalization processing on the unit historical traffic data to obtain normalized unit historical traffic data;
s5: dividing the area to be predicted into n x n tuples of space transverse and longitudinal analysis matrixes so that the normalized unit history traffic data corresponds to each tuple one by one, wherein the rows of the space transverse and longitudinal analysis matrixes represent longitudes of positions where the area to be predicted is located, the columns of the space transverse and longitudinal analysis matrixes represent longitudes of positions where the area to be predicted is located, and elements in the space transverse and longitudinal analysis matrixes are unit history traffic data of corresponding unit intervals;
s6, acquiring a test set and a training set according to the normalized unit historical traffic data;
s7: inputting the space transverse and longitudinal analysis matrix into the taxi travel demand prediction model based on ConvLSTM according to the training set, and obtaining a trained taxi travel demand prediction model based on ConvLSTM;
s8: inputting the test set into the trained taxi travel demand prediction model based on ConvLSTM, and obtaining test prediction traffic data; the method comprises the steps of obtaining a loss function between test predicted traffic data and real traffic data, and executing S9 when the value of the loss function is smaller than a loss function value threshold value, wherein the trained taxi travel demand prediction model based on ConvLSTM is an optimal taxi travel demand prediction model based on ConvLSTM; otherwise, repeatedly executing S7;
s9: acquiring accuracy between the test predicted traffic data and the real traffic data; and obtaining the predicted traffic data within the output future time threshold according to the optimal taxi travel demand prediction model based on ConvLSTM.
Further, in S4, the normalized historical traffic data of the unit is obtained as follows:
wherein y is k Normalized unit history traffic data for the kth unit interval, t k For the unit history traffic data of the kth unit section, max (t) is the maximum value of the unit history traffic data, and min (t) is the minimum value of the unit history traffic data; k is the number of the cell segment.
Further, the loss function between the test predicted traffic data and the real traffic data in S8 is:
wherein Loss is a Loss function value; y is i The method comprises the steps of normalizing unit historical traffic data of a region to be predicted to obtain an ith element value;the output size is the number of parameters of the taxi travel demand prediction model based on ConvLSTM, which is the ith prediction value of the taxi travel demand prediction model based on ConvLSTM;
further, the accuracy between the test predicted traffic data and the real traffic data in S9 is calculated as follows:
wherein y is i The method comprises the steps of normalizing unit historical traffic data of a region to be predicted to obtain an ith element value;an ith predicted value of a taxi travel demand prediction model based on ConvLSTM; ABS (·) represents an absolute value operation.
The beneficial effects are that: according to the taxi travel demand prediction method based on ConvLSTM, through standardization and normalization processing of the historical traffic data of each unit interval, the operation amount is reduced, and the prediction efficiency is improved. The ConvLSTM neural network not only can establish a time sequence relationship as the LSTM neural network, but also can describe local spatial characteristics as the CNN neural network, and the accuracy of taxi track prediction is greatly improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, a brief description will be given below of the drawings required for the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the present invention, and that other drawings can be obtained according to these drawings without inventive effort to a person skilled in the art.
FIG. 1 is a flow chart of a taxi travel demand prediction method according to the invention;
FIG. 2 is a schematic diagram of a ConvLSTM model of the present invention;
FIG. 3 is a flow chart of a taxi travel demand prediction model based on ConvLSTM;
FIG. 4 is a plot of accuracy versus iteration number in an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by one of ordinary skill in the art without undue burden on the person of ordinary skill in the art based on the embodiments of the present invention, are within the scope of the present invention.
The embodiment provides a taxi travel demand prediction method based on ConvLSTM, as shown in fig. 1, comprising the following steps:
s1: establishing a taxi travel demand prediction model based on ConvLSTM:
specifically, the formula of the taxi travel demand prediction model in this embodiment is as follows:
in which W is x Inputting a weight parameter of a door for a ConvLSTM network; w (W) h Outputting weight parameters of a gate for a ConvLSTM network; w (W) c The weight parameters of the forget gate of the ConvLSTM network are obtained; b i Inputting a deviation parameter of a gate for a ConvLSTM network; b f Outputting a gate bias for a ConvLSTM networkParameters; b o The method comprises the steps of obtaining a deviation parameter of a ConvLSTM network forgetting gate; x is x t Inputting at the current moment; i.e t Inputting a gate value for the current time step; c t Forget the value of the gate for the current time step; c t-1 Forget the value of the gate for the last time step; f (f) t Memory cell values for the current time step; o (o) t Outputting a value of the gate for the current time step; h t-1 A hidden state of the previous time step; sigma is a sigmoid activation function; tanh is a trigonometric tangent function; * Representing convolution, as distinguished from general LSTM;representing the multiplication of the corresponding elements;
specifically, convLSTM is a convolutional long-short-term memory network (CNN-LSTM network), which is a hybrid network model based on a convolutional neural network and a long-short-term memory network system, wherein the convolutional neural network (Convolutional Neural Networks, CNN) is a feedforward neural network which comprises convolutional calculation and has a depth structure, and the main realization is feature extraction; a Long Short-Term Memory network (LSTM) is a time-loop neural network, which is specifically designed to solve the Long-Term dependency problem of a general RNN (loop neural network), all RNNs have a chain form of repeated neural network modules, and mainly realize the prediction of time sequences. The input of the convolutional neural network part in the ConvLSTM model is historical traffic data of the taxi, the output of the convolutional neural network part is a characteristic diagram extracted through a convolutional layer, the input of the long-term memory network part is a characteristic diagram output by the convolutional neural network part, and the output of the long-term memory network part is a predicted value of future trip requirements of the taxi. The method for predicting the taxi demand in the embodiment can well solve the problem of low prediction accuracy caused by the change of history and the existing number of taxis.
The core concept of ConvLSTM is in the cellular state and "gate" structure. The cell state corresponds to the path of information transmission, allowing information to be transferred down the sequence, which can be regarded as a "memory" of the network. Theoretically, the cell state can always convey information about the sequence during processing. Thus, even the information of the earlier time step can be carried into the cells of the later time step, which overcomes the influence of short-term memory, and the addition and deletion of the information is achieved by a "gate" structure that learns which information should be saved or forgotten during the training process, the ConvLSTM model cell structure is shown in FIG. 2: gate 1 is a forget gate to determine which relevant information in the previous step needs to be retained, gate 2 is an input gate to determine which information in the current input is important, needs to be added, and gate 3 is an output gate to determine what the next hidden state should be.
S2, acquiring historical traffic data of a region to be predicted of a historical time range threshold, and preprocessing the historical traffic data to acquire standard historical traffic data; the historical traffic data comprises a taxi license plate number, a passenger carrying state, a passenger carrying time, a longitude of a taxi position, a latitude of the taxi position and a kilometer speed per hour;
specifically, in this embodiment, the area to be predicted is a large company, the historical traffic data of the taxi in the historical time range threshold of the whole large company is collected through the GPS installed on the taxi, and the original historical traffic data of the taxi is subjected to data preprocessing, namely, the missing value, the abnormal value and the repeated value are cleaned, so that the historical traffic data can be matched with the requirements of the taxi travel demand prediction model to adapt to the taxi travel demand prediction model, the specific preprocessing method includes coordinate screening, data cleaning and repeated removal operation, and further the standard historical traffic data of the taxi in the area to be predicted is counted and is used as the input of the subsequent model.
S3, dividing the area to be predicted according to the longitude and latitude directions to obtain a plurality of unit areas, and obtaining unit historical traffic data of each unit area within the historical time range threshold according to the standard historical traffic data; when the area to be predicted is divided according to the longitude and latitude directions, the selected longitude and latitude units are determined manually according to the local topography of the selected area to be predicted.
Specifically, in this embodiment, the unit history traffic data of each unit interval is counted using a groupby function; the element in the 250 x 250 matrix at a certain moment in the historical time range threshold can be corresponding to the element in the 250 x 250 matrix after the unit history traffic data in the unit interval is normalized in the set historical time range threshold, wherein the historical time range threshold is a set past time period. Under the condition that the topography of Dalian city is fully considered, the Dalian city is divided according to the longitude and latitude direction, the range of each 0.001 unit of longitude and latitude is taken as a unit interval, 5 minutes is taken as a time range threshold, namely 5 minutes is taken as a granularity, the unit historical traffic data of taxis in a certain unit interval (namely the area surrounded by 0.001 unit of longitude and latitude) in every 5 minutes is counted, and then the unit historical traffic data of taxis in every 5 minutes in each unit interval of the whole Dalian city is counted.
S4, carrying out normalization processing on the unit historical traffic data to obtain normalized unit historical traffic data; so as to improve the prediction precision of the taxi travel demand prediction model.
Specifically, since each unit of historical traffic data has different dimensions and magnitude, in order to avoid that the data difference of the different unit of historical traffic data is large so as to influence the reliability of an analysis result, the unit of historical traffic data is normalized, and the unit of historical traffic data is scaled proportionally so as to fall into a small specific interval, thereby ensuring the reliability of the analysis result; the normalization process of this embodiment employs a dispersion normalization method, i.e., each element value is concentrated minus the minimum value in the data set, and then divided by the difference between the maximum value and the minimum value in the data set so as to fall within the [0,1] interval, as shown in the following formula:
wherein y is k Normalized unit history traffic data for the kth unit interval, t k For the unit history traffic data (element values in the data set to be converted) of the kth unit interval, max (t) is the maximum value of the unit history traffic data (i.e., the maximum value in the data set to be converted), and min (t) is the minimum value of the unit history traffic data (i.e., the minimum value in the data set to be converted); k is the number of the unit interval;
s5: dividing the region to be predicted into n x n tuples of space transverse and longitudinal analysis matrixes, so that the normalized unit history traffic data corresponds to each tuple and is used as an input set of a taxi travel demand prediction model. The rows of the space transverse and longitudinal analysis matrix represent longitudes of the position of the area to be predicted, the columns of the space transverse and longitudinal analysis matrix represent latitudes of the position of the area to be predicted, and elements in the space transverse and longitudinal analysis matrix are unit historical traffic data of corresponding unit intervals;
specifically, the spatial crossbar analysis matrix constructed in this embodiment divides each unit interval into a matrix tuple form of 250×250, and uses the corresponding position of the normalized historical traffic data to the tuple as the input set of the taxi travel demand prediction model. The space longitudinal and transverse analysis matrix represents the number of taxis at the position represented by the micro-area in the time period of the unit area, but 4032 matrixes are provided in total, the rows and columns in the matrixes respectively represent the longitudes and the latitudes, and the data in the matrixes can represent the number of the taxis at the longitudes and the latitudes, namely, according to a certain element in the space longitudinal and transverse analysis matrix, the number of the taxis at the time (time) and the place (longitude and latitude) can be known;
specifically, in this embodiment, the historical traffic data of 4032 groups of data taxis in the historical time range threshold of the entire Dalian city is collected through a GPS installed on a taxi, the normalized historical traffic data obtained after the historical traffic data is preprocessed and normalized is compressed into a data matrix of 100×100 through an np.zeros function, and a sliding window method is adopted, so that a sliding window operation is realized by advancing one unit at a time through a circulation function, so that one and only one of two adjacent groups of data in a training data set can slide, and in addition, the test data set and the training data set also slide, which is beneficial to mining the correlation in a track sequence, and further, the accuracy is improved. Classifying every 12 groups of data according to a time sequence, wherein 80% of all data sets are randomly selected as training set (train_data) data sets, and the other 20% are selected as test set (test_data) data sets and output as npy format; and the dimension of the data set is properly compressed to be 100 x 100 data matrixes, so that the model prediction speed is improved on the premise of not affecting the accuracy.
In this embodiment, the input gate is a matrix repetition of 100×100 compressed by compressing the normalized transverse and longitudinal analysis matrix with an np.zeros function, where the matrix repetition includes longitude and latitude, time, and normalized historical traffic data information; forget gate to determine the predicted cell state c at the previous time t-1 How much remains at the current time c t The model is self-adaptive; the output gate outputs the current predicted value for the state of the control unit, in this example, the predicted traffic data that is finally output.
S6, acquiring a test set and a training set according to the normalized unit historical traffic data;
s7: according to the training set, the spatial horizontal and vertical analysis matrix is input into the taxi travel demand prediction model based on ConvLSTM, a trained taxi travel demand prediction model based on ConvLSTM is obtained, the normalized historical traffic data is trained, predicted traffic data in a future time threshold range are obtained, and the trained taxi travel demand prediction model based on ConvLSTM is obtained;
preferably, the method for training the normalized historical traffic data according to the training set is as follows:
s71: let i=1, x=0; wherein i is the number of the row number of the space longitudinal and transverse analysis matrix;
s72: will beInput layer of convolutional neural network through taxi trip demand prediction model based on ConvLSTM, wherein S i Is the ith row in the space longitudinal and transverse analysis matrix S;N-th data in the i-th row in the spatial aspect analysis matrix S; inputting the result H into a circulation layer of the convolutional neural network and outputting the result H by the circulation layer t-1 And x t After the convolution, X= [ y, X is obtained] T Wherein y is H t-1 Convolved data, x is x t Convolved data; taking the taxi travel demand prediction model as input of a taxi travel demand prediction model based on ConvLSTM, and obtaining predicted traffic data after passing through the LSTM of the convolution neural network of the taxi travel demand prediction model based on ConvLSTM; the calculation process of the taxi travel demand prediction model based on ConvLSTM is as shown in formula (1);
s8: inputting the test set into the trained taxi travel demand prediction model based on ConvLSTM, and obtaining test prediction traffic data; the method comprises the steps of obtaining a loss function between test predicted traffic data and real traffic data, and executing S9 when the value of the loss function is smaller than a loss function threshold value, wherein the trained taxi travel demand prediction model based on ConvLSTM is an optimal taxi travel demand prediction model based on ConvLSTM; otherwise, repeatedly executing S7;
s9: acquiring accuracy between the test predicted traffic data and the real traffic data; and obtaining predicted traffic data in a future time threshold range according to the optimal taxi travel demand prediction model based on ConvLSTM.
Specifically, according to the taxi travel demand prediction model based on ConvLSTM, training the normalized historical traffic data by using a training data set to obtain training prediction traffic data of a future time threshold range, importing the test set into the taxi travel demand prediction model based on ConvLSTM, and testing the accuracy of the taxi travel demand prediction model based on ConvLSTM to predict the taxi traffic data of the future time threshold range;
specifically, as shown in fig. 3, according to the taxi travel demand prediction model based on ConvLSTM, the output gate of the last layer of the ConvLSTM neural network is used as the prediction result of the whole network. According to the method, the historical taxi traffic data of the Dalian city is learned, and the taxi traffic of the city level is predicted, so that the accuracy of the prediction result is greatly improved.
Preferably, the loss function between the test predicted traffic data and the real traffic data in S8 is: establishing a loss function to obtain a difference value between predicted traffic volume data and real traffic volume data obtained by a taxi travel demand prediction model based on ConvLSTM, and evaluating the taxi travel demand prediction model based on ConvLSTM;
a loss function loss is calculated from the predicted value and the actual value,
wherein Loss is a Loss function value; y is i The i element value after normalization processing is carried out on the unit historical traffic data (namely the data set) of the area to be predicted;for the ith predicted value of the taxi travel demand prediction model based on ConvLSTM, the output size is the parameter number of the taxi travel demand prediction model based on ConvLSTM, and is mainly used for measuring the deviation degree between predicted and actual values made by the taxi travel demand prediction model based on ConvLSTM and evaluating the quality of the predicted result of the taxi travel demand prediction model based on ConvLSTM. />
Specifically, the loss function in this embodiment selects binary_cross entropy (i.e., binary cross entropy), the accuracy selects acc function, which is used to measure the deviation degree between the predicted traffic data and the real traffic data made by the taxi travel demand prediction model based on ConvLSTM, and evaluate the predicted quality of the model, where the learning rate is a value of a=0.005, the weight parameter and the deviation parameter are initialized by normal distribution (μ=0.485, σ=0.224), and the data batch in a single training process is 12. If the loss rate is larger than the set error value, retraining the model, otherwise, enabling the model to meet the requirements, inputting the test data set into a trained ConvLSTM neural network, and predicting the traveling demand density of taxies in the future Dalian city.
Preferably: the accuracy between the test predicted traffic data and the real traffic data in S9 is calculated as follows: calculating the accuracy Acc according to the predicted value and the actual value,
wherein y is i The i element value of the unit history traffic data (namely the data set) of the area to be predicted after normalization processing;and (3) recalculating a predicted value for an ith predicted value updating parameter of the taxi travel demand predicted model based on ConvLSTM, wherein ABS (Acrylonitrile) represents absolute value operation.
S9: and acquiring predicted traffic data in a future time threshold range according to the optimal taxi travel demand prediction model based on ConvLSTM.
Specifically, after multiple rounds of training, the accuracy rate of the embodiment is shown in fig. 4, at this time, the accuracy rate has already satisfied Acc < = 0.01, the model is the optimal prediction model for taxi travel demand based on ConvLSTM after the model is trained and satisfies the prediction requirement, and finally, the prediction of the taxi traffic volume of the whole Dalian city is performed through the optimal prediction model for taxi travel demand based on ConvLSTM, and the predicted traffic volume data in taxi traffic volume in the Dalian city to the corresponding period is input as a future period of time.
According to the method, the space-time correlation in the taxi track sequence is fully excavated, and future traffic data of the taxi is predicted by learning the historical traffic data of the taxi, so that the accuracy of traffic prediction is improved. The traffic prediction is to use historical traffic data of a taxi, mainly GPS positioning data, establish a prediction model based on a large amount of historical traffic data, take known traffic distribution as input of the prediction model, and obtain a road where the taxi is located at the next moment through deduction operation of the model. The traffic volume prediction of the rented vehicles can improve urban traffic safety, and belongs to a part of intelligent traffic. The control and the utilization of the public traffic resource of taxis can be effectively improved for traffic departments, meanwhile, the urban congestion condition can be relieved, the urban road utilization condition can be improved, and the public traffic resource management system brings real benefits to masses of citizens. However, the taxi GPS historical traffic data has the characteristics of large data volume, high latitude, chaotic data, wide coverage and the like, and comprises information such as a taxi license plate number, a passenger carrying state, time, longitude, latitude, kilometer speed per hour and the like. In addition, taxis are unevenly distributed in a space-time traffic network, the correlation between taxi traffic volumes is more secret and is larger by external influence factors, so that great difficulty is brought to prediction of taxi departure demands, great difficulty is inevitably brought to the prediction if a traditional prediction method is adopted, and the accuracy is low, so that the prediction method based on deep learning is the only feasible method.
Based on the method, the invention discloses a taxi travel demand prediction method of ConvLSTM, which solves the problem of mining of taxi track data correlation under the condition of complex external influence factors, and improves the accuracy of a prediction model under massive taxi track data. The built model is simple, concise and strong in operability, and high in accuracy.
According to the invention, the sliding window method is adopted in the training data set, so that one data in two adjacent sets of data sets is moved, the number of the data sets is increased, and the correlation in the track sequence is easier to mine, so that the accuracy is improved. The ConvLSTM neural network used in the method can not only establish a time sequence relationship as the LSTM neural network, but also describe local spatial features as the CNN neural network, so that the accuracy of taxi track prediction is greatly improved.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the invention.
Claims (4)
1. The taxi travel demand prediction method based on ConvLSTM is characterized by comprising the following steps of:
s1: establishing a taxi travel demand prediction model based on ConvLSTM:
s2, acquiring historical traffic data of a region to be predicted of a historical time range threshold, and preprocessing the historical traffic data to acquire standard historical traffic data; the historical traffic data comprises a taxi license plate number, a passenger carrying state, a passenger carrying time, a longitude of a position where the taxi is located, a latitude of the position where the taxi is located and a kilometer speed per hour;
s3, dividing the area to be predicted according to the longitude and latitude directions to obtain a plurality of unit intervals, and obtaining unit historical traffic data of each unit interval in the historical time range threshold according to the standard historical traffic data;
s4, carrying out normalization processing on the unit historical traffic data to obtain normalized unit historical traffic data;
s5: dividing the area to be predicted into n x n tuples of space transverse and longitudinal analysis matrixes so that the normalized unit history traffic data corresponds to each tuple one by one, wherein the rows of the space transverse and longitudinal analysis matrixes represent longitudes of positions where the area to be predicted is located, the columns of the space transverse and longitudinal analysis matrixes represent longitudes of positions where the area to be predicted is located, and elements in the space transverse and longitudinal analysis matrixes are unit history traffic data of corresponding unit intervals;
s6, acquiring a test set and a training set according to the normalized unit historical traffic data;
s7: inputting the space transverse and longitudinal analysis matrix into the taxi travel demand prediction model based on ConvLSTM according to the training set, and obtaining a trained taxi travel demand prediction model based on ConvLSTM;
s8: inputting the test set into the trained taxi travel demand prediction model based on ConvLSTM, and obtaining test prediction traffic data; the method comprises the steps of obtaining a loss function between test predicted traffic data and real traffic data, and executing S9 when the value of the loss function is smaller than a loss function value threshold value, wherein the trained taxi travel demand prediction model based on ConvLSTM is an optimal taxi travel demand prediction model based on ConvLSTM; otherwise, repeatedly executing S7;
s9: acquiring accuracy between the test predicted traffic data and the real traffic data; and obtaining the predicted traffic data within the output future time threshold according to the optimal taxi travel demand prediction model based on ConvLSTM.
2. The method for predicting taxi travel demand based on ConvLSTM as claimed in claim 1, wherein the method comprises the following steps: in S4, the normalized historical traffic data of the unit is obtained as follows:
wherein y is k Normalized unit history traffic data for the kth unit interval, t k For the unit history traffic data of the kth unit section, max (t) is the maximum value of the unit history traffic data, and min (t) is the minimum value of the unit history traffic dataThe method comprises the steps of carrying out a first treatment on the surface of the k is the number of the cell segment.
3. The method for predicting taxi travel demand based on ConvLSTM as claimed in claim 2, wherein the method comprises the following steps: the loss function between the test predicted traffic data and the real traffic data in S8 is:
wherein Loss is a Loss function value; y is i The method comprises the steps of normalizing unit historical traffic data of a region to be predicted to obtain an ith element value;for the ith predicted value of the taxi travel demand prediction model based on ConvLSTM, the outputsize is the parameter number of the taxi travel demand prediction model based on ConvLSTM.
4. The method for predicting taxi travel demand based on ConvLSTM as claimed in claim 3, wherein the method comprises the following steps: the accuracy between the test predicted traffic data and the real traffic data in S9 is calculated as follows:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210908815.4A CN116029407A (en) | 2022-07-29 | 2022-07-29 | Taxi travel demand prediction method based on ConvLSTM |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210908815.4A CN116029407A (en) | 2022-07-29 | 2022-07-29 | Taxi travel demand prediction method based on ConvLSTM |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116029407A true CN116029407A (en) | 2023-04-28 |
Family
ID=86080169
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210908815.4A Pending CN116029407A (en) | 2022-07-29 | 2022-07-29 | Taxi travel demand prediction method based on ConvLSTM |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116029407A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108985475A (en) * | 2018-06-13 | 2018-12-11 | 厦门大学 | Net based on deep neural network about vehicle car service needing forecasting method |
CN110210644A (en) * | 2019-04-17 | 2019-09-06 | 浙江大学 | The traffic flow forecasting method integrated based on deep neural network |
CN110599767A (en) * | 2019-09-04 | 2019-12-20 | 广东工业大学 | Long-term and short-term prediction method based on network taxi appointment travel demands |
CN111507762A (en) * | 2020-04-15 | 2020-08-07 | 中国科学院自动化研究所 | Urban taxi demand prediction method based on multi-task co-prediction neural network |
CN113487219A (en) * | 2021-07-23 | 2021-10-08 | 重庆交通大学 | Urban taxi demand prediction method and device and computer equipment |
-
2022
- 2022-07-29 CN CN202210908815.4A patent/CN116029407A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108985475A (en) * | 2018-06-13 | 2018-12-11 | 厦门大学 | Net based on deep neural network about vehicle car service needing forecasting method |
CN110210644A (en) * | 2019-04-17 | 2019-09-06 | 浙江大学 | The traffic flow forecasting method integrated based on deep neural network |
CN110599767A (en) * | 2019-09-04 | 2019-12-20 | 广东工业大学 | Long-term and short-term prediction method based on network taxi appointment travel demands |
CN111507762A (en) * | 2020-04-15 | 2020-08-07 | 中国科学院自动化研究所 | Urban taxi demand prediction method based on multi-task co-prediction neural network |
CN113487219A (en) * | 2021-07-23 | 2021-10-08 | 重庆交通大学 | Urban taxi demand prediction method and device and computer equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109697852B (en) | Urban road congestion degree prediction method based on time sequence traffic events | |
CN108510741B (en) | Conv1D-LSTM neural network structure-based traffic flow prediction method | |
CN109919358B (en) | Real-time station flow prediction method based on neural network space-time attention mechanism | |
CN111292525B (en) | Traffic flow prediction method based on neural network | |
CN113487061A (en) | Long-time-sequence traffic flow prediction method based on graph convolution-Informer model | |
CN111612281B (en) | Method and device for predicting pedestrian flow peak value of subway station and computer equipment | |
Niu et al. | DeepSense: A novel learning mechanism for traffic prediction with taxi GPS traces | |
CN111275962B (en) | Vehicle track data aggregation effect prediction method and device | |
CN112270355B (en) | Active safety prediction method based on big data technology and SAE-GRU | |
CN108417032B (en) | Analysis and prediction method for roadside parking demand in urban central area | |
Li et al. | Graph CNNs for urban traffic passenger flows prediction | |
CN109920248B (en) | Bus arrival time prediction method based on GRU neural network | |
CN109086926B (en) | Short-time rail transit passenger flow prediction method based on combined neural network structure | |
CN113780665B (en) | Private car stay position prediction method and system based on enhanced recurrent neural network | |
CN113051811B (en) | Multi-mode short-term traffic jam prediction method based on GRU network | |
CN115148019A (en) | Early warning method and system based on holiday congestion prediction algorithm | |
CN110414715B (en) | Community detection-based passenger flow volume early warning method | |
CN115985102B (en) | Urban traffic flow prediction method and equipment based on migration contrast learning | |
CN111815956B (en) | Expressway traffic flow prediction method | |
CN116541790B (en) | New energy vehicle health assessment method and device based on multi-feature fusion | |
CN113591380A (en) | Traffic flow prediction method, medium and equipment based on graph Gaussian process | |
CN116631186B (en) | Expressway traffic accident risk assessment method and system based on dangerous driving event data | |
CN112598165A (en) | Private car data-based urban functional area transfer flow prediction method and device | |
CN110619419A (en) | Passenger flow prediction method for urban rail transit | |
CN112201037B (en) | Intersection arrival rate estimation method based on sampling trajectory data |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20230428 |
|
RJ01 | Rejection of invention patent application after publication |