Quiz: pixel classification with a forest

Short questions to test your understanding. Try each on paper first, then open the answer.


Q1. What is a pixel’s feature vector in pixel classification, and where do the training points come from?

One number per channel of the stack.

The values of the pixel in every channel of the feature stack (each filter family at each scale): typically a few dozen numbers describing its brightness, edges, blobs, ridges and texture around it. The training points are the painted pixels, with the class of the stroke they belong to.


Q2. Why use several scales σ for each filter family?

How large are the structures, and how far does a pixel need to “see”?

Structures come in different sizes: a 2-pixel membrane, a 30-pixel nucleus, a texture of fine grains. Small scales capture fine detail and texture; large scales capture context (is this pixel inside a large bright object?). The forest picks whichever channels help; it does not need to be told the right scale.


Q3. The OOB accuracy on your painted pixels is 99.9 %. Why should you not believe it?

What is next to an out-of-bag pixel?

Neighbouring pixels in a stroke are near copies; an OOB pixel’s neighbours were in the bootstrap sample, so the trees have effectively seen it. Moreover, the strokes are where labelling was easy. Evaluate on a held-out region (or image) with full labels.


Q4. The uncertainty map is dark (confident) inside a group of cells you never painted. Does that mean they are classified correctly?

What can the forest say about a class it has never seen?

No. The forest can only choose among the classes it was shown; if the unknown cells resemble one of them, all trees agree on it and the map is confident. Uncertainty is high where known classes meet, not where something new appears. Look at the image (or the truth) and add a class or strokes.


Q5. Name the feature family you would rely on to separate a granular region from a smooth region of the same mean brightness.

Smoothing removes the difference.

Texture (structure-tensor eigenvalues) or edges (gradient magnitude) at small σ: the granular region has strong local gradients everywhere, the smooth one does not. Smoothed intensity at large σ is the same for both.


Q6. You paint 5000 background pixels and 50 nucleus pixels. What happens to ambiguous pixels, and what are two remedies?

Who wins the majority in a mixed leaf?

Mixed leaves are dominated by background, so ambiguous pixels (dim nuclei, rims) are called background. Remedies: weight each class by 1/n_c (balance), or sample the same number of pixels per class; better still, paint more nucleus strokes on the hard cases.


Q7. How can a graph cut improve a pixel classification?

What does the forest ignore about neighbouring pixels’ labels?

The forest labels each pixel on its own, so its result can be speckled. A graph cut uses -\log P(\text{class} \mid \text{features}) as the data term and adds a smoothness term that makes neighbours prefer the same label: isolated wrong pixels disappear and boundaries become clean.


Q8. (math) 300 background and 30 nucleus pixels. Give the balancing weights w_k = n/(K n_k) and the weighted P(\text{nucleus}) of a leaf with 6 background and 3 nucleus pixels.

n = 330, K = 2.

w_{\text{bg}} = 330/600 = 0.55, w_{\text{nuc}} = 330/60 = 5.5. Leaf: P(\text{nucleus}) = 3 \cdot 5.5/(3 \cdot 5.5 + 6 \cdot 0.55) = 16.5/19.8 = 0.83 (unweighted: 3/9 = 0.33).