Pathology-Knowledge Enhanced Multi-instance Prompt Learning for Few-Shot Whole Slide Image Classification

Linhao Qu, Dingkang Yang, Dan Huang, Qinhao Guo, Rongkui Luo, Shaoting Zhang, Xiaosong Wang

Abstract

This paper introduces PEMP (Pathology-knowledge Enhanced Multi-instance Prompt Learning), a novel framework designed to address the challenge of classifying massive Whole Slide Images (WSIs) with extremely limited labeled data. By integrating expert pathology knowledge into Vision-Language Models (VLMs) like CLIP, PEMP utilizes both visual examples and descriptive text as multi-scale prompts. The system achieves state-of-the-art performance in few-shot cancer prognosis and rare tumor classification tasks by bridging the gap between general-purpose visual features and specialized medical intuition.

Introduction

Deep learning models for pathology often face a "few-shot" bottleneck. Clinical data is frequently scarce due to patient privacy, the rarity of certain diseases, and the high cost of expert annotation. While standard Multi-instance Learning (MIL) treats a slide as a "bag" of thousands of small image patches, it typically requires large datasets to generalize effectively. Vision-Language Models (VLMs) offer a promising starting point, but they often lack the domain-specific knowledge required to distinguish subtle pathological patterns—such as the difference between "fuzzy" and "clear" tumor boundaries—without explicit guidance.

Conceptual overview of the PEMP framework, illustrating the alignment of visual and textual prompts at both slide and patch levels.

PEMP addresses this by mimicking the learning process of human pathologists: combining visual observation of textbook examples with descriptive textual knowledge. This multi-level prompt learning strategy allows the model to "learn" from a handful of examples by anchoring them to expert-defined concepts.

Methodology

The PEMP framework employs a two-level architecture that operates at both the patch-level (focusing on local cellular features like atypia) and the slide-level (focusing on global structural features like tumor stroma ratio).

Detailed architecture of PEMP, showing the visual and textual prompt learning modules and the two-level alignment via contrastive learning.

Key technical components include:

  1. Knowledge-Enhanced Prompts: The model uses expert-curated static prompts consisting of actual visual examples of high-risk and low-risk patterns alongside corresponding textual descriptions.
  2. Messenger & Summary Layers: To handle the large number of patches in a WSI, a Messenger Layer (using self-attention) allows patches to communicate, while a Summary Layer (attention-pooling) aggregates them into a single slide-level representation.
  3. Alignment-wise Contrastive Loss (AC-Loss): This loss function ensures that the model’s internal visual features for a specific pattern are mathematically aligned with the corresponding expert text description, creating a cohesive multi-modal understanding.

Results and Discussion

PEMP was evaluated across five datasets covering cervical cancer prognosis, lymph node metastasis, and rare round cell tumor subtyping. The model consistently outperformed existing state-of-the-art methods like TOP and CoOp.

  • Superiority in Low-Shot Scenarios: PEMP showed dramatic improvements in 2-shot and 4-shot settings, often outperforming competitors by a wide margin. On the round cell subtype task, it achieved a 6.2% higher AUC on average, demonstrating its utility for rare diseases.
  • The Importance of Visual Prompts: A key insight is that text descriptions alone are insufficient for pathology. Providing actual image examples (visual prompts) significantly boosts the model's ability to activate the correct features in the frozen CLIP backbone.
  • Interpretability: The model offers diagnostic transparency by highlighting which patches in a slide most closely match the expert-provided visual prompts, effectively "showing its work."

Conclusion

PEMP demonstrates that injecting domain-specific knowledge through multi-modal prompts can significantly enhance the few-shot capabilities of Vision-Language Models in specialized fields. While the method currently relies on expert-curated prompts, future work will explore automating prompt generation and extending this paradigm to other specialized domains beyond pathology, such as satellite imagery or industrial inspection.

Summary updated

BibTeX
@inproceedings{qu2024pathology,
  author = {Linhao Qu and Dingkang Yang and Dan Huang and Qinhao Guo and Rongkui Luo and Shaoting Zhang and Xiaosong Wang},
  title = {{Pathology-Knowledge Enhanced Multi-instance Prompt Learning for Few-Shot Whole Slide Image Classification}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-73247-8\_12},
}
Figure