Structure-Guided Ranking Loss for Single Image Depth Prediction

Ke Xian, Jianming Zhang, Oliver Wang, Long Mai, Zhe Lin, Zhiguo Cao

Introduction

Monocular depth estimation—the task of predicting 3D depth from a single 2D image—is a cornerstone of computer vision with applications ranging from autonomous driving to augmented reality. This CVPR 2020 paper from researchers at Huazhong University of Science and Technology and Adobe Research introduces a novel loss function and dataset that significantly advance the state-of-the-art in this field.

The Challenge: Ill-Posedness and Blurry Boundaries

Predicting depth from a single image is inherently "ill-posed," as multiple 3D configurations can produce the same 2D projection. While training on "web stereo" data (e.g., 3D movies) provides a wealth of information, this data often only provides "pseudo-depth" accurate up to an unknown affine transformation (scale and shift).

Existing methods typically use ranking losses, which penalize incorrect relative depth orders between randomly sampled point pairs. However, random sampling is inefficient. It often misses critical structural information at object boundaries, leading to "blurry" depth maps or artifacts where objects appear disconnected from their context.

Methods: Structure-Guided Ranking Loss

The authors propose the Structure-Guided Ranking Loss, which shifts the focus from random sampling to targeted, structure-aware sampling. This approach employs two primary strategies:

  1. Edge-Guided Sampling: Using a Sobel operator to identify intensity edges, the model employs a 4-point scheme. By sampling two points on each side of an edge, the loss function simultaneously enforces sharp transitions across the boundary and local smoothness within each side, effectively eliminating "halo" artifacts.
  2. Instance-Guided Sampling: To maintain consistency across large objects, the researchers leverage Mask R-CNN to generate object masks. Sampling pairs inside and outside these masks forces the model to respect semantic boundaries, ensuring that complex objects like humans are represented as coherent 3D structures.

The final model combines this ranking loss with a multi-scale gradient matching loss for global consistency, utilizing a standard ResNet-50 backbone to demonstrate that the primary gains come from the loss formulation and data quality.

HR-WSI: A New High-Resolution Dataset

A key contribution of this work is the HR-WSI (High-Resolution Web Stereo Image) dataset. Containing over 21,000 high-resolution images ($833 \times 1251$) with disparity maps, it is significantly larger and higher quality than previous datasets like ReDWeb. This dataset provides the necessary detail for the model to learn fine-grained structural features.

Key Results and Generalization

The proposed method demonstrates exceptional "zero-shot" generalization across diverse unseen benchmarks, including Ibims, TUM, Sintel, NYUDv2, KITTI, and DIODE.

Qualitative comparison of depth prediction methods. "Our Loss" shows significantly sharper boundaries and better structural consistency compared to previous state-of-the-art methods like Y3D, MC, and Affine-Invariant Loss.

Quantitatively, the model achieved the lowest average ranking error (1.17) compared to MiDaS (2.50) and Y3D (5.33). Qualitatively, as seen in the comparison above, the depth maps produced are noticeably cleaner around complex geometries like chair legs and human limbs. Ablation studies confirmed that both edge-guided and instance-guided sampling are crucial to these improvements.

Conclusion and Future Work

By intelligently guiding the training process through structural cues, the Structure-Guided Ranking Loss addresses the long-standing issue of blurry boundaries in monocular depth estimation. While the method currently depends on the quality of external segmentation models (Mask R-CNN), it opens new avenues for task-specific depth estimation, such as high-precision detail for synthetic bokeh or ground-plane estimation for robotics.

Summary updated

BibTeX
@inproceedings{xian2020structure,
  author = {Ke Xian and Jianming Zhang and Oliver Wang and Long Mai and Zhe Lin and Zhiguo Cao},
  title = {{Structure-Guided Ranking Loss for Single Image Depth Prediction}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2020},
  doi = {10.1109/cvpr42600.2020.00069},
}
Figure