Sphere2Vec: A general-purpose location representation learning over a spherical surface for large-scale geospatial predictions

Gengchen Mai, Yao Xuan, Wenyun Zuo, Yutong He, Jiaming Song, Stefano Ermon, Krzysztof Janowicz, Ni Lao

Abstract

Sphere2Vec is a novel location encoder that learns high-dimensional representations of geographic coordinates while strictly preserving spherical distances. By moving beyond flat 2D maps and 3D Cartesian approximations, it addresses the "geometry gap" in geospatial machine learning. Evaluated across synthetic and real-world datasets, Sphere2Vec achieves up to a 30.8% error reduction in geospatial predictions, particularly excelling in polar regions where traditional models fail.

The Problem: The Earth Isn't Flat

Most machine learning models treat the Earth as if it were a flat 2D plane (like a Mercator projection) or a simple 3D box. This creates a massive "geometry gap." In 2D, treating latitude and longitude as simple X and Y coordinates leads to map projection distortion; for example, the distance between two degrees of longitude shrinks to zero at the poles but is vast at the equator. Models trained this way struggle to understand spatial relationships near the Arctic or Antarctic.

In 3D, "NeRF-style" encoders treat points as locations in a 3D cube. However, the straight-line distance between two points through the Earth (Euclidean distance) is not the same as the distance along its surface (Great Circle distance). Sphere2Vec bridges this gap by providing a "spherical-native" way for neural networks to understand global positioning.

Methodology

The authors propose a multi-scale spherical location encoder based on the Double Fourier Sphere (DFS) method. This approach integrates location data directly into the learning pipeline alongside image data.

The Sphere2Vec framework integrates a location encoder with an image encoder for joint supervised training and inference.

Key technical components include:

  • Spherical Basis Functions: Instead of standard 2D grids, Sphere2Vec uses a set of basis functions (sines and cosines) designed to wrap around a sphere without seams or distortions at the poles.
  • Multi-Scale Encoding: Similar to map zoom levels, Sphere2Vec encodes locations at multiple frequencies to capture both broad global patterns (climate zones) and fine-grained local details (city-level distributions).
  • Theoretical Rigor: The researchers provide mathematical proofs showing that their encoding is injective (unique locations get unique codes) and that embedding distances correspond to actual spherical surface distances.

Evaluation and Datasets

The study evaluates Sphere2Vec across a rigorous battery of tests:

  1. Synthetic Datasets: 20 new datasets based on the Mixture of von Mises-Fisher (MvMF) distribution to test recovery of complex spherical patterns.
  2. Species Recognition: Five datasets including BirdSnap and iNaturalist (2017/2018), using location as a geographic prior for animal identification.
  3. Flickr Image Recognition (YFCC): Predicting image tags based on GPS metadata.
  4. Remote Sensing (fMoW): Classifying land use from satellite imagery globally.

Key Insights and Results

Sphere2Vec outperformed all baselines on synthetic datasets, reducing error rates by as much as 30.8%. On real-world iNaturalist and fMoW datasets, it consistently beat state-of-the-art 2D and 3D encoders.

Qualitative comparison of predicted distributions for species and remote sensing tasks. Sphere2Vec (dfs) produces more realistic, compact ranges compared to traditional grid or wrap methods.
  • The "Polar Advantage": Traditional models produce "horizontal striping" artifacts near the poles. Sphere2Vec eliminates these, producing smooth, compact spatial distributions regardless of latitude.
  • The 3D Euclidean Trap: Surprisingly, 3D Cartesian encoders are often worse than 2D encoders for spherical data because 3D distance is not monotonic with surface distance, confusing the model on opposite sides of the globe.
  • Data Sparsity Resilience: In areas with few training samples, Sphere2Vec’s geometric "common sense" allows it to generalize better than kernel-based methods (like RBF) that rely on dense local examples.

Conclusion

By proving that calculating on a round planet is both mathematically possible and computationally superior, Sphere2Vec provides a new cornerstone for global-scale artificial intelligence. Future work may extend this to climate modeling, trajectory prediction, and large-scale GeoAI foundation models.

Summary updated

BibTeX
@inproceedings{mai2023sphere,
  author = {Gengchen Mai and Yao Xuan and Wenyun Zuo and Yutong He and Jiaming Song and Stefano Ermon and Krzysztof Janowicz and Ni Lao},
  title = {{Sphere2Vec: A general-purpose location representation learning over a spherical surface for large-scale geospatial predictions}},
  booktitle = {ISPRS},
  year = {2023},
  doi = {10.1016/j.isprsjprs.2023.06.016},
}
Figure