← Portfolio

Urban Embeddings Explorer

Discovering visually similar neighbourhoods across 200+ cities from satellite embeddings.

2025 · London, UK · TerraMind Blue-Sky Challenge, round 2 winner (ESA/IBM), Oct 2025

Links
Topics
remote sensingdeep learningembeddingsweb dev
Stack
PythonTerraMindReactMapbox GL JSFastAPIQdrant

Built to explore how TerraMind, a geospatial foundation model, “sees” urban areas globally — a similarity search system that surfaces visually related neighbourhoods across continents. A passion project, not a research one: I wanted to learn how to work with geospatial foundation models and build something that puts them to use on cities specifically, rather than the usual land-cover benchmarks. Entered into and won round 2 of the TerraMind Blue-Sky Challenge (ESA/IBM) — entry writeup here.

Structure (in short)

1. Embedding Extraction

Sentinel-2 L2A imagery (12 bands, matching TerraMind’s training setup) was pulled from STAC catalogues for 200+ cities above 100k population (max 5 per country, for regional spread), as a cloud-masked median composite over the most recent months. Passing this through TerraMind gives 768-dimensional embeddings across 196 patches per 224×224m tile — over 48,000 tiles globally.

2. Filtering Spatial Dimensions

Raw embeddings mostly returned the tile’s own neighbours as “most similar” — the model was encoding location as much as appearance. To find visual similarity across different cities rather than within one, I measured which embedding dimensions correlated with geographic proximity (spatial autocorrelation within tiles, and correlation between tile distance and embedding similarity), then used an automatic cutoff to drop the most location-biased ones — 61 of 768 dimensions (7.9%). After filtering, similarity search picks out tree cover, rivers, harbours, industrial zones and other features that recur across cities rather than within one.

Spatial correlation analysis: dimension filtering threshold

3. Aggregating Patches to a Tile

Each tile still has 196 patch embeddings to collapse into one vector. Simple stats (mean, median, min, max) gave broadly similar results, with median and max picking up slightly more useful signal. Since a 224m tile can straddle quite different land uses, I also tried clustering the patches within a tile and averaging only the dominant cluster — sharper for tiles with one clear land-use type, at the cost of discarding the rest. UMAP projection of the aggregated embeddings mostly groups cities by region (desert, European, coastal), though some clusters cut across geography entirely — there’s a distinct region in embedding space where airports from around the world sit together.

4. Web Application

A React frontend with a Mapbox view of all 48,000+ tiles, paired with a synced UMAP plot, lets you click any neighbourhood and see visually similar ones surface elsewhere in the world — click somewhere in Sydney and you might land in Rio. A FastAPI backend queries a Qdrant vector database holding the filtered, aggregated embeddings; the mean and dominant-cluster aggregations are both exposed in the live app.

At 10m resolution the embeddings capture broad urban patterns rather than fine detail, but that’s enough to show what a foundation model picks up on at scale. Explore it below.