Residual Non-local Attention Networks for Image Restoration
RNAN combines local and non-local attention; on Urban100 color denoising at σ=70, it reaches 27.45 dB.
Key Findings
Methodology
RNAN uses global residual learning to predict noise, blur, or compression artifacts. It stacks Residual Local Attention Blocks and Residual Non-local Attention Blocks, each separating feature extraction into a Trunk Branch and a Mask Branch. The Trunk uses simplified Residual Blocks for hierarchical features. The Mask uses strided convolution, deconvolution, and Sigmoid to produce spatial-channel weights; selected masks insert an Embedded Gaussian Non-local Block to model dependencies across the whole image.
Key Results
- For color denoising at σ=70, RNAN obtains 28.16 dB on Kodak24, 26.83 dB on BSD68, and 27.45 dB on Urban100. These exceed the second-best FFDNet by 0.48, 0.30, and 1.06 dB, respectively.
- For color demosaicing, RNAN reaches 39.71/0.9725 on McMaster18, 43.09/0.9902 on Kodak24, 42.50/0.9929 on BSD68, and 39.75/0.9848 on Urban100 in PSNR/SSIM, substantially outperforming IRCNN.
- On Urban100 color denoising at σ=30, removing attention gives 30.96 dB; adding a Mask Branch gives 31.17 dB; adding non-local mixed attention gives 31.32 dB; a deeper configuration reaches 31.50 dB.
Significance
The paper addresses two persistent restoration problems: limited convolutional receptive fields and uniform treatment of regions and channels. RNAN can compare local texture with distant, structurally similar content while allocating capacity to difficult regions. Its shared design applies to denoising, demosaicing, compression-artifact reduction, and super-resolution. This demonstrates that attention, previously more prominent in recognition, can improve pixel-faithful low-level vision rather than merely select semantic objects.
Technical Contribution
The main contributions are the Trunk–Mask architecture, local/non-local mixed attention, and residual non-local attention learning. The Non-local Block uses an Embedded Gaussian affinity, f(xi,xj)=exp((Wuxi)^T(Wvxj)), followed by Softmax aggregation; its residual output is zi=Wzyi+xi. Unlike the classification-oriented Htrunk(x)(Hmask(x)+1), RNAN uses Htrunk(x)Hmask(x)+x, directly preserving low-level input information and enabling very deep restoration networks.
Novelty
The authors present RNAN as the first systematic use of residual non-local attention for image restoration. Compared with DnCNN, MemNet, IRCNN, and other primarily local convolutional models, RNAN places non-local reasoning inside the Mask Branch, allowing global relationships to guide trunk feature extraction. The innovation is therefore not simply adding a non-local layer, but using global affinity to construct adaptive spatial-channel attention for restoration.
Limitations
- Non-local affinity over all spatial positions increases computation and memory. This cost leads the authors to use only two RNABs, at low- and high-level feature spaces; the paper does not establish that dense non-local processing is optimal throughout the network.
- Training relies mainly on 800 DIV2K images and synthetic AWGN or standard JPEG degradation. Real camera noise, motion blur, spatially varying corruption, mixed degradation, and perceptual quality are not comprehensively tested.
- The paper reports strong denoising, demosaicing, and compression results, but the supplied text does not provide a complete super-resolution table or a thorough speed/parameter breakdown.
Future Work
Future research should develop sparse, windowed, low-rank, or otherwise efficient non-local attention to reduce memory and latency. Real degradation datasets, blind restoration, L1 or perceptual objectives, and cross-device evaluation would test robustness beyond synthetic AWGN and JPEG. A dynamic controller could decide which layers, regions, or channels require global reasoning, while joint quality–speed–energy benchmarks would clarify deployment trade-offs.
AI Executive Summary
Image restoration attempts to recover clean images from noise, blur, mosaicing, or compression. CNNs such as SRCNN, ARCNN, DnCNN, and MemNet established strong baselines, yet local convolutions struggle to connect distant pixels. They also tend to treat flat regions, textured regions, and feature channels too uniformly, causing texture loss and over-smoothing.
The ICLR 2019 paper introduces the Residual Non-local Attention Network (RNAN). Global residual learning makes the network predict degradation components, while stacked Residual Local/Non-local Attention Blocks combine a Trunk Branch and a Mask Branch. The Trunk extracts hierarchical features; the local Mask expands context with strided convolution and deconvolution; the non-local Mask uses an Embedded Gaussian Non-local Block to relate every position to the full feature map. Sigmoid produces spatial-channel weights, and H(x)=Htrunk(x)Hmask(x)+x preserves low-level detail.
Using 800 DIV2K training images, RNAN reaches 28.16, 26.83, and 27.45 dB on Kodak24, BSD68, and Urban100 color denoising at σ=70, improving over FFDNet by 0.48, 0.30, and 1.06 dB. For demosaicing, it achieves 43.09 dB/0.9902 SSIM on Kodak24 and 39.75/0.9848 on Urban100, outperforming IRCNN. Ablations peak at 31.50 dB. The work shows that global relationships and selective feature allocation improve restoration, although dense non-local computation and limited real-world degradation testing remain important obstacles.
Deep Analysis
Background
Image restoration is a central low-level vision problem. SRCNN and ARCNN introduced CNNs to super-resolution and compression-artifact reduction; DnCNN used residual learning; IRCNN incorporated denoiser priors; MemNet and encoder–decoder designs explored deeper memory and skip connections. These methods demonstrated the power of CNNs, but most rely on local convolution and do not explicitly model distant similarity, channel dependencies, or unequal restoration difficulty across image regions.
Core Problem
The degradation process is irreversible, making restoration an ill-posed inverse problem. A local receptive field cannot efficiently exploit repeated structures far apart in an image, especially under severe noise. Flat regions are easier to restore than textures, yet conventional models often process them similarly. Channels may also encode useful high-frequency details or corruption, so treating all channels equally can erase structure or preserve artifacts.
Innovation
- ��A Trunk–Mask design separates hierarchical feature extraction from adaptive weighting.
- ��The local Mask uses large-stride convolution and deconvolution, enlarging context without the detail loss associated with repeated max pooling.
- ��The non-local Mask inserts an Embedded Gaussian Non-local Block, allowing every position to compare with all positions.
- ��Residual attention learning uses HtrunkHmask+x, rather than the classification-oriented Htrunk(Hmask+1), better preserving low-level restoration information.
Methodology
- ��The input IL passes through shallow convolution; the output reconstructs IR, with IR=HRNAN(IL) and global residual learning focused on degradation.
- ��Each block has q=2 surrounding Residual Blocks; its Trunk contains t=2 simplified RBs, each using two 3×3 convolutions and one ReLU.
- ��The Mask uses m=1 RB, strided convolution, 2m RBs, transposed convolution, more RB processing, a 1×1 convolution, and Sigmoid.
- ��The NLB computes Softmax-weighted global affinity, with g(xj)=Wgxj and residual output Wzyi+xi.
- ��The model contains 10 attention blocks, including 2 RNABs; RB width is 64, while NLB channel dimension C is 32.
Experiments
The models are trained on 800 DIV2K images using 16 random 48×48 LQ patches per batch. ADAM uses β1=0.9, β2=0.999, ε=10^-8, and an initial learning rate of 10^-4 halved every 200,000 back-propagation iterations; the objective is L2. Denoising uses Kodak24, BSD68, and Urban100 with AWGN σ=10/30/50/70. Demosaicing uses McMaster18, Kodak24, BSD68, and Urban100. Compression reduction uses LIVE1 and Classic5 with JPEG quality 10/20/30/40. PSNR and SSIM are reported.
Results
RNAN obtains the best reported color and grayscale denoising results across the listed datasets and noise levels. At grayscale σ=70, it reaches 25.89 dB on Urban100, versus 27.45 dB for color. Demosaicing reaches 43.09/0.9902 on Kodak24 and 42.50/0.9929 on BSD68. For JPEG artifact reduction, RNAN is best on LIVE1 and Classic5 at all reported qualities. Ablations show independent gains from the Mask Branch, Non-local Block, and additional Residual Attention Blocks.
Applications
RNAN can support camera denoising, smartphone enhancement, Bayer demosaicing, JPEG post-processing, and super-resolution. Deployment requires training or fine-tuning on degradation statistics matching the target device. The architecture is a useful controlled-setting baseline because it handles several restoration tasks with one design, but practical products must measure latency, memory, and robustness to unknown corruption.
Limitations & Outlook
Dense global affinity is expensive in memory and computation, explaining the use of only two RNABs. The training distribution is dominated by DIV2K and synthetic AWGN/JPEG, so real sensor noise, motion blur, and mixed corruption may cause domain shift. L2 optimization favors average pixel fidelity and does not fully capture perceptual texture quality. Efficient attention, real-degradation modeling, blind restoration, and standardized quality–speed–energy evaluation are natural next steps.
Plain Language Accessible to non-experts
Imagine a large photo-repair factory. Older systems employ workers who inspect only a small patch at a time. They can fix a nearby scratch, but they may not notice that the other side of the photograph contains an identical window, brick pattern, or letter that could guide the repair. They also polish a blank wall and a complicated texture with nearly the same effort, so important detail can disappear.
RNAN assigns two teams. The main repair line progressively rebuilds the image, from broad structure to fine detail. An inspection team assigns attention scores: difficult, damaged textures receive more effort, while easy regions receive less. Some inspectors look nearby; others can compare the entire photograph and find distant matches. They also judge locations and color information separately, rather than treating every part alike.
The factory keeps a copy of the original input and adds it back at the end, protecting details that were already correct. In tests, this strategy improved denoising, demosaicing, and JPEG artifact reduction over several earlier systems. Its drawback is obvious: asking inspectors to compare the whole photograph requires more time and memory, and training on artificial damage does not guarantee perfect behavior on every real camera.
ELI14 Explained like you're 14
Suppose a photo has been covered with sand, squeezed into a blurry JPEG, or recorded as a strange grid of colors. A normal fixer looks through a magnifying glass at one small square. Nearby squares help, but if the same window, brick wall, or piece of text appears far away, the fixer may never connect them. It can mistake real texture for dirt and wipe it away.
RNAN is like a superhero repair crew! The main crew works layer by layer, finding big shapes first and tiny details later. A second crew gives advice: “This area is tricky—look carefully!” Some advisers inspect neighbors, while others compare the whole picture at once. They also decide separately which places and color information deserve attention, so every pixel is not treated identically.
The crew keeps the original photo’s useful pieces instead of rebuilding everything from scratch. That shortcut helps a very deep team avoid losing details. On Urban100 with heavy color noise, level 70, RNAN reaches 27.45 dB; on Kodak24 demosaicing it reaches 43.09 dB, beating IRCNN in the reported comparison.
Is it perfect? Not quite! Whole-picture comparisons need extra computer power, and the experiments mostly use artificial noise. If RNAN becomes faster and learns real phone-camera damage, it could become a powerful automatic fixer for cameras, scanners, and social-media photos!
Glossary
Residual Learning
A model learns the difference between a corrupted input and its target instead of recreating the entire target directly. Skip connections preserve useful low-level information and stabilize deep optimization.
RNAN uses global residual learning for degradation prediction and Htrunk(x)Hmask(x)+x inside attention blocks.
Non-local Block
A module lets one position aggregate information from all positions, weighted by feature similarity rather than spatial proximity alone. RNAN uses Embedded Gaussian affinity and Softmax normalization.
It is inserted in the Mask Branch to create globally informed attention maps.
Mixed Attention
Attention that assigns weights across both spatial positions and feature channels. Sigmoid maps these weights to the interval [0,1] for adaptive feature rescaling.
RNAN’s local and non-local Mask Branches produce spatial-channel mixed attention.
Trunk Branch
The feature-extraction path that builds hierarchical representations. RNAN implements it with simplified residual blocks without Batch Normalization.
It reconstructs edges, textures, and other restoration-relevant features before masking.
Mask Branch
The path that estimates which features should be amplified or suppressed. Its output is a location- and channel-specific modulation map.
It uses strided convolution, transposed convolution, 1×1 convolution, and Sigmoid.
PSNR/SSIM
PSNR expresses reconstruction error as peak signal-to-noise ratio in decibels; SSIM measures structural, luminance, and contrast similarity. Higher values generally indicate better fidelity.
The paper reports these metrics for denoising, demosaicing, and compression-artifact reduction.
Open Questions Unanswered questions from this research
- 1 Real-world generalization remains uncertain: DIV2K training with AWGN and JPEG does not represent phone-camera noise, spatially varying corruption, or mixed degradation. Real paired data and blind restoration tests are needed.
- 2 The efficiency frontier of non-local reasoning is unresolved: more blocks can improve PSNR but increase memory and latency. Sparse, low-rank, or windowed alternatives may retain global benefits more cheaply.
Applications
Immediate Applications
Camera and scanner denoising
Camera manufacturers can fine-tune RNAN on paired data matching a device’s sensor noise to process high-ISO photographs or scanned documents. Its selective attention is useful for textured regions, but deployment must profile the memory and latency cost of non-local blocks.
JPEG repair and demosaicing
Photo software and content platforms can use RNAN for upload preprocessing, Bayer reconstruction, and compression-artifact removal. The paper reports gains over IRCNN on McMaster18 and Kodak24, though production systems should calibrate training to their actual encoder and sensor pipeline.
Long-term Vision
Unified low-level vision enhancement
A future system could jointly model real noise, blur, compression, and low resolution, automatically identifying degradation and selecting local or global computation. Such a system could affect mobile photography, medical imaging, and remote sensing, but requires reliable data, efficient inference, and safety-oriented evaluation.
Abstract
In this paper, we propose a residual non-local attention network for high-quality image restoration. Without considering the uneven distribution of information in the corrupted images, previous methods are restricted by local convolutional operation and equal treatment of spatial- and channel-wise features. To address this issue, we design local and non-local attention blocks to extract features that capture the long-range dependencies between pixels and pay more attention to the challenging parts. Specifically, we design trunk branch and (non-)local mask branch in each (non-)local attention block. The trunk branch is used to extract hierarchical features. Local and non-local mask branches aim to adaptively rescale these hierarchical features with mixed attentions. The local mask branch concentrates on more local structures with convolutional operations, while non-local attention considers more about long-range dependencies in the whole feature map. Furthermore, we propose residual local and non-local attention learning to train the very deep network, which further enhance the representation ability of the network. Our proposed method can be generalized for various image restoration applications, such as image denoising, demosaicing, compression artifacts reduction, and super-resolution. Experiments demonstrate that our method obtains comparable or better results compared with recently leading methods quantitatively and visually.