Abstract:Unsupervised medical anomaly detection learns normal anatomical patterns from healthy training images and identifies deviations at test time. Reconstruction-based and diffusion-based methods commonly use the difference between an input image and its reconstruction as anomaly evidence. However, this residual can be ambiguous. Expressive models may preserve pathological structures, while benign anatomical variation, imaging noise, and acquisition differences may also produce large reconstruction errors. We propose discriminative mask-guided diffusion (DMD), a medical anomaly detection framework that complements residual-based localization with reconstruction-shift discrimination. DMD first learns a compact quantized latent representation of normal images. Localized masks then perturb selected latent regions, and a latent diffusion model reconstructs the perturbed representations. The resulting reconstructions are paired with their original normal images to define a self-supervised classification task. At inference, the classifier provides a learned image-level anomaly score, while the residual between the input and its diffusion-based reconstruction yields a pixel-level anomaly map. Experiments on five datasets spanning brain MRI, breast ultrasound, and chest radiography show that DMD achieves the best overall performance among the state-of-the-art baseline methods.
Abstract:Medical anomaly detection identifies abnormal images and localizes lesions under scarce supervision while generalizing across organs and modalities. Existing CLIP-based methods reduce annotation requirements through vision--language alignment, but their normal and abnormal references, whether text prompts or learned visual tokens, remain fixed across test images. Such static references may not transfer reliably to unseen targets in a cross-domain medical imaging scenario. To address this, we propose ReCAP, a language-free framework that replaces static anchors with input-conditioned visual prototypes. ReCAP re-centers separated normal and abnormal prototypes for each image through a bounded gated modulation, enabling query-adaptive anomaly scoring while constraining context-induced prototype drift. For the few-shot setting, we introduce a non-parametric normal-reference memory to preserve instance-level target-domain variation and complement the conditional prototype branch. Across six medical benchmarks, ReCAP achieves the best image-level AUROC on all zero-shot and 23 of 24 few-shot settings, and the best zero-shot pixel-level AUROC on all three segmentation datasets. Particularly, it reduces inference latency by over 70% compared to the fastest baseline, without text prompts or test-time gradient updates.