arXiv(opens in a new tab)Computer ScienceNov 2021Cited by 4 papers on PaperVantage

Manuscript Offprint

arXiv:2111.09881

Restormer: Efficient Transformer for High-Resolution Image Restoration

Syed Waqas Zamir, Aditya Arora, Salman Hameed Khan, Munawar Hayat, F. Khan, Ming-Hsuan Yang

Abstract

Since convolutional neural networks (CNNs) perform well at learning generalizable image priors from large-scale data, these models have been extensively applied to image restoration and related tasks. Recently, another class of neural architectures, Transformers, have shown significant performance gains on natural language and high-level vision tasks. While the Transformer model mitigates the shortcomings of CNNs (i.e., limited receptive field and inadaptability to input content), its computational complexity grows quadratically with the spatial resolution, therefore making it infeasible to apply to most image restoration tasks involving high-resolution images. In this work, we propose an efficient Transformer model by making several key designs in the building blocks (multi-head attention and feed-forward network) such that it can capture long-range pixel interactions, while still remaining applicable to large images. Our model, named Restoration Transformer (Restormer), achieves state-of-the-art results on several image restoration tasks, including image deraining, single-image motion deblurring, defocus deblurring (single-image and dual-pixel data), and image denoising (Gaussian grayscale/color denoising, and real image denoising). The source code and pre-trained models are available at https://github.com/swz30/Restormer.

1 Introduction

Image restoration is the task of reconstructing a high-quality image by removing degradations (e.g., noise, blur, rain drops) from a degraded input. Due to the ill-posed nature, it is a highly challenging problem that usually requires strong image priors for effective restoration. Since convolutional neural networks (CNNs) perform well at learning generalizable priors from large-scale data, they have emerged as a preferable choice compared to conventional restoration approaches.

[][][][][][][][][][]
(a) Deblurring (Tab. 2)(b) Deraining (Tab. 1)
[][][][][][][][][][]
(c) Gaussian Denoising (Tab. 5)(d) Real Denoising (Tab. 6)

Figure 1: Our Restormer achieves the state-of-the-art performance on image restoration tasks while being computationally efficient.

The basic operation in CNNs is the ‘convolution’ that provides local connectivity and translation equivariance. While these properties bring efficiency and generalization to CNNs, they also cause two main issues. (a) The convolution operator has a limited receptive field, thus preventing it from modeling long-range pixel dependencies. (b) The convolution filters have static weights at inference, and thereby cannot flexibly adapt to the input content. To deal with the above-mentioned shortcomings, a more powerful and dynamic alternative is the self-attention (SA) mechanism [77, 79, 95, 17] that calculates response at a given pixel by a weighted sum of all other positions.

Self-attention is a core component in Transformer models [77, 34] but with a unique implementation, i.e., multi-head SA that is optimized for parallelization and effective representation learning. Transformers have shown state-of-the-art performance on natural language tasks [10, 49, 62, 19] and on high-level vision problems [17, 76, 11, 78]. Although SA is highly effective in capturing long-range pixel interactions, its complexity grows quadratically with the spatial resolution, therefore making it infeasible to apply to high-resolution images (a frequent case in image restoration). Recently, few efforts have been made to tailor Transformers for image restoration tasks [13, 44, 80]. To reduce the computational loads, these methods either apply SA on small spatial windows of size 8$$\times$$8 around each pixel [44, 80], or divide the input image into non-overlapping patches of size 48$$\times$$48 and compute SA on each patch independently [13]. However, restricting the spatial extent of SA is contradictory to the goal of capturing the true long-range pixel relationships, especially on high-resolution images.

In this paper, we propose an efficient Transformer for image restoration that is capable of modeling global connectivity and is still applicable to large images. Specifically, we introduce a multi-Dconv head ‘transposed’ attention (MDTA) block (Sec. 3.1) in place of vanilla multi-head SA [77], that has linear complexity. It applies SA across feature dimension rather than the spatial dimension, i.e., instead of explicitly modeling pairwise pixel interactions, MDTA computes cross-covariance across feature channels to obtain attention map from the (key and query projected) input features. An important feature of our MDTA block is the local context mixing before feature covariance computation. This is achieved via pixel-wise aggregation of cross-channel context using 1$$\times$$1 convolution and channel-wise aggregation of local context using efficient depth-wise convolutions. This strategy provides two key advantages. First, it emphasizes on the spatially local context and brings in the complimentary strength of convolution operation within our pipeline. Second, it ensures that the contextualized global relationships between pixels are implicitly modeled while computing covariance-based attention maps.

