Beyond Static Anchors: Bounded Prototype Conditioning for Language-Free Medical Anomaly Detection

Yibo Wan, Jinyu Cai, See-kiong NgarXiv 2026

TL;DR

ReCAP (Re-Centered Anomaly Prototypes) is a language-free medical anomaly detection framework that replaces rigid, static anomaly references with dynamic, input-conditioned visual prototypes. By adapting its anomaly boundaries to individual images while strictly bounding prototype drift, ReCAP achieves state-of-the-art zero- and few-shot performance across six medical benchmarks while slashing inference latency by over 70%.

What Problem Does This Paper Address?

Medical anomaly detection—identifying rare lesions and abnormalities across diverse organs and modalities like MRI, CT, and X-rays—is severely bottlenecked by a lack of annotated data. To bypass this, recent methods leverage the vision-language representations of foundation models like CLIP for zero- or few-shot detection.

However, these methods suffer from a major flaw: they rely on static anchors. Whether they use text prompts (like "normal chest X-ray" vs. "abnormal chest X-ray") or fixed, learned visual tokens, these reference points remain completely unchanged during testing.

This static approach breaks down under cross-domain shifts. What looks "normal" in a brain MRI is entirely different from a normal liver CT. Furthermore, generic text descriptions are too coarse to capture subtle, localized medical lesions, and fixed global anchors cannot account for fine-grained, instance-level variations. The authors set out to create an anomaly detection boundary that dynamically adapts to the context of each specific patient scan.

Methods

The authors introduce ReCAP, a language-free framework that dynamically adjusts the anomaly boundary for each test image without requiring text prompts or test-time gradient updates.

Figure 1: Overview of ReCAP. Instead of aligning visual features with hand-crafted text prompts, our framework learns normal and abnormal visual prototypes directly in the CLIP visual space. The prototypes are further modulated by query-specific anatomical context to produce adaptive visual anchors for anomaly scoring. In the few-shot setting, an auxiliary normal memory bank provides instance-level normal references, while the zero-shot setting relies solely on the learned visual prototypes.

Key components include:

  • Input-Conditioned Visual Prototypes: Instead of using text embeddings, ReCAP learns base normal and abnormal visual prototypes directly within the CLIP feature space using lightweight segmentation and detection adapters.
  • Bounded Gated Modulation: To handle domain shifts, ReCAP pools patch tokens from the input image to create a global context descriptor, which it uses to re-center the prototypes. Crucially, this modulation is bounded using a $\tanh$ function and a learnable gate. If an image contains a massive lesion, the global context descriptor gets contaminated. Unconstrained adaptation would shift the "normal" anchor toward the anomaly, accidentally explaining it away! The bounded design ensures the model adapts to the domain (e.g., CT vs. MRI) without adapting to the lesion.
  • Normal-Reference Memory: For few-shot scenarios, ReCAP pairs this prototype branch with a non-parametric memory bank filled with patch tokens from normal support images, preserving fine-grained target-domain variations.
  • Multi-Layer Learnable Fusion: The model aggregates patch-level anomaly scores across multiple intermediate CLIP layers to output both an image-level anomaly score and a pixel-level anomaly map.

Datasets

ReCAP was evaluated across six distinct medical imaging datasets spanning five imaging domains:

  1. BrainMRI (BraTS2021): Brain MRI slices evaluated for classification and localization.
  2. LiverCT (BTCV + LiTS): Abdominal CT slices evaluated for classification and localization.
  3. RESC: Retinal OCT dataset for retinal edema classification and localization.
  4. OCT17: Retinal OCT dataset evaluated for image-level classification.
  5. Chest: RSNA chest radiographs for lung opacity classification.
  6. HIS: Digital histopathology patches from Camelyon16 for lymph node classification.

Key Insights and Ideas

  • The Danger of Over-Adaptation: The most elegant insight in the paper is the need for bounded conditioning. In anomaly detection, the query image itself provides the context. If the model adapts too freely, it will absorb the anomaly into its definition of normality. Bounding the shift allows the model to adapt to the anatomical structure and modality without erasing the target lesion.
  • Ditching Language for Pure Vision: Text prompts are fundamentally limited in medicine; many structural deviations are too subtle or localized to be described effectively with generic words. Moving entirely to the visual feature space allows for much tighter, more accurate anomaly boundaries.
  • Parametric + Non-Parametric Synergy: Combining an adaptive parametric prototype boundary with a non-parametric memory bank creates a powerful dual-branch system for few-shot learning—one handles global domain shifts, while the other preserves local, instance-level normal patterns.

Key Results

Quantitative Performance

ReCAP achieved outstanding results across the board, outperforming both prompt-based CLIP methods and language-free baselines:

  • Zero-Shot & Few-Shot Dominance: ReCAP achieved the best image-level AUROC on all zero-shot settings and 23 out of 24 few-shot settings. For instance, in a 2-shot setting on LiverCT, it boosted image AUROC from 84.48% (MadCLIP) to 90.45%.
  • Clean Localization: It secured the best zero-shot pixel-level AUROC on all three segmentation datasets (BrainMRI, LiverCT, RESC).
  • Massive Speedup: By bypassing text encoding and complex token-patch cross-attention, ReCAP is incredibly lightweight. It achieves an inference latency of just 17.4 ms per image in zero-shot mode—a 70%+ reduction compared to the fastest language-free baseline, VisualAD (66.1 ms).

Qualitative Performance

As shown in the localization heatmaps, ReCAP produces much cleaner, more compact anomaly responses that tightly overlap with ground-truth annotations, avoiding the diffuse, off-target background activations common in baseline models.

Figure 2: Qualitative comparison of anomaly localization. We compare heatmaps produced by APRIL-GAN, MVFA, MadCLIP, VisualAD, and ReCAP on representative samples from BrainMRI, LiverCT, and retinal OCT datasets.

Limitations and Future Work

While ReCAP demonstrates exceptional efficiency and accuracy, the authors note a few limitations:

  • 2D Constraint: The current evaluation is strictly focused on 2D image-based benchmarks.
  • Future Directions: Real-world clinical workflows frequently rely on 3D data. The authors highlight that extending ReCAP to handle fully volumetric (3D) clinical data and multimodal medical inputs remains an important and necessary next step.

Summary updated

BibTeX
@misc{wan2026beyond,
  author = {Yibo Wan and Jinyu Cai and See-kiong Ng},
  title = {{Beyond Static Anchors: Bounded Prototype Conditioning for Language-Free Medical Anomaly Detection}},
  year = {2026},
  eprint = {2608.00442},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2608.00442},
}
Figure