Abstract
This paper introduces Scalar Function Topology Divergence (SFTD), a novel differentiable metric designed to compare the multi-scale topology of two functions while respecting their spatial localization. Traditional topological data analysis (TDA) methods, such as persistence barcodes, often suffer from a "localization problem" where they fail to distinguish between identical topological features located in different spatial regions. SFTD overcomes this by measuring topological divergence across a shared domain using an extended lattice structure. We demonstrate that SFTD serves as an effective loss function for 3D reconstruction and medical image segmentation, providing significant improvements in structural fidelity and computational speed compared to existing topological losses.
1. Introduction
In computer vision and medical imaging, comparing a predicted shape to a ground truth typically relies on pixel-wise metrics like the Dice score or Cross-Entropy. While effective for general overlap, these metrics are "topology-blind" — they do not explicitly penalize structural errors such as disconnected components or extraneous holes, provided the majority of pixels align.
Existing TDA tools like Persistence Barcodes can detect these structural discrepancies. However, they are often invariant to spatial transformations. For instance, a hole at the top of a predicted volume and a hole at the bottom of the ground truth would result in identical barcodes, leading a standard Wasserstein distance to report zero error. SFTD is specifically engineered to break this invariance, ensuring that topological features are not only present but also correctly localized.
2. Methodology: Scalar Function Topology Divergence
The core innovation of SFTD is the F-Cross-Barcode, which captures topological features that exist in one function $f$ but are missing or misplaced in another function $g$.
2.1 Graph and Lattice Doubling
To compare two functions, the authors construct a "doubled graph" or an extended $n+1$ dimensional lattice. This structure effectively "stacks" the two functions and introduces connections that allow topological features to be tracked between them.
2.2 Divergence Calculation and Differentiability
The SFTD is defined as the sum of the lengths of the "cross-intervals" in the $k$-th persistence barcode of this combined structure, raised to a power $p$. Crucially, the authors provide an algorithm for differentiating SFTD, allowing it to be integrated as a loss term in deep learning frameworks. This enables neural networks to directly optimize for topological consistency during training.
3. Experimental Evaluation
The authors evaluated SFTD across several challenging domains, including synthetic 2D/3D data, 3D shape reconstruction (red blood cells and cell nuclei), and 3D medical segmentation (BraTS 21).
3.1 Key Results
- Improved Reconstruction: Integrating SFTD into the SHAPR model for 3D red blood cell reconstruction reduced the 1-IoU error from 0.487 to 0.449.
- Superior 2D Performance: In 2D segmentation of cancer cells (Colon dataset), SFTD reduced topological errors ($\tau^{err}$) by up to 35% compared to Betti matching.
- Computational Efficiency: SFTD is approximately 35 times faster than Betti matching, making it a practical choice for large-scale 3D models.
- Higher-Order Homology: The paper demonstrates the practical use of $H_3$ (3D homology) by adding a 4th dimension to the lattice, allowing for the detection of complex 3D structural errors that lower-dimensional tools miss.
4. Conclusion and Future Work
SFTD provides a powerful, localized, and differentiable metric for topological comparison. By breaking the spatial invariance of traditional TDA, it ensures that 3D reconstructions and segmentations are structurally accurate in the correct locations. While the computational cost of persistent homology remains a consideration for very high-resolution volumes, SFTD's efficiency gains represent a significant step forward. Future work includes applying these tools to complex graph-based data and further exploring applications in geometric deep learning.
Summary updated