PanoFormer: Panorama Transformer for Indoor 360° Depth Estimation

Zhijie Shen, Chunyu Lin, Kang Liao, Lang Nie, Zishuo Zheng, Yao Zhao

TL;DR

This paper introduces PanoFormer, a novel Transformer-based architecture designed to overcome the limitations of traditional CNNs in estimating depth from 360° panoramic images. By employing a "tangent patch" strategy and a learnable token flow within its self-attention mechanism, PanoFormer effectively handles panoramic distortions and better captures geometric structures, leading to state-of-the-art performance.

What Problem Does This Paper Address?

Estimating depth from a single image is a challenging, ill-posed problem. While convolutional neural networks (CNNs) have achieved significant success in this area for standard perspective images, they struggle with 360° panoramic images. The equirectangular projection (ERP) commonly used for panoramas introduces severe distortions, especially towards the poles, which deform object shapes and disrupt geometric perception. Existing CNN-based methods often try to mitigate these distortions through complex projection fusion or distortion-aware convolutions, but they are limited by their fixed receptive fields, which hinder their ability to effectively perceive the distorted geometric structures inherent in panoramas. This paper aims to bridge this gap by developing a model specifically designed to handle panoramic distortions and leverage the unique geometric properties of spherical images for accurate depth estimation.

Methods

The core innovation of PanoFormer lies in its adaptation of the Transformer architecture for panoramic depth estimation. Key components include:

  • Tangent Patches: Instead of processing the ERP image directly, PanoFormer divides the image into "tangent patches." These patches are derived from a spherical tangent domain, effectively reducing the negative impact of panoramic distortions by focusing on local, less distorted regions. A Spherical Token Locating Model (STLM) is introduced to guide the sampling of these tangent patches.
  • Panorama Self-Attention with Token Flow: The standard self-attention mechanism in Transformers is modified. A "learnable token flow" is incorporated into the self-attention module. This flow allows tokens to adjust their positions dynamically, enabling the model to better perceive and learn complex geometric structures within the panorama, even in distorted regions.
  • Panorama-Specific Metrics: To better evaluate performance on panoramic data, two new metrics are proposed:
  • Pole Root Mean Square Error (P-RMSE): This metric specifically targets the polar regions of the spherical domain, where distortions are most severe, to assess the model's ability to handle these challenging areas.
  • Left-Right Consistency Error (LRCE): This metric measures depth consistency across the left-right boundaries of the panorama, addressing the seamless nature of spherical images.

The overall architecture follows a hierarchical encoder-decoder structure, incorporating these novel components.

Datasets

The paper evaluates PanoFormer on four datasets:

  • Stanford2D3D: A real-world dataset.
  • Matterport3D: Another real-world dataset.
  • PanoSUNCG: A virtual panoramic dataset.
  • 3D60: An aggregated dataset comprising data from the other three, designed to test generalizability.

The authors note that previous work often used subsets of these datasets, sometimes ignoring polar regions. Their approach aims to address the full panorama.

Key Insights and Ideas

  • Transformers are well-suited for panoramic tasks: The global attention mechanism of Transformers, when adapted, can inherently handle long-range dependencies in panoramas better than CNNs.
  • Distortion is the primary challenge: The paper strongly emphasizes that panoramic distortions are the main hurdle for existing depth estimation methods, and their proposed tangent patch approach directly tackles this.
  • Geometric structure is key: The learnable token flow is crucial for enabling the model to "see" and utilize the underlying geometric shapes in the scene, which is vital for accurate depth estimation.
  • Standard metrics are insufficient: The introduction of P-RMSE and LRCE highlights the need for specialized evaluation metrics that account for the unique properties of spherical images.

Key Results

PanoFormer significantly outperforms state-of-the-art (SOTA) methods across all tested datasets and metrics.

  • Quantitative Improvements: The paper reports substantial improvements, including a 16% RMSE improvement on Stanford2D3D and 26% on Matterport3D. On the PanoSUNCG dataset, an impressive 42% RMSE improvement is achieved. The new metrics also show strong performance, with P-RMSE gains of about 40% on virtual datasets and LRCE improvements of up to 40% on PanoSUNCG.
  • Qualitative Improvements: Visualizations show that PanoFormer produces more accurate and detailed depth maps, particularly in regions with distortions and near boundaries, where other methods struggle.
  • Extensibility: The proposed PST block is shown to be effective for semantic panorama segmentation, another pixel-wise task, demonstrating the model's versatility.

Limitations and Future Work

  • Dataset Limitations: The authors note that for the new metrics (P-RMSE and LRCE), calculation was limited on the two real-world datasets due to their nature.
  • Future Work: The paper suggests that the PST block can be extended to other learning frameworks. The success in semantic segmentation also points towards broader applications of this architecture in panoramic computer vision tasks.

The code for PanoFormer will be made publicly available.

Summary updated

Abstract

Existing panoramic depth estimation methods based on convolutional neural networks (CNNs) focus on removing panoramic distortions, failing to perceive panoramic structures efficiently due to the fixed receptive field in CNNs. This paper proposes the panorama transformer (named PanoFormer) to estimate the depth in panorama images, with tangent patches from spherical domain, learnable token flows, and panorama specific metrics. In particular, we divide patches on the spherical tangent domain into tokens to reduce the negative effect of panoramic distortions. Since the geometric structures are essential for depth estimation, a self-attention module is redesigned with an additional learnable token flow. In addition, considering the characteristic of the spherical domain, we present two panorama-specific metrics to comprehensively evaluate the panoramic depth estimation models' performance. Extensive experiments demonstrate that our approach significantly outperforms the state-of-the-art (SOTA) methods. Furthermore, the proposed method can be effectively extended to solve semantic panorama segmentation, a similar pixel2pixel task. Code will be available.
BibTeX
@inproceedings{shen2022panoformer,
  author = {Zhijie Shen and Chunyu Lin and Kang Liao and Lang Nie and Zishuo Zheng and Yao Zhao},
  title = {{PanoFormer: Panorama Transformer for Indoor 360° Depth Estimation}},
  booktitle = {European Conference on Computer Vision},
  year = {2022},
  doi = {10.1007/978-3-031-19769-7\_12},
}
Figure