Quiz: from masks to objects
Before this unit: Day 36: Neural networks; Day 38: Evaluation and statistics; Day 39: Variational autoencoders.
See also: Day 15: Watershed; Day 5: Deconvolution; Day 35: Gaussian mixtures.
Short questions to test your understanding. Try each on paper first, then open the answer.
Q1. What is the difference between semantic, instance and panoptic segmentation of a tissue image with nuclei and stroma?
Which pixels get a class, which get an identity?
Semantic: every pixel gets a class (nucleus, stroma, background), but two touching nuclei are not told apart. Instance: every nucleus pixel gets the identity of its nucleus (nucleus 1, 2, …). Panoptic: both: every pixel has a class, and the countable “things” (nuclei) also have an identity; “stuff” (stroma, background) has only a class.
Q2. Why can a convolutional network not simply output “nucleus 1, nucleus 2, …” for each pixel?
How many output channels does it have, and does it treat positions differently?
It has a fixed number of output maps and does the same computation at every position, while the number of objects varies from image to image and the numbering of objects is arbitrary (any permutation of the labels is equally correct). So it predicts a map from which a classical step can separate the objects.
Q3. A three-class network (background / interior / boundary) misses a single boundary pixel between two touching cells. What happens to the objects?
The objects come from connected components of the interior.
The two interiors become connected through the missing pixel, so connected-component labelling gives one object: the two cells merge.
Q4. Why can a predicted distance map separate two touching nuclei where the distance transform of a thresholded mask cannot?
What has the network seen that the mask does not show?
If the mask of the two nuclei has no visible neck (it is one smooth blob), its distance transform has one peak. The network sees the image (a slightly darker contact line, texture, shape), and can predict a low value along the contact: two peaks, and the watershed separates them.
Q5. Which instance route is the worst choice for C-shaped cells, and why?
From which point is all of the border of a C visible along straight lines?
Star-convex polygons: a C-shape is not star-convex (no point sees all of its border along straight rays), so every pixel’s polygon covers only part of it; after suppression the cell is split into pieces or partly missed. Flows, whose paths bend inside the cell, handle it. Both routes in detail: StarDist, Cellpose.
Q6. You raise h in the distance route from 0.1 to 0.5 on an image with long cells and touching round nuclei. Which errors go down, which go up?
h is the minimum height a peak must have above its saddle to be a marker.
Splits of long cells go down (the small extra peaks on their ridges are no longer markers). Merges of touching nuclei go up when their neck is shallower than h.
Q7. (math) A prediction has 4 matched objects with IoU 0.9 each, no false positives and 4 missed objects. Compute SQ, RQ and PQ.
RQ = TP/(TP + \frac12 FP + \frac12 FN).
SQ = 0.9; RQ = 4/(4 + 0 + 2) = 0.667; PQ = 0.6. The segments that were found are good; half the objects were missed.
Q8. What is the advantage of looking at the predicted map, not only at the final labels?
Where does a merge or a split come from?
The map shows the cause: a faded boundary, a filled neck, a noisy ridge, arrows pointing at each other, a faint dim cell. The labels only show the consequence. Knowing the cause tells you whether to change the post-processing (threshold, h, steps) or whether the network itself must be improved (more training data of that kind).