Inferring Taxi Status Using GPS Trajectories

Yin Zhu, Yu Zheng, Liuhang Zhang, Darshan Santani, Xing Xie, Qiang Yang

Abstract

Urban computing relies heavily on understanding city-wide mobility, yet raw taxi GPS data often lacks status labels (occupied, cruising, or parked). This report details a hybrid machine learning framework developed by Microsoft Research Asia to fill this data gap. By integrating a local Decision Tree classifier with a global Hidden Semi-Markov Model (HSMM), the system effectively infers taxi status from low-frequency GPS sampling (e.g., one point per minute). The approach incorporates road network data, points of interest (POIs), and historical travel patterns to achieve significantly higher accuracy than standard sequence models.

Introduction

Transportation engineers and urban planners utilize taxi trajectories to model traffic flow and city dynamics. However, most taxi fleets do not link their meters to GPS systems, resulting in "blind" trajectories. A taxi moving slowly could be stuck in a traffic jam while carrying a passenger, or it could be crawling along a curb searching for a fare. Distinguishing these states is challenging due to low sampling rates, data sparsity, and the inherent uncertainty of driver behavior.

Raw vs. Inferred Taxi Trajectory

Methodology

The proposed framework operates in three distinct phases:

1. Parking Detection

Before analyzing movement, the system identifies "parked" states. It employs a density-based clustering algorithm to locate areas where a taxi lingers. To distinguish actual parking from traffic stops (e.g., red lights or congestion), a supervised filter is applied. A key feature in this phase is the Minimum Bounding Ratio (MBR), which compares the area of the GPS cluster to the area of the nearest road segment.

Parking Detection and Traffic Jam Differentiation

2. Local Probabilistic Classification

For moving segments, 26 features are extracted, including trajectory patterns, road types, nearby POIs (like hotels or malls), and historical occupancy rates for specific road segments. A C4.5 Decision Tree is used to generate a probability of occupancy for each point. Interestingly, the Decision Tree outperformed more complex models like Conditional Random Fields (CRFs) due to its superior ability to find non-linear thresholds in features like road level and distance.

3. Global Smoothing via HSMM

The core innovation is the use of a Hidden Semi-Markov Model (HSMM) for global inference. Unlike standard HMMs that only consider point-to-point transitions, the HSMM explicitly models the duration of a state. Since taxi trips and cruising periods have characteristic temporal rhythms (e.g., trips often last ~10 minutes), the HSMM prevents unrealistic "flickering" between states and provides a more coherent global trajectory.

Experimental Evaluation

The model was validated using a massive dataset from Beijing, comprising 8,000 taxis. A subset of 600 taxis over 1.5 months (161,349 trajectories) provided the ground truth via meter-linked GPS data.

Key Results: * Parking Accuracy: The parking detection algorithm achieved an F1-measure of 0.858, successfully filtering out congestion-related stops. * Model Performance: The DT+HSMM combination consistently outperformed HMM and CRF baselines. The model's accuracy stabilized when the maximum duration parameter was set to $\ge 20$ minutes, confirming the importance of long-term temporal modeling. * Overall Accuracy: Despite the sparse 1-minute sampling rate, the system achieved an overall accuracy of approximately 72.1% across the three statuses (Occupied, Non-Occupied, Parked).

Conclusion

This research demonstrates that taxi status can be accurately inferred from sparse GPS data by combining local feature engineering with global duration-aware sequence modeling. By leveraging urban context—such as road levels and POIs—the framework provides a scalable solution for enriching "blind" taxi datasets. Future work will focus on handling irregular sampling frequencies and mining more granular driver activities, such as distinguishing between searching for passengers and personal breaks.

Summary updated

Abstract

In this paper, we infer the statuses of a taxi, consisting of occupied, non-occupied and parked, in terms of its GPS trajectory. The status information can enable urban computing for improving a city's transportation systems and land use planning. In our solution, we first identify and extract a set of effective features incorporating the knowledge of a single trajectory, historical trajectories and geographic data like road network. Second, a parking status detection algorithm is devised to find parking places (from a given trajectory), dividing a trajectory into segments (i.e., sub-trajectories). Third, we propose a two-phase inference model to learn the status (occupied or non-occupied) of each point from a taxi segment. This model first uses the identified features to train a local probabilistic classifier and then carries out a Hidden Semi-Markov Model (HSMM) for globally considering long term travel patterns. We evaluated our method with a large-scale real-world trajectory dataset generated by 600 taxis, showing the advantages of our method over baselines.
BibTeX
@misc{zhu2012inferring,
  author = {Yin Zhu and Yu Zheng and Liuhang Zhang and Darshan Santani and Xing Xie and Qiang Yang},
  title = {{Inferring Taxi Status Using GPS Trajectories}},
  year = {2012},
  eprint = {1205.4378},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1205.4378},
}
Figure