Quiz: thresholds from noise statistics
Before this unit: Finding spots: filter, then local maxima (previous unit); Day 2: Edges, blobs and ridges.
See also: Day 3: Bit depth and noise; Day 4: Image formation; Day 13: Morphology; Day 38: Evaluation and statistics.
Short questions to test your understanding. Try each on paper first, then open the answer. “k” is a threshold in units of the noise standard deviation of the filtered image.
Q1. Why is a threshold in units of noise better than a threshold on raw grey values?
What changes when the exposure doubles?
Raw values change with exposure, gain, camera, illumination and the filter used; the same number means a different thing on every image. Dividing by the noise makes k a statement about probabilities (“how unusual is this for noise?”), which carries over between images and filters.
Q2. The pixel values of a background region are (4, -2, 1, 0, 30, -1, 2, -3, 0). Estimate the noise with the MAD. What would the ordinary standard deviation say?
Median first, then the median of the absolute deviations, then divide by 0.6745.
Sorted: -3, -2, -1, 0, 0, 1, 2, 4, 30, median 0. Absolute deviations sorted: 0, 0, 1, 1, 2, 2, 3, 4, 30, median 2. \hat\sigma = 2/0.6745 = 2.97. The ordinary standard deviation is 10.2, dominated by the single value 30 (a spot, not noise).
Q3. A pixel of pure noise exceeds 3 sd with probability 0.13 %. Why does a 512 × 512 image filtered at σ = 1.5 give about 100 false spots at k = 3, not 0.13 % of its maxima (about 6)?
Which pixels does the detector test?
The detector tests only local maxima, and a local maximum is the largest value of its neighbourhood: its distribution is shifted to higher values than that of an ordinary pixel. So the fraction of maxima above 3 sd is far larger than 0.13 % (about 2 %, 99 of 4 862).
Q4. At k = 4 a 512² image has about 4 false spots. How many do you expect in a 2048² image with the same filter and threshold? What k would bring it back to about 4?
False spots scale with the area. From k = 4 to k = 5 the count drops by about a factor 40.
16 times the area: about 16 \times 4.3 \approx 69. To get back to about 4 per image, raise k to about 4.7 (the Euler formula gives 4.4 false spots per 2048² image at k = 4.7). Bigger images need slightly higher thresholds for the same number of false spots per image.
Q5. With k = 4, noise sd 10 and spots of σ = 1.5, what is roughly the dimmest spot (peak amplitude) you can detect? What changes if you collect four times more light?
A_\text{min} \approx k\sigma_n/\sqrt{\pi\sigma^2}.
40/\sqrt{\pi \cdot 2.25} = 40/2.66 \approx 15 grey levels above the background. With four times the light, every spot’s signal is ×4 but the shot noise only ×2: all SNRs double, so spots half as bright as before (relative to the new exposure) now reach the threshold.
Q6. An image has Poisson noise and a bright region. With one global threshold, where do the false spots appear, and where are spots missed? Name two fixes.
Variance = mean.
The noise sd is larger where the background is bright. A global threshold (set from the typical, mostly dark, pixels) is too low there, so false spots cluster in the bright region; in dark regions it is too high relative to the local noise, so dim spots are missed. Fixes: a local noise estimate \sqrt{\text{gain} \cdot \text{background} + \text{read noise}^2} per pixel, or the Anscombe transform 2\sqrt{x + 3/8} before filtering.
Q7. Your camera adds a faint fixed stripe pattern, and you measure the noise with the MAD on the raw image. After filtering you get more false spots than predicted. Why?
\sqrt{\sum w^2} assumes independent pixels.
The stripes make the noise correlated: the filter averages independent noise down, but a pattern that is smooth along the stripes survives averaging. The predicted filtered noise \hat\sigma\sqrt{\sum w^2} is then too small, and the threshold too low. Estimate the noise on the filtered image itself (or on blank images taken with the same camera).
Q8. (math) Show that the median of |X - \mu| for X \sim \mathcal N(\mu, \sigma^2) is 0.6745\,\sigma.
P(|Z| \le c) = 2\Phi(c) - 1.
The median m satisfies P(|X - \mu| \le m) = \tfrac12, i.e. 2\Phi(m/\sigma) - 1 = \tfrac12, so \Phi(m/\sigma) = 0.75 and m = \Phi^{-1}(0.75)\,\sigma = 0.6745\,\sigma.