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}$$
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 (Gaussian) smoothing:
Based on assumptions that we make on the noise, we can analyse the accuracy of such a filter.
For example, let: $$\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.$$
Median filter
Fourier domain
An alternative view on the Gaussian filter is to consider it as weighting in the Fourier domain:
Wavelet transform
Singular value decomposition
Many of the approaches mentioned earlier can be modelled in this way:
We can adapt these formulations based on the noise model. In that case, $\lambda$ the balances noise level and regularity.
Assume that $\mathbf{f}^\delta \sim N(\mathbf{f}, \sigma^2 I)$ and $\mathbf{f} \sim N(0, (LL^T)^{-1})$. Then a (Bayesian) MAP estimate is obtained by solving $$\min_{\mathbf{f}} {\textstyle\frac{1}{2\sigma^2}} \|\mathbf{f}-\mathbf{f}^\delta\|_2^2 + {\textstyle\frac{1}{2}}\|L\mathbf{f}\|_2^2.$$
A well-known example is Total Variation 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.$$