Skip to content

SphereUFormer: A U-Shaped Transformer for Spherical 360 Perception

Conference: CVPR 2025
arXiv: 2412.06968
Code: None
Area: 3D Vision / Panoramic Perception
Keywords: 360-degree Perception, Spherical Representation, Transformer, Depth Estimation, Semantic Segmentation

TL;DR

SphereUFormer proposes a U-shaped Transformer architecture that operates directly in the spherical domain (icosphere mesh). By incorporating a spherical local self-attention mechanism and sphere-specific up/downsampling operations, it avoids the distortions introduced by Equirectangular Projection (ERP), comprehensively outperforming existing methods on both 360° depth estimation and semantic segmentation tasks.

Background & Motivation

Background: Panoramic 360° perception (e.g., depth estimation, semantic segmentation) is a fundamental task for understanding spherical environments. Mainstream approaches project 360° images onto a 2D plane for processing, where common projections include Equirectangular Projection (ERP), cubemap, and patch cropping. On the 2D plane, CNNs or ViTs can then be directly applied.

Limitations of Prior Work: (1) ERP projection introduces severe distortion, particularly with over-sampled sampling densities in polar regions; (2) cubemaps suffer from inter-face discontinuities, requiring complex padding and post-processing fusion; (3) patch cropping restricts the receptive field, potentially cutting off crucial information and requiring high overlap. Previously, a few methods directly operating on the sphere (such as spherical graph convolutions, HealSWIN) failed to compete with 2D projection-based methods due to complex convolution kernel designs.

Key Challenge: The trade-off between maintaining distortion-free spherical representations and constructing efficient architectures. While 2D projections are computationally convenient but introduce distortions, spherical representations preserve fidelity but lack compatible, highly efficient computational architectures.

Goal: Design a Transformer architecture operating directly in the spherical domain that avoids projection distortions while competing with (or even outperforming) 2D projection-based SOTA methods.

Key Insight: Leverage the excellent geometric properties of the icosphere—high symmetry, uniform sampling, and natural hierarchical subdivision structure—to design sphere-specific attention mechanisms and up/downsampling operations.

Core Idea: Adapt the UFormer architecture to the icosphere representation by replacing 2D window attention with spherical local self-attention and using icosphere hierarchical subdivisions for up/downsampling, outperforming all projection-based methods with a pure spherical architecture for the first time.

Method

Overall Architecture

The input consists of RGB values of 360° images on a high-resolution icosphere. After encoding into latent vectors via linear projection, they enter a U-shaped encoder-decoder structure. The encoder contains multiple Spherical Attention Modules (SAMs) and spherical downsampling layers to progressively reduce spherical resolution; a bottleneck SAM lies at the bottom; the decoder comprises SAM blocks, upsampling layers, and skip connections to progressively recover resolution. Finally, a linear output projection maps the features to the target number of channels (depth values or semantic categories).

Key Designs

  1. Spherical Local Self-Attention:

    • Function: Process local attention computation on the sphere, replacing window attention in 2D.
    • Mechanism: For each node \(x_i\) on the icosphere, its K-nearest neighbors (with the order controlled by the window coefficient \(C_{win}\)) are collected based on the spherical graph structure to compute query-key-value attention. Since the icosphere graph is fixed, the neighbor index mapping only needs to be pre-calculated once. To enhance expressiveness, a head dimension coefficient \(C_{head}\) is introduced to apply a reverse bottleneck expansion to the attention head dimension (\(D_H = (D/H) \cdot C_{head}\)), increasing the capacity of each head with negligible increases to total parameter scale.
    • Design Motivation: Since regular grid windows do not exist on a sphere, locality must be defined based on the graph structure. As self-attention is the sole spatial operation in the model (due to the absence of convolutional layers), \(C_{head}\) is required to guarantee sufficient expressiveness for each head.
  2. Spherical Relative Position Encoding:

    • Function: Encode relative spatial relationships between nodes within the attention mechanism.
    • Mechanism: For each query-key node pair, the angular differences \((\Delta\phi, \Delta\theta)\) are measured and normalized to \([-1,1]\). During inference, spatial positional biases are sampled from a \(7\times7\) learnable grid via bilinear interpolation and added to the attention weights. For global positions, absolute sinusoidal positional embedding is applied only to the vertical direction \(\phi\), while no absolute embedding is applied to the horizontal direction \(\theta\) to maintain horizontal rotational equivariance.
    • Design Motivation: 360° scenes are always vertically aligned (fixed gravity/sky axis), while the horizontal orientation can be arbitrary. Thus, the vertical direction requires absolute position awareness, whereas the horizontal direction only needs relative position encoding. The shared \(7\times7\) grid also avoids memory explosion that would arise from learning independent parameters for every node pair.
  3. Icosphere Up/Downsampling:

    • Function: Convert representations between different spherical resolution levels.
    • Mechanism: Leverage the hierarchical subdivision structure of the icosphere—where each level subdivides each triangular face into 4 sub-faces. Downsampling employs center pooling (faces mode) or center/average pooling (vertices mode); upsampling utilizes nearest-neighbor interpolation (faces mode) or simple edge midpoint interpolation (vertices mode, where each new node aligns precisely with the center of an existing edge).
    • Design Motivation: The subdivision structure of the icosphere naturally provides a 2× up/downsampling ratio, with the number of nodes at each level increasing by a factor of \(4\times\), eliminating the need to design complex pooling or interpolation algorithms.

