End-to-End Training of Hybrid CNN-CRF Models for Stereo

Patrick Knöbelreiter, Christian Reinbacher, Alexander Shekhovtsov, Thomas Pock

Abstract

Stereo depth estimation is a fundamental task in computer vision, often hampered by noise and untextured regions. This paper proposes a principled hybrid architecture that integrates the local feature-learning capabilities of Convolutional Neural Networks (CNNs) with the global spatial reasoning of Conditional Random Fields (CRFs). By employing a Structured Support Vector Machine (SSVM) framework, the model is trained end-to-end, allowing for the simultaneous optimization of matching costs and geometric priors. Our results on KITTI and Middlebury benchmarks demonstrate that this approach achieves competitive accuracy with significantly fewer parameters and no reliance on traditional post-processing.

Introduction

Stereo matching—the process of calculating depth from a pair of images—remains a challenging "ill-posed" problem. Traditional approaches have relied on CRFs for global optimization, often using hand-tuned parameters and engineered matching costs. Conversely, modern deep learning methods utilize CNNs to learn complex local features but frequently produce noisy raw outputs that require extensive "black-box" post-processing, such as median filtering or bilateral smoothing.

This work bridges the gap between these two paradigms by creating a unified model where the CNN learns the specific features required by the CRF to produce an accurate, globally consistent depth map.

Methodology

The proposed hybrid architecture consists of three primary components designed for joint optimization:

The hybrid CNN-CRF architecture, illustrating the flow from input images through Unary and Pairwise CNNs to the final CRF inference.
  1. Unary-CNN: This network extracts features from both left and right images. A Correlation Layer then generates a "cost volume," representing the likelihood of various disparities for each pixel.
  2. Pairwise-CNN: Instead of using static mathematical formulas for depth discontinuities, this component learns to predict edge weights directly from the image. It identifies object boundaries where depth transitions are expected.
  3. CRF Inference (Dual-MM): To maintain training efficiency, the model utilizes a parallelized "dual block descent" algorithm, enabling fast approximation of the global solution on a GPU.

The system is trained using a Structured Support Vector Machine (SSVM) objective. By employing loss-augmented inference, the authors can backpropagate errors from the final disparity map through the CRF and back to the initial convolutional layers.

Experimental Evaluation

The model was evaluated on the KITTI 2015 and Middlebury V3 benchmarks. A key finding is the efficiency of the hybrid approach: a shallow 7-layer model achieved a bad3 error of 4.04% on the KITTI design set, a dramatic improvement over the 13.08% error of the raw CNN output.

Qualitative results comparing raw CNN output, the addition of a CRF, and the full joint model with Pairwise CNN.

Furthermore, the model is highly efficient, containing only 281,000 parameters—significantly fewer than the 700k–800k+ parameters found in many deep-only architectures. The 3-layer variant achieves near-real-time performance, running at 3–4 frames per second for standard resolutions.

Discussion and Conclusion

Jointly training the CNN and CRF leads to superior generalization. When the CNN is aware of the subsequent CRF smoothing, it learns to produce more effective matching costs. Unlike purely deep networks, this model is interpretable; the Pairwise-CNN outputs clearly indicate learned object boundaries.

While the model currently struggles with occlusions and discrete "staircase" artifacts on slanted surfaces, it represents a significant step toward principled, end-to-end stereo systems. Future work may involve continuous label spaces or explicit occlusion modeling to further refine performance.

Summary updated

BibTeX
@inproceedings{knobelreiter2017end,
  author = {Patrick Knöbelreiter and Christian Reinbacher and Alexander Shekhovtsov and Thomas Pock},
  title = {{End-to-End Training of Hybrid CNN-CRF Models for Stereo}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2017},
  url = {https://openreview.net/forum?id=r1Wqqab_bB},
}
Figure