{"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/filo-zero-shot-anomaly-detection-by-fine","title":"FiLo: Zero-Shot Anomaly Detection by Fine-Grained Description and High-Quality Localization","arxiv_id":"2404.13671","date":"2024-04-21","proceeding":null,"authors":["Zhaopeng Gu","Bingke Zhu","Guibo Zhu","Yingying Chen","Hao Li","Ming Tang","Jinqiao Wang"],"abstract":"Zero-shot anomaly detection (ZSAD) methods entail detecting anomalies directly without access to any known normal or abnormal samples within the target item categories. Existing approaches typically rely on the robust generalization capabilities of multimodal pretrained models, computing similarities between manually crafted textual features representing \"normal\" or \"abnormal\" semantics and image features to detect anomalies and localize anomalous patches. However, the generic descriptions of \"abnormal\" often fail to precisely match diverse types of anomalies across different object categories. Additionally, computing feature similarities for single patches struggles to pinpoint specific locations of anomalies with various sizes and scales. To address these issues, we propose a novel ZSAD method called FiLo, comprising two components: adaptively learned Fine-Grained Description (FG-Des) and position-enhanced High-Quality Localization (HQ-Loc). FG-Des introduces fine-grained anomaly descriptions for each category using Large Language Models (LLMs) and employs adaptively learned textual templates to enhance the accuracy and interpretability of anomaly detection. HQ-Loc, utilizing Grounding DINO for preliminary localization, position-enhanced text prompts, and Multi-scale Multi-shape Cross-modal Interaction (MMCI) module, facilitates more accurate localization of anomalies of different sizes and shapes. Experimental results on datasets like MVTec and VisA demonstrate that FiLo significantly improves the performance of ZSAD in both detection and localization, achieving state-of-the-art performance with an image-level AUC of 83.9% and a pixel-level AUC of 95.9% on the VisA dataset. Code is available at https://github.com/CASIA-IVA-Lab/FiLo.","url_abs":"https://arxiv.org/abs/2404.13671v2","url_pdf":"https://arxiv.org/pdf/2404.13671v2.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":"filo-zero-shot-anomaly-detection-by-fine","repo_url":"https://github.com/casia-iva-lab/filo","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"anomaly-detection","task_name":"Anomaly Detection"},{"task_slug":null,"task_name":"Position"},{"task_slug":"zero-shot-anomaly-detection","task_name":"zero-shot anomaly detection"}],"methods":[{"method_slug":"attention","method_name":"Attention"},{"method_slug":"dino","method_name":"DINO"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"vision-transformer","method_name":"Vision Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2404.13671","atlas_url":"https://app.syntology.ai/?focus=2404.13671","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2404.13671"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/casia-iva-lab/filo","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran_violates":1,"ran_draft_wrong":1,"ran":2,"ran_fixture":1,"unverified":7},"by_repo_kind":{"official":{"samples":12,"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":"f19962ebb134b3d7","entry":"convert_to_custom_text_state_dict","repo":"casia-iva-lab/filo","repo_kind":"official","path":"models/vv_open_clip/model.py","file_url":"https://github.com/casia-iva-lab/filo/blob/HEAD/models/vv_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":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f19962ebb134b3d7"}},{"code_sha256_prefix":"dcd422d66b0581d8","entry":"get_cast_dtype","repo":"casia-iva-lab/filo","repo_kind":"official","path":"models/vv_open_clip/model.py","file_url":"https://github.com/casia-iva-lab/filo/blob/HEAD/models/vv_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":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"dcd422d66b0581d8"}},{"code_sha256_prefix":"4b3a4d17e1df3140","entry":"load_state_dict","repo":"casia-iva-lab/filo","repo_kind":"official","path":"models/vv_open_clip/factory.py","file_url":"https://github.com/casia-iva-lab/filo/blob/HEAD/models/vv_open_clip/factory.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"4b3a4d17e1df3140"}},{"code_sha256_prefix":"abedbe9b904a9780","entry":"smooth","repo":"casia-iva-lab/filo","repo_kind":"official","path":"utils/loss.py","file_url":"https://github.com/casia-iva-lab/filo/blob/HEAD/utils/loss.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"abedbe9b904a9780"}},{"code_sha256_prefix":"208456d9417303f4","entry":"sparsity","repo":"casia-iva-lab/filo","repo_kind":"official","path":"utils/loss.py","file_url":"https://github.com/casia-iva-lab/filo/blob/HEAD/utils/loss.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"208456d9417303f4"}},{"code_sha256_prefix":"566817905973a0e8","entry":"build_model_from_openai_state_dict","repo":"casia-iva-lab/filo","repo_kind":"official","path":"models/vv_open_clip/model.py","file_url":"https://github.com/casia-iva-lab/filo/blob/HEAD/models/vv_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":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"566817905973a0e8"}},{"code_sha256_prefix":"ddcbd45e940484ee","entry":"gather_features","repo":"casia-iva-lab/filo","repo_kind":"official","path":"models/vv_open_clip/loss.py","file_url":"https://github.com/casia-iva-lab/filo/blob/HEAD/models/vv_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":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ddcbd45e940484ee"}},{"code_sha256_prefix":"5c7cf820e99443ff","entry":"get_model_config","repo":"casia-iva-lab/filo","repo_kind":"official","path":"models/vv_open_clip/factory.py","file_url":"https://github.com/casia-iva-lab/filo/blob/HEAD/models/vv_open_clip/factory.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5c7cf820e99443ff"}},{"code_sha256_prefix":"f34d8f34635af394","entry":"get_tokenizer","repo":"casia-iva-lab/filo","repo_kind":"official","path":"models/vv_open_clip/factory.py","file_url":"https://github.com/casia-iva-lab/filo/blob/HEAD/models/vv_open_clip/factory.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f34d8f34635af394"}},{"code_sha256_prefix":"a1693b09a14a516f","entry":"load_openai_model","repo":"casia-iva-lab/filo","repo_kind":"official","path":"models/vv_open_clip/openai.py","file_url":"https://github.com/casia-iva-lab/filo/blob/HEAD/models/vv_open_clip/openai.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a1693b09a14a516f"}},{"code_sha256_prefix":"fb651d0a97fd4d3f","entry":"prepare_inputs_for_generation","repo":"casia-iva-lab/filo","repo_kind":"official","path":"models/vv_open_clip/coca_model.py","file_url":"https://github.com/casia-iva-lab/filo/blob/HEAD/models/vv_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":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"fb651d0a97fd4d3f"}},{"code_sha256_prefix":"2a377da4a76a2d44","entry":"register_pooler","repo":"casia-iva-lab/filo","repo_kind":"official","path":"models/vv_open_clip/hf_model.py","file_url":"https://github.com/casia-iva-lab/filo/blob/HEAD/models/vv_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":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2a377da4a76a2d44"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}