DnCNN and DRUNet: Denoising Networks

Definition:

DnCNN: Denoising CNN

DnCNN learns the residual noise n^=DnCNN(y)\hat{n} = \text{DnCNN}(y) rather than the clean image directly:

x^=yβˆ’n^,L=βˆ₯n^βˆ’(yβˆ’x)βˆ₯2\hat{x} = y - \hat{n}, \qquad L = \|\hat{n} - (y - x)\|^2

Architecture: Conv-ReLU + (Dβˆ’2)(D-2) Conv-BN-ReLU + Conv, all 3x3 with 64 channels. Typically D=17D = 17 layers.

class DnCNN(nn.Module):
    def __init__(self, channels=1, num_layers=17, features=64):
        super().__init__()
        layers = [nn.Conv2d(channels, features, 3, padding=1), nn.ReLU(True)]
        for _ in range(num_layers - 2):
            layers += [nn.Conv2d(features, features, 3, padding=1, bias=False),
                       nn.BatchNorm2d(features), nn.ReLU(True)]
        layers.append(nn.Conv2d(features, channels, 3, padding=1))
        self.net = nn.Sequential(*layers)

    def forward(self, y):
        return y - self.net(y)  # residual learning

Definition:

DRUNet: U-Net with Noise Level Map

DRUNet extends U-Net for blind denoising by concatenating a noise level map Οƒβ‹…1\sigma \cdot \mathbf{1} to the input:

x^=DRUNet([y,β€…β€ŠΟƒβ‹…1])\hat{x} = \text{DRUNet}([\mathbf{y},\; \sigma \cdot \mathbf{1}])

This allows a single model to handle any noise level. Architecture: 4-level U-Net with residual blocks at each scale.

# Input: (B, C+1, H, W) where last channel is sigma map
noise_map = torch.full((B, 1, H, W), sigma)
x_input = torch.cat([noisy, noise_map], dim=1)
denoised = drunet(x_input)

DRUNet is the backbone of many plug-and-play (PnP) algorithms for inverse problems (see Chapter 33).

Example: Why Residual Learning Works for Denoising

Explain why learning n^\hat{n} is easier than learning x^\hat{x}.

CNN Denoiser Comparison

ModelArchitectureNoise HandlingParametersUse Case
DnCNN17-layer plain CNNFixed sigma~556KSimple known-noise denoising
DRUNetU-Net + residual blocksAny sigma (noise map input)~32MPnP algorithms, blind denoising
FFDNetDownsampled + CNNSigma map input~485KFast flexible denoising

Historical Note: DnCNN: CNN Meets Image Denoising

2017

Zhang et al. (2017) showed that a simple CNN with residual learning and BatchNorm could match or exceed traditional denoising methods (BM3D) that had been state-of-the-art for a decade. This paper demonstrated that deep learning could compete with hand-crafted algorithms in low-level vision.