[Paper Review] Attention Attention Everywhere: Monocular Depth Prediction with Skip Attention
This paper proposes PixelFormer, a novel monocular depth estimation framework that formulates depth prediction as a pixel query refinement problem using a Skip Attention Module (SAM) to fuse long-range decoder features with high-resolution encoder features. By initializing queries from coarsest-level features and refining them via window-based cross-attention, the model improves depth boundary accuracy and generalization, achieving state-of-the-art performance with 5.3% and 3.9% relative error improvements on NYUv2 and KITTI, respectively.
Monocular Depth Estimation (MDE) aims to predict pixel-wise depth given a single RGB image. For both, the convolutional as well as the recent attention-based models, encoder-decoder-based architectures have been found to be useful due to the simultaneous requirement of global context and pixel-level resolution. Typically, a skip connection module is used to fuse the encoder and decoder features, which comprises of feature map concatenation followed by a convolution operation. Inspired by the demonstrated benefits of attention in a multitude of computer vision problems, we propose an attention-based fusion of encoder and decoder features. We pose MDE as a pixel query refinement problem, where coarsest-level encoder features are used to initialize pixel-level queries, which are then refined to higher resolutions by the proposed Skip Attention Module (SAM). We formulate the prediction problem as ordinal regression over the bin centers that discretize the continuous depth range and introduce a Bin Center Predictor (BCP) module that predicts bins at the coarsest level using pixel queries. Apart from the benefit of image adaptive depth binning, the proposed design helps learn improved depth embedding in initial pixel queries via direct supervision from the ground truth. Extensive experiments on the two canonical datasets, NYUV2 and KITTI, show that our architecture outperforms the state-of-the-art by 5.3% and 3.9%, respectively, along with an improved generalization performance by 9.4% on the SUNRGBD dataset. Code is available at https://github.com/ashutosh1807/PixelFormer.git.
Motivation & Objective
- To address inaccuracies in depth labeling at object boundaries despite correct edge alignment in SOTA models.
- To improve fusion of high-resolution local features and global contextual features in encoder-decoder architectures.
- To enable direct supervision of initial pixel queries via depth bin prediction for better embedding of depth information.
- To enhance generalization on out-of-distribution datasets like SUNRGBD through adaptive, image-specific depth binning.
- To replace conventional convolution-based skip connections with an attention-based module that captures long-range dependencies.
Proposed method
- The model uses a vision transformer backbone to extract hierarchical features, with the coarsest feature map used to initialize pixel queries via a Pixel Query Initialiser module.
- A Skip Attention Module (SAM) refines these queries at higher resolutions by computing window-based cross-attention between decoder features and neighboring encoder features.
- The SAM enables long-range feature aggregation by attending to relevant encoder features within a local window, improving context integration beyond local convolutions.
- A Bin Center Predictor (BCP) module estimates image-adaptive depth bins directly from the initial pixel queries, providing direct supervision from ground truth depth.
- The network is trained using ordinal regression over discretized depth bins, with the BCP module enabling early and effective depth supervision.
- The overall architecture combines the encoder-decoder structure with iterative query refinement, replacing standard skip connections with attention-based fusion.

Experimental results
Research questions
- RQ1Can attention-based fusion of encoder and decoder features improve depth prediction accuracy compared to standard convolutional skip connections?
- RQ2Does initializing pixel queries from coarse features and refining them through cross-attention lead to better depth embedding and generalization?
- RQ3Can direct supervision of initial pixel queries via bin center prediction improve model performance and convergence?
- RQ4How does the proposed method generalize to out-of-distribution datasets like SUNRGBD compared to SOTA models?
- RQ5Can window-based cross-attention effectively capture long-range dependencies in high-resolution features without excessive computational cost?
Key findings
- PixelFormer achieves a 5.3% improvement in absolute relative error (Abs Rel) on the NYUv2 dataset compared to the previous SOTA.
- On the KITTI dataset, the model improves by 3.9% in absolute relative error and 3.9% in square relative error (Sq Rel) over the previous state-of-the-art.
- The model demonstrates a 9.4% improvement in generalization performance on the SUNRGBD dataset in terms of absolute relative error.
- Ablation studies confirm that the Skip Attention Module (SAM) outperforms both addition-based and concatenation-based fusion by 4.0% in Abs Rel and 4.2% in Sq Rel on KITTI.
- The Bin Center Predictor (BCP) module, which uses initial pixel queries to predict depth bins, improves performance by 3.0% in Abs Rel over using a separate ViT for bin prediction.
- Qualitative results show that PixelFormer reduces depth label confusion at object boundaries, such as on pillows and beds, compared to NeWCRFs.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.