{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/a-zero-few-shot-anomaly-classification-and","title":"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","arxiv_id":"2305.17382","date":"2023-05-27","proceeding":null,"authors":["Xuhai Chen","Yue Han","Jiangning Zhang"],"abstract":"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.","url_abs":"https://arxiv.org/abs/2305.17382v3","url_pdf":"https://arxiv.org/pdf/2305.17382v3.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"a-zero-few-shot-anomaly-classification-and","repo_url":"https://github.com/bychelsea/vand-april-gan","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"a-zero-few-shot-anomaly-classification-and","repo_url":"https://github.com/hq-deng/AnoVL","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"anomaly-classification","task_name":"Anomaly Classification"},{"task_slug":"anomaly-detection","task_name":"Anomaly Detection"},{"task_slug":"novelty-detection","task_name":"Novelty Detection"}],"methods":[{"method_slug":"clip","method_name":"CLIP"},{"method_slug":"test","method_name":"Test"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/anomaly-classification-on-visa","task":"Anomaly Classification","dataset":"VisA","model":"APRIL-GAN","rank_in_archive_order":1,"of":1,"metrics":{"Detection AUROC":"78.0"},"uses_additional_data":true},{"leaderboard":"/sota/anomaly-detection-on-mvtec-ad","task":"Anomaly Detection","dataset":"MVTec AD","model":"APRIL-GAN（zero-shot）","rank_in_archive_order":120,"of":148,"metrics":{"Detection AUROC":"86.1","Segmentation AP":"40.8","Segmentation AUPRO":"44.0","Segmentation AUROC":"87.6"},"uses_additional_data":false},{"leaderboard":"/sota/anomaly-detection-on-visa","task":"Anomaly Detection","dataset":"VisA","model":"APRIL-GAN","rank_in_archive_order":42,"of":50,"metrics":{"Detection AUROC":"78.0","F1-Score":"32.3","Segmentation AUPRO":"86.8","Segmentation AUROC":"94.2"},"uses_additional_data":true}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2305.17382","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2305.17382"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/bychelsea/vand-april-gan","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/hq-deng/AnoVL","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_violates":1,"ran_draft_wrong":2,"ran":1,"unverified":6},"by_repo_kind":{"official":{"samples":10,"ran":4,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"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"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"f19962ebb134b3d7","entry":"convert_to_custom_text_state_dict","repo":"bychelsea/vand-april-gan","repo_kind":"official","path":"open_clip/model.py","file_url":"https://github.com/bychelsea/vand-april-gan/blob/HEAD/open_clip/model.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f19962ebb134b3d7"}},{"code_sha256_prefix":"d6cbed724d58041a","entry":"encode_text_with_prompt_ensemble","repo":"bychelsea/vand-april-gan","repo_kind":"official","path":"prompt_ensemble.py","file_url":"https://github.com/bychelsea/vand-april-gan/blob/HEAD/prompt_ensemble.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d6cbed724d58041a"}},{"code_sha256_prefix":"dcd422d66b0581d8","entry":"get_cast_dtype","repo":"bychelsea/vand-april-gan","repo_kind":"official","path":"open_clip/model.py","file_url":"https://github.com/bychelsea/vand-april-gan/blob/HEAD/open_clip/model.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"dcd422d66b0581d8"}},{"code_sha256_prefix":"4b3a4d17e1df3140","entry":"load_state_dict","repo":"bychelsea/vand-april-gan","repo_kind":"official","path":"open_clip/factory.py","file_url":"https://github.com/bychelsea/vand-april-gan/blob/HEAD/open_clip/factory.py","link_basis":"plan_row","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4b3a4d17e1df3140"}},{"code_sha256_prefix":"096be08051b5c0d0","entry":"build_model_from_openai_state_dict","repo":"bychelsea/vand-april-gan","repo_kind":"official","path":"open_clip/model.py","file_url":"https://github.com/bychelsea/vand-april-gan/blob/HEAD/open_clip/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"096be08051b5c0d0"}},{"code_sha256_prefix":"ddcbd45e940484ee","entry":"gather_features","repo":"bychelsea/vand-april-gan","repo_kind":"official","path":"open_clip/loss.py","file_url":"https://github.com/bychelsea/vand-april-gan/blob/HEAD/open_clip/loss.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ddcbd45e940484ee"}},{"code_sha256_prefix":"5c7cf820e99443ff","entry":"get_model_config","repo":"bychelsea/vand-april-gan","repo_kind":"official","path":"open_clip/factory.py","file_url":"https://github.com/bychelsea/vand-april-gan/blob/HEAD/open_clip/factory.py","link_basis":"plan_row","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5c7cf820e99443ff"}},{"code_sha256_prefix":"f34d8f34635af394","entry":"get_tokenizer","repo":"bychelsea/vand-april-gan","repo_kind":"official","path":"open_clip/factory.py","file_url":"https://github.com/bychelsea/vand-april-gan/blob/HEAD/open_clip/factory.py","link_basis":"plan_row","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f34d8f34635af394"}},{"code_sha256_prefix":"fb651d0a97fd4d3f","entry":"prepare_inputs_for_generation","repo":"bychelsea/vand-april-gan","repo_kind":"official","path":"open_clip/coca_model.py","file_url":"https://github.com/bychelsea/vand-april-gan/blob/HEAD/open_clip/coca_model.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"fb651d0a97fd4d3f"}},{"code_sha256_prefix":"2a377da4a76a2d44","entry":"register_pooler","repo":"bychelsea/vand-april-gan","repo_kind":"official","path":"open_clip/hf_model.py","file_url":"https://github.com/bychelsea/vand-april-gan/blob/HEAD/open_clip/hf_model.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2a377da4a76a2d44"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}