NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

DeepStay: Stay Region Extraction from Location Trajectories using Weak Supervision

Christian Löwens, Daniela Thyssens, Emma Andersson, Christina Jenkins, Lars Schmidt-Thieme · DOI

Abstract

Identifying "stay regions"—locations where individuals spend significant time—is a fundamental task in human mobility analysis. Traditional methods rely on rigid, hand-crafted heuristics and unsupervised clustering, which often struggle with noisy GPS data and lack the ability to learn from large-scale datasets. This paper introduces DeepStay, the first deep learning-based approach for stay region extraction. By leveraging programmatic weak supervision from OpenStreetMap (OSM) and self-supervised forecasting, DeepStay achieves state-of-the-art performance on public benchmarks without requiring extensive manual labeling.

Introduction

Stay Region (SR) extraction is the process of identifying meaningful geographic locations, such as homes, offices, or retail stores, from raw GPS trajectories. These regions are essential for mapping personal points of interest and understanding urban dynamics. Historically, this task has been dominated by unsupervised algorithms like DBSCAN or heuristic-based methods that use fixed thresholds for time, distance, and velocity.

However, traditional methods face two major hurdles: the inherent noise and varying sampling rates of mobile GPS data, and a critical lack of labeled ground-truth data for supervised learning. DeepStay addresses these challenges by framing stay region extraction as a pointwise classification problem, utilizing a transformer-based architecture trained through a combination of weak supervision and self-supervised learning.

Methodology

Transformer-Based Pointwise Classification

Unlike previous models that attempt to segment trajectories before classification, DeepStay utilizes a Transformer encoder to learn latent representations for every individual point in a sequence. This pointwise approach allows the model to capture complex temporal dependencies and transition states (e.g., the moment a user exits a vehicle to enter a building) more effectively than segment-wise models.

Programmatic Weak Supervision

To overcome the scarcity of labeled data, the authors implement programmatic weak supervision. By querying OpenStreetMap (OSM), the system generates "weak labels" based on geographic context. For instance, a GPS point located within a building or near an amenity is assigned a higher probability of being a "stay," while points on highways are labeled as "non-stays." DeepStay employs an ensemble of four labeling functions—building, amenity, street, and transport mode—to create confidence-weighted training signals.

Self-Supervised Learning (SSL)

The model's robustness is further enhanced through a multi-task loss function. During training, the model performs a self-supervised "pretext task" where it forecasts the velocity and bearing angle of the subsequent point in the trajectory. This forces the encoder to learn the underlying dynamics of movement, improving its feature extraction capabilities even on unlabeled segments of the data.

Data Preprocessing

Trajectories are converted into 2D Cartesian coordinates (UTM) and standardized. To prevent the model from simply memorizing specific geographic coordinates, the authors apply random rotations to the trajectories during the training phase, ensuring the model learns movement patterns rather than static locations.

Experimental Setup and Datasets

The study utilizes two primary public datasets to validate the model:

  1. GeoLife (GL): A large-scale dataset containing trajectories from 182 users. While it lacks explicit stay labels, it includes transportation mode labels. This dataset was used for pre-training via weak supervision and SSL.
  2. ExtraSensory (ES): This dataset includes various sensor data and activity labels (e.g., "watching TV," "biking"). The authors derived ground-truth stay labels from these activities to fine-tune and evaluate DeepStay's performance.

Results and Discussion

Stay Region Extraction Performance

On the ExtraSensory dataset, DeepStay achieved an F1 score of 0.788, significantly outperforming the previous state-of-the-art density-based method, D-Star (0.753), and traditional threshold-based methods (0.453). The results indicate that the transformer architecture is better suited for handling the nuances of human mobility than rigid geometric heuristics.

Transportation Mode Detection (TMD)

To demonstrate the versatility of the architecture, the authors adapted DeepStay for Transportation Mode Detection (classifying modes such as walking, bus, or car). The model achieved an F1 score of 0.830, a substantial improvement over the previous state-of-the-art model, SECA (0.764).

Ablation Insights

Ablation studies revealed that while self-supervised forecasting provided a performance boost, the most significant gains were attributed to pre-training on the weakly labeled GeoLife dataset. This suggests that large-scale, "noisy" labels derived from geographic databases like OSM provide a more powerful training signal than smaller, perfectly labeled datasets.

Conclusion

DeepStay represents a shift in trajectory analysis from heuristic-based clustering to data-driven deep learning. By successfully utilizing weak supervision from OSM, the model bypasses the need for expensive manual labeling while maintaining high accuracy across different mobility tasks. Future work may involve modeling the dependencies between different weak labeling functions and incorporating larger, more diverse GNSS datasets to further improve the model's generalization across global geographic regions.

Summary updated

BibTeX
@inproceedings{lowens2023deepstay,
  author = {Christian Löwens and Daniela Thyssens and Emma Andersson and Christina Jenkins and Lars Schmidt-Thieme},
  title = {{DeepStay: Stay Region Extraction from Location Trajectories using Weak Supervision}},
  booktitle = {ITSC},
  year = {2023},
  url = {https://openreview.net/forum?id=MFD5V2eQhA},
}
Figure