MExD: An Expert-Infused Diffusion Model for Whole-Slide Image Classification

Jianwei Zhao, Xin Li, Fan Yang, Qiang Zhai, Ao Luo, Yang Zhao, Hong Cheng, Huazhu Fu · DOI

Introduction

Whole-Slide Image (WSI) classification is a cornerstone of digital pathology, yet it presents significant computational challenges due to the "gigapixel" scale of the data. Standard approaches utilize Multiple Instance Learning (MIL), which decomposes a slide into thousands of smaller patches. However, MIL frameworks often struggle with extreme data imbalance—where a "positive" label may depend on a tiny fraction of malignant cells—and the inherent limitations of discriminative models in capturing complex, noisy data distributions.

To address these challenges, we introduce MExD (Expert-Infused Diffusion Model). MExD is the first framework to reimagine WSI classification as a generative process, combining a Dynamic Mixture-of-Experts (Dyn-MoE) aggregator with a 1D diffusion classifier to achieve state-of-the-art performance and robust uncertainty estimation.

Methodology: Generative Classification via Expert Insights

The MExD architecture moves beyond simple discriminative boundaries by treating classification as an iterative denoising process. The framework consists of three primary components:

  1. Patch Feature Extraction: High-dimensional image patches are converted into numerical feature vectors using pre-trained backbones such as ViT or CTransPath.
  2. Dynamic Mixture-of-Experts (Dyn-MoE) Aggregator: This stage acts as a sophisticated noise filter. Instead of treating all patches uniformly, MExD employs specialized "experts" (e.g., negative experts for healthy tissue, positive experts for specific cancer subtypes). A routing mechanism selects the most representative patches (top-k selection), effectively sparsifying the bag of features and focusing the model on the most relevant diagnostic information.
  3. 1D-Diffusion Classifier (Diff-C): The core innovation of MExD is the use of a 1D denoising diffusion model for the final classification. Conditioned on the "expert insights" from the Dyn-MoE, the model iteratively refines a label signal from Gaussian noise. This generative approach allows the model to better capture the underlying data distribution compared to traditional linear layers.
Overview of the MExD framework architecture.

Experimental Results

MExD was evaluated on three major pathology benchmarks: Camelyon16 (breast cancer metastasis), TCGA-NSCLC (lung cancer subtyping), and BRACS (breast carcinoma subtyping).

Performance and Uncertainty Estimation

MExD consistently outperformed state-of-the-art MIL baselines, including TransMIL and MambaMIL. Notably, on the challenging BRACS dataset, MExD achieved a significant improvement in accuracy and F1-score. Beyond raw accuracy, MExD provides superior uncertainty estimation. By sampling the stochastic diffusion process multiple times, the model can quantify its confidence, measured by the Patch-Agnostic vs. Patch-Uncertain (PAvPU) metric. This capability is vital for clinical decision support, where identifying ambiguous cases is as important as correct classification.

Performance comparison across benchmarks.

Discussion and Conclusion

The success of MExD highlights two key insights: specialization and generative robustness. The Dyn-MoE aggregator prevents the model from being overwhelmed by healthy tissue, while the diffusion process provides a more resilient classification boundary.

While the iterative nature of diffusion models introduces a slight computational overhead compared to single-pass models, the gains in accuracy and reliability are substantial. Future work will explore extending this generative paradigm to other pathology tasks, such as spatial segmentation and survival analysis. MExD represents a significant step forward, shifting the focus of pathology AI from simple labeling to a deeper, generative understanding of complex tissue morphology.

Summary updated

BibTeX
@inproceedings{zhao2025mexd,
  author = {Jianwei Zhao and Xin Li and Fan Yang and Qiang Zhai and Ao Luo and Yang Zhao and Hong Cheng and Huazhu Fu},
  title = {{MExD: An Expert-Infused Diffusion Model for Whole-Slide Image Classification}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2025},
  doi = {10.1109/cvpr52734.2025.01936},
}
Figure