Hard Negative Sample Mining for Whole Slide Image Classification

Wentao Huang, Xiaoling Hu, Shahira Abousamra, Prateek Prasanna, Chao Chen · DOI

Abstract

In digital pathology, Whole Slide Image (WSI) classification is a challenging task due to the massive scale of images and the absence of local annotations. Multiple Instance Learning (MIL) is the standard paradigm, but existing methods often struggle with computational efficiency and noisy feature representations during fine-tuning. This paper introduces a framework that leverages Hard Negative Sample Mining to identify the most informative patches from negative slides. Combined with a novel Multiple Instance Ranking loss ($L_{MIRank}$), the approach significantly enhances feature discriminability. Experimental results on the Camelyon16 and TCGA-LUAD datasets show that the proposed method achieves state-of-the-art accuracy while reducing training time by up to 83%.

Introduction

Digital pathology slides can contain billions of pixels, necessitating a Multiple Instance Learning (MIL) approach where slides are decomposed into smaller patches. While slide-level labels are available, patch-level ground truth is typically missing. Recent advancements have focused on self-supervised pre-training followed by MIL aggregation. However, fine-tuning these encoders often relies on pseudo-labels that treat all patches from negative slides as equally informative. This leads to high computational costs and suboptimal learning, as many negative patches are "easy" (e.g., background or healthy tissue) and do not provide useful information for refining the model's decision boundary.

Methods

The proposed framework addresses these inefficiencies through a three-stage iterative process designed to improve both accuracy and compute efficiency:

  1. Hard Negative Sample Mining: The model identifies "hard" negative patches—those from negative slides that receive the highest positiveness scores from the current MIL aggregator. By focusing on a small fraction (e.g., the top 5%) of these challenging samples, the model concentrates its learning capacity on the most ambiguous regions that are most likely to cause misclassification.
  2. Multiple Instance Ranking Loss ($L_{MIRank}$): To further refine the feature space, the authors introduce a hinge-based ranking loss. This loss explicitly forces the scores of the top $K$ patches from positive slides to be significantly higher than those from negative slides, creating a more robust margin between classes.
  3. Iterative Encoder Fine-tuning: The mined hard negatives and top positive patches are used to fine-tune the patch encoder via supervised contrastive learning. This improved encoder then provides more discriminative features for the next round of MIL training.
The proposed pipeline: WSI Tiling, Feature Extraction, MIL Training with $L_{MIRank}$, and Encoder Fine-tuning using mined hard negatives.

Experimental Results

The framework was evaluated on the Camelyon16 dataset for metastasis detection and the TCGA-LUAD dataset for gene mutation prediction (EGFR, KRAS, STK11, TP53).

As shown in the performance comparison below, the proposed method consistently outperforms existing state-of-the-art MIL frameworks such as DSMIL and ItS2CLR. On Camelyon16, the model achieved a peak AUC of 0.9604, surpassing the previous best of 0.9465. In the more complex task of mutation prediction on TCGA-LUAD, it demonstrated superior performance across all target genes.

Comparison of the proposed method against state-of-the-art baselines on Camelyon16 and TCGA-LUAD datasets.

Beyond accuracy, the method offers significant efficiency gains. By processing only a small fraction of negative patches, the fine-tuning time per iteration was slashed from 240 minutes to just 39 minutes—an 83% reduction in compute time. This efficiency makes iterative refinement feasible for large-scale clinical applications where processing billions of patches was previously a bottleneck.

Conclusion

This research demonstrates that "less is more" in the context of WSI fine-tuning. By intelligently mining hard negative samples and employing a ranking-based loss, the proposed framework achieves superior classification performance and interpretability while drastically lowering computational requirements. This approach paves the way for more efficient and accurate automated diagnosis in digital pathology, effectively finding the "needle in the haystack" by focusing on the most challenging parts of the data.

Summary updated

BibTeX
@inproceedings{huang2025hard,
  author = {Wentao Huang and Xiaoling Hu and Shahira Abousamra and Prateek Prasanna and Chao Chen},
  title = {{Hard Negative Sample Mining for Whole Slide Image Classification}},
  booktitle = {MICCAI},
  year = {2025},
  url = {https://openreview.net/forum?id=93KnREt5I3},
}
Figure