← Back to list

Does GPS Help AI See Better? Testing Location Encoders for Satellite Imagery

You’re looking at a satellite image. Green, trees, maybe a river. Forest? Farmland? Wetlands? Without knowing where this is, even a human…

Amrith Coumaran in Towards AI · 2026-05-19 23:01 · 0 claps · 7.7 min read
#geospatial-analytics #embedding
Open on Medium ↗
Wiki topics: RAG · RAG & Retrieval GRW · Growth & Analytics 🔧 · Data Engineering 🔭 · Astronomy & Space

Does GPS Help AI See Better? Testing Location Encoders for Satellite Imagery

You’re looking at a satellite image. Green, trees, maybe a river. Forest? Farmland? Wetlands? Without knowing where this is, even a human would struggle. A pine forest in Sweden and a eucalyptus plantation in Brazil look nearly identical from 700 km up.

This is the dirty secret of satellite image classification: pixels alone are not enough. A model that only looks at RGB channels has no concept of latitude, climate, or ecology. It has to guess whether a patch of green is Nordic taiga or Amazon rainforest based purely on texture.

The obvious fix is to give the model GPS coordinates. But coordinates are just two numbers, you can’t just concatenate them and expect the model to magically understand geography. You need an encoding that transforms raw lat/lon into a representation the neural network can use.

The question is: which encoding works best? And more importantly, do any of them actually help?

To find out, I built a benchmark comparing three fundamentally different approaches, using a DINOv2 vision model as the backbone and testing on EuroSAT, a dataset of 1,000 Sentinel-2 satellite images across 10 land-use classes (Annual Crop, Forest, Highway, Industrial, Residential, etc.).

  • Naive sin/cos, Multi-scale sine & cosine of lat/lon at frequencies 2^k with 256 dim
  • GeoCLIP, Random Fourier Features trained on 4M geotagged Flickr photos with 512 dim
  • SatCLIP, Spherical harmonics trained contrastively on Sentinel-2 patches with 256 dim
## Snippet: Load and encode GPS with SatCLIP

from satclip import SatCLIP  # or huggingface wrapper
from utils.device import get_device

device = get_device()  # CUDA → MPS → CPU

satclip = SatCLIP.from_pretrained("microsoft/SatCLIP-ViT16-L40").to(device)
satclip.eval()

# Encode a single (lat, lon) pair → 256-dim vector
coord = torch.tensor([[48.8566, 2.3522]], dtype=torch.float32)  # Paris
with torch.no_grad():
    embedding = satclip.encode(coord.to(device))  # shape: (1, 256)

First, I wanted to understand what each encoder’s “world” looks like. I took 65,341 points on a 1° global grid, encoded them with each method, and projected down to 2D with UMAP.

UMAP by continent (Image by author)

UMAP by continent (Image by author)

The naive sin/cos encoder produces the cleanest continental separation. Europe is a tight cluster, Africa is distinct, Asia sprawls predictably. This isn’t surprising as sin/cos is a pure geometric function that maps similar coordinates to similar embeddings by construction. It doesn’t know what a continent is, but it doesn’t need to.

GeoCLIP is messier. Its Random Fourier Features are trained on millions of geotagged photographs, so the embedding space optimizes for visual similarity of ground-level photos, not geographic proximity. A beach in Thailand and a beach in Greece look similar through a camera lens, so GeoCLIP pulls them together even though they’re on opposite sides of the planet.

SatCLIP falls in between. Trained on satellite imagery rather than ground photos, its space reflects land-cover similarity. Deserts cluster, forests cluster, urban areas cluster, often spanning multiple continents. This gives richer structure than GeoCLIP but less crisp geography than the naive baseline.

The silhouette scores quantify this: Naive sin/cos leads at -0.21, followed by SatCLIP at -0.29 and GeoCLIP at -0.34. But as we’re about to see, clean geographic clusters don’t translate to useful features.

Can we retrieve nearby places?

A good location encoding should let you find places that are geographically close to a query point. I tested this by encoding 50 major cities, retrieving their 10 nearest neighbors in the global grid, and measuring the actual distance on Earth.

World map retrievals (Image by author)

World map retrievals (Image by author)

