TDA for Computer Vision: Topology in Images and Shapes
Published:
Topological Features in Images
An image \(I: \{1,\ldots,m\} \times \{1,\ldots,n\} \to \mathbb{R}\) is a scalar function on a grid. Standard TDA applies directly:
- Sublevel set filtration \(I^{-1}((-\infty, t])\): as \(t\) increases from dark to bright, bright regions appear and merge.
- Superlevel set filtration \(I^{-1}([t, \infty))\): as \(t\) decreases, dark regions appear and merge.
The resulting \(H_0\) and \(H_1\) persistence diagrams capture:
- \(H_0\): bright blobs (each bar born when a bright region appears, dies when it merges with a brighter region).
- \(H_1\): dark rings or holes surrounded by bright tissue.
Texture Analysis
Adams et al. (2017) showed that persistence-based features significantly outperform classical texture descriptors (LBP, Haralick features) on:
- Distinguishing tumour types in histology images.
- Classifying materials by surface texture.
- Identifying cell types in microscopy.
The key insight: texture is inherently a multi-scale phenomenon (features at different granularities), and the persistence barcode naturally captures topology at all scales.
Medical Image Analysis
Retinal fundus images: The optic disc and blood vessels create characteristic topological patterns. \(H_1\) features capture vessel loop structure; changes in loop persistence correlate with diabetic retinopathy severity.
Brain MRI: White matter lesions disrupt the topological structure of white matter connectivity. Persistence diagrams of DTI tractography graphs detect early neurodegeneration before volume-based measures.
Histopathology: Cancer changes the topology of cell arrangements. Malignant tissue has more irregular hole patterns (high \(H_1\) persistence variance) than benign tissue.
Combining TDA with CNNs
Two integration strategies:
- Pre-computed features: Compute persistence images from raw data โ concatenate with CNN features โ classify.
- Topological regularisation: Add a topological loss to the CNN training objective (e.g., ensure segmentation masks have correct \(\beta_0, \beta_1\)).
Clough et al. (2020) used topological losses to train segmentation networks that produce topologically correct cardiac structures โ significantly reducing clinically problematic disconnected regions.
Shape Recognition
For 2D shape recognition (silhouettes, contours):
- Compute \(H_1\) persistence of the boundary curve under the curvature function.
- Curvature-based filtrations are invariant to rotation, translation, and scale.
- The resulting persistence diagrams are compact shape descriptors.
References
- H. Adams et al., โPersistence Images: A Stable Vector Representation of Persistent Homology,โ JMLR 2017.
- J. Clough, N. Byrne, I. Oksuz, V. Zimmer, J. Schnabel, A. King, โA Topological Loss Function for Deep-Learning Based Image Segmentation Using Persistent Homology,โ TPAMI 2022. arXiv:1910.01877.
- C. Chen, X. Ni, Q. Bai, Y. Wang, โA Topological Regularizer for Classifiers via Persistent Homology,โ AISTATS 2019.
