Introduction
In 2015, the ECML/PKDD conference hosted a Kaggle competition challenging participants to predict the final destination of a taxi ride based on its initial trajectory. While many competitors relied on extensive manual feature engineering involving city geography and traffic patterns, a team from the MILA lab secured first place among 381 teams using a predominantly automated neural network approach. Their success demonstrated that strategic architectural choices—specifically in representing temporal data and structuring the output layer—can outperform traditional domain-specific feature engineering.
Problem Definition
Predicting a taxi's destination is a "variable-length input to fixed-length output" problem. A taxi's trajectory consists of a sequence of GPS coordinates that grows as the trip progresses. Traditional regression models face several hurdles in this context:
- Variable Input Length: Standard Multi-Layer Perceptrons (MLPs) require fixed-size input vectors.
- Multi-modal Distributions: A taxi starting at a specific point may be headed to several distinct, likely locations (e.g., an airport or a train station). Simple regression often predicts the geometric mean of these locations, which may result in an impossible destination.
- Contextual Metadata: Integrating discrete factors like driver ID, client ID, and time of day with continuous GPS data is non-trivial.
Methodology
The winning strategy centered on a Multi-Layer Perceptron (MLP) with several key modifications designed to handle the spatial and temporal nuances of the task.
Model Architecture
To process variable-length GPS sequences, the model utilized a fixed-size trajectory input by extracting the first $k$ and last $k$ points ($k=5$) of the partial trajectory. This input was combined with learned embeddings for metadata. Instead of one-hot encoding discrete variables such as Taxi ID or the time of day, the authors mapped these values into a continuous 10-dimensional vector space. This allowed the model to learn latent relationships between different time intervals and drivers.
Metadata Embeddings
The use of embeddings was critical for capturing human activity patterns. By decomposing time into specific intervals (quarter hour, day of the week, week of the year), the model could automatically group similar periods, such as identifying "rush hour" or "weekend" patterns without explicit programming.
Destination Clustering Output
The most innovative component was the output layer. Rather than predicting raw latitude and longitude, the team applied Mean-Shift clustering to all destinations in the training set to identify approximately 3,400 common drop-off points. The network outputs a probability distribution $p_i$ over these clusters using a Softmax layer. The final prediction $\hat{y}$ is calculated as the weighted average of the cluster centroids $c_i$:
$$\hat{y} = \sum_{i=1}^{C} p_i c_i$$
This approach effectively incorporates a spatial prior, preventing the model from predicting impossible locations by forcing the output to be a convex combination of known destinations.
Experimental Setup
The study utilized the Porto Taxi Dataset, containing 1.7 million complete trajectories from 442 taxis over one year. To ensure statistical significance beyond the competition's small test set, the authors created a custom validation set of 19,000 trajectories and a test set of 20,000 trajectories by randomly sampling prefixes from the training data.
Results and Discussion
The MLP model achieved first place in the competition with a Mean Haversine Distance error of 2.39 on the public leaderboard and 1.87 on the private leaderboard.
Key Insights
- Spatial Priors: Clustering forces the model to stay within the "convex hull" of known drop-off points, significantly improving reliability.
- Simplicity vs. Complexity: Although the team tested more sophisticated architectures like Recurrent Neural Networks (RNNs) and Memory Networks, the MLP performed best in the competition. This suggests that for destination prediction, the starting and current positions are often more informative than the intermediate path.
- Future Potential: On the larger custom test set, a Bidirectional RNN eventually outperformed the MLP (2.60 vs 2.81 error), indicating that recurrent models may be superior given sufficient training time and data.
Conclusion
The MILA lab's victory highlights the power of neural networks to automate feature discovery in complex spatial-temporal tasks. By treating destination prediction as a classification-regression hybrid over learned clusters and utilizing embeddings for categorical metadata, they established a robust framework for trajectory-based forecasting.
Summary updated