One Model, Many Cities: A Transferable Social Relationship Inference Framework for Human Mobility Data

Chen Chu, Cyrus Shahabi, Emmanuel Tung, Khurram ShafiqueSIGSPATIAL/GIS 2025

TL;DR

This paper introduces a novel framework for inferring social relationships from human mobility data that can be trained on one dataset and generalized to others, even from different cities, without requiring new labels. By aligning location embeddings across datasets, their method achieves state-of-the-art zero-shot inference performance, significantly outperforming existing approaches.

What Problem Does This Paper Address?

Inferring social connections between people is valuable for many applications, from understanding social dynamics to public health. Human mobility data, like check-in records, offers a rich source for this, as people tend to visit places with their friends. However, a major hurdle is the scarcity of large-scale datasets that contain both mobility data and ground-truth social connections. This makes it difficult to train robust deep learning models that can generalize well. Existing methods often rely on supervised learning with explicit labels or unsupervised approaches that are heavily tied to specific datasets and their geographic semantics, limiting their applicability to new, unseen data.

Methods

The core of the proposed solution is a transferable social relationship inference framework consisting of two main modules:

  • Universal Social Relationship Classifier (USRC): This is a deep learning model designed to infer social relationships from trajectory data. It takes into account co-visit sequences (users at the same place and time) and co-location sequences (users at the same place at different times). The USRC uses Transformer encoders to process these sequences and learns location embeddings.
  • Spatial Embedding Transfer (SET): This module is the key to generalization. It aligns the location embedding distribution of a target (unlabeled) dataset with the source (labeled) dataset's embedding space, allowing the pre-trained USRC model to interpret the target data without additional supervision. SET operates in three steps:
  • Spatial Initiation: It initializes target location embeddings by identifying "anchor points" based on location popularity (using location entropy) and pairing them between source and target datasets. This leverages the insight that popular locations tend to have similar roles across cities.
  • Structural Matching: This step refines the alignment by incorporating Origin-Destination (OD) flows derived from trajectory data. It uses a fine-tuning module to adjust target embeddings based on these flows, ensuring a more precise match with the source embedding space.
  • Global Finetuning: Finally, an unsupervised contrastive learning approach is used to fine-tune the target location embeddings. This step focuses on capturing the unique co-location/visit patterns of the target dataset, making the embeddings more compatible with the pre-trained USRC model.

Datasets

The authors used five real-world datasets for their experiments:

  • Gowalla_LA: Check-in data and friendship labels from Los Angeles.
  • Gowalla_NY: Check-in data and friendship labels from New York.
  • Gowalla_ST: Check-in data and friendship labels from Stockholm.
  • Foursquare_LA: Check-in data and friendship labels from Los Angeles.
  • Foursquare_NY: Check-in data and friendship labels from New York.

These datasets are derived from publicly available Gowalla and Foursquare check-in data, with friendship relationships extracted. The authors note that Gowalla and Foursquare differ significantly in their data collection methods, justifying their treatment as independent datasets even within the same city.

Key Insights and Ideas

  • Social ties are location-agnostic: The paper's core insight is that social bonds depend more on the frequency of meetings and location popularity rather than the specific geographic semantics of the locations themselves. This allows for transferability across different cities.
  • Embedding alignment is crucial for generalization: By aligning the embedding spaces of different datasets, the model can leverage knowledge learned from a labeled source dataset to make predictions on unlabeled target datasets.
  • Popularity and structure matter: The SET module's success stems from its ability to capture both the structural similarities (location popularity) and the flow-based relationships (OD flows) between locations in different cities.
  • Zero-shot inference is achievable: The framework enables effective social relationship inference without requiring any ground-truth social labels in the target dataset.
  • Contrastive learning refines target embeddings: The global finetuning step, using contrastive learning, is essential for adapting the aligned embeddings to the specific nuances of the target dataset and ensuring compatibility with the pre-trained USRC.

Key Results

  • The proposed framework achieves state-of-the-art performance in zero-shot social relationship inference, outperforming other unsupervised and even some supervised approaches.
  • When trained on a high-quality dataset (Gowalla_LA), the model outperforms the best supervised results on other datasets (Foursquare_LA and Foursquare_NY).
  • The SET module significantly improves location embedding alignment, outperforming existing baseline methods in zero-shot prediction tasks.
  • In an ablation study, the full SET module (combining Spatial Initiation, Structural Matching, and Global Finetuning) consistently performed best, highlighting the importance of each component.
  • The method demonstrates exceptional transferability across different cities and datasets.

Limitations and Future Work

  • Data Sensitivity: The authors acknowledge that current research is constrained by the sensitivity of location data and social relationship networks, limiting the availability of diverse datasets.
  • Future Directions:
    • Exploring datasets with richer granularities and specific types of social relationships (e.g., colleagues, family).
  • Incorporating richer contextual information into spatial transfer learning to model correlations between spatial context and human mobility patterns.
  • Developing a more general geospatial foundation model that can be trained on large-scale data and remain highly generalizable.

Summary updated

BibTeX
@inproceedings{chu2025one,
  author = {Chen Chu and Cyrus Shahabi and Emmanuel Tung and Khurram Shafique},
  title = {{One Model, Many Cities: A Transferable Social Relationship Inference Framework for Human Mobility Data}},
  booktitle = {SIGSPATIAL/GIS},
  year = {2025},
  doi = {10.1145/3748636.3762710},
}
Figure