SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2303.14814 · CVPR · 2023

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

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

arXiv · PDF · Open in the Atlas

Code that ran

7 of 12 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 2 violated it and 1 has no contract verdict; 3 failures of our instrument; 5 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2303.14814.json · badge: /api/ran/2303.14814.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
caoyunkang/WinClip community (classifier label)
classifier basis: plan_row
6 ran · 4 no recorded run
zqhang/Accurate-WinCLIP-pytorch reimplementation (classifier label)
classifier basis: classifier_2025
1 ran · 1 no recorded run
FunctionStatusWhere it lives
convert_to_custom_text_state_dict Ran
ran, violated the contract we drafted
caoyunkang/WinClip/WinCLIP/CLIPAD/model.py
pointer only (licence: MIT); the stored copy get_code serves, from deep-real/dcp, is pointer only (licence: NONE) · get_code("f19962ebb134b3d7")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from deep-real/dcp, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_cast_dtype Ran
ran; our contract draft was wrong, not the code
caoyunkang/WinClip/WinCLIP/CLIPAD/model.py
code served (permissive licence) · get_code("dcd422d66b0581d8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned dtype. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

ARGS = {
    "precision": "bf16"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dtype — a dtype output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dtype output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_state_dict Ran
ran; our contract draft was wrong, not the code
caoyunkang/WinClip/WinCLIP/CLIPAD/factory.py
pointer only (licence: MIT); the stored copy get_code serves, from zqhang/PointAD, is pointer only (licence: NONE) · get_code("4b3a4d17e1df3140")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from zqhang/PointAD, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

normalize Ran
ran, honoured the contract we drafted
zqhang/Accurate-WinCLIP-pytorch/reproduce_WinCLIP.py
code served (permissive licence) · get_code("0c3f9d9b0ac9f33d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

pred = torch.randn(2, 4)
max_value = 1.5
min_value = -1.0

ARGS = {
    'pred': pred,
    'max_value': max_value,
    'min_value': min_value
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
prepare_inputs_for_generation Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
caoyunkang/WinClip/WinCLIP/CLIPAD/coca_model.py
pointer only (licence: MIT); the stored copy get_code serves, from WHU-USI3DV/TreeCLS, is pointer only (licence: NONE) · get_code("fb651d0a97fd4d3f")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from WHU-USI3DV/TreeCLS, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

register_pooler Ran
ran on a synthesized input
caoyunkang/WinClip/WinCLIP/CLIPAD/hf_model.py
pointer only (licence: MIT); the stored copy get_code serves, from WHU-USI3DV/TreeCLS, is pointer only (licence: NONE) · get_code("2a377da4a76a2d44")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from WHU-USI3DV/TreeCLS, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

str2bool Ran
ran, violated the contract we drafted
caoyunkang/WinClip/eval_WinCLIP.py
code served (permissive licence) · get_code("25c7475539e39da4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

def str2bool(v):
    return v.lower() in ('yes', 'true', 't', '1')

ARGS = {
    'v': 'true'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
build_model_from_openai_state_dict Not yet run
unverified (harvested, no recorded run)
zqhang/Accurate-WinCLIP-pytorch/src/open_clip/model.py
code served (permissive licence) · get_code("e332828701fffe70")
How it ran

no invocation recorded.

build_model_from_openai_state_dict Not yet run
unverified (harvested, no recorded run)
caoyunkang/WinClip/WinCLIP/CLIPAD/model.py
code served (permissive licence) · get_code("c94ec43ef54519ef")
How it ran

no invocation recorded.

gather_features Not yet run
unverified (harvested, no recorded run)
caoyunkang/WinClip/WinCLIP/CLIPAD/loss.py
pointer only (licence: MIT); the stored copy get_code serves, from lxa9867/imagefolder, is pointer only (licence: NOASSERTION) · get_code("ddcbd45e940484ee")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from lxa9867/imagefolder, and GitHub could not classify the licence of that repository (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

get_model_config Not yet run
unverified (harvested, no recorded run)
caoyunkang/WinClip/WinCLIP/CLIPAD/factory.py
code served (permissive licence) · get_code("5c7cf820e99443ff")
How it ran

no invocation recorded.

get_tokenizer Not yet run
unverified (harvested, no recorded run)
caoyunkang/WinClip/WinCLIP/CLIPAD/factory.py
pointer only (licence: MIT); the stored copy get_code serves, from sarahesl/alignclip, is pointer only (licence: NONE) · get_code("f34d8f34635af394")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from sarahesl/alignclip, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 11 are also present in other papers whose code we hold (10 with at least one paper dated earlier, 2 the same month, 11 later) and 0 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
get_cast_dtype 66 other papers
5 dated earlier, 61 later
2103.00020 (2021-03)
Learning Transferable Visual Models From Natural Language Supervision
2210.08402 (2022-10)
LAION-5B: An open large-scale dataset for training next generation image-text models
2212.07143 (2022-12)
Reproducible scaling laws for contrastive language-image learning
and 63 more not named here
gather_features 57 other papers
5 dated earlier, 1 the same month, 51 later · 1 only as an assembly brick
2206.01670 (2022-06)
Egocentric Video-Language Pretraining
2212.00638 (2022-12)
Finetune like you pretrain: Improved finetuning of zero-shot vision models
2301.07094 (2023-01)
Learning Customized Visual Models with Retrieval-Augmented Knowledge
and 54 more not named here
convert_to_custom_text_state_dict 49 other papers
5 dated earlier, 44 later
2103.00020 (2021-03)
Learning Transferable Visual Models From Natural Language Supervision
2210.08402 (2022-10)
LAION-5B: An open large-scale dataset for training next generation image-text models
2212.07143 (2022-12)
Reproducible scaling laws for contrastive language-image learning
and 46 more not named here
register_pooler 45 other papers
2 dated earlier, 43 later
2301.07094 (2023-01)
Learning Customized Visual Models with Retrieval-Augmented Knowledge
2302.03668 (2023-02)
Hard Prompts Made Easy: Gradient-Based Discrete Optimization for Prompt Tuning and Discovery
2305.07017 (2023-05)
An Inverse Scaling Law for CLIP Training
and 42 more not named here
prepare_inputs_for_generation 43 other papers
1 dated earlier, 42 later
2301.07094 (2023-01)
Learning Customized Visual Models with Retrieval-Augmented Knowledge
2305.07017 (2023-05)
An Inverse Scaling Law for CLIP Training
2305.17382 (2023-05)
APRIL-GAN: A Zero-/Few-Shot Anomaly Classification and Segmentation Method for CVPR 2023 VAND Workshop Challenge Tracks 1&2: 1st Place on Zero-shot AD and 4th Place on Few-shot AD
and 40 more not named here
build_model_from_openai_state_dict 30 other papers
2 dated earlier, 28 later
2301.07094 (2023-01)
Learning Customized Visual Models with Retrieval-Augmented Knowledge
2302.03668 (2023-02)
Hard Prompts Made Easy: Gradient-Based Discrete Optimization for Prompt Tuning and Discovery
2304.05884 (2023-04)
Unicom: Universal and Compact Representation Learning for Image Retrieval
and 27 more not named here
str2bool 23 other papers
20 dated earlier, 3 later
1410.5401 (2014-10)
Neural Turing Machines
1502.04623 (2015-02)
DRAW: A Recurrent Neural Network For Image Generation
1504.06852 (2015-04)
FlowNet: Learning Optical Flow with Convolutional Networks
and 20 more not named here
get_model_config 22 other papers
2 dated earlier, 20 later
2211.07636 (2022-11)
EVA: Exploring the Limits of Masked Visual Representation Learning at Scale
2301.07094 (2023-01)
Learning Customized Visual Models with Retrieval-Augmented Knowledge
2305.17382 (2023-05)
APRIL-GAN: A Zero-/Few-Shot Anomaly Classification and Segmentation Method for CVPR 2023 VAND Workshop Challenge Tracks 1&2: 1st Place on Zero-shot AD and 4th Place on Few-shot AD
and 19 more not named here
load_state_dict 18 other papers
1 dated earlier, 1 the same month, 16 later
2301.07094 (2023-01)
Learning Customized Visual Models with Retrieval-Augmented Knowledge
2303.07240 (2023-03)
PMC-CLIP: Contrastive Language-Image Pre-training using Biomedical Documents
2305.17382 (2023-05)
APRIL-GAN: A Zero-/Few-Shot Anomaly Classification and Segmentation Method for CVPR 2023 VAND Workshop Challenge Tracks 1&2: 1st Place on Zero-shot AD and 4th Place on Few-shot AD
and 15 more not named here
get_tokenizer 8 other papers
1 dated earlier, 7 later
2301.07094 (2023-01)
Learning Customized Visual Models with Retrieval-Augmented Knowledge
2305.17382 (2023-05)
APRIL-GAN: A Zero-/Few-Shot Anomaly Classification and Segmentation Method for CVPR 2023 VAND Workshop Challenge Tracks 1&2: 1st Place on Zero-shot AD and 4th Place on Few-shot AD
2310.18961 (2023-10)
AnomalyCLIP: Object-agnostic Prompt Learning for Zero-shot Anomaly Detection
and 5 more not named here
normalize 3 other papers
3 later
2310.18961 (2023-10)
AnomalyCLIP: Object-agnostic Prompt Learning for Zero-shot Anomaly Detection
2410.00320 (2024-10)
PointAD: Comprehending 3D Anomalies from Points and Pixels for Zero-shot 3D Anomaly Detection
2505.09265 (2025-05)
MetaUAS: Universal Anomaly Segmentation with One-Prompt Meta-Learning

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

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 Win-CLIP+, 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%) AU-ROC in zero-shot anomaly classification and segmentation while WinCLIP+ does 93.1%/95.2% (83.8%/96.4%) in 1normal-shot, surpassing state-of-the-art by large margins.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2303.14814")
get_code_for_paper("2303.14814")
have("2303.14814")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2303.14814.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2303.14814.svg)](https://syntology.ai/paper/2303.14814)

Connect an agent — have() is free.