Hierarchical Object-Aware Dual-Level Contrastive Learning for Domain Generalized Stereo Matching

Yikun Miao, Meiqing Wu, Siew Kei Lam, Changsheng Li, Thambipillai SrikanthanNeurIPS 2024

TL;DR

The HODC framework is a "plug-and-play" training strategy that significantly boosts the ability of stereo matching models to generalize from synthetic training data to real-world environments. By forcing neural networks to learn hierarchical, object-aware features through dual-level contrastive loss, it achieves state-of-the-art performance across major benchmarks without requiring any changes to the underlying model architecture.

The Generalization Gap in Stereo Matching

Stereo matching—the process of finding pixel-wise correspondences between a left and right image to calculate depth—is a cornerstone of autonomous driving and robotics. While deep learning models have become incredibly accurate, they suffer from a significant "generalization gap."

Because real-world depth data is hard to collect, models are often trained on massive synthetic datasets like SceneFlow. However, when these models are tested on real roads, they frequently fail. Current networks tend to rely on superficial cues like specific textures, colors, or lighting found in the synthetic data. When the environment changes, the model gets lost. To fix this, we need models that understand the semantic and structural nature of the world—recognizing that a "car" or a "signpost" should have consistent matching properties regardless of its texture.

The HODC Framework

To address this, the authors introduce Hierarchical Object-Aware Dual-Level Contrastive learning (HODC). Instead of just teaching the model to match individual pixels, HODC teaches it to match regions based on object identity at multiple scales.

HODC Framework Architecture
  1. Hierarchical Segmentation: Using object index maps (available in synthetic data), the framework segments images into regions at different scales (e.g., $4\times4$, $8\times8$, and $16\times16$ grids). A region is defined as pixels that belong to the same object within the same grid cell.
  2. Dual-Level Contrastive Loss:
    • Intra-Scale: The model is trained to pull the representation of a region in the left image toward its corresponding warped region in the right image, while pushing it away from other non-matching regions of the same size.
  3. Inter-Scale: This encourages "global awareness." It pulls a small local region's representation toward the representation of the larger object-aware region it belongs to.
  4. Hard Negative Selection: The framework specifically identifies "hard negatives"—regions that look similar to the target but are actually different—and forces the model to distinguish between them, reducing ambiguity in textureless or repetitive areas.

Crucially, this is a training-only framework. Once the model is trained with these losses, the contrastive modules are discarded, leaving a standard stereo matching network that is simply better at extracting robust features.

Key Insights

  • Objects over Pixels: The core insight is that semantic consistency is a powerful prior. Disparity should be similar within a local region of the same object. By supervising the model at the object/region level, it learns to ignore distractor textures.
  • The Power of Hard Negatives: Simply enforcing consistency between left and right views isn't enough. Actively pushing away the "top 10% most similar" incorrect matches is what truly gives the model discriminative power.
  • Scale Matters: By using a hierarchy (inter-scale matching), the model learns to relate local details to global structures, which is essential for handling large objects or complex boundaries.

Datasets and Key Results

The models were trained on SceneFlow (a large-scale synthetic dataset) and evaluated directly on four realistic datasets without any fine-tuning: KITTI 2012 & 2015, Middlebury, ETH3D, and DrivingStereo. The HODC framework was integrated into four popular architectures: PSMNet, GwcNet, CFNet, and IGEV.

Qualitative comparison of disparity maps
  • Massive Error Reduction: On the KITTI 2015 benchmark, HODC reduced the D1 error (percentage of outliers) for the baseline PSMNet from 16.3% down to 4.7%.
  • State-of-the-Art: HODC-IGEV achieved a D1 error of 4.5% on KITTI 2015 and 2.7% on ETH3D, outperforming existing domain generalization methods by significant margins.
  • Weather Robustness: In the DrivingStereo tests, HODC-PSMNet maintained an average error of 4.6% across all weather conditions, while the baseline PSMNet skyrocketed to 62.9% error, proving that the learned features are truly robust to environmental shifts.

Limitations and Future Work

  • Dependency on Object Maps: The training process requires object index maps. While these are standard in synthetic data, applying this framework to real-world datasets for self-supervised learning would require highly accurate pre-trained segmentation models.
  • Architecture Agnosticism: While HODC works with existing architectures, the authors note that the next step is designing new network architectures specifically optimized to exploit these semantically and structurally driven features from the ground up.
  • Computational Overhead: During training, calculating the contrastive loss adds memory and time overhead (roughly 1.5x to 2x per iteration depending on the number of groups used), though this does not affect inference speed.

Summary updated

BibTeX
@inproceedings{miao2024hierarchical,
  author = {Yikun Miao and Meiqing Wu and Siew Kei Lam and Changsheng Li and Thambipillai Srikanthan},
  title = {{Hierarchical Object-Aware Dual-Level Contrastive Learning for Domain Generalized Stereo Matching}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=HcqV2bPFKz},
}
Figure