The naive encoder is catastrophically bad. Its nearest neighbors average 7,640 km from the query city, that’s roughly the distance from San Francisco to London. It correctly identifies the continent only 14% of the time. The problem is structural: sin/cos at 256 dimensions creates a high-dimensional sphere where distance in embedding space barely correlates with geographic distance beyond the coarsest scale.

GeoCLIP does much better: mean distance of 913 km, 73.4% continent recall. It knows that Western Europe and East Asia are different places.

But SatCLIP dominates: 176 km mean distance, 77.8% continent recall. It finds nearest neighbors within the same city region, not just the same continent. When it makes a mistake, it’s off by a couple hundred kilometers, not thousands.

The gap between GeoCLIP and SatCLIP is revealing. Both are learned, both are pretrained, but GeoCLIP is optimized for visual similarity of ground-level photos while SatCLIP is optimized for spectral similarity of satellite imagery. For geographic retrieval of satellite data, the training objective matters enormously.

Does GPS actually improve classification?

This is the experiment that matters. I took DINOv2 CLS embeddings (768-dim, batch size 128) and concatenated them with each GPS encoding, then ran 5-fold logistic regression on EuroSAT. No fine-tuning, no complex architecture, just a linear probe.

Accuracy Comparison (Image by author)

Accuracy Comparison (Image by author)

## Snippet: The linear probe setup

from sklearn.linear_model import LogisticRegressionCV
import numpy as np

# X_image: (N, 768) from DINOv2 CLS token
# X_gps:   (N, 256) from SatCLIP (or 512 for GeoCLIP, 256 for sin/cos)
X = np.hstack([X_image, X_gps])
# 5-fold cross-validated logistic regression

clf = LogisticRegressionCV(
    Cs=10, cv=5, max_iter=1000, multi_class='multinomial'
)
clf.fit(X, y_labels)  # y_labels: 10 EuroSAT classes
| Feature set         | Accuracy  | Δ       |
| - - - - - - - - - - | - - - - - | - - - - |
| Image only (DINOv2) | 84.6%     | -       |
| + Naive sin/cos     | 84.6%     | +0.0%   |
| + GeoCLIP           | 84.6%     | +0.0%   |
| + SatCLIP           | **98.3%** | +13.7%  |

Two encodings add exactly nothing. The third adds 13.7 percentage points. You could try the most obvious encoding in the world (sin/cos) or a sophisticated learned approach (GeoCLIP), and neither would make a dent. A linear classifier on DINOv2 features already captures almost everything these encodings have to offer.

SatCLIP is different. It pushes accuracy from 84.6% to 98.3%, not incremental, but transformative.

Where does it help most? The per-class F1 breakdown tells a clear story:

Per-class F1 scores (Image by author)

Per-class F1 scores (Image by author)

The hardest classes for the image-only model are Herbaceous Vegetation (F1: 0.68), Pasture (0.67), and Permanent Crops (0.77). These are exactly the classes where visual ambiguity is highest, grass, crops, and pasture all look like various shades of green from above. Location is the disambiguating signal. SatCLIP boosts all three above 0.95.

The confusion matrix for the best model is nearly diagonal:

Confusion Matrix (Image by author)

Confusion Matrix (Image by author)

The few remaining errors are between geographically adjacent and visually similar classes like River vs. Sea/Lake, or Residential vs. Industrial, where even a human with GPS coordinates might hesitate.

Why do most GPS encodings fail?

Qualitative examples (Image by author)

Qualitative examples (Image by author)

Of 300 held-out test samples, adding SatCLIP GPS rescues 54 that the image-only model misclassifies. The pattern is consistent: DINOv2 alone confuses visually similar land-cover types; SatCLIP tells the classifier where the image is, and location resolves the ambiguity.

But why don’t the other encodings help at all? The Spearman correlation between DINOv2 features and each GPS encoding is low across the board (<0.13 for all three), so it’s not “redundancy” with vision features that kills them.

The real answer is geographic scale.

All 1,000 EuroSAT images are from Europe, specifically, from a region spanning roughly France to Poland, the Alps to the North Sea. Lat/lon varies by about 1° across the entire dataset.

