Quiz: edge-stopping diffusion (Perona–Malik)

Short questions to test your understanding. Try each on paper first, then open the answer. Perona–Malik: between two neighbours the flow is g(|d|)\,d (d = difference), with g_1(s) = e^{-(s/K)^2} or g_2(s) = 1/(1 + (s/K)^2).


Q1. With g_2 and K = 10, what is the conductivity for a difference of 5, of 10 and of 50?

g_2(s) = 1/(1 + (s/K)^2).

1/1.25 = 0.8, 1/2 = 0.5, 1/26 = 0.038. Differences of 5 are mostly smoothed, differences of 50 are almost insulated.


Q2. What does K \to \infty give? And K \to 0?

Look at g in both limits.

K \to \infty: g \to 1 for every difference: the heat equation, a Gaussian blur. K \to 0: g \to 0 for every non-zero difference: nothing moves, the image (with its noise) stays as it is.


Q3. Why can a Perona–Malik step make an edge steeper, although every single flow goes from the brighter to the darker pixel?

Compare the flows into and out of a pixel on the steep part, with the flux \phi(s) = s\,g(s).

Beyond s = K (for g_2) the flux s\,g(s) falls: a steeper difference passes less heat. A pixel just below the steep middle receives little from above (steep, small flux) but loses more to its gentler lower shoulder: it gets darker. The pixel just above loses little across the middle but receives more from its gentle upper shoulder: it gets brighter. The two move apart, so the middle steepens.


Q4. A ramp of slope 4 grey levels per pixel is smoothed with K = 3. What happens over many steps? And with K = 10?

Is the slope in the forward or the backward range?

K = 3: slope 4 > K is in the backward range everywhere, so tiny fluctuations decide where it sharpens; the ramp breaks into flat terraces with sharp steps between them (staircasing). K = 10: slope 4 is in the forward range, the ramp is smoothed (only its corners round off) and stays a ramp.


Q5. Why is a single bright noisy pixel a problem for classical Perona–Malik, and how does pre-smoothing help?

How large are its differences to its neighbours, compared with K?

If its height is well above K, its differences to all neighbours are in the “edge” range and g is almost 0: the pixel is insulated and stays (with g_1 practically forever). If g is computed from the image blurred with σ ≈ 1, the spike’s gradients are small (its height is spread out), so g \approx 1 there and the spike diffuses away; a real edge, which is long, still has a large smoothed gradient.


Q6. Why does Perona–Malik need a stopping time, while a Gaussian blur needs a σ? Are these the same kind of parameter?

What happens if you run forever?

Since g > 0 everywhere, heat leaks across every edge a little: run long enough and the image becomes flat. The stopping time, like σ, sets how much is smoothed, and like λ in regularisation it trades noise against detail: a regularisation parameter. The best value grows with the noise level.


Q7. What is the largest stable explicit time step for Perona–Malik in 2D, and why?

Compare the conductivity with that of the heat equation.

\Delta t \le 1/4, as for heat: g \le 1, so no pair of neighbours exchanges more than in the heat equation, and the step stays a weighted average with non-negative weights.


Q8. (math) For g_1(s) = e^{-(s/K)^2}, where does the flux \phi(s) = s\,g_1(s) peak?

Differentiate \phi.

\phi'(s) = (1 - 2s^2/K^2)\,e^{-s^2/K^2}, zero at s = K/\sqrt2. Differences above K/\sqrt2 \approx 0.71K are in the backward (sharpening) range for g_1; for g_2 the switch is at s = K.