Playing to Vision Foundation Model's Strengths in Stereo Matching

Chuang-Wei Liu, Qijun Chen, Rui Fan

TL;DR

This paper introduces ViTAS, a novel adapter designed to bridge the gap between high-level Vision Foundation Models (VFMs) and the precise geometric requirements of stereo matching. By combining the general-purpose feature power of DINOv2 with a specialized pyramid-based adapter and cost-volume processing, the authors' ViTAStereo architecture achieves state-of-the-art results on the KITTI benchmarks and demonstrates superior generalizability across diverse real-world datasets.

What Problem Does This Paper Address?

For years, Convolutional Neural Networks (CNNs) like ResNet have been the workhorses for feature extraction in stereo matching. Recently, the field has seen the rise of Vision Foundation Models (VFMs)—large Vision Transformers (ViTs) pre-trained on massive datasets. While VFMs are incredible at "understanding" a scene (semantic segmentation, object detection), they often struggle with "measuring" a scene (geometric tasks like stereo matching).

The core challenge is a domain gap: VFM features are optimized for pixel-level classification or regression, but stereo matching requires features that are highly distinctive for similarity measurement during cost volume construction. Furthermore, some recent "cost-volume-free" approaches using Transformers suffer from scale ambiguity, failing to generalize when they encounter objects at distances or scales not seen during training.

Methods

The authors propose ViTAS (ViT Adapter for Stereo), a modular adapter that transforms single-resolution VFM tokens into a multi-scale feature pyramid suitable for stereo matching. It consists of three key components:

  1. Spatial Differentiation Module (SDM): This module uses convolutions and transposed convolutions to re-scale ViT tokens into a four-level feature pyramid (from 1/4 to 1/32 of the original resolution).
  2. Patch Attention Fusion Module (PAFM): A lightweight module that aggregates multi-scale information. Instead of expensive global attention, it uses a "local patch attention" (measuring similarity in a pixel-to-patch manner) and "quasi-global attention" (a squeeze-and-excitation style approach). This reduces computational complexity from $O(N^2)$ to $O(N)$.
  3. Cross-Attention Module (CAM): This module facilitates interactions between the left and right image features to enhance distinctiveness, especially in challenging texture-less or occluded regions.
Fig. 1. An illustration of our proposed ViTAS, consisting of an SDM, four CAMs, and three PAFMs for each sub-network.

The full system, ViTAStereo, plugs these adapted features into a standard cost-volume-based back-end (specifically, the one from IGEV-Stereo).

Datasets

The models were trained and evaluated using a mix of synthetic and real-world data:

  • Pre-training: SceneFlow (synthetic) and Virtual KITTI.
  • Fine-tuning & Evaluation: KITTI Stereo 2012 & 2015 (autonomous driving), Middlebury (high-res indoor), and ETH3D (indoor/outdoor grayscale).

Key Insights and Ideas

  • Cost Volumes are Indispensable: The authors argue that abandoning cost volumes (as seen in some recent Transformer-only models) is a mistake. Their experiments show that cost volumes provide the necessary "interpretability" and geometric constraints to prevent scale ambiguity on unseen data.
  • Efficiency through Locality: By designing the PAFM to use local patch attention rather than global attention, the authors achieved higher accuracy with significantly fewer learnable parameters (0.22M vs. 1.3M+ in competing fusion methods).
  • Unfreezing the VFM: The "aha moment" in their ablation study was finding the sweet spot for fine-tuning. Unfreezing just the last five blocks of the VFM provided the best trade-off between accuracy and model complexity.
Fig. 3. Ablation studies on (a) the optimal configuration for CAM attention blocks and (b) the most suitable number of unfrozen VFM blocks.

Key Results

ViTAStereo sets a new bar for performance:

  • KITTI 2012: Achieved the #1 rank on the leaderboard, outperforming the previous best (StereoBase) by ~7.9% in terms of error pixels (3-pixel tolerance).
  • KITTI 2015: Achieved the 2nd best performance overall.
  • Generalizability: When the ViTAS adapter was added to other existing SOTA networks (like GMStereo or CREStereo), it consistently improved their performance on new, unseen datasets like Middlebury and ETH3D.
Fig. 4. Qualitative experimental results on the KITTI Stereo datasets [23], [44], where significantly improved regions are shown with pink dashed boxes.

Limitations and Future Work

While ViTAS is highly effective, the authors acknowledge that the Cross-Attention Module (CAM) still demands significant computational and memory resources. Future research will focus on developing even more efficient strategies for aggregating stereo contextual information. Additionally, while DINOv2 was used as the backbone here, the modular nature of ViTAS means it could potentially be adapted to even newer foundation models as they emerge.

Summary updated

BibTeX
@misc{liu2024playing,
  author = {Chuang-Wei Liu and Qijun Chen and Rui Fan},
  title = {{Playing to Vision Foundation Model's Strengths in Stereo Matching}},
  year = {2024},
  eprint = {2404.06261},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2404.06261},
}
Figure