{"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/zero-shot-in-distribution-detection-in-multi","title":"GL-MCM: Global and Local Maximum Concept Matching for Zero-Shot Out-of-Distribution Detection","arxiv_id":"2304.04521","date":"2023-04-10","proceeding":null,"authors":["Atsuyuki Miyai","Qing Yu","Go Irie","Kiyoharu Aizawa"],"abstract":"Zero-shot out-of-distribution (OOD) detection is a task that detects OOD images during inference with only in-distribution (ID) class names. Existing methods assume ID images contain a single, centered object, and do not consider the more realistic multi-object scenarios, where both ID and OOD objects are present. To meet the needs of many users, the detection method must have the flexibility to adapt the type of ID images. To this end, we present Global-Local Maximum Concept Matching (GL-MCM), which incorporates local image scores as an auxiliary score to enhance the separability of global and local visual features. Due to the simple ensemble score function design, GL-MCM can control the type of ID images with a single weight parameter. Experiments on ImageNet and multi-object benchmarks demonstrate that GL-MCM outperforms baseline zero-shot methods and is comparable to fully supervised methods. Furthermore, GL-MCM offers strong flexibility in adjusting the target type of ID images. The code is available via https://github.com/AtsuMiyai/GL-MCM.","url_abs":"https://arxiv.org/abs/2304.04521v4","url_pdf":"https://arxiv.org/pdf/2304.04521v4.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":"zero-shot-in-distribution-detection-in-multi","repo_url":"https://github.com/atsumiyai/gl-mcm","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"zero-shot-in-distribution-detection-in-multi","repo_url":"https://github.com/atsumiyai/locoop","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"zero-shot-in-distribution-detection-in-multi","repo_url":"https://github.com/hoshi23/ood-x-banchmarks","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"zero-shot-in-distribution-detection-in-multi","repo_url":"https://github.com/hoshi23/ood-x-benchmarks","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"object","task_name":"Object"},{"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":"clip","method_name":"CLIP"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2304.04521","atlas_url":"https://app.syntology.ai/?focus=2304.04521","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2304.04521"}},"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/atsumiyai/locoop","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/atsumiyai/gl-mcm","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/hoshi23/ood-x-benchmarks","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/hoshi23/ood-x-banchmarks","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":8,"ran_draft_wrong":3,"ran_fixture":1,"ran_honours":1,"unverified":3},"by_repo_kind":{"official":{"samples":16,"ran":13,"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":"088e80bb4051265a","entry":"accuracy","repo":"atsumiyai/gl-mcm","repo_kind":"official","path":"utils/common.py","file_url":"https://github.com/atsumiyai/gl-mcm/blob/HEAD/utils/common.py","link_basis":"harvester_set","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":"088e80bb4051265a"}},{"code_sha256_prefix":"98f385d847636a3e","entry":"basic_clean","repo":"atsumiyai/gl-mcm","repo_kind":"official","path":"clip/simple_tokenizer.py","file_url":"https://github.com/atsumiyai/gl-mcm/blob/HEAD/clip/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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"98f385d847636a3e"}},{"code_sha256_prefix":"3853ecdb6fc74451","entry":"fpr_and_fdr_at_recall","repo":"atsumiyai/gl-mcm","repo_kind":"official","path":"utils/detection_util.py","file_url":"https://github.com/atsumiyai/gl-mcm/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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3853ecdb6fc74451"}},{"code_sha256_prefix":"d919ae32e5e4e616","entry":"get_pairs","repo":"atsumiyai/gl-mcm","repo_kind":"official","path":"clip/simple_tokenizer.py","file_url":"https://github.com/atsumiyai/gl-mcm/blob/HEAD/clip/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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d919ae32e5e4e616"}},{"code_sha256_prefix":"80c8dac5a9baef31","entry":"get_subset_with_len","repo":"atsumiyai/gl-mcm","repo_kind":"official","path":"utils/train_eval_util.py","file_url":"https://github.com/atsumiyai/gl-mcm/blob/HEAD/utils/train_eval_util.py","link_basis":"harvester_set","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":"80c8dac5a9baef31"}},{"code_sha256_prefix":"75e589009e3da37c","entry":"get_test_labels","repo":"atsumiyai/gl-mcm","repo_kind":"official","path":"utils/common.py","file_url":"https://github.com/atsumiyai/gl-mcm/blob/HEAD/utils/common.py","link_basis":"harvester_set","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":"75e589009e3da37c"}},{"code_sha256_prefix":"2358075eb310a541","entry":"load_scores","repo":"atsumiyai/gl-mcm","repo_kind":"official","path":"utils/file_ops.py","file_url":"https://github.com/atsumiyai/gl-mcm/blob/HEAD/utils/file_ops.py","link_basis":"harvester_set","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":"2358075eb310a541"}},{"code_sha256_prefix":"1be3e6a03938ec75","entry":"prepare_dataframe","repo":"atsumiyai/gl-mcm","repo_kind":"official","path":"utils/file_ops.py","file_url":"https://github.com/atsumiyai/gl-mcm/blob/HEAD/utils/file_ops.py","link_basis":"harvester_set","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":"1be3e6a03938ec75"}},{"code_sha256_prefix":"65aed69fd9c43272","entry":"read_file","repo":"atsumiyai/gl-mcm","repo_kind":"official","path":"utils/common.py","file_url":"https://github.com/atsumiyai/gl-mcm/blob/HEAD/utils/common.py","link_basis":"harvester_set","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":"65aed69fd9c43272"}},{"code_sha256_prefix":"f3fda6c7f479b606","entry":"set_val_loader","repo":"atsumiyai/gl-mcm","repo_kind":"official","path":"utils/train_eval_util.py","file_url":"https://github.com/atsumiyai/gl-mcm/blob/HEAD/utils/train_eval_util.py","link_basis":"harvester_set","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":"f3fda6c7f479b606"}},{"code_sha256_prefix":"db2eed8f505e7836","entry":"setup_log","repo":"atsumiyai/gl-mcm","repo_kind":"official","path":"utils/file_ops.py","file_url":"https://github.com/atsumiyai/gl-mcm/blob/HEAD/utils/file_ops.py","link_basis":"harvester_set","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":"db2eed8f505e7836"}},{"code_sha256_prefix":"d4acb3120a027622","entry":"stable_cumsum","repo":"atsumiyai/gl-mcm","repo_kind":"official","path":"utils/detection_util.py","file_url":"https://github.com/atsumiyai/gl-mcm/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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d4acb3120a027622"}},{"code_sha256_prefix":"9542161e9640b858","entry":"whitespace_clean","repo":"atsumiyai/gl-mcm","repo_kind":"official","path":"clip/simple_tokenizer.py","file_url":"https://github.com/atsumiyai/gl-mcm/blob/HEAD/clip/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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9542161e9640b858"}},{"code_sha256_prefix":"a7667e7d84eccfd8","entry":"build_model","repo":"atsumiyai/gl-mcm","repo_kind":"official","path":"clip/model.py","file_url":"https://github.com/atsumiyai/gl-mcm/blob/HEAD/clip/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":"a7667e7d84eccfd8"}},{"code_sha256_prefix":"24570af601666d85","entry":"get_measures","repo":"atsumiyai/gl-mcm","repo_kind":"official","path":"utils/detection_util.py","file_url":"https://github.com/atsumiyai/gl-mcm/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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"24570af601666d85"}},{"code_sha256_prefix":"c22a78c25372b59f","entry":"load","repo":"atsumiyai/gl-mcm","repo_kind":"official","path":"clip/clip.py","file_url":"https://github.com/atsumiyai/gl-mcm/blob/HEAD/clip/clip.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":"c22a78c25372b59f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}