Single linkage cut its tree at one threshold; the watershed stopped when the markers’ floods met. Today we keep every merge: one tree that contains all segmentations at once.
Why a hierarchy: there is rarely one right scale.
The merge tree (dendrogram), and cutting it at a level.
Changing the merge order with attributes: altitude, dynamics, area, volume.
The ultrametric contour map: the whole hierarchy in one image.
Region adjacency graphs and greedy merging; the component tree.
Choosing a cut, and the failure modes.
Slides titled The math give the formulas and proofs; the ideas are complete without them.
The gradient watershed unit ended with a tree: merge watershed basins across their lowest pass, one pair at a time. Cutting that tree at a height h gave the same result as flooding from the h-minima.
The spanning-tree unit: Kruskal’s merge order is also a tree (single linkage).
Today this tree is the object of study, not a by-product.
Why a hierarchy
There is rarely one right scale: a part of a nucleus, a nucleus, a pair of touching nuclei, a cluster of cells.
Compute all segmentations at once, as a nested family: each one is obtained from the finer one by merging regions.
Decide later: by a threshold, by clicking, or by a measurement (size, shape, a score).
Right: one hierarchy of a synthetic nuclei image, cut at three levels. Of 18 true nuclei, 8, 13 and 7 are matched (IoU ≥ 0.5) at 60, 19 and 8 regions: no single level is right for all.
The merge tree (dendrogram)
Leaves = the initial regions (pixels, watershed basins, superpixels).
Each merge creates a parent node at the level where it happens.
Cut the tree horizontally at level t: every subtree below the cut is one region.
Raising t only merges, never splits: the partitions are nested.
Right: five basins a–e of a 1D landscape. Merged across their passes in increasing order: b+c at 4, then a at 5, d+e at 6, all at 7 (next slide, top tree). A cut between 5 and 6 gives \{a, b, c\}, \{d\}, \{e\}.
The MST already is a hierarchy
Kruskal’s merge order (the spanning-tree unit) is a merge tree: every “join” is a merge at level d. Cutting it at t is single linkage at t.
For watershed basins with pass heights, the same tree is the hierarchy by altitude: the order in which basins meet when the water rises.
Its weakness is the weakness of single linkage: a region merges as soon as one low pass connects it, whatever its size or depth.
The top tree on the next slide is this hierarchy for the five basins.
Changing the order: attributes
Same graph, same spanning tree, different order. Flood by altitude as before, but each time two regions meet, give that merge the attribute of the smaller one (the one that would disappear):
Then sort the merges by these new values. Five basins (right):
altitude: three regions \{a, b, c\}, \{d\}, \{e\};
dynamics: b (1), d (2), a (4), e (5): \{a\}, \{b, c\}, \{d, e\};
area: b (2), d (3), then \{d, e\} (9) before a (10): also \{a\}, \{b, c\}, \{d, e\}.
Attribute hierarchies as pseudocode
for each pass (p, q, h), lowest first: # flooding by altitude (Kruskal)
A = region of p, B = region of q
if A ≠ B:
value = smaller of attr(A), attr(B) # h − min, |C| or |C|·(h − min)
remember (p, q, value)
join A and B # keep their minimum and area
sort the remembered passes by value
build the merge tree from them (Kruskal again)
The same tree edges in a new order: only which merge comes first changes.
The math: extinction values and ultrametrics
Extinction values (Vachier & Meyer; Najman & Schmitt 1996). In the altitude flooding, when two components C_1, C_2 meet at pass h, the one with the smaller attribute A “dies”; its extinction value is \min(A(C_1), A(C_2)), with A = h - \min C (dynamics), |C| (area) or |C|(h - \min C) (volume). Re-weighting each MST edge by this value and sorting gives the attribute hierarchy. For dynamics, cutting it at h gives exactly the h-minima watershed.
Ultrametric. For a merge tree, let u(p, q) be the level at which p and q first share a region (their lowest common ancestor). Then u(p, r) \le \max\big(u(p, q),\ u(q, r)\big), because at level \max(u(p,q), u(q,r))p shares a region with q and q with r, and the regions at one level are disjoint. Conversely every ultrametric defines a hierarchy (its “balls” are nested). For the single-linkage tree, u is the minimax distance.
The ultrametric contour map
Give every boundary between two leaves the level at which it disappears (the ultrametric of the two leaves): one grey image, the UCM.
Thresholding the UCM at t gives the partition at t: boundaries brighter than t remain.
Strong, lasting boundaries are bright; boundaries that vanish early are dark.
Right: the micrograph’s dynamics hierarchy (310 basins), its UCM, and two thresholds. The best classical contour detectors of the 2010s output exactly such a map.
The math: UCM and closed contours
The thresholds \{\text{UCM} > t\} are nested: raising t removes boundaries, never adds them; each is the boundary set of the partition at t.
A contour map is a UCM (comes from some hierarchy) iff every threshold gives closed contours: no boundary piece ends in the middle of a region. A boundary with a dangling end would separate a region from itself.
Evaluating a hierarchy: compare every threshold of its UCM with the true boundaries (boundary precision–recall, object evaluation unit); the best single threshold and the best per-image threshold are both reported.
Region adjacency graphs
A region adjacency graph (RAG): one node per region, one edge per touching pair. Nodes and edges carry statistics: area, mean grey level, histogram; boundary length, lowest pass, mean gradient along the boundary.
Greedy merging: always merge the most similar adjacent pair, update the statistics of the new region and its edges, repeat. A priority queue with lazy updates (old entries are skipped when popped) keeps it fast.
Right: the RAG of the 115 basins of the nuclei image (one node per basin at its centroid; the big background basin is the hub in the middle).
Greedy merging by a region criterion
A 3 \times 3 grid of regions with means \begin{bmatrix} 10 & 12 & 30 \\ 11 & 25 & 31 \\ 40 & 26 & 50 \end{bmatrix} merged by difference of means (4-neighbours):
three pairs with difference 1: 10–11, 30–31, 25–26 (any order);
40 joins that group (mean 28): 12; then the two big groups (11 and 30.4): 19.4; finally 50: 26.9.
After each merge the means change, so the order is not known in advance: this is not single linkage. Variants: statistical region merging (merge when the difference is within what noise can explain) and binary partition trees (any merging criterion, recorded as a tree).
Cheapest edge leaks, mean difference does not
A bright disc (190) with one weak spot in its boundary (a gentle ramp), and a darker disc (110) with a sharp boundary.
Altitude (cheapest pass): the bright disc’s weak spot is the lowest pass in the image, so at 2 regions it has leaked into the background, while the dark disc stays separate.
Mean difference: the bright disc differs by 120 from the background, the dark one by 40: the dark disc merges first, the bright one stays (with the ramp wedge attached).
One weak pixel decides a minimum; it hardly changes a mean.
Try it: merge trees
Another tree: the component tree
Threshold the image at every level t and take the connected components of \{f \ge t\} (labelling unit). Raising t splits and shrinks components: they nest into a tree, the component tree (max-tree).
Region merging builds trees from edges (passes between regions); the component tree from thresholds (pixel values).
The leaves of the component tree of -f (min-tree) are the regional minima, the seeds of the basins; the two trees are closely related.
Attribute filters (keep components of a certain area or shape) are cuts of the component tree.
Choosing a cut
One global level: simplest; the same scale everywhere (the h-minima watershed is one such cut).
A different level per branch: choose, in each branch, the node that best fits a criterion (closest to an expected size or shape, highest score of a classifier). Every choice of nodes that covers each leaf exactly once is a valid segmentation.
Interactive: click a region to merge it up (replace it by its parent) or split it (replace it by its children).
Evaluate the whole hierarchy: the best possible cut for a known truth bounds what any cut rule can reach.
Failure modes
Greedy merging is final: an early wrong merge is never undone; everything above it inherits the mistake.
Attributes need a meaningful scale: area in pixels changes with the magnification; a fixed area threshold must be stated in µm².
Garbage leaves: a boundary missed by the initial regions (a basin that spans two objects) is missed by every level of the hierarchy.
The altitude hierarchy inherits leaks (one low pass); region criteria inherit chaining along ramps (the merged region’s mean drifts).
Summary
A merge tree records every merge with its level; cutting it gives nested partitions.
The MST/Kruskal order is the altitude hierarchy; attributes (dynamics, area, volume) re-order the merges of the same tree.
The ultrametricu(p, q) (level of the lowest common ancestor) satisfies u(p, r) \le \max(u(p,q), u(q,r)); the UCM stores the whole hierarchy in one image.
RAG merging with region statistics (difference of means) resists single weak pixels; it is greedy and final.
The component tree builds a hierarchy from thresholds instead of edges.
Where this leads
Superpixels: a few hundred compact leaves for the RAG.
Learned boundary probabilities as the RAG weights: instance segmentation agglomerates network predictions this way.
3D: supervoxel hierarchies for volumes (electron microscopy connectomics).