Projects · MSc thesis · UPF

Privacy-preserving synthetic mobility data

Can deep generative models produce mobility data that's both useful and private? A user-level privacy–utility evaluation on real GPS trips.

Python · PyTorch · VAE · WGAN-GP · Membership inference

Why

Wider access to mobility data would advance urban planning and transport modelling, but it’s rarely shared: a few weeks of someone’s trips reveal where they live, where they work and their routine.

Diagram. Sensitive mobility data, which reveals home location, work location and regular travel schedule, goes into a generator that outputs synthetic mobility data with those details obscured.
The idea — learn the patterns from sensitive trips, release synthetic trips that don't expose anyone's home, work or routine.

Synthetic data promises a way out: train a generative model on the real trips, then release trips it generates instead. Whether that delivers utility and privacy together is still unclear, because most earlier work looked at tabular data, or at privacy for individual records rather than for whole people.

The dataset

The GeoLife GPS dataset from Beijing, processed into 7,739 origin–destination trips from 154 users. Travel follows the city’s rhythm: commuting peaks on weekday mornings and early evenings, and very little happens overnight.

Heatmap of active trips by day of the week and hour of the day. Weekdays light up around the morning and early-evening commute; weekends spread more across the afternoon.
Active trips by day and hour.
Polar chart of active trips by time of day in 15-minute buckets, with large lobes in the morning and late afternoon to evening and almost nothing overnight.
The same trips around the clock, in 15-minute buckets.

What it is

My MSc thesis at Universitat Pompeu Fabra. It asks three questions of synthetic trips generated from that data:

  1. Utility: how faithfully does the synthetic data reproduce real mobility?
  2. Privacy: can a user-level membership inference attack tell which people were in the training data?
  3. Activity: are more active users, with more trips to learn from, more exposed?

Experiment setup

Two deep generative models, built in PyTorch, are compared against a bootstrap baseline:

Three diagrams. VAE: a real trip goes through an encoder to a latent z, sampled from a normal distribution, then through a decoder to a synthetic trip; a reconstruction loss compares output with input. WGAN-GP: noise z goes through a generator to a synthetic trip; a critic compares synthetic and real trips and sends a gradient signal back to make fakes harder to tell apart. Bootstrap: real trips are sampled with replacement into sampled trips, with no model in between.
The three generators. The bootstrap copies real trips verbatim, so it's the reference for how a leaky release looks.
  • Variational autoencoder (VAE): compresses each trip into a latent space and decodes samples back into trips.
  • Wasserstein GAN with gradient penalty (WGAN-GP): a generator learns to produce trips that a critic can’t tell apart from real ones.
  • Bootstrap: resamples real trips directly. It’s a positive control: if the attack can’t catch the bootstrap, it can’t catch anything.

Utility

Left, a line chart of the share of trips by hour of day in Beijing for real data, VAE, WGAN-GP and a bootstrap baseline; all follow the morning and evening peaks closely. Right, four maps of trip origins and destinations by grid cell; the VAE's are packed into the centre ("too condensed") and the WGAN-GP's spread smoothly into areas with no real trips ("too smooth, over-generalised").
Time is easy, space is hard. Every model reproduces the daily rhythm, but the VAE collapses trips into the centre and the WGAN-GP smooths them into places nobody travels.

Both models reproduced the temporal structure of travel well, but the spatial structure poorly. On a downstream prediction task, a model trained on synthetic trips and tested on real ones recovered only about a quarter of real-data performance (TSTR ratio 0.25–0.27).

Privacy evaluation

Flow chart of the membership inference evaluation. All users of the real dataset are split into eval-out, eval-in and shadow users. Eval-in and shadow users form the main training dataset, which trains the main generator and produces a synthetic dataset. Shadow users also form a shadow training dataset, split N times at random into out/in sets that train N shadow generators and N shadow datasets. Features extracted from the shadow datasets train an attack classifier; features extracted from the synthetic dataset and the eval users are used for the final membership inference evaluation.
The attack. Shadow generators trained on known in/out splits teach a classifier what membership looks like; it then tries to spot which evaluation users were in the real model's training data.

The attack works at the level of people, not individual trips: for each evaluation user, it predicts whether their trips were used to train the generator.

  • VAE and WGAN-GP: no measurable membership leakage (AUC ≈ 0.50, chance level).
  • Bootstrap: clear leakage (AUC 0.75), confirming the attack works when there’s something to find.
  • Activity level: no membership difference could be established across activity levels, but direct copying of real records rose with user activity across all models.
Two line charts of near-copy rate by user activity group (low 10–20, medium 21–63, high 64+ trips per user). Bootstrap rises from about 0.48 to 0.93. VAE rises from about 0.0035 to 0.0083 and WGAN-GP from about 0.006 to 0.0096. An annotation reads "Higher chance of user's trips reproduced".
The more trips a person contributes, the more often near-copies of them appear in the synthetic data, for every model. Rare for VAE and WGAN-GP (under 1%), routine for the bootstrap.

What it means

Scatter plot of pooled membership-inference AUC (lower is more private) against OD-flow Jensen–Shannon distance (lower is more useful). Bootstrap sits at high utility but AUC 0.75. VAE and WGAN-GP sit at AUC about 0.50 but JS distance about 0.65. The "ideal" region of good utility and privacy, bottom left, is empty.
The trade-off in one picture. The bootstrap is useful but leaky; the VAE and WGAN-GP are private but far less useful. Nothing reached the ideal corner.

The privacy observed here is largely a by-product of under-fitting, not evidence of a favourable trade-off: the models protected people by not learning enough to be useful. Establishing rigorously where privacy and utility can coexist is the foundation for releasing synthetic mobility data with confidence, and for the open access that mobility research depends on.

Cover of the MSc thesis "Synthetic Mobility Data, A User-Level Membership Inference Assessment" by Campbell Gray, Master in Intelligent Interactive Systems, Universitat Pompeu Fabra, July 2026.
Synthetic Mobility Data: A User-Level Membership Inference AssessmentMSc thesis, Master in Intelligent Interactive Systems, Universitat Pompeu Fabra, July 2026. Supervised by Manuel Portela.Code on GitHub ↗

Presented at Urban Transitions 2026

I presented this work as an oral talk at Urban Transitions 2026 (10–12 November, Sitges, Spain).

Campbell Gray speaking at a lectern on stage at Urban Transitions 2026, next to a large projected slide titled "Utility: Synthetic trips get the when right but struggle with the where", showing the hourly trip chart and the four Beijing origin–destination maps.
Presenting the utility results in Sitges.
Urban Transitions 2026 banner: Integrating Housing, Urban and Transport Planning, Environment, Climate Action, Circular Economy and Health for Healthier Urban Living. 10–12 November 2026, Sitges, Spain.