All models are wrong, but some are useful.
- George Box
For today, we focus on grey-scale images represented as 2D arrays $F \in \mathbb{R}^{n\times n}$ or 1D arrays $\mathbf{f}\in\mathbb{R}^{n^2}$.
Additive Gaussian noise:
$$f_i\sim N (\overline{f}_i,\sigma^2)$$
Poisson noise:
$$f\sim P(\overline{f}_i)$$
Salt-and-Pepper:
$$f_i = \begin{cases} 0 & \text{with probability } p/2 \\ 1 & \text{with probability } p/2\\ \overline{f}_i & \text{with probability } 1-p \end{cases}$$
Note the truncation of the signal. It's an additional factor complicating the noise model!
We need a way to judge the quality of an image. Which metric is suitable is highly application (and community) dependent.
We discern methods with and without a reference:
Getting rid of noise is easy, it's keeping the useful bits that is hard.
- This lecture
Suppose we have a noisy version, $F^\delta$, of $\overline{F}$ and a method to denoise the image: $$\widetilde{F} = \mathcal{R}(F^\delta).$$
If $\mathcal{D}$ is a metric we can decompose the error as $$\mathbb{E} \mathcal{D}\bigl(\mathcal{R}(F^\delta),\overline{F}\bigr) \leq \underbrace{\mathcal{D}\bigl(\mathcal{R}(\overline{F}),\overline{F}\bigr)}_{\text{bias}} + \underbrace{\mathbb{E} \mathcal{D}\bigl(\mathcal{R}(F^\delta),\mathcal{R}(\overline{F})\bigr)}_{\text{variance}}.$$
The ideal denoiser has both a small bias and is stable.
Local smoothing:
Gaussian filter
The Gaussian filter kernel: $G_{pq} = \frac{1}{2\pi\sigma^2} e^{-\frac{p^2 + q^2}{2\sigma^2}}$
Theoretical analysis
Based on assumptions that we make on the noise, we can analyse the accuracy of such a filter.
For example, let's use a simple five-point filter: $$\widetilde{F}_{i,j} =(1-4\alpha)F_{i,j}^\delta + \alpha(F_{i+1,j}^\delta + F_{i-1,j}^\delta + F_{i,j+1}^\delta + F_{i,j-1}^\delta)$$
Assuming that $F^\delta_{ij} \sim N(\overline{F}_{ij},\sigma^2)$ we have $$\mathbb{E}\|\widetilde{F} - \overline{F}\|_2^2 \leq \left(1 - 8\alpha + 20\alpha^2\right)n^2\sigma^2 + \alpha^2 \|\nabla^2 \overline{F}\|_2^2.$$
Assuming that $F^\delta_{ij} \sim \text{Poisson}(\overline{F}_{ij})$ we have $$\mathbb{E}\|\widetilde{F} - \overline{F}\|_2^2 \leq \left(1 - 8\alpha + 20\alpha^2\right)\|\overline{F}\|_1 + \alpha^2 \|\nabla^2 \overline{F}\|_2^2.$$
Simulated experiment
The dashed curves show the theoretical upper error bounds, while the points are empirical averages over repeated noise realisations.
Small $\alpha$ reduces variance, while larger $\alpha$ increases bias for the five-point filter.
With more noise, the optimal $\alpha$ is larger (more smoothing).
Median filter
Fourier domain
An alternative view on the Gaussian filter is to consider it as weighting in the Fourier domain:
Fourier domain provides an intuitive representation for constructing different filter types:
Wavelet transform
Singular value decomposition
Usually, the singular values for the clean image decay rapidly, while the noise has a flatter spectrum (less structure):
This allows us to denoise the image by keeping only the components with the largest singular values:
We can adapt this formulation based on the noise and object model. Common examples:
Many of the denoising approaches mentioned earlier can be modelled in this way:
A well-known example is Total Variation (TV) denoising with:
$$\mathcal{D}(\mathbf{f},\mathbf{f}^\delta) = \|\mathbf{f} - \mathbf{f} ^\delta\|_2^2, \quad \mathcal{R}(\mathbf{f}) = \|\nabla \mathbf{f}\|_1.$$