LoGex: Improved tail detection of extremely rare histopathology classes via guided diffusion

Maximilian Müller, Matthias HeinOpenReview 2024 · DOI · OpenReview

Introduction

In clinical medicine, data distribution is inherently long-tailed. While common conditions (the "head") are well-represented, hundreds of rare diseases (the "tail") may have only a handful of examples. Standard machine learning models often fail in these scenarios, misclassifying rare conditions as common ones. In safety-critical fields like histopathology, such errors are unacceptable.

The LoGex (LoRA + Guidance) framework shifts the focus from perfect classification to robust detection. By treating rare conditions as Out-of-Distribution (OOD) samples, the goal is to ensure that AI models flag rare diseases for human review rather than making confident, incorrect predictions. LoGex achieves this by generating targeted synthetic data to bridge the gap between head and tail classes.

Methodology

The LoGex pipeline consists of four primary stages designed to leverage generative AI for data augmentation in low-data regimes.

The LoGex four-step pipeline for improving rare class detection.
  1. Auxiliary Classifier Training: A baseline model is trained on the available imbalanced dataset to capture initial features of both head and tail classes.
  2. LoRA Fine-tuning: A pre-trained latent diffusion model (Stable Diffusion) is adapted to the histopathology domain using Low-Rank Adaptation (LoRA), specifically focusing on the limited tail samples.
  3. Guided Generation (DiG-IN): To overcome the limitations of prompting with scarce data, the authors employ DiG-IN guidance. This involves backpropagating through the diffusion process to optimize the starting noise, ensuring the generated images strongly activate "rare class" neurons in the auxiliary classifier.
  4. Retraining with Augmentation: The final classifier is retrained on the original dataset supplemented with high-quality, feature-rich synthetic tail samples.

Experimental Setup

The framework was evaluated using a large-scale histopathology dataset containing over 129,000 image tiles across 16 classes. To simulate extreme clinical imbalance, the data was subsampled into four "head" classes (>1,000 samples each) and twelve "tail" classes (exactly 10 samples each). This setup tests the limits of traditional OOD detection and classification methods.

Results and Discussion

LoGex demonstrates significant improvements in tail detection compared to existing state-of-the-art methods. The model achieved an Area Under the Curve (AUC) of 96.27% for detecting tail samples.

Visual comparison of real images versus synthetic samples generated with LoRA and LoRA+Guidance across various tail classes.

Key findings include:

  • Reduced False Positives: LoGex achieved a False Positive Rate (FPR) of 16.25% at a 95% True Positive Rate, outperforming standard cross-entropy (25.05%) and the FG-Entropy baseline (20.66%).
  • Preserved Head Accuracy: The model maintained a balanced accuracy of approximately 97% on common head classes, indicating that learning to detect rare cases does not degrade performance on frequent ones.
  • Importance of Guidance: Qualitative analysis shows that LoRA alone on 10 samples often produces generic results. Guidance is essential to manifest the specific structural and textural features required for the classifier to learn effective decision boundaries.

Conclusion

LoGex provides a viable path for improving the safety of medical AI by focusing on the detection of rare, "out-of-distribution" conditions. While synthetic images are not always "medically perfect," they effectively capture the features necessary for robust detection. Future research will explore the application of this framework to other modalities like MRI and CT scans, as well as further refining guidance techniques to improve the classification accuracy of rare diseases.

Summary updated

Abstract

In realistic medical settings, the data are often inherently long-tailed, with most samples concentrated in a few classes and a long tail of rare classes, usually containing just a few samples. This distribution presents a significant challenge because rare conditions are critical to detect and difficult to classify due to limited data. In this paper, rather than attempting to classify rare classes, we aim to detect these as out-of-distribution data reliably. We leverage low-rank adaption (LoRA) and diffusion guidance to generate targeted synthetic data for the detection problem. We significantly improve the OOD detection performance on a challenging histopathological task with only ten samples per tail class without losing classification accuracy on the head classes.
BibTeX
@misc{muller2024logex,
  author = {Maximilian Müller and Matthias Hein},
  title = {{LoGex: Improved tail detection of extremely rare histopathology classes via guided diffusion}},
  year = {2024},
  eprint = {2409.01317},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2409.01317},
}
Figure