NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

DepthFormer: Exploiting Long-range Correlation and Local Information for Accurate Monocular Depth Estimation

Zhenyu Li, Zehui Chen, Xianming Liu, Junjun Jiang

Abstract

DepthFormer is a novel framework for monocular depth estimation (MDE) that synergizes the global context-modeling capabilities of Transformers with the local precision of Convolutional Neural Networks (CNNs). By employing a parallel encoder and a specialized fusion module termed Hierarchical Aggregation and Heterogeneous Interaction (HAHI), DepthFormer achieves state-of-the-art accuracy on major benchmarks including KITTI and NYU-Depth-v2. This paper details the architecture's ability to preserve fine-grained local details while capturing long-range spatial dependencies.

Introduction

Monocular depth estimation (MDE)—predicting 3D depth from a single 2D image—is a fundamental challenge in computer vision. Traditionally, Convolutional Neural Networks (CNNs) have dominated this field due to their strong spatial inductive bias. However, CNNs suffer from a limited receptive field, making it difficult to model long-range correlations, such as the distance relationship between foreground and background objects.

While Vision Transformers (ViTs) offer a global receptive field, they often lack the local precision needed for sharp object boundaries. A pilot study conducted by the authors revealed that while ViTs excel at distant object estimation, they are significantly less accurate than CNNs for near objects. DepthFormer addresses this by creating a "best of both worlds" architecture that integrates global context with local detail.

Proposed Method: DepthFormer Architecture

The core of DepthFormer is a parallel encoder architecture designed to extract complementary features from the input image.

  1. Parallel Encoder Branching: The model processes the input through two simultaneous paths. The Transformer Branch utilizes a Swin Transformer to capture global scene structure and long-range correlations. Conversely, the Convolution Branch employs a lightweight CNN (the first block of a ResNet-50) to preserve high-frequency local information and spatial cues.
  2. HAHI Module: The Hierarchical Aggregation and Heterogeneous Interaction (HAHI) module serves as the network's neck. It uses deformable self-attention to fuse features across Transformer layers and deformable cross-attention to model the affinity between global Transformer features and local CNN features. The use of deformable attention allows the model to focus on sparse, relevant sampling points, significantly reducing memory consumption.
  3. Standard Decoder: Fused features are passed through a series of upsampling layers to produce the final high-resolution depth map.
The detailed architecture of DepthFormer, highlighting the parallel Transformer and Convolution branches and the HAHI fusion module.

Experimental Results

DepthFormer was evaluated on three primary datasets: KITTI (outdoor), NYU-Depth-v2 (indoor), and SUN RGB-D (cross-dataset generalization).

Quantitative Performance

  • NYU-Depth-v2: DepthFormer achieved an Absolute Relative Error (AbsRel) of 0.094, outperforming established models like AdaBins (0.103) and NeWCRFs (0.095).
  • KITTI: On the official benchmark, the model achieved a SILog error of 10.46, ranking among the most competitive submissions at the time of release.
  • Generalization: In zero-shot tests on SUN RGB-D, DepthFormer demonstrated superior robustness, suggesting that its dual-branch approach learns more transferable features of the 3D world.

Qualitative Analysis

Visual comparisons demonstrate that DepthFormer produces sharper boundaries and more accurate depth gradients compared to previous state-of-the-art methods like BTS and Adabins.

Qualitative comparison of depth estimation results on the NYU-Depth-v2 dataset. DepthFormer (Ours) shows improved boundary definition and closer alignment with Ground Truth (GT).

Conclusion

DepthFormer effectively bridges the gap between the global modeling of Transformers and the local precision of CNNs. By utilizing a parallel encoder and the HAHI fusion module, it sets new standards for monocular depth estimation. Future work may explore extending the HAHI module to multi-modal sensor fusion (e.g., RGB + LiDAR) and improving the computational efficiency of the parallel architecture for real-time applications.

Summary updated

BibTeX
@article{li2023depthformer,
  author = {Zhenyu Li and Zehui Chen and Xianming Liu and Junjun Jiang},
  title = {{DepthFormer: Exploiting Long-range Correlation and Local Information for Accurate Monocular Depth Estimation}},
  journal = {Mach. Intell. res},
  year = {2023},
  doi = {10.1007/s11633-023-1458-0},
}
Figure