{"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/enhancing-outlier-knowledge-for-few-shot-out","title":"Enhancing Outlier Knowledge for Few-Shot Out-of-Distribution Detection with Extensible Local Prompts","arxiv_id":"2409.04796","date":"2024-09-07","proceeding":null,"authors":["Fanhu Zeng","Zhen Cheng","Fei Zhu","Xu-Yao Zhang"],"abstract":"Out-of-Distribution (OOD) detection, aiming to distinguish outliers from known categories, has gained prominence in practical scenarios. Recently, the advent of vision-language models (VLM) has heightened interest in enhancing OOD detection for VLM through few-shot tuning. However, existing methods mainly focus on optimizing global prompts, ignoring refined utilization of local information with regard to outliers. Motivated by this, we freeze global prompts and introduce a novel coarse-to-fine tuning paradigm to emphasize regional enhancement with local prompts. Our method comprises two integral components: global prompt guided negative augmentation and local prompt enhanced regional regularization. The former utilizes frozen, coarse global prompts as guiding cues to incorporate negative augmentation, thereby leveraging local outlier knowledge. The latter employs trainable local prompts and a regional regularization to capture local information effectively, aiding in outlier identification. We also propose regional-related metric to empower the enrichment of OOD detection. Moreover, since our approach explores enhancing local prompts only, it can be seamlessly integrated with trained global prompts during inference to boost the performance. Comprehensive experiments demonstrate the effectiveness and potential of our method. Notably, our method reduces average FPR95 by 5.17% against state-of-the-art method in 4-shot tuning on challenging ImageNet-1k dataset, even outperforming 16-shot results of previous methods.","url_abs":"https://arxiv.org/abs/2409.04796v1","url_pdf":"https://arxiv.org/pdf/2409.04796v1.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":[],"tasks":[{"task_slug":"ood-detection","task_name":"Out of Distribution (OOD) Detection"},{"task_slug":"out-of-distribution-detection","task_name":"Out-of-Distribution Detection"}],"methods":[{"method_slug":"focus","method_name":"Focus"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2409.04796","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2409.04796"}},"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":"deterministic:regex_extraction","url":"https://github.com/AuroraZengfh/Local-Prompt","reach":{"status":"ok"}}],"summary":{"ran_draft_wrong":3,"ran_fixture":1,"ran":5,"ran_honours":1,"unverified":3},"by_repo_kind":{"found_in_text":{"samples":13,"ran":10,"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":13,"samples":[{"code_sha256_prefix":"98f385d847636a3e","entry":"basic_clean","repo":"AuroraZengfh/Local-Prompt","repo_kind":"found_in_text","path":"clip_w_local/simple_tokenizer.py","file_url":"https://github.com/AuroraZengfh/Local-Prompt/blob/HEAD/clip_w_local/simple_tokenizer.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"98f385d847636a3e"}},{"code_sha256_prefix":"3853ecdb6fc74451","entry":"fpr_and_fdr_at_recall","repo":"AuroraZengfh/Local-Prompt","repo_kind":"found_in_text","path":"utils/detection_util.py","file_url":"https://github.com/AuroraZengfh/Local-Prompt/blob/HEAD/utils/detection_util.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3853ecdb6fc74451"}},{"code_sha256_prefix":"c28216e5027f12a2","entry":"getAttMap","repo":"AuroraZengfh/Local-Prompt","repo_kind":"found_in_text","path":"utils/grad_cam.py","file_url":"https://github.com/AuroraZengfh/Local-Prompt/blob/HEAD/utils/grad_cam.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c28216e5027f12a2"}},{"code_sha256_prefix":"d919ae32e5e4e616","entry":"get_pairs","repo":"AuroraZengfh/Local-Prompt","repo_kind":"found_in_text","path":"clip_w_local/simple_tokenizer.py","file_url":"https://github.com/AuroraZengfh/Local-Prompt/blob/HEAD/clip_w_local/simple_tokenizer.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":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d919ae32e5e4e616"}},{"code_sha256_prefix":"7458439441af1cea","entry":"load_image","repo":"AuroraZengfh/Local-Prompt","repo_kind":"found_in_text","path":"utils/grad_cam.py","file_url":"https://github.com/AuroraZengfh/Local-Prompt/blob/HEAD/utils/grad_cam.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7458439441af1cea"}},{"code_sha256_prefix":"850654253698ad7e","entry":"normalize","repo":"AuroraZengfh/Local-Prompt","repo_kind":"found_in_text","path":"utils/grad_cam.py","file_url":"https://github.com/AuroraZengfh/Local-Prompt/blob/HEAD/utils/grad_cam.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"850654253698ad7e"}},{"code_sha256_prefix":"fe4e39f3658c298b","entry":"set_ood_loader_ImageNet","repo":"AuroraZengfh/Local-Prompt","repo_kind":"found_in_text","path":"utils/train_eval_util.py","file_url":"https://github.com/AuroraZengfh/Local-Prompt/blob/HEAD/utils/train_eval_util.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"fe4e39f3658c298b"}},{"code_sha256_prefix":"1549a4e42b6f3cb3","entry":"set_val_loader","repo":"AuroraZengfh/Local-Prompt","repo_kind":"found_in_text","path":"utils/train_eval_util.py","file_url":"https://github.com/AuroraZengfh/Local-Prompt/blob/HEAD/utils/train_eval_util.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1549a4e42b6f3cb3"}},{"code_sha256_prefix":"d4acb3120a027622","entry":"stable_cumsum","repo":"AuroraZengfh/Local-Prompt","repo_kind":"found_in_text","path":"utils/detection_util.py","file_url":"https://github.com/AuroraZengfh/Local-Prompt/blob/HEAD/utils/detection_util.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d4acb3120a027622"}},{"code_sha256_prefix":"9542161e9640b858","entry":"whitespace_clean","repo":"AuroraZengfh/Local-Prompt","repo_kind":"found_in_text","path":"clip_w_local/simple_tokenizer.py","file_url":"https://github.com/AuroraZengfh/Local-Prompt/blob/HEAD/clip_w_local/simple_tokenizer.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"9542161e9640b858"}},{"code_sha256_prefix":"dbbf313e1d3a69ba","entry":"build_model","repo":"AuroraZengfh/Local-Prompt","repo_kind":"found_in_text","path":"clip_w_local/model.py","file_url":"https://github.com/AuroraZengfh/Local-Prompt/blob/HEAD/clip_w_local/model.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"dbbf313e1d3a69ba"}},{"code_sha256_prefix":"24570af601666d85","entry":"get_measures","repo":"AuroraZengfh/Local-Prompt","repo_kind":"found_in_text","path":"utils/detection_util.py","file_url":"https://github.com/AuroraZengfh/Local-Prompt/blob/HEAD/utils/detection_util.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"24570af601666d85"}},{"code_sha256_prefix":"fbf8c0143d9c48e3","entry":"load","repo":"AuroraZengfh/Local-Prompt","repo_kind":"found_in_text","path":"clip_w_local/clip.py","file_url":"https://github.com/AuroraZengfh/Local-Prompt/blob/HEAD/clip_w_local/clip.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"fbf8c0143d9c48e3"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}