A feed-forward network (FN) is the other building block of the Transformer model [77], which consists of two fully connected layers with a non-linearity in between. In this work, we reformulate the first linear transformation layer of the regular FN [77] with a gating mechanism [16] to improve the information flow through the network. This gating layer is designed as the element-wise product of two linear projection layers, one of which is activated with the GELU non-linearity [27]. Our gated-Dconv FN (GDFN) (Sec. 3.2) is also based on local content mixing similar to the MDTA module to equally emphasize on the spatial context. The gating mechanism in GDFN controls which complementary features should flow forward and allows subsequent layers in the network hierarchy to specifically focus on more refined image attributes, thus leading to high-quality outputs.

Apart from the above architectural novelties, we show the effectiveness of our progressive learning strategy for Restormer (Sec. 3.3). In this process, the network is trained on small patches and large batches in early epochs, and on gradually large image patches and small batches in later epochs. This training strategy helps Restormer to learn context from large images, and subsequently provides quality performance improvements at test time. We conduct comprehensive experiments and demonstrate state-of-the-art performance of our Restormer on 1616 benchmark datasets for several image restoration tasks, including image deraining, single-image motion deblurring, defocus deblurring (on single-image and dual pixel data), and image denoising (on synthetic and real data); See Fig. 1. Furthermore, we provide extensive ablations to show the effectiveness of architectural designs and experimental choices.

The main contributions of this work are summarized below:

  • We propose Restormer, an encoder-decoder Transformer for multi-scale local-global representation learning on high-resolution images without disintegrating them into local windows, thereby exploiting distant image context.
  • We propose a multi-Dconv head transposed attention (MDTA) module that is capable of aggregating local and non-local pixel interactions, and is efficient enough to process high-resolution images.
  • A new gated-Dconv feed-forward network (GDFN) that performs controlled feature transformation, i.e., suppressing less informative features, and allowing only the useful information to pass further through the network hierarchy.

Figure

Figure 2: Architecture of Restormer for high-resolution image restoration. Our Restormer consists of multiscale hierarchical design incorporating efficient Transformer blocks. The core modules of Transformer block are: (a) multi-Dconv head transposed attention (MDTA) that performs (spatially enriched) query-key feature interaction across channels rather the spatial dimension, and (b) Gated-Dconv feed-forward network (GDFN) that performs controlled feature transformation, i.e., to allow useful information to propagate further.

