Abstract
Convolutional layers are an integral part of many deep neural network solutions in computer vision. Recent work shows that replacing the standard convolution operation with mechanisms based on self-attention leads to improved performance on image classification and object detection tasks. In this work, we show how attention mechanisms can be used to replace another canonical operation: strided transposed convolution. We term our novel attention-based operation attention-based upsampling since it increases/upsamples the spatial dimensions of the feature maps. Through experiments on single image super-resolution and joint-image upsampling tasks, we show that attention-based upsampling consistently outperforms traditional upsampling methods based on strided transposed convolution or based on adaptive filters while using fewer parameters. We show that the inherent flexibility of the attention mechanism, which allows it to use separate sources for calculating the attention coefficients and the attention targets, makes attention-based upsampling a natural choice when fusing information from multiple image modalities.
Introduction
In computer vision, upsampling—increasing the spatial resolution of a feature map—is a fundamental task. The standard tool for this is the strided transposed convolution. However, this approach suffers from two primary drawbacks. First, it utilizes static kernels, applying the same learned weights across the entire image regardless of local content (e.g., smooth regions vs. high-detail textures). Second, it is parameter-inefficient; as kernel sizes increase, the parameter count grows significantly. Furthermore, in Joint Image Upsampling, where a high-resolution guide image (like RGB) helps upsample a low-resolution target (like a depth map), standard convolutions struggle to elegantly fuse information from different modalities.
Methodology: Attention-based Upsampling (ABU)
The proposed Attention-based Upsampling (ABU) replaces fixed kernels with a content-adaptive masked self-attention mechanism. This allows the model to generate a unique convolutional kernel for every pixel position dynamically.
The Core Mechanism
- Q, K, V Generation: The input is transformed into Query (Q), Key (K), and Value (V) tensors using $1 \times 1$ convolutions.
- Resolution Increase: To increase resolution, the model performs "zero-upsampling" (ZU) on Keys and Values by inserting zeros between pixels, while Queries are upscaled via bilinear interpolation.
- Masked Attention: A spatial mask ($M$) is applied to the upsampled Key/Value maps to ensure the attention mechanism only aggregates information from the original valid pixel positions.
- Spatial Awareness: Relative positional vectors are added to the Query-Key dot product to maintain spatial awareness, compensating for the permutation-invariance of standard attention.
For multi-modal tasks, ABU separates the source of structure (Q and K derived from a high-res guide) from the source of content (V derived from the low-res target), allowing for precise information fusion.
Experimental Results
The researchers evaluated ABU on two tasks: Single Image Super-Resolution (SISR) and Joint Image Upsampling. For SISR, benchmarks included Set5, Set14, and BSDS100. For Joint Upsampling, the NYU Depth Dataset v2 was utilized.
Performance and Efficiency
ABU demonstrated significant improvements over traditional methods. On the BSDS100 benchmark (4x scale), the attention-based model achieved a PSNR of 27.84 dB, outperforming the deconvolution baseline (27.76 dB) while using roughly half the parameters (0.69M vs 1.41M). In joint upsampling on NYU v2, ABU achieved an RMSE of 2.64, a substantial improvement over Deep Joint Filtering (DJF) at 3.54.
Qualitatively, ABU produces sharper edges and fewer "texture-copying" artifacts—where RGB textures erroneously bleed into the depth map—compared to previous state-of-the-art techniques.
Conclusion
Attention-based Upsampling offers a parameter-efficient, content-adaptive alternative to transposed convolutions. While currently slower to train due to a lack of low-level hardware optimization compared to standard convolutions, its superior performance in edge preservation and multi-modal fusion makes it a compelling choice for high-fidelity image reconstruction tasks. Future work will focus on optimizing low-level kernels to improve training and inference speed.
Summary updated