Revisiting Stereo Depth Estimation From a Sequence-to-Sequence Perspective with Transformers

Zhaoshuo Li, Xingtong Liu, Nathan Drenkow, Andy S. Ding, Francis X. Creighton, Russell H. Taylor, Mathias Unberath

Abstract

Stereo depth estimation relies on optimal correspondence matching between pixels on epipolar lines in the left and right images to infer depth. In this work, we revisit the problem from a sequence-to-sequence correspondence perspective to replace cost volume construction with dense pixel matching using position information and attention. This approach, named STereo TRansformer (STTR), has several advantages: It 1) relaxes the limitation of a fixed disparity range, 2) identifies occluded regions and provides confidence estimates, and 3) imposes uniqueness constraints during the matching process. We report promising results on both synthetic and real-world datasets and demonstrate that STTR generalizes across different domains, even without fine-tuning.

Introduction

Most modern deep-learning models for stereo depth rely on cost volumes. To find the depth of a pixel, these models search a pre-defined range of horizontal shifts (disparities) between the left and right images. However, this traditional approach suffers from three major flaws: a fixed disparity range limited by memory, the "smearing" of occluded regions where no valid match exists, and a lack of physical uniqueness constraints in the matching process.

STereo TRansformer (STTR) rethinks this problem by ditching the cost volume in favor of a sequence-to-sequence matching perspective. By leveraging Transformers and Optimal Transport, STTR handles unlimited disparity ranges, explicitly identifies occlusions, and enforces matching uniqueness.

Methodology

STTR treats stereo matching as a sequence-to-sequence problem along epipolar lines. The architecture consists of several key components designed to mimic the geometric and biological aspects of vision.

The STTR architecture: Stereo inputs are processed through a feature extractor, followed by a Transformer with alternating attention, an Optimal Transport layer for uniqueness, and a Context Adjustment Layer for final refinement.

Alternating Attention and Positional Encoding

Instead of 3D convolutions, STTR uses a Transformer that alternates between self-attention (contextualizing pixels within the same image) and cross-attention (matching pixels across the left and right images). To assist in matching textureless areas, the model employs relative positional encoding, helping the Transformer understand the spatial distance between pixels.

Optimal Transport and Occlusion Detection

To enforce the physical "one-to-one" matching constraint, STTR utilizes the Sinkhorn algorithm for Optimal Transport. The inclusion of "dustbins" allows the model to mathematically assign pixels that have no valid match in the corresponding view, enabling explicit and highly accurate occlusion detection.

Context Adjustment Layer (CAL)

While the Transformer operates on 1D epipolar lines, the CAL uses 2D convolutions to ensure that the resulting depth map is spatially consistent across the entire image, effectively refining the raw disparity output.

Experimental Results and Generalization

The model was evaluated on diverse benchmarks including Scene Flow, MPI Sintel, KITTI 2015, Middlebury 2014, and the SCARED medical dataset.

Qualitative results on Middlebury 2014 and SCARED datasets. STTR demonstrates strong zero-shot generalization to indoor and medical domains without fine-tuning.

Key Insights

  • Unlimited Disparity: STTR maintains a constant memory footprint regardless of disparity range. A model trained on 192px disparities successfully predicted up to 458px during inference, outperforming traditional methods that fail beyond their hard-coded limits.
  • Zero-Shot Generalization: By learning the underlying geometry of matching rather than scene-specific textures, STTR performs exceptionally well on new datasets (like endoscopic surgery images) without any fine-tuning.
  • Occlusion Accuracy: STTR achieves an IOU of 0.92 to 0.98 for occlusion estimation, a task many competing models do not explicitly address.

Conclusion

STTR demonstrates that revisiting stereo matching as a sequence-to-sequence problem offers significant advantages over traditional cost-volume methods. While the $O(N^2)$ complexity of self-attention remains a computational challenge for high-resolution images, the model's ability to handle unconstrained disparities and generalize across domains marks a significant step forward in robust depth estimation.

Summary updated

BibTeX
@misc{li2020revisiting,
  author = {Zhaoshuo Li and Xingtong Liu and Nathan Drenkow and Andy S. Ding and Francis X. Creighton and Russell H. Taylor and Mathias Unberath},
  title = {{Revisiting Stereo Depth Estimation From a Sequence-to-Sequence Perspective with Transformers}},
  year = {2020},
  eprint = {2011.02910},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2011.02910},
}
Figure