References (100)

  • A high-quality denoising dataset for smartphone cameras
  • NTIRE 2019 challenge on real image denoising: Methods and results
  • Defocus deblurring using dual-pixel data
  • Learning to reduce defocus blur by realistically modeling dual-pixel data
  • NTIRE 2021 challenge for defocus deblurring using dual-pixel images: Methods and results
  • Real image denoising with feature attention
  • Densely residual laplacian super-resolution
  • A deep journey into super-resolution: A survey
  • Layer Normalization
  • Language Models are Few-Shot Learners
  • End-to-end object detection with transformers
  • Spatial-adaptive network for single image denoising
  • Pre-trained image processing transformer
  • Rethinking coarse-to-fine approach in single image deblurring
  • Image denoising by sparse 3-D transform-domain collaborative filtering
  • Language modeling with gated convolutional networks
  • Transformers for image recognition at scale
  • Burst image restoration and enhancement
  • Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsity
  • Clearing the skies: A deep network architecture for single-image rain removal
  • Removing rain from single images via a deep detail network
  • Dynamic scene deblurring with parameter selective sharing and nested skip connections
  • Self-guided network for fast image denoising
  • Toward convolutional blind denoising of real photographs
  • Single image haze removal using dark channel prior
  • Gaussian Error Linear Units (GELUs)
  • Mix & match: training convnets with mixed image sizes for improved accuracy, speed and scale resiliency (opens arXiv in a new tab)
  • Single image super-resolution from transformed self-exemplars
  • NTIRE 2019 challenge on image enhancement: Methods and results
  • Focnet: A fractional optimal control network for image denoising
  • Multi-scale progressive fusion network for single image deraining
  • Edge-based defocus blur estimation with adaptive scale selection
  • Transformers in Vision: A Survey
  • Transfer learning from synthetic to real-noise denoising with adaptive instance normalization
  • Deep photo: Model-based photograph enhancement and viewing
  • Colorization transformer
  • DeblurGAN: Blind motion deblurring using conditional adversarial networks
  • DeblurGAN-v2: Deblurring (orders-of-magnitude) faster and better
  • Deep defocus map estimation using domain adaptation
  • Iterative filter adaptive network for single image defocus deblurring
  • Single image deraining: A comprehensive benchmark analysis
  • Recurrent squeeze-and-excitation context aggregation net for single image deraining
  • SwinIR: Image restoration using swin transformer
  • Enhanced deep residual networks for single image super-resolution
  • Non-local recurrent network for image restoration
  • Multi-level wavelet-cnn for image restoration
  • Dual residual networks leveraging the potential of paired operations for image restoration
  • RoBERTa: A Robustly Optimized BERT Pretraining Approach
  • Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
  • SGDR: Stochastic gradient descent with warm restarts
  • A database of human segmented natural images and its application to evaluating segmentation algorithms and measuring ecological statistics
  • Nonparametric blind super-resolution
  • Robust and interpretable blind image denoising via bias-free convolutional neural networks
  • Dynamic attentive graph learning for image restoration
  • Deep multi-scale convolutional neural network for dynamic scene deblurring
  • Ntire 2021 challenge on image deblurring
  • Multi-temporal recurrent neural networks for progressive non-uniform single image deblurring with incremental temporal training
  • Dilated residual networks with symmetric skip connection for image denoising
  • Benchmarking denoising algorithms with real photographs
  • Spatially-adaptive image restoration using distortion-guided networks
  • Improving language understanding by generative pre-training
  • Adaptive consistency prior based deep network for image denoising
  • Progressive image deraining networks: A better and simpler baseline
  • Real-world blur dataset for learning and benchmarking deblurring algorithms
  • U-Net: convolutional networks for biomedical image segmentation
  • Human-aware motion deblurring
  • Just noticeable defocus blur detection and estimation
  • Real-time single image and video super-resolution using an efficient sub-pixel convolutional neural network
  • Single image defocus deblurring using kernel-sharing parallel atrous convolutions
  • Spatially-attentive patch-hierarchical network for adaptive motion deblurring
  • Scale-recurrent network for deep image deblurring
  • Deep learning on image denoising: An overview
  • Image denoising using deep cnn with batch renormalization
  • Anchored neighborhood regression for fast example-based super-resolution
  • Training data-efficient image transformers & distillation through attention
  • Attention is all you need
  • Pyramid vision transformer: A versatile backbone for dense prediction without convolutions
  • Non-local neural networks
  • Uformer: A general u-shaped transformer for image restoration (opens arXiv in a new tab)
  • Semi-supervised transfer learning for image rain removal
  • Identifying recurring patterns with deep neural networks for natural image denoising
  • SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers
  • Unnatural l0 sparse representation for natural image deblurring
  • Learning texture transformer network for image super-resolution
  • Deep joint rain detection and removal from a single image
  • Uncertainty guided multi-scale residual learning-using a cycle spinning cnn for single image de-raining
  • Tokens-to-Token ViT: Training Vision Transformers from Scratch on ImageNet
  • Variational denoising network: Toward blind noise modeling and removal
  • Dual adversarial network: Toward real-world noise removal and noise generation
  • CycleISP: Real image restoration via improved data synthesis
  • Learning enriched features for real image restoration and enhancement
  • Multi-stage progressive image restoration
  • Deep stacked hierarchical multi-patch network for image deblurring
  • Self-attention generative adversarial networks
  • Density-aware single image de-raining using a multi-stream dense network
  • Image de-raining using a conditional generative adversarial network
  • Dynamic scene deblurring using spatially variant recurrent neural networks
  • Plug-and-play image restoration with deep denoiser prior
  • Deblurring by realistic blurring
  • Beyond a gaussian denoiser: Residual learning of deep cnn for image denoising

Couldn't load all references. Reload the page to try again.