Cubical Homology Computation: Persistence on Images
Published:
Cubical Complexes for Images
An elementary cube in \(\mathbb{R}^d\) is a product of intervals:
The dimension of \(Q\) is the number of non-degenerate factors \([a, a+1]\). A cubical complex \(K\) is a finite set of elementary cubes closed under faces.
For a 2D image of size \(m \times n\):
- 0-cubes (vertices): \(m \cdot n\) pixels.
- 1-cubes (edges): horizontal and vertical edges between adjacent pixels.
- 2-cubes (faces): unit squares between 4-adjacent pixels.
Total complex size: \(O(mn)\) — much smaller than the \(O(2^{mn})\) worst case for a full simplicial complex.
Sublevel Set Filtration
Given a scalar function \(f: \mathbb{R}^d \to \mathbb{R}\) (e.g., image intensity), the sublevel set filtration is:
\[K_t = \{Q \in K : f(Q) \leq t\}\]where \(f(Q)\) for a cube \(Q\) is typically defined as \(\max_{v \in \text{vertices}(Q)} f(v)\) — the maximum vertex value. This ensures monotonicity: \(K_s \subseteq K_t\) whenever \(s \leq t\).
The superlevel set filtration (filtering by \(f(Q) \geq t\)) is used for detecting “dark blobs” in images.
Boundary Maps for Cubes
The cubical boundary map is analogous to the simplicial case. For a 2-cube \([a, a+1] \times [b, b+1]\):
\[\partial_2 Q = [a, a+1] \times \{b\} - [a, a+1] \times \{b+1\} + \{a\} \times [b, b+1] - \{a+1\} \times [b, b+1]\]The sign conventions ensure \(\partial^2 = 0\), so cubical homology is well-defined.
Cubical Ripser
Cubical Ripser (Kaji et al. 2020) implements:
- Build the cubical filtration from pixel/voxel data.
- Apply the standard persistence algorithm with column reduction.
- Use the cohomology algorithm in the reverse direction for speedup.
Performance: On a \(256 \times 256\) image (65536 pixels), cubical persistence computation takes under 1 second. For a \(256^3\) volumetric image (~16 million voxels), it takes a few minutes — feasible for medical imaging workflows.
Applications
- Medical imaging: persistence diagrams of CT/MRI scans detect structural features (vessels, lesions) across scales.
- Materials science: 3D X-ray tomography of porous materials; the \(H_2\) diagram captures the birth/death of enclosed voids.
- Texture analysis: \(H_0\) and \(H_1\) persistence features from sublevel set filtrations distinguish textures better than histogram-based features.
- Change detection: comparing persistence diagrams of the same scene at different times detects structural changes.
References
- S. Kaji, T. Sudo, K. Ahara, “Cubical Ripser: Software for Computing Persistent (Co)homology of Image and Volume Data,” arXiv:2005.12692, 2020.
- T. Kaczynski, K. Mischaikow, M. Mrozek, Computational Homology, Springer, 2004.
- GUDHI Library: gudhi.inria.fr
