Estimating Depth from Monocular Images as Classification Using Deep Fully Convolutional Residual Networks

Yuanzhouhan Cao, Zifeng Wu, Chunhua Shen

Introduction

Estimating the 3D structure of a scene from a single 2D image—monocular depth estimation—is a fundamental challenge in computer vision with critical applications in robotics and autonomous systems. Traditionally, this task has been approached as a regression problem, where models attempt to predict a continuous numerical depth value for every pixel. However, regression is inherently difficult for deep networks, as hitting an exact value is challenging and standard regression losses lack a built-in mechanism for uncertainty.

This paper proposes a paradigm shift: treating depth estimation as a classification task. By discretizing the continuous depth range into discrete "bins," the network learns to identify depth ranges rather than exact values. This approach aligns more closely with human perception and provides a probabilistic output that enhances model performance and robustness.

Methodology

The proposed framework is built upon a deep fully convolutional residual network (ResNet) architecture, optimized for dense prediction.

The overall pipeline of the proposed method, showing the transition from continuous ground truth (GT) depth to discrete bins and the network architecture.

The methodology consists of four key components:

  1. Log-Space Depth Discretization: Continuous depth values are divided into discrete bins. Crucially, this discretization occurs in log space, resulting in finer resolution for nearby objects and coarser resolution for distant ones. This reflects the physical reality that depth uncertainty typically increases with distance.
  2. Fully Convolutional Residual Networks: The model utilizes powerful backbones like ResNet-101 or ResNet-152. By removing fully connected layers, the network becomes "fully convolutional," allowing it to process arbitrary image sizes and produce a dense score map representing the probability distribution across depth bins for each pixel.
  3. Information Gain Loss: Unlike standard cross-entropy loss, which treats all misclassifications equally, the authors introduce an information gain matrix. This loss function penalizes predictions less if they are in bins adjacent to the true depth, encouraging the network to be "close" even when it is not perfectly accurate.
  4. CRF Post-processing: The probabilistic output of the classification layer allows for refinement using a Fully Connected Conditional Random Field (CRF). This step ensures spatial consistency, aligning depth boundaries with image features like color and texture.

Experimental Results and Discussion

The model was rigorously evaluated on the NYUD2 (indoor) and KITTI (outdoor) datasets, as well as the SUN RGB-D dataset for cross-dataset generalization.

Error metrics (Relative, Log10, and RMS) plotted against the number of depth bins, demonstrating how increasing discretization resolution impacts performance.

The results demonstrated that the classification approach significantly outperforms traditional regression models. On the NYUD2 dataset, the model achieved a state-of-the-art relative error of 0.141. A key finding, illustrated in the error analysis, is that increasing the number of bins generally leads to lower errors across various metrics, validating the effectiveness of the discretization strategy. Furthermore, the model showed strong generalization capabilities; when trained on indoor data (NYUD2) and tested on a different indoor dataset (SUN RGB-D), it maintained high accuracy, suggesting it learns robust geometric features.

Conclusion

By rethinking monocular depth estimation as a classification problem, this work demonstrates that deep networks can achieve superior accuracy and better generalization compared to standard regression approaches. The use of log-space discretization and information-aware loss functions leverages the strengths of deep residual networks for dense spatial tasks. Future work may focus on improving output resolution beyond the current 1/8 downsampling and exploring more sophisticated upsampling techniques to preserve fine-grained scene details.

Summary updated

BibTeX
@article{cao2018estimating,
  author = {Yuanzhouhan Cao and Zifeng Wu and Chunhua Shen},
  title = {{Estimating Depth from Monocular Images as Classification Using Deep Fully Convolutional Residual Networks}},
  journal = {IEEE Trans. Circuits Syst. Video Technol.},
  year = {2018},
  doi = {10.1109/tcsvt.2017.2740321},
}
Figure