Papers › Uformer: A General U-Shaped Transformer for Image Restoration

Uformer: A General U-Shaped Transformer for Image Restoration

6 Jun 2021CVPR 2022 1arXiv:2106.03106archive 2025-07-28

Zhendong Wang, Xiaodong Cun, Jianmin Bao, Wengang Zhou, Jianzhuang Liu, Houqiang Li

In this paper, we present Uformer, an effective and efficient Transformer-based architecture for image restoration, in which we build a hierarchical encoder-decoder network using the Transformer block. In Uformer, there are two core designs. First, we introduce a novel locally-enhanced window (LeWin) Transformer block, which performs nonoverlapping window-based self-attention instead of global self-attention. It significantly reduces the computational complexity on high resolution feature map while capturing local context. Second, we propose a learnable multi-scale restoration modulator in the form of a multi-scale spatial bias to adjust features in multiple layers of the Uformer decoder. Our modulator demonstrates superior capability for restoring details for various image restoration tasks while introducing marginal extra parameters and computational cost. Powered by these two designs, Uformer enjoys a high capability for capturing both local and global dependencies for image restoration. To evaluate our approach, extensive experiments are conducted on several image restoration tasks, including image denoising, motion deblurring, defocus deblurring and deraining. Without bells and whistles, our Uformer achieves superior or comparable performance compared with the state-of-the-art algorithms. The code and models are available at https://github.com/ZhendongWang6/Uformer.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2106.03106")

Code

Syntology Ran 6 of 6 code samples harvested from 2 repositories linked to this paper; 0 have no recorded run. Of those that ran: 3 ran · violated contract; 2 ran · our draft was wrong; 1 ran · fixture could not drive it.

By repository: official repository: 3 samples from 1 repository, 3 ran; community (archive-listed): 1 sample from 1 repository, 1 ran; 2 identical to code first harvested elsewhere. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

ZhendongWang6/Uformer officialmentioned in papermentioned on GitHubpytorch report
lucidrains/ddpm-proteins mentioned on GitHubpytorch report
lucidrains/uformer-pytorch mentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

6 samples harvested; 6 ran; 0 honoured the contract we drafted; 0 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

3ran · violated contract
2ran · our draft was wrong
1ran · fixture could not drive it

Licence: 2 of the 6 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 2 repositories linked to this paper, official or community; each sample names its own and says which. Some samples are identical code Syntology first harvested from another repository; for those, this paper's copy is not located and its licence is not recorded. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

conv ZhendongWang6/Uformer/model.py official repository ran · our draft was wrong MIT (permissive) · ad4c565716dab068 · report
window_partition ZhendongWang6/Uformer/model.py official repository ran · fixture could not drive it MIT (permissive) · c4b5a8b25f271a68 · report
window_reverse ZhendongWang6/Uformer/model.py official repository ran · our draft was wrong MIT (permissive) · e2cf4a766e987768 · report
cast_tuple lucidrains/uformer-pytorch/uformer_pytorch/uformer_pytorch.py community (archive-listed) ran · violated contract MIT (permissive) · d9a9e2f685256932 · report
default identical code first harvested elsewhere ran · violated contract fingerprinted licence of this copy not recorded · 60fff7c3c400d7ff · report
exists identical code first harvested elsewhere ran · violated contract licence of this copy not recorded · aa5486a3650902d8 · report

Tasks

DeblurringDecoderDenoisingImage DeblurringImage Defocus DeblurringImage DenoisingImage EnhancementImage RestorationRain RemovalSingle Image Desnowing

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Deblurring GoPro Uformer-B PSNR 32.97 #28 of 56 Archive leaderboard report
Deblurring GoPro Uformer-B SSIM 0.967 #28 of 56 Archive leaderboard report
Deblurring HIDE (trained on GOPRO) Uformer-B PSNR (sRGB) 30.83 #18 of 26 Archive leaderboard report
Deblurring HIDE (trained on GOPRO) Uformer-B Params (M) 50.88 #18 of 26 Archive leaderboard report
Deblurring HIDE (trained on GOPRO) Uformer-B SSIM (sRGB) 0.952 #18 of 26 Archive leaderboard report
Deblurring RSBlur Uformer-B Average PSNR 33.98 #7 of 12 Archive leaderboard report
Deblurring RealBlur-J (trained on GoPro) Uformer-B PSNR (sRGB) 29.06 #4 of 15 Archive leaderboard report
Deblurring RealBlur-J (trained on GoPro) Uformer-B SSIM (sRGB) 0.884 #4 of 15 Archive leaderboard report
Deblurring RealBlur-R (trained on GoPro) Uformer-B PSNR (sRGB) 36.22 #3 of 19 Archive leaderboard report
Deblurring RealBlur-R (trained on GoPro) Uformer-B SSIM (sRGB) 0.957 #3 of 19 Archive leaderboard report
Image Deblurring GoPro Uformer-B PSNR 32.97 #30 of 55 Archive leaderboard report
Image Deblurring GoPro Uformer-B Params (M) 50.88 #30 of 55 Archive leaderboard report
Image Deblurring GoPro Uformer-B SSIM 0.967 #30 of 55 Archive leaderboard report
Image Dehazing SOTS Indoor Uformer PSNR 31.91 #26 of 34 Archive leaderboard report
Image Dehazing SOTS Indoor Uformer SSIM 0.971 #26 of 34 Archive leaderboard report
Image Dehazing SOTS Outdoor Uformer PSNR 26.52 #25 of 31 Archive leaderboard report
Image Dehazing SOTS Outdoor Uformer SSIM 0.945 #25 of 31 Archive leaderboard report
Image Denoising DND Uformer-B PSNR (sRGB) 39.98 #5 of 16 Archive leaderboard report
Image Denoising DND Uformer-B SSIM (sRGB) 0.955 #5 of 16 Archive leaderboard report
Image Denoising SIDD Uformer-B PSNR (sRGB) 39.89 #9 of 22 Archive leaderboard report
Image Denoising SIDD Uformer-B SSIM (sRGB) 0.960 #9 of 22 Archive leaderboard report
Image Enhancement TIP 2018 Uformer-B PSNR 29.28 #4 of 6 Archive leaderboard report
Image Enhancement TIP 2018 Uformer-B SSIM 0.917 #4 of 6 Archive leaderboard report
Single Image Desnowing CSD UFormer Average PSNR (dB) 33.80 #5 of 6 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Absolute Position EncodingsAdamAttentionBPEConvolutionDense ConnectionsDropoutLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxTransformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections