Persistent Homology

A way to measure the shape of a point cloud — how cells cluster and ring — by growing balls around each point and recording which structures appear and disappear.

A way to measure the shape of a point cloud — how cells cluster and ring — by growing balls around each point and recording which structures appear and disappear as they grow.

What it is

Take the centroids of every cell in a field of view: a cloud of points. Counting them throws away everything about how they are arranged, yet arrangement is often what you are actually reading — sheets versus cords, rosettes, glandular rings, a dense cluster against a sparse background.

Persistent homology measures that arrangement. The construction is unexpectedly simple:

Put a ball of radius r around every point and let r grow from zero. At r = 0 you have isolated points. As the balls expand they touch and merge, so separate groups fuse into one; later, a ring of points can enclose a gap, creating a loop, and eventually the gap fills in. At each radius you have a shape, and you record two kinds of feature:

  • H0 — connected components. How many separate clusters exist at this radius. Every point starts as its own component and they merge as r grows.
  • H1 — loops. Closed rings with a hole in the middle, which appear when points encircle an empty region and die when the region fills.

Every feature is born at one radius and dies at another, giving a point (birth, death). Plotting all of them is the persistence diagram. Features far from the diagonal persisted across a wide range of scales and represent real structure; features hugging the diagonal appeared and vanished immediately and are noise. That separation is the whole idea, and it is why the method is called persistent homology.

Two practical parameters. The filtration is the recipe for growing the shape — the Vietoris–Rips filtration used here connects any set of points that are all pairwise within r. And r is usually capped at some maximum edge length ε, which sets the largest spatial scale considered. ε is measured in pixels, so it is tied to magnification.

To compare two point clouds you compare their diagrams, most commonly with the Wasserstein distance: match each point in one diagram to a point in the other as cheaply as possible, with unmatched points matched to the diagonal (i.e. treated as noise). The total matching cost is the distance. It is a genuine metric, so “these two arrangements differ by 3.2” is meaningful.

Why it matters for my work

It is a principled way to put a number on something pathologists judge by eye constantly and describe only qualitatively — architecture. A cell-count metric cannot distinguish twenty cells in a ring from twenty cells in a clump; a persistence diagram can.

The concrete instance in this wiki is Çakı et al., Med Image Anal 2026;113:104155, which uses the Wasserstein distance between the persistence diagrams of true and predicted cell centroids to decide which image regions a detection network is getting structurally wrong, and pushes training toward them. Notably, that work computes topology with gradients switched off — it uses the number as a weight rather than backpropagating through it, which avoids the fact that persistence is only piecewise-differentiable.

The scale dependence is the practical catch. ε is in pixels, so any topological feature is implicitly defined at a magnification — see Scanner and Stain Variability for the general version of that problem.

How it connects

Hard Example Mining — the training strategy that persistent homology is used to steer in the source paper; topology decides which examples are hard.

Cell Detection and Counting — the task where this becomes useful, because the failure mode in crowded tissue is architectural rather than pixel-wise.

Scanner and Stain Variability — ε is a pixel distance, so a topological descriptor tuned at one magnification does not transfer unchanged to another.

Intratumoral Heterogeneity — spatial variation in marker expression is a shape question too, and persistence diagrams are one of the few tools that summarise it without first imposing a grid or a region.

Open questions

  • Would this add anything to the group’s existing quantification work, where the readout is currently a proportion (Ki-67 index, HER2 score) rather than an arrangement? An architectural descriptor might carry information those indices discard.
  • H0 and H1 only. H2 (voids) is meaningless in 2D sections but would be defined on serial sections or 3D imaging.
  • No page yet on the alternative filtrations (cubical, on the image itself rather than on a point cloud), which is how most topological segmentation losses work. Worth adding if a second paper arrives.