Naive sin/cos at a base frequency of 2⁰ = 1 radian per degree is tuned to detect global patterns. Across a 1° window, the encoding barely flickers. You’re handing the classifier a signal that’s practically constant.

GeoCLIP is better, but its Random Fourier Features were trained on a dataset of geotagged photographs spanning the entire planet. Its frequency distribution is optimized to distinguish continents, not to tell apart farms in Bavaria from farms in the Netherlands.

SatCLIP’s spherical harmonics are different. Higher harmonic degrees resolve spatial structure at finer and finer scales, think of them as Fourier components on a sphere’s surface, where degree L corresponds to a wavelength of roughly 20,000 / L km. At L=64, SatCLIP can resolve patterns at ~300 km scale, which is exactly what you need to capture the north-south gradient of European land cover: Mediterranean scrub, Central European farmland, Nordic forests.

(If you want to put a number on it: SatCLIP’s 256-dim embedding corresponds to roughly L=8 spherical harmonics, which resolve patterns at ~2,500 km scale globally, more than enough to discriminate land-use within a continent-spanning region like Europe.)

Feature redundancy (Image by author)

Feature redundancy (Image by author)

The practical lesson: every encoding comes with an implicit spatial scale. Choosing one means betting on the scale of your problem. Sin/cos bets on global geometry and loses. GeoCLIP bets on global photo similarity and loses. SatCLIP bets on multi-scale satellite land-cover patterns and the bet pays off.

Takeaways

  1. The encoding matters more than the architecture. A linear classifier + SatCLIP embeddings matches or beats fancy multimodal architectures on EuroSAT. The representation quality of the GPS encoding, not the complexity of the fusion model, is the bottleneck.

  2. Spherical harmonics are principled for Earth data. As eigenfunctions of the Laplacian on the sphere, they naturally capture multi-scale spatial structure. SatCLIP proves this isn’t just mathematical elegance, it’s a 13.7% accuracy gain.

  3. Benchmark your encoding on your actual task. The most common approach (sin/cos) added nothing. A popular learned approach (GeoCLIP) added nothing. SatCLIP transformed the results. If you’re building a GeoAI pipeline, test your encoding on your specific dataset and geographic extent, don’t assume.

  4. DINOv2 + SatCLIP = 98.3% on EuroSAT with zero fine-tuning. This is a strong baseline for any satellite image classification task. Vision features from DINOv2, location features from SatCLIP, fused with a linear layer. No training, no GPU cluster, no PhD thesis.

Conclusion: We started with a simple question: does giving a model GPS coordinates actually help it classify satellite imagery? The answer turned out to depend entirely on how those coordinates are encoded. Naive geometry and ground-level photo priors added nothing, while a satellite-trained spherical harmonic representation boosted accuracy by 13.7 percentage points with zero fine-tuning. If you take one thing away, let it be this: benchmark your location encoder on your actual data and geography, the default choice is probably wrong.

References:

[1] P. Helber et al., EuroSAT: A Novel Dataset and Deep Learning Benchmark for Land Use and Land Use Classification (2019), IEEE JSTARS. Dataset: https://github.com/phelber/eurosat (MIT License) [2] M. Oquab et al., DINOv2: Learning Robust Visual Features without Supervision (2024), TMLR. [3] V. Cao et al., GeoCLIP: Clip-Inspired Alignment between Locations and Images for Effective Worldwide Geo-localization (2023), NeurIPS. [4] K. T. Mai et al., SatCLIP: Global, General-Purpose Location Embeddings for Satellite Imagery (2024), AAAI. [5] L. McInnes et al., UMAP: Uniform Manifold Approximation and Projection for Dimension Reduction (2018), arXiv:1802.03426.


메타데이터
post_id
8c7645a85e0a
slug
does-gps-help-ai-see-better-testing-location-encoders-for-satellite-imagery-8c7645a85e0a
url
https://pub.towardsai.net/does-gps-help-ai-see-better-testing-location-encoders-for-satellite-imagery-8c7645a85e0a
canonical_url
https://pub.towardsai.net/does-gps-help-ai-see-better-testing-location-encoders-for-satellite-imagery-8c7645a85e0a
author_url
https://medium.com/@amrithc
status
ok
fetched_at
2026-06-09 15:37:30