NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

MADPOT: Medical Anomaly Detection with CLIP Adaptation and Partial Optimal Transport

Mahshid Shiri, Cigdem Beyan, Vittorio Murino

Introduction

Medical Anomaly Detection (AD) is a critical task in clinical diagnostics, often described as a "needle in a haystack" problem. Identifying subtle lesions, tiny tumors, or minute structural irregularities within complex medical scans requires high precision. However, the field faces three primary challenges: the significant domain gap between foundation models (trained on natural images) and medical imagery, the scarcity of labeled abnormal data, and the localized nature of pathology, where anomalies often occupy only a fraction of the total image area.

Existing approaches frequently rely on synthetic anomaly generation or the maintenance of extensive memory banks of "normal" features. These methods often struggle to generalize across different imaging modalities or hospital settings. To address these limitations, we present MADPOT, a novel framework that adapts the CLIP (Contrastive Language-Image Pre-training) vision-language model for medical AD using visual adapters and Partial Optimal Transport (POT).

Methodology

MADPOT enhances the frozen CLIP backbone through a multi-faceted architecture designed to bridge the medical domain gap while focusing on localized signals.

1. Visual Feature Adapters

Rather than fine-tuning the entire CLIP model, which is computationally expensive and risks catastrophic forgetting, MADPOT inserts lightweight, learnable "adapter" and "projector" layers at specific depths (specifically the 12th and 24th layers). This allows the model to extract and refine medical-specific visual features while retaining the broad semantic knowledge inherent in the original CLIP weights.

2. Learnable Multi-Prompt Sets

Standard zero-shot approaches often rely on a single static prompt (e.g., "a photo of a normal brain"). MADPOT instead utilizes learnable sets of multiple prompts for both "normal" and "abnormal" classes. This diversity allows the model to capture the various ways an anomaly might manifest—accounting for differences in shape, size, and texture that a single prompt might miss.

3. Partial Optimal Transport (POT)

The core innovation of MADPOT is the application of Partial Optimal Transport. Standard Optimal Transport (OT) enforces a strict mathematical balance, attempting to match every pixel in an image to a corresponding textual prompt. In medical AD, where the majority of the image is healthy tissue, this "mass conservation" forces the model to align irrelevant background pixels with anomaly-related text, washing out the signal. POT relaxes this constraint, transporting only a fraction of the "mass." This allows the model to ignore healthy background regions and align textual prompts specifically with the most informative, potentially anomalous image patches.

4. Contrastive Learning (CL)

To prevent the learned prompts from collapsing into redundant representations, MADPOT employs Contrastive Learning. This ensures that "normal" features are pulled together in the embedding space while "abnormal" features are pushed away, establishing clear decision boundaries between healthy and pathological states.

Experimental Evaluation

The framework was rigorously evaluated using the BMAD benchmark, a comprehensive suite encompassing six datasets across five distinct modalities:

  • Brain MRI (BraTS)
  • Liver CT (LiTS)
  • Chest X-ray (NIHChest, CheXpert)
  • Retinal OCT (OCT17, RESC)
  • Digital Histopathology (HIS)

Testing scenarios included few-shot (16 samples), zero-shot (unseen modalities), and cross-dataset evaluations (training on one institution's data and testing on another).

Key Results and Insights

Superior Performance in Few-Shot and Zero-Shot Settings

In the 16-shot setting, MADPOT achieved an average Anomaly Classification (AC) score of 97.83%, outperforming the previous state-of-the-art (MVFA) by a significant margin of 7.25%. In zero-shot scenarios, where the model encountered completely unseen modalities, MADPOT surpassed existing methods by nearly 8%.

Robustness and Localization

The model demonstrated exceptional cross-dataset robustness. When trained on one chest X-ray dataset and tested on another, it maintained an AUC of up to 90.69%, indicating that it learns generalizable pathological features rather than dataset-specific noise. Furthermore, MADPOT proved highly effective at pinpointing anomalies (segmentation), achieving near-perfect scores on Liver (99.84%) and Retinal (99.3%) datasets.

The Synergy of POT and CL

Ablation studies revealed that while POT is essential for focusing on small anomalies, it requires Contrastive Learning to maintain accuracy. Without CL, POT or standard OT can occasionally misalign features. Together, they allow the model to both locate the anomaly and correctly distinguish it from healthy tissue.

Conclusion and Future Work

MADPOT represents a significant step forward in medical anomaly detection by demonstrating that "ignoring" the majority of an image through Partial Optimal Transport can lead to higher sensitivity toward pathology. By avoiding the need for synthetic data or memory-intensive feature banks, MADPOT offers a more viable path for real-world clinical deployment.

Currently, the framework is optimized for 2D image analysis. Future research will focus on incorporating temporal data processing to handle longitudinal studies, such as monitoring tumor growth over time in sequential scans, and further refining performance in specific modalities where zero-shot gaps remain.

Summary updated

BibTeX
@inproceedings{shiri2025madpot,
  author = {Mahshid Shiri and Cigdem Beyan and Vittorio Murino},
  title = {{MADPOT: Medical Anomaly Detection with CLIP Adaptation and Partial Optimal Transport}},
  booktitle = {ICIAP},
  year = {2025},
  doi = {10.1007/978-3-032-10185-3\_20},
}
Figure