HEAL-SWIN: A Vision Transformer on the Sphere

Oscar Carlsson, Jan E. Gerken, Hampus Linander, Heiner Spieß, Fredrik Ohlsson, Christoffer Petersson, Daniel Persson

Introduction

In the rapidly evolving fields of autonomous driving and robotics, wide-angle fisheye cameras have become indispensable. Their expansive field of view is critical for environmental awareness and safety. However, standard computer vision architectures, including Convolutional Neural Networks (CNNs) and Vision Transformers (ViTs), are fundamentally designed for flat, rectangular grids. To utilize these models, high-resolution fisheye imagery must typically be projected onto a 2D plane. This projection process introduces significant spatial distortion—stretching pixels at the periphery and compressing them at the center—which degrades the model's ability to learn accurate spatial representations.

While specialized spherical neural networks have been proposed, they often face scalability issues. Many rely on complex Fourier transforms that struggle with high-resolution data, or utilize grids that are non-uniformly dense, wasting computation at the poles. Furthermore, many practical applications use lenses that only cover a hemisphere; traditional spherical models often waste resources processing the 'empty' half of the sphere. HEAL-SWIN addresses these challenges by providing a high-resolution, distortion-free, and computationally efficient framework that treats images as native spherical signals.

The HEAL-SWIN Architecture

HEAL-SWIN achieves its performance by synergizing two key technologies: the HEALPix grid and the Swin Transformer.

  1. HEALPix Grid: Originally developed for astrophysics to map the Cosmic Microwave Background, the Hierarchical Equal Area iso-Latitude Pixelation (HEALPix) grid divides a sphere into pixels of exactly equal area. Its 'nested' structure is particularly powerful: each base quadrilateral can be subdivided into four smaller ones recursively, creating a natural hierarchy.
  2. Swin Transformer: This architecture processes images through local 'windows' of attention, shifting these windows between layers to facilitate global information flow while maintaining linear computational complexity relative to image size.

The core innovation of HEAL-SWIN is the native mapping of the Swin Transformer’s patching and windowing operations onto the HEALPix hierarchy. Because HEALPix is inherently hierarchical, the 'patch merging' and 'windowed attention' steps of the Swin Transformer occur directly on the sphere without the need for distortive flattening.

Comparison of hierarchical windowed attention between HEAL-SWIN and standard Swin Transformer.

To ensure cross-window communication, the researchers introduced two spherical window-shifting strategies: Grid Shifting, which moves windows along the axes of the HEALPix base quadrilaterals, and Spiral Shifting, which reorders pixels into a pole-to-pole ring and 'rolls' the sequence to create overlapping regions.

Datasets and Evaluation

The model was rigorously evaluated across several challenging benchmarks:

  • SynWoodScape & WoodScape: Synthetic and real-world automotive datasets featuring fisheye street scenes, essential for testing autonomous driving capabilities.
  • Stanford 2D-3D-S: A dataset of indoor omnidirectional (360°) RGB-D images used to test performance in complex indoor environments.
  • Spherical MNIST: A standard benchmark for validating spherical classification performance.

Results and Discussion

HEAL-SWIN demonstrates state-of-the-art performance across multiple vision tasks. In semantic segmentation on the SynWoodScape dataset, HEAL-SWIN achieved a Mean Intersection over Union (mIoU) of 0.947, significantly outperforming the standard flat Swin Transformer's 0.918. On the Stanford 2D-3D-S benchmark, it reached 44.3 mIoU, surpassing other specialized spherical models like HexRUNet and Gauge CNN.

Beyond segmentation, the model's 3D awareness is particularly evident in depth estimation. By treating data as spherical, HEAL-SWIN captures the underlying geometry more effectively than flat models. This is reflected in a substantial reduction in 'Chamfer distance,' a metric measuring 3D reconstruction error.

Quantitative comparison of Chamfer distance and mIoU for HEAL-SWIN (HS) vs. standard Swin (S).

Crucially, HEAL-SWIN is highly efficient. For 180° fisheye lenses, the model can simply ignore the 'unseen' portions of the HEALPix grid (processing only 8 of the 12 base pixels), leading to significant memory and compute savings. Despite the geometric complexity, inference times remain nearly identical to standard flat models at comparable resolutions.

Conclusion and Future Directions

HEAL-SWIN represents a significant step forward in processing spherical data natively and efficiently. By aligning the hierarchical nature of HEALPix with the windowed attention of the Swin Transformer, the authors have created a model that is both accurate and scalable.

Future work will focus on achieving mathematical rotation equivariance, ensuring that internal features rotate perfectly in sync with the input. Additionally, refining the 'relative position bias' to better account for pixel shape variations near the poles and developing specialized spherical decoder heads could further enhance performance in dense prediction tasks like segmentation and depth estimation.

Summary updated

BibTeX
@inproceedings{carlsson2023heal,
  author = {Oscar Carlsson and Jan E. Gerken and Hampus Linander and Heiner Spieß and Fredrik Ohlsson and Christoffer Petersson and Daniel Persson},
  title = {{HEAL-SWIN: A Vision Transformer on the Sphere}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2023},
}
Figure