Spherical Positional Encodings for Global and Panoramic Data

26 concepts18 papers1 proposal

When we apply deep learning architectures like Transformers or Coordinate Networks to data collected from the real world—such as global climate grids, satellite trajectories, or 360° panoramic images—we run into a fundamental geometric conflict. Standard neural networks typically process spatial data using flat, 2D Cartesian coordinates $(x, y)$. However, the data itself lives on a sphere.

Forcing a spherical surface onto a flat 2D grid introduces severe topological distortions. To build models that truly understand global weather patterns, immersive video, or planetary navigation, researchers have developed Spherical Positional Encodings. These techniques replace flat coordinate assumptions with embeddings that natively respect the geometry of a sphere.

The Flaws of Flat Coordinates on a Round World

To understand why standard positional encodings fail, consider an equirectangular projection—the standard way a 360° panorama or a global weather map is flattened into a rectangle. This projection introduces two critical issues:

  1. The Boundary Discontinuity (Seams): In a 2D grid, the pixel at the far-left edge $(x=0)$ and the pixel at the far-right edge $(x=W)$ are treated as being as far apart as possible. On an actual sphere, however, these two edges meet. A weather system or a moving object crossing this longitudinal boundary appears to vanish from one side of the image and magically reappear on the other.
  2. Polar Distortion (Singularities): As you move toward the poles, longitudinal lines converge. On a flat map, the North Pole is stretched from a single physical point into an entire horizontal line of pixels. Standard networks waste immense capacity processing these distorted regions, failing to realize that all pixels along the top edge represent the exact same location.

Without geometric awareness, a model cannot preserve true physical distances. As shown by Kim et al. in worldwide vessel trajectory modeling, mapping coordinates directly onto a spherical surface is essential to preserve physical distance relationships in high-dimensional feature spaces. Similarly, Bi et al. demonstrated in the Pangu-Weather architecture that earth-specific positional biases are required to distinguish between the non-uniform physical properties of different latitudes, ensuring the model treats the equator and the poles differently despite their grid similarities.

To resolve these distortions, modern architectures embed spatial information using three primary spherical strategies.


Strategy 1: Mapping to a 3D Unit Sphere

