[Paper Review] Transformer-Based Attention Networks for Continuous Pixel-Wise Prediction
This paper proposes TransDepth, a hybrid CNN-Transformer architecture for continuous pixel-wise prediction tasks such as monocular depth estimation and surface normal estimation. By integrating a unified attention gate decoder into a ResNet backbone enhanced with Vision Transformer blocks, TransDepth effectively models long-range dependencies while preserving local details, achieving state-of-the-art performance on NYU, KITTI, and ScanNet benchmarks.
While convolutional neural networks have shown a tremendous impact on various computer vision tasks, they generally demonstrate limitations in explicitly modeling long-range dependencies due to the intrinsic locality of the convolution operation. Initially designed for natural language processing tasks, Transformers have emerged as alternative architectures with innate global self-attention mechanisms to capture long-range dependencies. In this paper, we propose TransDepth, an architecture that benefits from both convolutional neural networks and transformers. To avoid the network losing its ability to capture local-level details due to the adoption of transformers, we propose a novel decoder that employs attention mechanisms based on gates. Notably, this is the first paper that applies transformers to pixel-wise prediction problems involving continuous labels (i.e., monocular depth prediction and surface normal estimation). Extensive experiments demonstrate that the proposed TransDepth achieves state-of-the-art performance on three challenging datasets. Our code is available at: https://github.com/ygjwd12345/TransDepth.
Motivation & Objective
- To address the limitation of convolutional neural networks in modeling long-range spatial dependencies in dense prediction tasks.
- To overcome the loss of local inductive bias when using pure Transformers in pixel-wise regression tasks.
- To propose a novel attention gate decoder that fuses multi-scale features and enhances feature representation in the decoder.
- To demonstrate the effectiveness of combining CNNs and Transformers for continuous label prediction, particularly in monocular depth and surface normal estimation.
- To establish new state-of-the-art performance on benchmark datasets for both depth and normal estimation tasks.
Proposed method
- Integrates Vision Transformer blocks into the ResNet-50 backbone to enhance global context modeling while preserving local spatial inductive bias.
- Proposes a unified attention gate decoder that applies separate channel-wise and spatial-wise attention mechanisms to fuse multi-scale features.
- Uses gated attention to dynamically weight feature maps across different scales, improving feature propagation and representation learning.
- Employs a multi-scale fusion strategy where the decoder receives features from multiple encoder stages (e.g., f³, f⁴, f⁵) to enrich context.
- Leverages the self-attention mechanism to model long-range dependencies across all pixels in the feature map, enabling global context modeling.
- Trains the network end-to-end with standard regression loss functions for depth and normal estimation tasks.
Experimental results
Research questions
- RQ1Can Transformers be effectively applied to continuous pixel-wise prediction tasks such as monocular depth estimation and surface normal estimation?
- RQ2How can the global modeling capability of Transformers be combined with the local inductive bias of CNNs to improve dense prediction performance?
- RQ3What is the optimal design for a decoder that fuses multi-scale features while maintaining spatial and channel-wise attention for better representation?
- RQ4Does the proposed unified attention gate decoder outperform standard attention or skip-connection-based decoders in capturing long-range and local dependencies?
- RQ5Can the hybrid CNN-Transformer architecture achieve state-of-the-art results on standard benchmarks like NYU, KITTI, and ScanNet?
Key findings
- TransDepth achieves a new state-of-the-art performance of 0.900 on the δ < 1.25 metric for monocular depth estimation on the NYU dataset.
- On the KITTI dataset, TransDepth achieves 0.956 on the δ < 1.25 metric, setting a new SOTA for depth prediction.
- For surface normal estimation on NYU, TransDepth achieves 61.7% on the 11.25° metric, establishing a new SOTA result.
- Abllation studies show that fusing three encoder features (f³, f⁴, f⁵) yields the best performance, with further expansion leading to overfitting.
- The hybrid backbone of ResNet-50 with ViT-B/16 outperforms both pure ResNet and pure ViT backbones across all metrics on the NYU depth dataset.
- Qualitative attention maps demonstrate that the attention gate decoder successfully captures multi-scale spatial dependencies across different regions of the image.
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.