HEAL-SWIN: A Vision Transformer On The Sphere

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

Fisheye cameras are the unsung heroes of autonomous driving, providing the wide-angle "surround view" necessary for safety. However, their extreme distortion is a nightmare for standard computer vision models. In their paper, HEAL-SWIN: A Vision Transformer On The Sphere, researchers from Chalmers University and other institutions propose a elegant solution: stop trying to flatten the world and start learning directly on the sphere.

TL;DR

HEAL-SWIN is a novel vision transformer that operates directly on spherical data by combining the uniform HEALPix grid with the hierarchical windowed attention of the SWIN transformer. It achieves state-of-the-art performance on distorted fisheye images for tasks like semantic segmentation and depth estimation without the computational overhead typical of spherical models.

What Problem Does This Paper Address?

Standard deep learning architectures like CNNs and Vision Transformers (ViTs) are designed for flat, rectangular grids. When applied to wide-angle fisheye images, these models suffer from "projection loss"—the distortion introduced when you try to map a curved surface onto a flat plane.

While previous "spherical" models exist, they often rely on non-uniform grids (which over-sample the poles) or computationally expensive Fourier transforms that don't scale to the high resolutions needed for robotics. The challenge is to create a model that respects spherical geometry while remaining as efficient and flexible as modern transformers.

Methods

The core innovation of HEAL-SWIN is the marriage of two hierarchical structures:

  1. The HEALPix Grid: Borrowed from astrophysics, the Hierarchical Equal Area iso-Latitude Pixelation (HEALPix) grid divides a sphere into pixels of exactly equal area. Crucially, it has a nested structure where pixels can be grouped into larger "patches" and "windows" perfectly.
  2. The SWIN Transformer: This architecture uses local attention windows that shift between layers to capture global context.

By representing the HEALPix grid as a 1D list in "nested ordering," the authors adapted SWIN’s patching and windowing operations to work natively on the sphere.

Figure 1. Our HEAL-SWIN model uses the nested structure of the HEALPix grid to lift the windowed self-attention of the SWIN model onto the sphere.

The researchers also introduced a Spiral Shifting strategy. Unlike standard SWIN which shifts windows along X and Y axes, HEAL-SWIN can shift windows along the azimuthal angle (around the sphere), which they found to be more effective for spherical data.

Figure 4. Grid (left) and spiral (right) shifting strategies for the HEAL-SWIN transformer, projected onto the plane for visualiza- tion. The grid lines outline the eight base pixels used for this dataset, arrows indicate the directions in which pixels move. High- lighted regions are masked in the attention layers. Note that in grid shifting, pixels at boundaries of colliding base pixels are moved to the outer edge. In ring shifting, distortions are introduced towards the pole (center). For better visibility, the amount of shifting in these images is exaggerated.

Datasets

The model was evaluated across several challenging benchmarks:

  • WoodScape: A real-world automotive dataset featuring 8,234 fisheye images from various global locations.
  • SynWoodScape: A synthetic version of WoodScape generated using the CARLA simulator, providing "pixel-perfect" ground truth for depth and segmentation.
  • Stanford 2D-3D-S: A dataset of indoor RGB-D fisheye images.
  • Spherical MNIST: A standard benchmark for spherical classification.

Key Insights and Ideas

  • Native Geometric Alignment: The hierarchical nature of HEALPix is a "perfect match" for SWIN. This allows the model to process spherical data with almost zero additional computational overhead compared to a standard transformer.
  • Efficiency on Half-Spheres: Most fisheye cameras only cover about half a sphere. HEAL-SWIN can be restricted to just the relevant part of the grid (8 out of 12 base pixels), whereas many other spherical models are forced to process the entire sphere, wasting half their computation.
  • Better 3D Understanding: By evaluating depth estimation via 3D point clouds (using Chamfer distance), the authors proved that HEAL-SWIN learns a more accurate representation of the physical world than models that treat the image as a flat plane.

Key Results

HEAL-SWIN consistently outperformed standard SWIN and other specialized spherical models:

  • Semantic Segmentation: On the synthetic SynWoodScape dataset, HEAL-SWIN achieved a mean Intersection over Union (mIoU) of 0.947, significantly higher than the standard SWIN's 0.918.
  • Depth Estimation: HEAL-SWIN showed a much lower Chamfer distance (better 3D fit) compared to the baseline, indicating it captures the scene's geometry more faithfully.
  • Indoor Scenes: On the Stanford 2D-3D-S benchmark, it reached 44.3 mIoU, surpassing previous state-of-the-art spherical models like HexRUNet (43.3) and UGSCNN (38.8).
Figure 2. Chamfer distance (lower is better) and mIoU (higher is better) for HEAL-SWIN (HS) and SWIN (S). Details are provided in Section 4.3 and in Section 4.1.2.

Qualitatively, the model is better at recognizing objects in highly distorted regions, such as pedestrians at the very edge of a fisheye lens's field of view.

Figure 5. Example of segmentation using SWIN (left) and HEAL- SWIN (right) on the Woodscape dataset of real automotive images. Overlays correspond to predicted segmentation masks. The pedes- trian (overlayed in red) is only recognized by HEAL-SWIN.

Limitations and Future Work

While powerful, HEAL-SWIN is not yet fully rotationally equivariant (meaning if you rotate the camera, the output might change slightly). The authors suggest that incorporating equivariance could provide a further performance boost.

Additionally, the current implementation uses a relatively simple UNet-like decoder. Adapting more modern, state-of-the-art transformer decoder heads to the HEALPix grid is a promising direction for future research. Finally, the "relative position bias" used in the attention mechanism currently doesn't fully account for the changing geometry near the poles, which could be refined in future versions.

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