Papers › APRIL-GAN: A Zero-/Few-Shot Anomaly Classification and Segmentation Method for CVPR...

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

27 May 2023arXiv:2305.17382archive 2025-07-28

Xuhai Chen, Yue Han, Jiangning Zhang

In this technical report, we briefly introduce our solution for the Zero/Few-shot Track of the Visual Anomaly and Novelty Detection (VAND) 2023 Challenge. For industrial visual inspection, building a single model that can be rapidly adapted to numerous categories without or with only a few normal reference images is a promising research direction. This is primarily because of the vast variety of the product types. For the zero-shot track, we propose a solution based on the CLIP model by adding extra linear layers. These layers are used to map the image features to the joint embedding space, so that they can compare with the text features to generate the anomaly maps. Besides, when the reference images are available, we utilize multiple memory banks to store their features and compare them with the features of the test images during the testing phase. In this challenge, our method achieved first place in the zero-shot track, especially excelling in segmentation with an impressive F1 score improvement of 0.0489 over the second-ranked participant. Furthermore, in the few-shot track, we secured the fourth position overall, with our classification F1 score of 0.8687 ranking first among all participating teams.

PaperPDFCodeCode 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="2305.17382")

Code

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

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

bychelsea/vand-april-gan officialmentioned in papermentioned on GitHubpytorchMIT report
hq-deng/AnoVL mentioned 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

10 samples harvested; 4 ran; 0 honoured the contract we drafted; 6 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 · violated contract
2ran · our draft was wrong
1ran
6unverified

Licence: 0 of the 10 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 bychelsea/vand-april-gan. “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 bychelsea/vand-april-gan/open_clip/model.py official repository ran · violated contract MIT (permissive) · f19962ebb134b3d7 · report
encode_text_with_prompt_ensemble bychelsea/vand-april-gan/prompt_ensemble.py official repository ran · our draft was wrong MIT (permissive) · d6cbed724d58041a · report
get_cast_dtype bychelsea/vand-april-gan/open_clip/model.py official repository ran · our draft was wrong MIT (permissive) · dcd422d66b0581d8 · report
load_state_dict bychelsea/vand-april-gan/open_clip/factory.py official repository ran MIT (permissive) · 4b3a4d17e1df3140 · report
build_model_from_openai_state_dict bychelsea/vand-april-gan/open_clip/model.py official repository unverified MIT (permissive) · 096be08051b5c0d0 · report
gather_features bychelsea/vand-april-gan/open_clip/loss.py official repository unverified MIT (permissive) · ddcbd45e940484ee · report
get_model_config bychelsea/vand-april-gan/open_clip/factory.py official repository unverified MIT (permissive) · 5c7cf820e99443ff · report
get_tokenizer bychelsea/vand-april-gan/open_clip/factory.py official repository unverified MIT (permissive) · f34d8f34635af394 · report
prepare_inputs_for_generation bychelsea/vand-april-gan/open_clip/coca_model.py official repository unverified MIT (permissive) · fb651d0a97fd4d3f · report
register_pooler bychelsea/vand-april-gan/open_clip/hf_model.py official repository unverified MIT (permissive) · 2a377da4a76a2d44 · report

Tasks

Anomaly ClassificationAnomaly DetectionNovelty Detection

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Anomaly Classification VisA APRIL-GAN Detection AUROC 78.0 #1 of 1 Archive leaderboard report
Anomaly Detection MVTec AD APRIL-GAN(zero-shot) Detection AUROC 86.1 #120 of 148 Archive leaderboard report
Anomaly Detection MVTec AD APRIL-GAN(zero-shot) Segmentation AP 40.8 #120 of 148 Archive leaderboard report
Anomaly Detection MVTec AD APRIL-GAN(zero-shot) Segmentation AUPRO 44.0 #120 of 148 Archive leaderboard report
Anomaly Detection MVTec AD APRIL-GAN(zero-shot) Segmentation AUROC 87.6 #120 of 148 Archive leaderboard report
Anomaly Detection VisA APRIL-GAN Detection AUROC 78.0 #42 of 50 Archive leaderboard report
Anomaly Detection VisA APRIL-GAN F1-Score 32.3 #42 of 50 Archive leaderboard report
Anomaly Detection VisA APRIL-GAN Segmentation AUPRO 86.8 #42 of 50 Archive leaderboard report
Anomaly Detection VisA APRIL-GAN Segmentation AUROC 94.2 #42 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

CLIPTest

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