Quiz: superpixels
Before this unit: Hierarchical segmentation and merge trees (previous unit); Day 27: Graph cuts; Day 15: Watershed.
See also: Feature spaces & k-means (day 35); Day 28: Ising model and Markov random fields; Day 35: Gaussian mixtures.
Short questions to test your understanding. Try each on paper first, then open the answer.
Q1. Name two reasons to segment superpixels instead of pixels, and the main risk.
Size of the graph; what happens to a missed boundary?
Reasons: a much smaller graph (hundreds of nodes instead of tens of thousands, so graph cuts, walkers and hierarchies are cheap), and regions on which features (means, histograms, texture) are more stable than on single pixels. Risk: a boundary that no superpixel follows is lost for every later step.
Q2. SLIC with N = 65\,536 pixels and K = 1024 superpixels: what is the grid spacing S, and the size of each centre’s search window?
S = \sqrt{N/K}.
S = \sqrt{64} = 8 pixels; each centre searches a 2S \times 2S = 16 \times 16 window.
Q3. What happens to SLIC superpixels when you increase the compactness m?
Which term of D^2 grows?
The position term (m\,d_s/S)^2 dominates: superpixels become more regular (near-squares on a grid) and follow colour edges less; weak edges are ignored. Small m gives ragged superpixels that follow every edge and texture.
Q4. Why does SLIC need a connectivity clean-up after k-means?
Does the distance D know anything about connectedness?
Each pixel is assigned to its nearest centre independently; nothing forces the pixels of one label to touch each other. With noise or small m a label can be scattered into fragments. The clean-up keeps each label’s largest piece and gives the orphan pieces to a neighbouring superpixel.
Q5. Why is SLIC’s cost per iteration independent of K?
How many windows cover a pixel?
Windows of side 2S on a grid of spacing S overlap so that each pixel lies in about 4 of them, whatever K is. So each iteration computes about 4N distances, while plain k-means computes NK.
Q6. The achievable segmentation accuracy of a set of superpixels is 0.97. A classifier labels the superpixels and reaches a pixel accuracy of 0.96. Could a better classifier reach 0.99?
What does “achievable” mean here?
No. Any method that gives each superpixel one label is at most 0.97 accurate (the majority label of every superpixel). To do better you need finer or better superpixels, or a pixel-level method.
Q7. Superpixels with high boundary recall but a high under-segmentation error: how is that possible?
Recall checks true boundaries; the error checks superpixels.
Boundary recall only asks whether every true boundary has a superpixel boundary nearby. Very many, ragged superpixel boundaries achieve that easily, even if some superpixels still spill across a true boundary somewhere else (counted by the under-segmentation error). Both measures are needed (and ragged boundaries also lower boundary precision).
Q8. (math) Show that, for fixed assignments, moving a SLIC centre to the mean of its pixels (in colour and position) minimises the cluster’s sum of D^2.
D^2 is a weighted sum of squares.
\sum_p D^2(p, \mathbf c) = \sum_p \lVert\mathbf f_p - \mathbf f\rVert^2 + \frac{m^2}{S^2}\sum_p\lVert\mathbf x_p - \mathbf x\rVert^2, with \mathbf c = (\mathbf f, \mathbf x). The two parts depend on separate coordinates; each is a convex quadratic minimised where its gradient vanishes: \sum_p(\mathbf f_p - \mathbf f) = 0 and \sum_p(\mathbf x_p - \mathbf x) = 0, i.e. at the means. The weight m^2/S^2 does not move the minimum.