HMIL: Hierarchical Multi-Instance Learning for Fine-Grained Whole Slide Image Classification

Cheng Jin, Luyang Luo, Huangjing Lin, Jun Hou, Hao Chen · DOI

Introduction: The Challenge of Fine-Grained Pathology

In digital pathology, Whole Slide Images (WSIs) are massive, often containing billions of pixels. The standard computational approach is Multi-Instance Learning (MIL), where a slide is treated as a "bag" of small image patches, or "instances." While MIL has proven effective for binary tasks (e.g., distinguishing cancer from healthy tissue), it often struggles with fine-grained classification—the ability to differentiate between specific malignant subtypes.

A Whole Slide Image (WSI) partitioned into a grid of patches, representing the 'bag of instances' used in Multi-Instance Learning (MIL).

Most existing MIL models treat classification as a "flat" problem, ignoring the inherent hierarchical structure of medical labels (for instance, Invasive Carcinoma is a sub-category of Malignant Tumor). Previous attempts to incorporate this hierarchy typically required labor-intensive, patch-level manual annotations. The Hierarchical Multi-Instance Learning (HMIL) framework addresses this by leveraging hierarchical relationships using only slide-level labels.

Methodology: A Dual-Branch Hierarchical Approach

HMIL utilizes a dual-branch architecture consisting of a Coarse Branch and a Fine Branch. The core innovation lies in synchronizing these branches through four primary mechanisms:

  1. Hierarchical Attention Matching (HAM): This module employs a class-wise attention mechanism to ensure spatial consistency. It aligns the patches identified as important for coarse diagnosis (e.g., "Malignant") with those used for fine-grained diagnosis (e.g., "Invasive Carcinoma").
  2. Hierarchical Bag Alignment (HBA): HBA enforces logical consistency at the slide level. It ensures that the predicted probabilities of fine-grained classes correctly sum up to the probability of their parent coarse class, preventing contradictory model outputs.
  3. Supervised Contrastive Learning (SCL): To improve the separation of highly similar subtypes, SCL pulls together feature representations of slides with identical labels while pushing different ones apart in the latent space.
  4. Dynamic Weighting (DW) Strategy: HMIL employs a curriculum-based training strategy. Initially, the model focuses on the simpler coarse classification task. As training progresses, the DW strategy shifts the focus toward capturing subtle, fine-grained morphological details.

Experimental Evaluation

The authors evaluated HMIL across three diverse datasets representing different modalities and scales:

  • BRACS: A public histology dataset for breast cancer subtyping (547 WSIs).
  • PANDA: A large-scale public histology dataset for prostate cancer grading (10,616 WSIs).
  • CCC (Cervical Cytological Carcinoma): A massive in-house dataset of 33,528 cytology slides. Testing on cytology is significant as cell-based imaging presents distinct challenges compared to tissue-based histology.

Key Results and Insights

HMIL consistently outperformed state-of-the-art MIL baselines, including ABMIL, CLAM, and TransMIL.

  • Performance Gains: On the BRACS dataset, HMIL achieved 55.56% accuracy for fine-grained classification, a notable improvement over the ~51% typical of standard attention-based models. On the CCC dataset, it reached an AUC of 91.24.
  • Feature Representation: t-SNE visualizations demonstrated that HMIL produces tighter, more distinct clusters for different cancer subtypes. In contrast, "flat" models showed significant overlap between similar classes.
  • Hierarchy as Guidance: The results suggest that hierarchical relationships are not merely constraints but valuable sources of semantic information. By forcing the model to respect these relationships, it develops more robust features that are less susceptible to noise.

Limitations and Future Work

While HMIL marks a significant step forward, challenges remain. Sensitivity for rare or highly difficult fine-grained classes remains around 40% in some instances, indicating a need for better handling of subtle morphological variations. Future research may involve integrating pathology foundation models—pre-trained on millions of medical images—to further enhance feature extraction. Additionally, investigating the model's robustness across different medical centers and scanning hardware (domain adaptation) is a critical next step for clinical deployment.

Summary updated

BibTeX
@article{jin2025hmil,
  author = {Cheng Jin and Luyang Luo and Huangjing Lin and Jun Hou and Hao Chen},
  title = {{HMIL: Hierarchical Multi-Instance Learning for Fine-Grained Whole Slide Image Classification}},
  journal = {IEEE Trans. Medical Imaging},
  year = {2025},
  url = {https://openreview.net/forum?id=8cC79KPHk8},
}
Figure