Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

Uformer: A General U-Shaped Transformer for Image Restoration

Uformer restores degraded images with window-restricted Transformer blocks

  • Problem Convolutional restoration networks capture long-range dependencies only weakly. Global self-attention could model them, but its cost grows quadratically on high-resolution feature maps.
  • Method Uformer builds a U-shaped encoder-decoder from LeWin blocks that attend within non-overlapping windows instead of globally. A learnable window-sized bias is added to decoder features.
  • Results Uformer-B reaches 39.89 dB PSNR on SIDD real-noise denoising, at least 0.14 dB above the other compared denoising methods.

Why restoration needs both local and global context

Most recent strong restoration methods are built on convolutional networks, which handle local structure well but capture long-range dependencies only weakly. Self-attention can model those long-range relations, but its cost grows quadratically with the size of the feature map, so earlier restoration work applied it only to a few low-resolution maps.

The study asks whether attention can work across several resolutions at once, so that fine detail at high resolution is also recovered.

Global attention over all tokens is impractical on high-resolution maps, and attention by itself does not exploit the neighbourhood of each degraded pixel well enough for restoration.

How the U-shaped network turns a degraded image into a restored one

A 3×3 convolution with LeakyReLU first maps the degraded image to low-level features with C channels. Each of the K encoder stages stacks LeWin blocks and then downsamples with a 4×4 convolution of stride 2, which doubles the channel count while the spatial size shrinks. A bottleneck of LeWin blocks sits at the lowest resolution, where the window covers a larger part of the image.

The decoder mirrors the encoder: a 2×2 transposed convolution with stride 2 halves the channels and doubles the spatial size, and the result is concatenated with the matching encoder features through skip-connections before the next LeWin blocks. A final 3×3 convolution turns the decoder features into a residual R, and the restored image is I' = I + R, so the network learns a correction to its input.

Window attention inside the LeWin block

Each LeWin block is a pair of residual sub-blocks: window-based self-attention on layer-normalised input, followed by the feed-forward module on layer-normalised output. Written out, \(X'_l = \text{W-MSA}(\text{LN}(X_{l-1})) + X_{l-1}\) and \(X_l = \text{LeFF}(\text{LN}(X'_l)) + X'_l\), where LN is layer normalisation.

W-MSA splits the feature map into non-overlapping M×M windows, giving \(N = HW/M^2\) windows, and attention is computed only among the tokens of each window. Each head works with dimension \(d_k = C/k\), and the head outputs are concatenated and projected linearly. A learnable relative position bias B, read from a table of size \((2M-1)\times(2M-1)\), is added to the attention logits, so that the attention is \(\text{SoftMax}(QK^T/\sqrt{d_k} + B)V\).

Global attention costs \(O(H^2W^2C)\), whereas window attention costs \(O(M^2HWC)\), so for a fixed window size the cost scales with the number of pixels rather than their square. The window stays at 8×8 in every LeWin block, so at deeper levels, where the map is smaller, the same window covers a larger share of the image.

Adding local context to the feed-forward path

The feed-forward network in a standard Transformer has limited ability to use local context, yet neighbouring pixels are important references in restoration. LeFF raises each token to a higher dimension with a linear layer, reshapes the tokens into a 2D map, applies a 3×3 depth-wise convolution, flattens the map back into tokens, and projects down to the input channel count.

GELU follows each linear or convolution layer.

The authors also tried a shifted-window strategy in the even LeWin blocks of each stage, which gave only slightly better results.

The multi-scale restoration modulator

Different degradations leave different perturbation patterns, so the modulator is meant to let the decoder adjust its features per degradation. Each LeWin block in the decoder holds a learnable tensor of shape M×M×C, where M is the window size and C is the channel count, and this tensor is added as a bias shared by all windows before self-attention.

Because the bias has window size and is added rather than multiplied in, the parameter and compute increase is small.

The authors show deblurring and denoising results with and without the modulator, and read the difference as more blur and noise patterns being removed. They relate the idea to StyleGAN, which adds a multi-scale noise term to convolution features, and offer that link as a possible explanation rather than a proof.

Training and model variants

Training uses AdamW with momentum terms of (0.9, 0.999) and a weight decay of 0.02, with random horizontal flips and rotations of 90°, 180° or 270°. The learning rate follows a cosine decay from 2e-4 down to 1e-6, the window size is 8×8 and the number of encoder and decoder stages K is 4 by default. Uformer-T uses C = 16 with encoder depths {2, 2, 2, 2}, Uformer-S uses C = 32 with the same depths, and Uformer-B uses C = 32 with depths {1, 2, 8, 8}; decoder depths mirror the encoder.