Loss & Training

Depth estimation employs BerhuLoss, while semantic segmentation uses standard Categorical Cross Entropy (ignoring the background class). During evaluation, predictions from all methods are projected onto a sphere for uniform evaluation, avoiding the bias from over-weighting polar regions in ERP-based evaluation. All methods are evaluated without using pre-trained weights to ensure a fair comparison.

Key Experimental Results

Main Results

Depth Estimation + Semantic Segmentation (256×512 Resolution Level)

Model Params Flops S2D3D MAE↓ S2D3D δ₁↑ Struct3D MAE↓ S2D3D mIoU↑
PanoFormer 14.5M 11.8G .174 92.5 .154 60.6
EGFormer 15.2M 15.6G .170 93.1 .150 66.4
SFSS 15.1M 18.9G .179 92.2 .155 68.2
Elite360D 14.7M 13.6G .169 93.5 .147 71.4
SphereUFormer 14.9M 13.1G .165 94.0 .142 72.2

Ablation Study

Configuration Rank \(C_{head}\) \(C_{win}\) Res. Params Flops
Base 7-hex 1 1 164K 11.2M 9.9G
+ Head Coeff. 7-hex 2 1 164K 14.9M 13.0G
+ Window Coeff. (Final) 7-hex 2 2 164K 14.9M 13.1G

Increasing \(C_{head}\) from 1 to 2 yields significant performance improvements (adding parameters only to the attention head dimension), while increasing \(C_{win}\) barely increases parameters but expands the receptive field of each node.

Key Findings

  • Spherical methods outperform ERP methods comprehensively for the first time: On all metrics of depth estimation and semantic segmentation, SphereUFormer outperforms SOTA methods such as PanoFormer and EGFormer, ending the paradigm that "spherical methods are inferior to projection-based methods."
  • Most significant improvements occur in image centers and polar regions: The spherical representation provides better effective resolution with zero distortion in these areas.
  • ERP methods exhibit boundary misalignment at the 360°/0° boundary, whereas SphereUFormer suffers from no such issues due to spherical continuity.
  • The gap widens at higher resolutions (512×1024 corresponding to rank 8), indicating that the advantages of spherical methods become more pronounced with increasing resolution.

Highlights & Insights

  • Adopting the icosphere as the representation is key: its high symmetry, uniform distribution, and natural hierarchical structure make up/downsampling as well as neighborhood definitions both intuitive and highly efficient. All mappings only need to be pre-calculated once, incurring zero run-time over-head.
  • A pure attention architecture paradoxically becomes an advantage in the spherical domain—while standard convolutions are difficult to apply directly due to the irregularity of the spherical graph, attention mechanisms are naturally compatible with arbitrary graph structures.
  • Improved evaluation fairness: Projecting all predictions uniformly onto the sphere for evaluation avoids polar bias, which itself serves as a contribution to the field.

Limitations & Future Work

  • Currently evaluated only on depth estimation and semantic segmentation; tasks like panoramic layout estimation and 3D detection remain to be explored.
  • No pre-trained weights were used (for fair comparison); spherical-domain pre-training schemes could potentially improve performance further.
  • Current experiments are restricted to two indoor datasets; generalization to outdoor panoramic scenes is yet to be validated.
  • Computational efficiency comparisons with patch-based methods are not fully comprehensive.
  • vs PanoFormer/EGFormer: Specially designed attention mechanisms are crafted on ERP to migrate distortion, which essentially "patches up" distorted data; SphereUFormer eliminates distortion fundamentally from the root.
  • vs HealSWIN: Also a spherical method but based on HEALPix + Swin; although it uses fewer parameters, its FLOPs are three times higher (39G vs 13G) and its performance is inferior to ours.
  • vs Elite360D: A hybrid scheme fusing ERP and low-resolution icosphere; the purely spherical SphereUFormer is simpler and stronger.

Rating

  • Novelty: ⭐⭐⭐⭐ The spherical Transformer architecture is completely designed, with each module tailored specifically to the sphere.
  • Experimental Thoroughness: ⭐⭐⭐⭐ Evaluated on dual datasets and dual tasks with detailed ablations, though lacking outdoor and more diverse task validations.
  • Writing Quality: ⭐⭐⭐⭐⭐ Comprehensive and in-depth discussion on spherical representation, with clearly motivated design decisions.
  • Value: ⭐⭐⭐⭐ Proves for the first time that pure spherical architectures can outperform projection-based methods, paving a new path for panoramic perception.