The most intuitive way to fix spherical distortion is to bypass 2D coordinates entirely. Instead of telling a network that an item is at pixel $(x, y)$, we project that pixel onto a virtual 3D unit sphere, calculating its Cartesian coordinates $(x', y', z')$.

$$\begin{aligned} x' &= \cos(\theta)\sin(\phi) \\ y' &= \sin(\theta)\sin(\phi) \\ z' &= \cos(\phi) \end{aligned}$$

where $\theta$ represents the azimuth (longitude) and $\phi$ represents the polar angle (latitude).

   Flat 2D Grid (Distorted)             Virtual 3D Sphere (True Geometry)
   +-----------------------+                         .

*  .
   | Polar Stretching      |                      .    / \    .
   | . . . . . . . . . . . |                    .     |   |     .
   |                       |       Project       .     \ /     .
   |   A               B   |    ------------->     .

*    .
   +-----------------------+                        True distance 
   (A and B seem far apart)                         between A and B

By calculating the Euclidean distance between these 3D coordinates, the network obtains an un-distorted measure of spatial proximity.

  • In Attention Mechanisms: Yun et al. introduced EGformer, which biases Transformer attention matrices using the 3D Euclidean distance between projected spherical points. This allows the model to handle cyclic continuity and distortion naturally during 360° depth estimation. Li et al. applied a similar 3D projection to panoramic video salient object detection, eliminating polar warping and ensuring consistent object shape representation across the entire field of view.
  • Cross-Projection Alignment: In PanFusion, Zhang et al. utilized 3D spherical space mapping as a shared geometric reference. This allows an attention mechanism to accurately map distorted panoramic pixels to their corresponding locations in flat, undistorted perspective views.
  • Alternative Projections: Rather than a continuous sphere, the authors of AOG-Net (Lu et al.) project spherical coordinates onto a cubemap representation. This geometric awareness provides a clean, piece-wise flat alternative that still eliminates boundary seams and warping during 360-degree image generation.

Strategy 2: Enforcing Continuity with Periodic and Rotary Encodings

When explicit 3D coordinates are not ideal, architectures can enforce boundary continuity by passing angular coordinates through periodic functions like sine and cosine.

If a model uses a positional embedding based on $\sin(\theta)$ and $\cos(\theta)$, the representation at $\theta = 0^\circ$ (the left edge) automatically matches the representation at $\theta = 360^\circ$ (the right edge). Chang et al. leveraged this property for indoor panorama depth estimation, demonstrating that sine and cosine encodings handle wrap-around geometry cleanly without boundary artifacts.

This periodic approach can be integrated into models in several ways:

  • Relative Position Embeddings: In HORIZON, Yan et al. incorporated periodic functions into relative position embeddings, ensuring that the left and right boundaries of an equirectangular canvas are treated as adjacent during self-attention. For global weather modeling, the ARROW architecture (Tian et al.) utilizes a "ring positional encoding" to handle the longitudinal wrap-around of global grid data, preventing artificial boundaries at the map edges.
  • Rotary Embeddings: In Image as a World, Gui et al. adapted the Rotary Position Embedding (RoPE) framework into a spherical rotary positional encoding. By embedding spatial information directly into a spherical coordinate system via rotation matrices, the model maintains perspective accuracy and prevents warping at the poles during interactive 360-degree video generation.
  • Continuous Fields: For generative tasks like Text2Light, Chen et al. showed that incorporating spherical coordinates into continuous neural fields prevents texture repetition and maintains perspective accuracy across longitudinal seams.

Strategy 3: Taming the Poles with Spherical Harmonics

While 3D projections and periodic encodings solve the wrap-around problem, they do not completely resolve the mathematical singularity at the poles, where infinite longitudinal lines intersect at a single point. To achieve true mathematical continuity across a globe, models require basis functions natively defined on a sphere: Spherical Harmonics.

Just as the standard Fourier transform decomposes a 1D signal into a sum of sines and cosines, Spherical Harmonics decompose a spherical signal into a set of orthogonal, continuous basis functions.

   Standard Fourier (1D/2D)                 Spherical Harmonics (Spherical)
   Continuous on flat intervals             Continuous across the entire globe
      _          _                             __      __
    /   \      /   \                          /  \    /  \
  _/     \____/     \___                     |    |  |    |
                                              \__/    \__/

Because these basis functions are natively defined on a spherical manifold, they do not suffer from coordinate convergence at the poles. Rußwurm et al. demonstrated that using spherical harmonics as positional encodings completely eliminates predictive artifacts at the poles. Unlike traditional rectangular map projections, this approach maintains mathematical continuity across the entire planetary surface.

In SatCLIP, Klemmer et al. combined these Spherical Harmonics with Sinusoidal Representation Networks (SirenNets) to construct general-purpose geographic location embeddings. This architecture allows the model to capture complex, non-linear spatial patterns while strictly respecting the global topology of the Earth.


Broader Geometric Context

Spherical positional encodings are part of a broader shift toward matching neural network architectures to the underlying geometry of their inputs. This perspective extends beyond perfect spheres to other non-Cartesian imaging setups:

  • Fisheye and Wide-Angle Lenses: In DarSwin, Athwale et al. replaced standard square image patches with a radial (polar) partitioning scheme. By representing spatial relationships using incident angle and azimuth rather than fixed 2D pixel coordinates, the model maintains a consistent geometric understanding that generalizes across different lens projection profiles.
  • Local Patch Topology: For omnidirectional image quality assessment, the ST360IQ framework (Tofighi et al.) integrates the spherical position of an image patch directly into a Transformer's input as a specialized geometric coordinate embedding. This provides the model with the necessary spatial context to account for topology-dependent visual characteristics.

By moving away from flat 2D coordinate assumptions and adopting spherical representations—whether through 3D unit sphere projections, periodic functions, or spherical harmonics—models can process global and panoramic data without distortion, preserving the true continuity of our round world.

Key Foundational Work

Spherical Vision Transformer for 360° Video Saliency Prediction (2023) — contributed 2 concept elements to this direction.
Text2Light: Zero-Shot Text-Driven HDR Panorama Generation (2022) — contributed 2 concept elements to this direction.
Panoramic Video Salient Object Detection with Ambisonic Audio Guidance (2023) — contributed 2 concept elements to this direction.
History & citationVersion 1 · 2026-10-04

Current · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_spherical_positional_encoding_d7fcd247,
  title = {spherical positional encoding},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/spherical-positional-encoding/rdr_d7fcd24755924a8cb5b7fabf8393e751},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-27},
}

This exact version (version 1, frozen text):

@misc{lacuna_spherical_positional_encoding_d7fcd247_v1,
  title = {spherical positional encoding},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/spherical-positional-encoding/rdr_d7fcd24755924a8cb5b7fabf8393e751/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-27},
}
About

These directions overlap with this one through shared papers.

See something wrong? Report a mistake