PSNR and SSIM are computed in RGB, except for deraining, where they are computed on the Y channel of YCbCr.

Real noise removal on SIDD and DND

The margin over the other compared denoising methods is at least 0.14 dB, and the eight baselines include BM3D, RIDNet, VDN, DANet, CycleISP, MIRNet, MPRNet and NBNet.

On DND, the model trained on SIDD reaches 39.98 dB PSNR through online server testing, which is 0.09 dB above NBNet's 39.89 dB.

To check whether the gain comes only from extra compute, the authors plot PSNR against GMACs, and they report that Uformer-T performs better than most models at the lowest computation.

Motion deblurring with GoPro-only training

Uformer is trained on GoPro only and then applied directly to HIDE, RealBlur-R and RealBlur-J, so those scores measure transfer to other data rather than fit to their training sets.

On RealBlur-R, Uformer-B reaches 36.22 dB and on RealBlur-J 29.06 dB, margins of at least 0.23 dB and 0.36 dB over the other compared methods. On HIDE, Uformer-B reaches 30.83 dB, slightly below MPRNet at 30.96 dB.

Defocus deblurring and real deraining

The SPAD comparison uses the Y channel of YCbCr for both metrics.

Transformer blocks against convolution and a single-scale ViT

Replacing every LeWin block with a ResBlock gives the UNet variants, sized with C = 32, 48 and 76 for UNet-T, UNet-S and UNet-B, all with encoder depths {2, 2, 2, 2}.

The single-scale ViT has a convolutional head and tail with 12 Transformer blocks of hidden dimension 256 on 16×16 patches, and it reaches 38.51 dB. The authors read the gap to Uformer as evidence that the hierarchical structure matters for restoration.

Where locality helps

Three settings are compared: no locality, locality in W-MSA, and locality in LeFF, measured on Uformer-S for SIDD and on Uformer-B for RealBlur-R and RealBlur-J. Adding locality to the feed-forward network raises Uformer-S from 39.74 dB to 39.77 dB on SIDD, and Uformer-B from 36.15 dB and 28.99 dB to 36.22 dB and 29.06 dB on RealBlur-R and RealBlur-J.

Locality in W-MSA alone changes SIDD PSNR by -0.02 dB, from 39.74 dB to 39.72 dB.

Using both at once lowers RealBlur-R and RealBlur-J from 36.22 dB and 29.06 dB to 36.19 dB and 28.85 dB, so the authors prefer the feed-forward placement.

Effect of the modulator across tasks

The modulator is switched off and on for Uformer-T on GoPro, and for Uformer-B on SIDD and on SPAD. On GoPro, PSNR rises from 29.11 dB to 29.57 dB, a 0.46 dB gain. For Uformer-B, PSNR rises from 39.86 dB to 39.89 dB on SIDD and from 47.43 dB to 47.84 dB on SPAD, a 0.03 dB and a 0.41 dB gain.

These three gains come from different backbones and datasets, so they are separate measurements rather than one shared effect size.

Limitations

The evaluated tasks are denoising, motion deblurring, defocus deblurring and deraining, and image-to-image translation and image super-resolution were not tested. The SIDD gain of the modulator is 0.03 dB and was measured only on Uformer-B, and the DND score comes from online server testing of a model trained on SIDD. The authors also note that restoration techniques can be misused, for example for privacy violations in surveillance, and that they can disturb camera identification and copyright tracing.

Paper info

Authors
Wang, Zhendong, Cun, Xiaodong, Bao, Jianmin, Zhou, Wengang, Liu, Jianzhuang, Li, Houqiang
Venue
arXiv · Preprint
First published
2021-6-6
Added
2026-11-12
Updated
2021-11-25
Version
v2
arXiv
2106.03106
Category
cs.CV
Original paper terms
arXiv non-exclusive 1.0
What we show
Paper info and commentary

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

Quote from the paper

Wang, Zhendong, Cun, Xiaodong, Bao, Jianmin, Zhou, Wengang, Liu, Jianzhuang, Li, Houqiang (2021). Uformer: A General U-Shaped Transformer for Image Restoration. arXiv:2106.03106v2. https://arxiv.org/abs/2106.03106v2

BibTeX
@misc{zhendong2021uformer,
  title = {{Uformer: A General U-Shaped Transformer for Image Restoration}},
  author = {Wang, Zhendong and Cun, Xiaodong and Bao, Jianmin and Zhou, Wengang and Liu, Jianzhuang and Li, Houqiang},
  year = {2021},
  eprint = {2106.03106},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2106.03106v2}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up