The Real-Time Dynamic Prediction of Optimal Taxi Cruising Area Based on Deep Learning
Abstract
:1. Introduction
- Firstly, based on the cumulative opportunity method, a dynamic prediction model of the real-time accessible range based on UTCN is proposed to predict the real-time dynamic accessible range of taxis. Traditional studies mostly use static indicators to predict travel hotspots in the morning and evening peaks. However, this study uses multi-source data to form a spatio-temporal data chain, which can realize the real-time dynamics of accessible range prediction.
- Secondly, considering the four factors of traffic, time, space, and external environment, an MTCN model is constructed to predict the pick-up ratio under different periods, and the high-probability passenger hotspot area is identified as the optimal cruising area. This can improve the probability of no-loading taxis picking up passengers, avoid taxis cruising aimlessly, and reduce the cruising distance of taxis to a certain extent.
- Finally, the dynamic identification method of the optimal cruising area is constructed by combining the global passenger pick-up ratio with the real-time accessible range. Based on the case analysis, the reliability of the deep learning algorithm used in this study is verified from the model level.
2. Study Area and Data
2.1. Study Area and Grid Division
2.2. Data Collection and Processing
2.2.1. Taxi GPS Trajectory Data
2.2.2. POI Data
2.2.3. Meteorological Environment Data
2.2.4. Spatial Matching of the Study Area and Data
3. Methodology
3.1. Real-Time Accessible Range Analysis and Dynamic Taxi Prediction
3.1.1. Taxi Accessible Range Determination Based on GCOM
Algorithm 1: Directly Accessible Grid Algorithm. |
Input: Start Grid ID, Start time, Time Interval |
Output: id_set |
1: licenseplates_set ← set() |
2: ids_set ← set() |
3: for item in data: |
4: if (id in item) and (start <= timestamp <= end) then: |
5: licenseplates_set.add(license plate) |
6: for item in data: |
7: for license plate in licenseplates_set: |
8: if (license plate in item) and (start <= timestamp <= end) then: |
9: ids_set.add(id) |
10: return id_set |
Algorithm 2: Grid Compensation Algorithm. |
Input: A two-dimensional list (Accessible id = 1, Inaccessible id = 0) |
Output: Compensation grid ID |
1: for x ← 0 to length_row do |
2: for y ← 0 to length_col do |
3: if grid[x][y] = 0 then |
4: if x − 1 >= 0 then |
5: a ← grid[x][y] |
6: if x + 1 < length_row then |
7: b ← grid[x + 1][y] |
8: if y − 1 >= 0 then |
9: c ← grid[x][y − 1] |
10: if y + 1 < length_col then |
11: d ← grid[x][y] |
12: if (a and b and c) or (a and b and d) or (a and c and d) or (b and c and d) then |
13: grid[x][y] ← 2 |
14: return grid |
3.1.2. Accessible Range Prediction Based on UTCN
3.2. Dynamic Prediction of Optimal Cruising Area Based on Pick-Up Ratio
3.2.1. Influencing Factor Analysis of Taxi Cruise-Seeking
- (1)
- Traffic attribute variables
- (2)
- Time Attribute Variables
- (3)
- Spatial Attribute Variables
- (4)
- Real-time Environment Attributes
3.2.2. Variable Feature Importance Analysis Based on the GBDT Algorithm
3.2.3. Grid Pick-Up Ratio Prediction Model Based on MTCN
Algorithm 3: MTCN-based Pick-up Ratio Prediction Model |
Input: DHR, VD, RR, HP, DR, CB, OO, LM, RD, SS, BS Output: OR |
Steps: |
1: import torch.nn as nn # Import the required libraries and packages |
2: import torch. optim as optim |
3: data preparation←(train_data, trainlabels,test_data,test_labels) #Data preparation |
4: class MultiVarTCN(nn.Module): # Define the MTCN model |
5: def __init__(self, input_size, output_size, num_channels, kernel_sizes, dropout): |
6: super(MultiVarTCN, self).__init__() |
7: self.tcn = nn.Sequential() |
8: num_layers = len(num_channels) |
9: for i in range(num_layers): |
10: if i == 0: |
11: in_channels = input_size |
12: else: |
13: in_channels = num_channels[i − 1] |
14: self.tcn.add_module(‘conv{}’.format(i + 1),nn.Conv1d(in_channels,num_channels[i], |
15: kernel_sizes[i], stride = 1, padding = (kernel_sizes[i] − 1), dilation = 1)) |
16: self.tcn.add_module(‘relu{}’.format(i + 1), nn.ReLU()) |
17: self.tcn.add_module(‘dropout{}’.format(i + 1), nn.Dropout(dropout)) |
18: self.linear = nn.Linear(num_channels[−1], output_size) |
19: def forward(self, x): |
20: out = self.tcn(x) |
21: out = out.transpose(1, 2) |
22: out = self.linear(out[:, −1, :]) |
23: return out |
24: data feature dimension←(input_size, output_size) # Input and output feature dimensions |
25: convolutional layer←(num_channels, kernel_sizes) # The number of channels and the size of the convolution kernel for each convolution layer |
26: other hyperparameters←(dropout, num_epochs, batch_size) |
# Dropout probability, number of training iterations Batch size settings |
27: model = MultiVarTCN(input_size, output_size, num_channels, kernel_sizes, dropout) # Create the MTCN model instance |
28: criterion = nn.MSELoss() # Loss function setting |
29: optimizer = optim.Adam(model.parameters(), lr = 0.001) #Optimizer settings |
30: data preparation←torch.from_numpy (train_data, trainlabels,test_data,test_labels) #Convert data to Tensor |
31: for epoch in range(num_epochs): # Cycle training model |
32: model. train() |
33: optimizer.zero_grad() |
34: outputs ← model(train_data) |
35: loss ← criterion(outputs, train_labels) |
36: loss.backward() |
37: optimizer. step() |
38: if (epoch + 1) % 10 == 0: # Print a loss every once in a while |
39: print(‘Epoch [{}/{}], Loss: {: .4f}’.format(epoch + 1, num_epochs, loss.item())) |
40: model.eval() # Model prediction |
41: return predictions(OR) |
3.2.4. Optimal Cruising Area Identification Based on Accessible Range and Pick-Up Ratio
4. Results and Discussion
4.1. Measurement Results of Real-Time Accessible Range and Pick-Up Ratio
4.1.1. Real-Time Accessible Range Analysis
- (1)
- Accessible Range of Different Periods at the Same Time Interval
- (2)
- Accessible Range of the Same Period at Different Time Intervals
4.1.2. Dynamic Identification of Optimal Cruising Area Based on Real-Time Pick-Up Ratio
- (1)
- Identification of Optimal Cruising Area in Different Time Periods on the Same Date
- (2)
- Identification of Optimal Cruising Area in the Same Period on Different Dates
4.2. Real-Time Dynamic Prediction of Optimal Cruising Area
4.2.1. Real-Time Accessible Range Prediction
- (1)
- Experimental Setting and Evaluation Index Selection
- (2)
- Analysis of Accessible Range Prediction Results
4.2.2. Importance Analysis of Variables Related to Pick-Up Ratio
4.2.3. Real-Time Pick-Up Ratio Prediction
- (1)
- Experimental Setting and Evaluation Index Selection
- (2)
- Identification of the Optimal Scheduling Area under the Prediction of Pick-up Ratio
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Shi, K.; Shao, R.; De Vos, J.; Cheng, L.; Witlox, F. The Influence of Ride-Hailing on Travel Frequency and Mode Choice. Transp. Res. Part D Transp. Environ. 2021, 101, 103125. [Google Scholar] [CrossRef]
- Di, W.; Tomio, M.; Morikawa, T. Interrelationships between Traditional Taxi Services and Online Ride-Hailing: Empirical Evidence from Xiamen, China. Sustain. Cities Soc. 2022, 83, 103924. [Google Scholar]
- Taxi Management Office of Xi’an and Chang’an University. Available online: http://m.xinhuanet.com/sn/2021-02/20/c_1127117639.htm (accessed on 20 October 2023).
- Zheng, L.; Xia, D.; Zhao, X.; Tan, L.; Li, H.; Chen, L.; Liu, W. Spatial-Temporal Travel Pattern Mining Using Massive Taxi Trajectory Data. Phys. A 2018, 501, 24–41. [Google Scholar] [CrossRef]
- Qu, B.; Yang, W.; Cui, G.; Wang, X. Profitable Taxi Travel Route Recommendation based on Big Taxi Trajectory Data. IEEE Trans. Intell. Transp. Syst. 2020, 21, 653–668. [Google Scholar] [CrossRef]
- Sung, H.; Choi, K.; Lee, S.; Cheon, S. Exploring the Impacts of Land Use by Service Coverage and Station-Level accessibility on Rail Transit Ridership. J. Transp. Geogr. 2014, 36, 134–140. [Google Scholar] [CrossRef]
- Zhang, W.; Zhao, Y.; Cao, X.J.; Lu, D.; Chai, Y. Nonlinear Effect of Accessibility on Car Ownership in Beijing: Pedestrian-Scale Neighborhood Planning. Transp. Res. D Transp. Environ. 2020, 86, 102445. [Google Scholar] [CrossRef]
- Zhao, K.; Khryashchev, D.; Vo, H. Predicting Taxi and Uber Demand in Cities: Approaching the Limit of Predictability. IEEE Trans. Knowl. Data Eng. 2021, 33, 2723–2736. [Google Scholar] [CrossRef]
- Lyu, T.; Wang, Y.; Ji, S.; Feng, T.; Wu, Z. A multiscale spatial analysis of taxi ridership. J. Transp. Geogr. 2022, 113, 103718. [Google Scholar] [CrossRef]
- Wang, Z.; Zhang, Y.; Jia, B.; Gao, Z. Comparative Analysis of Usage Patterns and Underlying Determinants for Ride-hailing and Traditional Taxi Services: A Chicago Case Study. Transport. Res. Part A Policy Pract. 2023, 179, 103912. [Google Scholar] [CrossRef]
- Su, R.; Fang, Z.; Luo, N.; Zhu, J. Understanding the Dynamics of the Pick-Up and Drop-Off Locations of Taxicabs in the Context of a Subsidy War among E-Hailing Apps. Sustainability 2018, 10, 1256. [Google Scholar] [CrossRef]
- Shen, H.; Zou, B.; Lin, J.; Liu, P. Modeling Travel Mode Choice of Young People with Differentiated E-hailing Ride Services in Nanjing China. Transp. Res. Part D Transp. Environ. 2020, 78, 102216. [Google Scholar] [CrossRef]
- Demissie, M.G.; Kattan, L.; Phithakkitnukoon, S.; De Almeida Correia, G.H.; Veloso, M.L.; Bento, C. Modeling Location Choice of Taxi Drivers for Passenger Pickup Using GPS Data. IEEE Trans. Intell. Transp. Syst. Mag. 2020, 13, 70–90. [Google Scholar] [CrossRef]
- Kelobonye, K.; Zhou, H.; McCarney, G.; Xia, J.C. Measuring the Accessibility and Spatial Equity of Urban Services under Competition Using the Cumulative Opportunities Measure. J. Transp. Geogr. 2020, 85, 102706. [Google Scholar] [CrossRef]
- Wong, R.; Szeto, W.Y.; Wong, S.C. A Cell-Based Logit-Opportunity Taxi Customer-Search Model. Transp. Res. Part C Emerg. Technol. 2014, 48, 84–96. [Google Scholar] [CrossRef]
- Chen, F.; Yin, Z.; Ye, Y.; Sun, D. Taxi Hailing Choice Behavior and Economic Benefit Analysis of Emission Reduction based on Multi-Mode Travel Big Data. Transp. Policy 2020, 97, 73–84. [Google Scholar] [CrossRef]
- Szeto, W.Y.; Wong, R.C.P.; Yang, W.H. Guiding Vacant Taxi Drivers to Demand Locations by Taxi-Calling Signals: A Sequential Binary Logistic Regression Modeling Approach and Policy Implications. Transp. Policy 2019, 76, 100–110. [Google Scholar] [CrossRef]
- Hochreiter, S.; Schmidhuber, J. Long Short-term Memory. Neural Comput. 1997, 9, 1735–1780. [Google Scholar] [CrossRef]
- Lv, M.; Hong, Z.; Chen, L.; Chen, T.; Zhu, T.; Ji, S. Temporal Multi-Graph Convolutional Network for Traffic Flow Prediction. IEEE Trans. Intell. Transp. Syst. 2021, 22, 3337–3348. [Google Scholar] [CrossRef]
- Wang, H.; Zhang, R.; Cheng, X.; Yang, L. Hierarchical Traffic Flow Prediction based on Spatial-Temporal Graph Convolutional Network. IEEE Trans. Intell. Transp. Syst. 2022, 23, 16137–16147. [Google Scholar] [CrossRef]
- Zhan, X.; Qian, X.; Ukkusuri, S.V. A Graph-Based Approach to Measuring the Efficiency of an Urban Taxi Service System. IEEE Trans. Intell. Transp. Syst. 2016, 17, 2479–2489. [Google Scholar] [CrossRef]
- Li, Q.; Cheng, R.; Ge, H. Short-Term Travel Demand Prediction of Online Ride-Hailing Based on Multi-Factor GRU Model. Phys. A 2023, 610, 128410. [Google Scholar] [CrossRef]
- Chang, W.; Chen, X.; He, Z.; Zhou, S. A Prediction Hybrid Framework for Air Quality Integrated with W-BiLSTM(PSO)-GRU and XGBoost Methods. Sustainability 2023, 15, 16064. [Google Scholar] [CrossRef]
- Yan, J.; Mu, L.; Wang, L.; Ranjan, R.; Zomaya, A.Y. Temporal Convolutional Networks for the Advance Prediction of ENSO. Sci. Rep. 2020, 10, 650705. [Google Scholar] [CrossRef] [PubMed]
- Luo, A.; Shangguan, B.; Yang, C.; Gao, F.; Fang, Z.; Yu, D. Spatial-Temporal Diffusion Convolutional Network: A Novel Framework for Taxi Demand Forecasting. ISPRS Int. J. Geo-Inf. 2022, 11, 193. [Google Scholar] [CrossRef]
- Wang, S.; Wang, J.; Li, W.; Fan, J.; Liu, M. Revealing the Influence Mechanism of Urban Built Environment on Online Car-Hailing Travel Considering Orientation Entropy of Street Network. Discret. Dyn. Nat. Soc. 2022, 2022, 3888800. [Google Scholar] [CrossRef]
- Bi, H.; Ye, Z. Exploring Ridesourcing Trip Patterns by Fusing Multi-Source Data: A Big Data Approach. Sustain. Cities Soc. 2021, 64, 102499. [Google Scholar] [CrossRef]
- Cao, Y.; Liu, L.; Dong, Y. Convolutional Long Short-Term Memory Two-Dimensional Bidirectional Graph Convolutional Network for Taxi Demand Prediction. Sustainability 2023, 15, 7903. [Google Scholar] [CrossRef]
- Lai, Y.; Lv, Z.; Li, K.C.; Liao, M. Urban Traffic Coulomb’s Law: A New Approach for Taxi Route Recommendation. IEEE Trans. Intell. Transp. Syst. 2019, 20, 3024–3037. [Google Scholar] [CrossRef]
- Zhang, T.; Huang, Y.; Liao, H.; Liang, Y. A Hybrid Electric Vehicle Load Classification and Forecasting Approach based on GBDT Algorithm and Temporal Convolutional Network. Appl. Energy 2023, 351, 121768. [Google Scholar] [CrossRef]
- Liu, K.; Chen, J.; Li, R.; Peng, T.; Ji, K.; Gao, Y. Nonlinear Effects of Community Built Environment on Car Usage Behavior: A Machine Learning Approach. Sustainability 2022, 14, 6722. [Google Scholar] [CrossRef]
- Chen, J.; Li, W.; Zhang, H.; Jiang, W.; Li, W.; Sui, Y.; Song, X.; Shibasaki, R. Mining Urban Sustainable Performance: GPS Data-based Spatio-Temporal Analysis on on-Road Braking Emission. J. Clean. Prod. 2020, 270, 122489. [Google Scholar] [CrossRef]
- Bian, R.R.; Wilmot, C.G.; Wang, L. Estimating Spatio-temporal Variations of Taxi Ridership Caused by Hurricanes Irene and Sandy: A Case Study of New York City. Transp. Res. Part D Transp. Environ. 2019, 77, 627–638. [Google Scholar] [CrossRef]
- Kim, H.; Lee, K.; Park, J.S.; Song, Y. Transit Network Expansion and Accessibility Implications: A Case Study of Gwangju Metropolitan Area, South Korea. Res. Transp. Econ. 2018, 69, 544–553. [Google Scholar] [CrossRef]
- Jiao, W.; Huang, W.; Fan, H. Evaluating Spatial Accessibility to Healthcare Services from the Lens of Emergency Hospital Visits based on Floating Car Data. Int. J. Digit. Earth 2022, 15, 108–133. [Google Scholar] [CrossRef]
- Li, B.; Cai, Z.; Jiang, L.; Su, S.; Huang, X. Exploring Urban Taxi Ridership and Local Associated Factors Using GPS Data and Geographically Weighted Regression. Cities 2019, 87, 68–86. [Google Scholar] [CrossRef]
- Gonzales, E.J.; Yang, C.; Morgul, E.F.; Ozbay, K. Modeling Taxi Demand with GPS Data from Taxis and Transit; Technical Representative CA-MNTRC-14-1141; Mineta National Transit Research Consortium: New York, NY, USA, 2014. [Google Scholar]
- Sun, Y.; Ding, S.; Zhang, Z. An Improved Grid Search Algorithm to Optimize SVR for Prediction. Soft Comput. 2021, 25, 5633–5644. [Google Scholar] [CrossRef]
Data Field | Meaning | Data Example 1 | Data Example 2 |
---|---|---|---|
LPN | License plate number | A****00 | A****34 |
TS | Timestamp | 1,573,261,275 | 1,573,261,305 |
C_wgs | Coordinate | POINT [108.925200, 34.347733] | POINT [108.925167, 34.350217] |
Speed | Speed | 12 | 32 |
Car_stat | Carrying state | 1 | 1 |
IH_st | Idle or hired status | 0 | 0 |
ID | Grid_id | 285 | 285 |
POI | Points of interest | 307 | 307 |
WC | Weather conditions | Sunny | Cloudy |
AT | Apparent temperature | 8.3 | 4.8 |
WS | Wind speed | 3.1 | 4.5 |
AQI | Air quality index | 49 | 74 |
Variable | Notation | Formula |
---|---|---|
Pick-up ratio (PR) | The probability of all cruising taxis in grid i picking up passengers within a certain period, [t1, t2). | |
Drop-off ratio (DR) | The probability of dropping off all passengers from operating taxis in grid i within a certain period, [t1, t2). | |
Cruising ratio (CR) | The number of all idle cruising taxis in grid i accounts for the proportion of the total number of taxis in the grid within a certain period, [t1, t2). | |
Heat of pick-up (HP) | The number of all cruising taxis picking up passengers in grid i within a certain period, [t1, t2). | |
Heat of drop-off (HD) | The number of all hiring taxis dropping off passengers in grid i within a certain period, [t1, t2). | |
Vehicle density (VD) | The number of operating taxis per unit area. | |
Average operation speed (AOS) | The average speed of all hiring taxis in grid i is within a certain period, [t1, t2), which can effectively reflect the real-time congestion situation of the road. |
Evaluating Indicator | RNN | LSTM | GRU | UTCN |
---|---|---|---|---|
MAE | 0.613 | 0.447 | 0.363 | 0.281 |
RMSE | 1.474 | 1.285 | 1.152 | 1.033 |
MAPE (%) | 5.824 | 5.662 | 5.455 | 5.375 |
Evaluating Indicator | RNN | LSTM | GRU | MTCN |
---|---|---|---|---|
MAE | 0.058 | 0.034 | 0.029 | 0.023 |
RMSE | 0.147 | 0.128 | 0.119 | 0.027 |
MAPE (%) | 9.232 | 8.667 | 7.436 | 7.329 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Wang, S.; Wang, J.; Ma, C.; Li, D.; Cai, L. The Real-Time Dynamic Prediction of Optimal Taxi Cruising Area Based on Deep Learning. Sustainability 2024, 16, 866. https://doi.org/10.3390/su16020866
Wang S, Wang J, Ma C, Li D, Cai L. The Real-Time Dynamic Prediction of Optimal Taxi Cruising Area Based on Deep Learning. Sustainability. 2024; 16(2):866. https://doi.org/10.3390/su16020866
Chicago/Turabian StyleWang, Sai, Jianjun Wang, Chicheng Ma, Dongyi Li, and Lu Cai. 2024. "The Real-Time Dynamic Prediction of Optimal Taxi Cruising Area Based on Deep Learning" Sustainability 16, no. 2: 866. https://doi.org/10.3390/su16020866
APA StyleWang, S., Wang, J., Ma, C., Li, D., & Cai, L. (2024). The Real-Time Dynamic Prediction of Optimal Taxi Cruising Area Based on Deep Learning. Sustainability, 16(2), 866. https://doi.org/10.3390/su16020866