Quiz: star-convex polygons
Before this unit: Day 41: Modern deep learning; Day 38: Evaluation and statistics.
See also: Day 15: Watershed; Day 10: Edge-preserving smoothing and PDEs; Day 27: Graph cuts.
Short questions to test your understanding. Try each on paper first, then open the answer.
Q1. What does the network predict for one pixel (one grid cell), and how many numbers is that for the usual setting?
One number says how good the pixel’s proposal is; the others describe the proposal.
An objectness (how central the pixel is in its nucleus: 1 at the centre, near 0 at the border, 0 outside) and the distances along 32 fixed directions to the border of its nucleus: 1 + 32 = 33 numbers. The rays define a polygon; the objectness is its score. In practice the network outputs them on a grid of one cell per 2 × 2 pixels.
Q2. Every pixel inside a nucleus proposes a polygon. Why are the proposals ranked by objectness and not by a plain “is this a nucleus” probability?
Compare the rays of a pixel in the middle with those of a pixel one step from the border.
All pixels inside are “nucleus” with the same probability, but they are not equally good proposers. A central pixel sees its nucleus evenly; a border pixel has very short rays on one side and long ones across the nucleus. Its far side is covered by few rays, and long rays are hard to predict. The objectness (the distance to the background, normalised per nucleus) is high exactly where the polygon is reliable. Sorting by it makes greedy NMS keep the central, good polygon first.
Q3. Which of these shapes can be described exactly (up to the ray sampling) by the rays from one point: a disc, an L-shape, a C-shape, a ring, a five-pointed star? For the ones that can, from where?
Star-convex: one point sees the whole border along straight lines.
Disc: yes, from any inner point (it is convex). L-shape: yes, from the square where its two arms meet, but not from the end of an arm. Five-pointed star: yes, from its centre (and points near it). C-shape and ring: no; from every point some part is hidden behind the gap or the hole. Such shapes are split into pieces or cut off.
Q4. You lower the NMS overlap threshold from 0.3 to 0.02 on a dense image. What happens? And if you raise it to 0.9?
A polygon is deleted if its IoU with a kept polygon is above the threshold.
At 0.02 almost any overlap deletes a polygon. Touching neighbours, whose polygons overlap a little along the contact, get deleted: lost nuclei (FN). At 0.9 only nearly identical polygons are deleted. Proposals of the same nucleus from different pixels, which overlap by 0.7–0.9, survive as duplicates (FP). With the real network on the dense sample: 305 objects at 0.3, 286 at 0.02, 432 at 0.9.
Q5. Two round nuclei touch along a short contact. Why does polygon NMS at 0.3 keep both, while two touching diagonal rods can be a problem for box NMS?
How much do the two polygons overlap? And the two bounding boxes?
Each nucleus has its own objectness peak, and each central polygon follows its own nucleus. The two polygons meet only along the contact, so their IoU is near 0, far below 0.3. A box follows the axes, not the object: two touching diagonal rods have boxes that overlap a lot (IoU 0.36 in the lecture’s example; more for longer rods), so box NMS may delete one of them.
Q6. The network trained on fluorescence nuclei finds 0 of 70 nuclei in an H&E histology image. Is that a failure of the polygon representation? What would you try?
What do nuclei look like in fluorescence, and what in H&E?
No. The nuclei are round enough to be star-convex. It is a failure of the training data: in fluorescence, nuclei are bright on dark; in H&E they are dark on bright, so the network outlines the bright gaps instead. Try inverting the image (and one colour channel instead of the grey average), but the real fix is a model trained (or fine-tuned) on annotated H&E images.
Q7. (math) Four rays of equal length r, every 90°. What polygon is it, and what is its area? Check with the formula A = \tfrac12\sin\tfrac{2\pi}{n}\sum_k r_k r_{k+1}.
The tips are at (r, 0), (0, r), (-r, 0), (0, -r).
A square standing on a corner, with diagonal 2r, so area (2r)^2/2 = 2r^2. Formula: \tfrac12 \sin 90° \cdot 4r^2 = 2r^2. Compared with the disc of radius r it covers 2/\pi = 64\,\%: four rays are far too few for a round nucleus.