PHG-Net: Persistent Homology Guided Medical Image Classification

Yaopeng Peng, Hongxiao Wang, Milan Sonka, Danny Z. Chen

TL;DR

PHG-Net is a novel framework that enhances medical image classification by integrating Persistent Homology (PH)—a tool from topological data analysis—directly into CNN and Transformer architectures. By treating topological features like connected components and loops as learnable point clouds, the model captures critical anatomical structures that standard pixel-oriented networks often overlook.

What Problem Does This Paper Address?

Modern deep learning models, such as Convolutional Neural Networks (CNNs) and Vision Transformers, are incredibly effective at identifying textures and local patterns. However, they often struggle to grasp the "global shape" or topology of anatomical structures.

In medical imaging, topology matters. The number of connected components, the presence of loops (like vascular structures), or voids (like cysts) are often key clinical indicators of disease. Standard networks tend to optimize for pixel intensities and local gradients, potentially neglecting these robust, scale-invariant anatomical features. While previous attempts have tried to incorporate topology, they often relied on rigid mathematical summaries that were difficult to integrate into end-to-end neural network training.

Methods

The authors propose PHG-Net, which bridges the gap between topological data analysis and deep learning through three main components:

  1. Cubical Persistent Homology: For every input image, the system performs a "sub-level filtration." Imagine gradually increasing a threshold on pixel intensity; as the threshold rises, different structures (islands of pixels or holes) are "born" and eventually "die" (merge or fill in). This process is captured in a Persistence Diagram (PD). The process of sub-level filtration and the resulting Persistence Diagram.
Figure 2. Illustrating the process of sub-level filtration. (a) A 3D plot of the sub-level set filtration of pixel intensities of a crop in an H&E stained image. The corresponding hematoxylin channel of the crop is projected on the xy plane. The z-axis is for threshold values. The red plane corresponds to one 2D slice of the 3D plot at threshold = 150. (b) Three thresholded binary images of the cropped image. As the threshold value increases or decreases, some connected components or loops are born or die. (c) The computed persistence diagram of the image crop (blue points denote the 0-D persistent homology (H0), and orange points denote the 1-D persistent homology (H1)).
  1. Learnable PD Encoder: Persistence Diagrams are essentially sets of points, which are difficult to feed into standard networks because the order of points shouldn't matter (permutation invariance). Inspired by PointNet, the authors designed a dedicated PD Encoder using Multi-Layer Perceptrons (MLPs) and max-pooling to transform these topological point sets into a fixed-length feature vector. The architecture of the PD Encoder and the guided residual block.
Figure 3. Illustrating (a) our persistence diagram encoder and (b) a persistent homology guided residual block (FC block). ⊙and ⊕are matrix multiplication and summation, respectively.
  1. Multi-Scale Guidance: Instead of just concatenating topological features at the very end of the network, PHG-Net injects them into multiple stages of the vision backbone (CNN or Transformer). A gating mechanism (FC block) allows the network to learn how to refine its visual feature maps using these topological cues at different scales. The overall PHG-Net pipeline showing multi-stage integration.
Figure 1. Illustrating the pipeline of our proposed PHG-Net. The details of the PD encoder are shown in Fig. 3(a). A fully connected block (FC block) is a two-layer MLP shown in Fig. 3(b). The blue points in a persistence diagram denote the 0-dimensional persistent homology (H0), and the orange points denote the 1-dimensional persistent homology (H1). VisionLoss and TopoLoss represent the vision loss and topological loss, respectively. ⊙denotes matrix multiplication. We use a CNN backbone for illustration.

Datasets

The model was evaluated on three diverse public medical datasets:

  • ISIC 2018: A large-scale dataset for skin lesion classification (7 classes).
  • Prostate Cancer Classification: H&E stained histology images focused on identifying Gleason patterns.
  • CBIS-DDSM: A curated mammography dataset for distinguishing benign vs. malignant masses.

Key Insights and Ideas

  • Topology as a Point Cloud: One of the "aha" moments is treating the Persistence Diagram not as a static summary, but as a point cloud that can be processed by a learnable neural network. This makes the topological extraction data-driven and task-specific.
  • Multi-Scale Refinement: The authors found that injecting topological information into early and middle layers of a network is far more effective than "late fusion" at the final layer. This allows the network to use topological context to refine its understanding of visual features as they are being built.
  • Lightweight but Powerful: The PD Encoder is remarkably small compared to the vision backbones, yet it provides a significant performance boost, proving that a little bit of structural "prior knowledge" goes a long way.

Key Results

PHG-Net demonstrated consistent improvements across all backbones (ResNet152, SENet154, and Swin Transformer v2).

  • Prostate Cancer: The SwinV2-B backbone saw an accuracy jump from 95.21% to 98.64% when equipped with PHG.
  • CBIS-DDSM: Accuracy improved from 73.51% to 77.23%, with significant gains in sensitivity and specificity.
  • Statistical Significance: The authors reported p-values (often < 0.001), confirming that the improvements were not due to chance but to the effective capture of topological features.

Qualitative heatmaps (Grad-CAM) showed that PHG-Net helps the model focus more accurately on the actual clinical targets, such as the specific arrangement of nuclei in cancer slides, rather than background noise.

Limitations and Future Work

While the results are promising, the paper notes a few areas for growth:

  • Computational Complexity: While the PD Encoder is lightweight, calculating the initial Persistence Diagram using cubical homology can be computationally intensive for very high-resolution images.
  • 2D vs 3D: The current work focuses on 2D images. Extending this to 3D medical data (like CT or MRI scans) would allow the model to capture $H_2$ features (voids/cavities), which could be even more informative for certain pathologies.
  • Filtration Functions: The study primarily uses pixel intensity for filtration. Future work could explore using other features, like edge maps or specific color channels, as the basis for the topological analysis.

Summary updated

Abstract

Modern deep neural networks have achieved great successes in medical image analysis. However, the features captured by convolutional neural networks (CNNs) or Transformers tend to be optimized for pixel intensities and neglect key anatomical structures such as connected components and loops. In this paper, we propose a persistent homology guided approach (PHG-Net) that explores topological features of objects for medical image classification. For an input image, we first compute its cubical persistence diagram and extract topological features into a vector representation using a small neural network (called the PH module). The extracted topological features are then incorporated into the feature map generated by CNN or Transformer for feature fusion. The PH module is lightweight and capable of integrating topological features into any CNN or Transformer architectures in an end-to-end fashion. We evaluate our PHG-Net on three public datasets and demonstrate its considerable improvements on the target classification tasks over state-of-the-art methods.
BibTeX
@inproceedings{peng2024phg,
  author = {Yaopeng Peng and Hongxiao Wang and Milan Sonka and Danny Z. Chen},
  title = {{PHG-Net: Persistent Homology Guided Medical Image Classification}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2024},
  doi = {10.1109/wacv57701.2024.00741},
}
Figure