{"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/arxiv-2508-13560","title":"DictAS: A Framework for Class-Generalizable Few-Shot Anomaly Segmentation via Dictionary Lookup","arxiv_id":"2508.13560","date":"2025-08-19","proceeding":"ICCV","authors":["Zhen Qu","Xian Tao","Xinyi Gong","ShiChen Qu","Xiaopei Zhang","Xingang Wang","Fei Shen","Zhengtao Zhang","Mukesh Prasad","Guiguang Ding"],"abstract":"Recent vision-language models (e.g., CLIP) have demonstrated remarkable class-generalizable ability to unseen classes in few-shot anomaly segmentation (FSAS), leveraging supervised prompt learning or fine-tuning on seen classes. However, their cross-category generalization largely depends on prior knowledge of real seen anomaly samples. In this paper, we propose a novel framework, namely DictAS, which enables a unified model to detect visual anomalies in unseen object categories without any retraining on the target data, only employing a few normal reference images as visual prompts. The insight behind DictAS is to transfer dictionary lookup capabilities to the FSAS task for unseen classes via self-supervised learning, instead of merely memorizing the normal and abnormal feature patterns from the training set. Specifically, DictAS mainly consists of three components: (1) Dictionary Construction - to simulate the index and content of a real dictionary using features from normal reference images. (2) Dictionary Lookup - to retrieve queried region features from the dictionary via a sparse lookup strategy. When a query feature cannot be retrieved, it is classified as an anomaly. (3) Query Discrimination Regularization - to enhance anomaly discrimination by making abnormal features harder to retrieve from the dictionary. To achieve this, Contrastive Query Constraint and Text Alignment Constraint are further proposed. Extensive experiments on seven public industrial and medical datasets demonstrate that DictAS consistently outperforms state-of-the-art FSAS methods.","url_abs":"https://arxiv.org/abs/2508.13560","url_pdf":"https://arxiv.org/pdf/2508.13560","source":{"archive":null,"snapshot":"2025-07-28","note":"not in the Papers with Code archive (frozen at the snapshot)","row_kind":"graph","title_abstract_authors_date":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)"},"code_links":[],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2508.13560","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2508.13560"}},"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":[{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/xiaozhen228/DictAS","reach":null}],"summary":{"ran":5,"unverified":1},"by_repo_kind":{"found_in_text":{"samples":6,"ran":5,"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":"4ff80bccfc42ae35","entry":"Attn_Block","repo":"xiaozhen228/DictAS","repo_kind":"found_in_text","path":"models/DictAS.py","file_url":"https://github.com/xiaozhen228/DictAS/blob/HEAD/models/DictAS.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4ff80bccfc42ae35"}},{"code_sha256_prefix":"adade1d43a80dcdb","entry":"GenValue","repo":"xiaozhen228/DictAS","repo_kind":"found_in_text","path":"models/DictAS.py","file_url":"https://github.com/xiaozhen228/DictAS/blob/HEAD/models/DictAS.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"adade1d43a80dcdb"}},{"code_sha256_prefix":"bdc2cec973f04ac5","entry":"Global_Feature","repo":"xiaozhen228/DictAS","repo_kind":"found_in_text","path":"models/DictAS.py","file_url":"https://github.com/xiaozhen228/DictAS/blob/HEAD/models/DictAS.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"bdc2cec973f04ac5"}},{"code_sha256_prefix":"452d4c731921f622","entry":"MLP","repo":"xiaozhen228/DictAS","repo_kind":"found_in_text","path":"models/DictAS.py","file_url":"https://github.com/xiaozhen228/DictAS/blob/HEAD/models/DictAS.py","link_basis":"first_harvest_node","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":"452d4c731921f622"}},{"code_sha256_prefix":"fe46200877a9944e","entry":"Sparse_Lookup","repo":"xiaozhen228/DictAS","repo_kind":"found_in_text","path":"models/DictAS.py","file_url":"https://github.com/xiaozhen228/DictAS/blob/HEAD/models/DictAS.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"fe46200877a9944e"}},{"code_sha256_prefix":"fbffe3769b455a92","entry":"MyDictionary","repo":"xiaozhen228/DictAS","repo_kind":"found_in_text","path":"models/DictAS.py","file_url":"https://github.com/xiaozhen228/DictAS/blob/HEAD/models/DictAS.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":"fbffe3769b455a92"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.CV","source":"arxiv_api"},"syntology_extracted_results":null}