Quiz: Bayesian image denoising

Short questions to test your understanding. Try each on paper first, then open the answer. Posterior energy E(L) = \sum_p D_p(L_p) + \lambda\sum_{(p,q)}[L_p \ne L_q]; with flip noise \varepsilon, a label that disagrees with the observed pixel costs \log\frac{1 - \varepsilon}{\varepsilon}.


Q1. Where do the two terms of the posterior energy come from?

Bayes’ rule, then -\log.

p(L \mid \mathbf y) \propto p(\mathbf y \mid L)\,p(L). The data term is -\log of the likelihood (the noise model); the smoothness term is -\log of the Ising prior (images have few disagreeing neighbours). -\log turns the product into a sum.


Q2. Flip noise with \varepsilon = 0.01 versus \varepsilon = 0.3: in which case does the data term weigh more, and why does that make sense?

Compute \log\frac{1 - \varepsilon}{\varepsilon}.

\varepsilon = 0.01: \log 99 = 4.6; \varepsilon = 0.3: \log(7/3) = 0.85. With rare flips an observed pixel is very likely right, so overriding it is expensive; with frequent flips the prior must do more of the work.


Q3. What is the difference between the MAP and the MPM estimate? Which one makes fewer wrong pixels on average?

One decides the whole image jointly, the other each pixel separately.

MAP: the single most probable image (lowest energy). MPM: for each pixel, its more probable value under the posterior marginal. The MPM minimises the expected number of wrong pixels; the MAP maximises the chance that the whole image is right.


Q4. Why does ICM get stuck, and why does annealing not?

What moves does each method allow?

ICM only makes single-pixel changes that lower the energy, so it stops as soon as no single change helps: a local minimum (e.g. a small clump of noise pixels that support each other). Annealing samples at T > 0, which also accepts uphill moves; if cooled slowly it can leave such minima before T gets low.


Q5. How is the marginal p(L_p = 1 \mid \mathbf y) obtained in practice, and what is it good for besides the MPM?

Unit 2.

Run a Gibbs sampler on the posterior at T = 1, discard the burn-in, and count the fraction of sweeps in which L_p = 1. It is an uncertainty map: values near 0.5 mark pixels the model cannot decide, typically along edges and in thin structures.


Q6. For binary denoising, the exact MAP can be computed with one minimum cut. Why then compare ICM, annealing and mean field at all?

Think of other models, and of the MPM.

The cut works only for binary labels with \lambda \ge 0; for more labels or other priors the iterative methods are what is available. And the exact MAP is not always the best image: with a large \lambda it removes thin structures that approximate methods (or the MPM) keep. The cut is the reference for judging optimisers, not the answer to every question.


Q7. You increase \lambda. In which order do a disc of radius 20, a 3-pixel-wide line and a 1-pixel line disappear from the MAP?

Gain grows with area, cost with boundary length.

The 1-pixel line first (two boundaries per unit length against one pixel of data gain), then the 3-pixel line (two boundaries against three pixels), the disc last (its area grows faster than its perimeter). This is the shrinking bias of the graph-cut day.


Q8. (math) For flip noise in spin form, what is the field h_p of the posterior Ising model?

h_p = \tfrac12\log\frac{1 - \varepsilon}{\varepsilon}\,y_p: the observed spin, weighted by half the log-odds of a correct observation. \log p(y_p \mid x_p) = \text{const} + h\,x_py_p.