Papers › Adapting Visual-Language Models for Generalizable Anomaly Detection in Medical Images

Adapting Visual-Language Models for Generalizable Anomaly Detection in Medical Images

19 Mar 2024CVPR 2024 1arXiv:2403.12570archive 2025-07-28

Chaoqin Huang, Aofan Jiang, Jinghao Feng, Ya zhang, Xinchao Wang, Yanfeng Wang

Recent advancements in large-scale visual-language pre-trained models have led to significant progress in zero-/few-shot anomaly detection within natural image domains. However, the substantial domain divergence between natural and medical images limits the effectiveness of these methodologies in medical anomaly detection. This paper introduces a novel lightweight multi-level adaptation and comparison framework to repurpose the CLIP model for medical anomaly detection. Our approach integrates multiple residual adapters into the pre-trained visual encoder, enabling a stepwise enhancement of visual features across different levels. This multi-level adaptation is guided by multi-level, pixel-wise visual-language feature alignment loss functions, which recalibrate the model's focus from object semantics in natural imagery to anomaly identification in medical images. The adapted features exhibit improved generalization across various medical data types, even in zero-shot scenarios where the model encounters unseen medical modalities and anatomical regions during training. Our experiments on medical anomaly detection benchmarks demonstrate that our method significantly surpasses current state-of-the-art models, with an average AUC improvement of 6.24% and 7.33% for anomaly classification, 2.03% and 2.37% for anomaly segmentation, under the zero-shot and few-shot settings, respectively. Source code is available at: https://github.com/MediaBrain-SJTU/MVFA-AD

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2403.12570")

Code

Syntology Ran 8 of 15 code samples harvested from 1 repository linked to this paper; 7 have no recorded run. Of those that ran: 1 ran · honoured contract; 1 ran · violated contract; 4 ran · our draft was wrong; 2 ran with no contract checked.

By repository: official repository: 15 samples from 1 repository, 8 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

mediabrain-sjtu/mvfa-ad officialmentioned in papermentioned on GitHubpytorchMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

15 samples harvested; 8 ran; 1 honoured the contract we drafted; 7 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · honoured contract
1ran · violated contract
4ran · our draft was wrong
2ran
7unverified

Licence: 0 of the 15 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from MediaBrain-SJTU/MVFA-AD. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

ClipAdapter MediaBrain-SJTU/MVFA-AD/CLIP/adapter.py official repository ran MIT (permissive) · b40db86d0bab4263 · report
basic_clean mediabrain-sjtu/mvfa-ad/CLIP/tokenizer.py official repository ran · our draft was wrong fingerprinted MIT (permissive) · 98f385d847636a3e · report
convert_to_custom_text_state_dict mediabrain-sjtu/mvfa-ad/CLIP/model.py official repository ran · violated contract MIT (permissive) · f19962ebb134b3d7 · report
get_cast_dtype mediabrain-sjtu/mvfa-ad/CLIP/model.py official repository ran · our draft was wrong MIT (permissive) · dcd422d66b0581d8 · report
get_pairs mediabrain-sjtu/mvfa-ad/CLIP/tokenizer.py official repository ran · our draft was wrong MIT (permissive) · d919ae32e5e4e616 · report
get_rot_mat mediabrain-sjtu/mvfa-ad/utils.py official repository ran · honoured contract fingerprinted MIT (permissive) · f0bead498d7b3068 · report
load_state_dict mediabrain-sjtu/mvfa-ad/CLIP/clip.py official repository ran MIT (permissive) · 4b3a4d17e1df3140 · report
whitespace_clean mediabrain-sjtu/mvfa-ad/CLIP/tokenizer.py official repository ran · our draft was wrong fingerprinted MIT (permissive) · 9542161e9640b858 · report
build_model_from_openai_state_dict mediabrain-sjtu/mvfa-ad/CLIP/model.py official repository unverified MIT (permissive) · 09c0abc70500a134 · report
cos_sim mediabrain-sjtu/mvfa-ad/utils.py official repository unverified MIT (permissive) · 80d50221b83e3ef4 · report
freeze_batch_norm_2d mediabrain-sjtu/mvfa-ad/CLIP/modified_resnet.py official repository unverified MIT (permissive) · 00c4c440750b8eec · report
get_model_config mediabrain-sjtu/mvfa-ad/CLIP/clip.py official repository unverified MIT (permissive) · 5c7cf820e99443ff · report
load_checkpoint mediabrain-sjtu/mvfa-ad/CLIP/clip.py official repository unverified MIT (permissive) · d53108edea9d2b46 · report
load_openai_model mediabrain-sjtu/mvfa-ad/CLIP/openai.py official repository unverified MIT (permissive) · 6407d54f96f9b83e · report
test mediabrain-sjtu/mvfa-ad/train_zero.py official repository unverified MIT (permissive) · 9e816aad57db813b · report

Tasks

Anomaly ClassificationAnomaly DetectionAnomaly Segmentation

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

CLIPFocus

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections