Papers › WinCLIP: Zero-/Few-Shot Anomaly Classification and Segmentation

WinCLIP: Zero-/Few-Shot Anomaly Classification and Segmentation

26 Mar 2023CVPR 2023 1arXiv:2303.14814archive 2025-07-28

Jongheon Jeong, Yang Zou, Taewan Kim, Dongqing Zhang, Avinash Ravichandran, Onkar Dabeer

Visual anomaly classification and segmentation are vital for automating industrial quality inspection. The focus of prior research in the field has been on training custom models for each quality inspection task, which requires task-specific images and annotation. In this paper we move away from this regime, addressing zero-shot and few-normal-shot anomaly classification and segmentation. Recently CLIP, a vision-language model, has shown revolutionary generality with competitive zero-/few-shot performance in comparison to full-supervision. But CLIP falls short on anomaly classification and segmentation tasks. Hence, we propose window-based CLIP (WinCLIP) with (1) a compositional ensemble on state words and prompt templates and (2) efficient extraction and aggregation of window/patch/image-level features aligned with text. We also propose its few-normal-shot extension WinCLIP+, which uses complementary information from normal images. In MVTec-AD (and VisA), without further tuning, WinCLIP achieves 91.8%/85.1% (78.1%/79.6%) AUROC in zero-shot anomaly classification and segmentation while WinCLIP+ does 93.1%/95.2% (83.8%/96.4%) in 1-normal-shot, surpassing state-of-the-art by large margins.

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="2303.14814")

Code

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

By repository: community (archive-listed): 12 samples from 2 repositories, 5 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

SkiddieAhn/Code-WinCLIP mentioned on GitHubpytorch report
zqhang/Accurate-WinCLIP-pytorch mentioned on GitHubpytorch report
openvinotoolkit/anomalib pytorchApache-2.0 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

12 samples harvested; 5 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
2ran · violated contract
1ran · our draft was wrong
1ran
7unverified

Licence: 0 of the 12 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 2 repositories linked to this paper, official or community; each sample names its own and says which. “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.

convert_to_custom_text_state_dict caoyunkang/WinClip/WinCLIP/CLIPAD/model.py community (archive-listed) ran · violated contract MIT (permissive) · f19962ebb134b3d7 · report
get_cast_dtype caoyunkang/WinClip/WinCLIP/CLIPAD/model.py community (archive-listed) ran · our draft was wrong MIT (permissive) · dcd422d66b0581d8 · report
load_state_dict caoyunkang/WinClip/WinCLIP/CLIPAD/factory.py community (archive-listed) ran MIT (permissive) · 4b3a4d17e1df3140 · report
normalize zqhang/Accurate-WinCLIP-pytorch/reproduce_WinCLIP.py community (archive-listed) ran · honoured contract fingerprinted MIT (permissive) · 0c3f9d9b0ac9f33d · report
str2bool caoyunkang/WinClip/eval_WinCLIP.py community (archive-listed) ran · violated contract MIT (permissive) · 25c7475539e39da4 · report
build_model_from_openai_state_dict zqhang/Accurate-WinCLIP-pytorch/src/open_clip/model.py community (archive-listed) unverified MIT (permissive) · e332828701fffe70 · report
build_model_from_openai_state_dict caoyunkang/WinClip/WinCLIP/CLIPAD/model.py community (archive-listed) unverified MIT (permissive) · c94ec43ef54519ef · report
gather_features caoyunkang/WinClip/WinCLIP/CLIPAD/loss.py community (archive-listed) unverified MIT (permissive) · ddcbd45e940484ee · report
get_model_config caoyunkang/WinClip/WinCLIP/CLIPAD/factory.py community (archive-listed) unverified MIT (permissive) · 5c7cf820e99443ff · report
get_tokenizer caoyunkang/WinClip/WinCLIP/CLIPAD/factory.py community (archive-listed) unverified MIT (permissive) · f34d8f34635af394 · report
prepare_inputs_for_generation caoyunkang/WinClip/WinCLIP/CLIPAD/coca_model.py community (archive-listed) unverified MIT (permissive) · fb651d0a97fd4d3f · report
register_pooler caoyunkang/WinClip/WinCLIP/CLIPAD/hf_model.py community (archive-listed) unverified MIT (permissive) · 2a377da4a76a2d44 · report

Tasks

Anomaly ClassificationAnomaly DetectionClassificationLanguage ModelingLanguage ModellingSegmentationzero-shot anomaly detection

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Anomaly Detection MVTec AD WinCLIP+ (4-shot) Detection AUROC 95.2 #91 of 148 Archive leaderboard report
Anomaly Detection MVTec AD WinCLIP+ (4-shot) Segmentation AUPRO 89 #91 of 148 Archive leaderboard report
Anomaly Detection MVTec AD WinCLIP+ (2-shot) Detection AUROC 94.4 #96 of 148 Archive leaderboard report
Anomaly Detection MVTec AD WinCLIP+ (2-shot) Segmentation AUPRO 88.4 #96 of 148 Archive leaderboard report
Anomaly Detection MVTec AD WinCLIP+ (1-shot) Detection AUROC 93.1 #101 of 148 Archive leaderboard report
Anomaly Detection MVTec AD WinCLIP+ (1-shot) Segmentation AUPRO 87.1 #101 of 148 Archive leaderboard report
Anomaly Detection MVTec AD WinCLIP (0-shot) Detection AUROC 91.8 #107 of 148 Archive leaderboard report
Anomaly Detection MVTec AD WinCLIP (0-shot) Segmentation AUPRO 64.6 #107 of 148 Archive leaderboard report
Anomaly Detection VisA WinCLIP+ (4-shot) Detection AUROC 87.3 #33 of 50 Archive leaderboard report
Anomaly Detection VisA WinCLIP+ (4-shot) Segmentation AUPRO 87.6 #33 of 50 Archive leaderboard report
Anomaly Detection VisA WinCLIP+ (4-shot) Segmentation AUPRO (until 30% FPR) 87.6 #33 of 50 Archive leaderboard report
Anomaly Detection VisA WinCLIP+ (2-shot) Detection AUROC 84.6 #35 of 50 Archive leaderboard report
Anomaly Detection VisA WinCLIP+ (2-shot) Segmentation AUPRO 86.2 #35 of 50 Archive leaderboard report
Anomaly Detection VisA WinCLIP+ (2-shot) Segmentation AUPRO (until 30% FPR) 86.2 #35 of 50 Archive leaderboard report
Anomaly Detection VisA WinCLIP+ (1-shot) Detection AUROC 83.8 #36 of 50 Archive leaderboard report
Anomaly Detection VisA WinCLIP+ (1-shot) Segmentation AUPRO 85.1 #36 of 50 Archive leaderboard report
Anomaly Detection VisA WinCLIP+ (1-shot) Segmentation AUPRO (until 30% FPR) 85.1 #36 of 50 Archive leaderboard report
Anomaly Detection VisA WinCLIP (0-shot) Detection AUROC 78.1 #41 of 50 Archive leaderboard report
Anomaly Detection VisA WinCLIP (0-shot) Segmentation AUPRO 56.8 #41 of 50 Archive leaderboard report
Anomaly Detection VisA WinCLIP (0-shot) Segmentation AUPRO (until 30% FPR) 56.8 #41 of 50 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

CLIP

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