{"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/from-global-to-local-multi-scale-out-of","title":"From Global to Local: Multi-scale Out-of-distribution Detection","arxiv_id":"2308.10239","date":"2023-08-20","proceeding":null,"authors":["Ji Zhang","Lianli Gao","Bingguang Hao","Hao Huang","Jingkuan Song","HengTao Shen"],"abstract":"Out-of-distribution (OOD) detection aims to detect \"unknown\" data whose labels have not been seen during the in-distribution (ID) training process. Recent progress in representation learning gives rise to distance-based OOD detection that recognizes inputs as ID/OOD according to their relative distances to the training data of ID classes. Previous approaches calculate pairwise distances relying only on global image representations, which can be sub-optimal as the inevitable background clutter and intra-class variation may drive image-level representations from the same ID class far apart in a given representation space. In this work, we overcome this challenge by proposing Multi-scale OOD DEtection (MODE), a first framework leveraging both global visual information and local region details of images to maximally benefit OOD detection. Specifically, we first find that existing models pretrained by off-the-shelf cross-entropy or contrastive losses are incompetent to capture valuable local representations for MODE, due to the scale-discrepancy between the ID training and OOD detection processes. To mitigate this issue and encourage locally discriminative representations in ID training, we propose Attention-based Local PropAgation (ALPA), a trainable objective that exploits a cross-attention mechanism to align and highlight the local regions of the target objects for pairwise examples. During test-time OOD detection, a Cross-Scale Decision (CSD) function is further devised on the most discriminative multi-scale representations to distinguish ID/OOD data more faithfully. We demonstrate the effectiveness and flexibility of MODE on several benchmarks -- on average, MODE outperforms the previous state-of-the-art by up to 19.24% in FPR, 2.77% in AUROC. Code is available at https://github.com/JimZAI/MODE-OOD.","url_abs":"https://arxiv.org/abs/2308.10239v1","url_pdf":"https://arxiv.org/pdf/2308.10239v1.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":"from-global-to-local-multi-scale-out-of","repo_url":"https://github.com/jimzai/mode-ood","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"ood-detection","task_name":"Out of Distribution (OOD) Detection"},{"task_slug":"out-of-distribution-detection","task_name":"Out-of-Distribution Detection"},{"task_slug":"representation-learning","task_name":"Representation Learning"}],"methods":[{"method_slug":"align","method_name":"ALIGN"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2308.10239","atlas_url":"https://app.syntology.ai/?focus=2308.10239","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2308.10239"}},"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/jimzai/mode-ood","reach":{"status":"ok"}}],"summary":{"ran_draft_wrong":3,"ran_honours":1,"ran":4,"unverified":2},"by_repo_kind":{"official":{"samples":10,"ran":8,"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":10,"samples":[{"code_sha256_prefix":"fac5364e2f53c6db","entry":"conv3x3","repo":"jimzai/mode-ood","repo_kind":"official","path":"models/resnet.py","file_url":"https://github.com/jimzai/mode-ood/blob/HEAD/models/resnet.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":"fac5364e2f53c6db"}},{"code_sha256_prefix":"209469a90d2f8a72","entry":"get_energy_score","repo":"jimzai/mode-ood","repo_kind":"official","path":"util/score.py","file_url":"https://github.com/jimzai/mode-ood/blob/HEAD/util/score.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"209469a90d2f8a72"}},{"code_sha256_prefix":"683101b9e3719e85","entry":"get_lgst_score","repo":"jimzai/mode-ood","repo_kind":"official","path":"util/score.py","file_url":"https://github.com/jimzai/mode-ood/blob/HEAD/util/score.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"683101b9e3719e85"}},{"code_sha256_prefix":"6126345504c875f7","entry":"get_msp_score","repo":"jimzai/mode-ood","repo_kind":"official","path":"util/score.py","file_url":"https://github.com/jimzai/mode-ood/blob/HEAD/util/score.py","link_basis":"plan_row","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6126345504c875f7"}},{"code_sha256_prefix":"50f35f73306b91cd","entry":"projector","repo":"jimzai/mode-ood","repo_kind":"official","path":"models/attention.py","file_url":"https://github.com/jimzai/mode-ood/blob/HEAD/models/attention.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":"50f35f73306b91cd"}},{"code_sha256_prefix":"736b93ffffc416ab","entry":"resnet18","repo":"jimzai/mode-ood","repo_kind":"official","path":"models/resnet_ss.py","file_url":"https://github.com/jimzai/mode-ood/blob/HEAD/models/resnet_ss.py","link_basis":"harvester_set","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":"736b93ffffc416ab"}},{"code_sha256_prefix":"e7381567b86eedac","entry":"resnet18","repo":"jimzai/mode-ood","repo_kind":"official","path":"models/resnet.py","file_url":"https://github.com/jimzai/mode-ood/blob/HEAD/models/resnet.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":"e7381567b86eedac"}},{"code_sha256_prefix":"57a690473dc3173f","entry":"resnet50","repo":"jimzai/mode-ood","repo_kind":"official","path":"models/resnet.py","file_url":"https://github.com/jimzai/mode-ood/blob/HEAD/models/resnet.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":"57a690473dc3173f"}},{"code_sha256_prefix":"35a7bbf658cac9cd","entry":"get_model","repo":"jimzai/mode-ood","repo_kind":"official","path":"util/model_loader.py","file_url":"https://github.com/jimzai/mode-ood/blob/HEAD/util/model_loader.py","link_basis":"first_harvest_node","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":"35a7bbf658cac9cd"}},{"code_sha256_prefix":"2297ed2ca4911b7c","entry":"set_loader","repo":"jimzai/mode-ood","repo_kind":"official","path":"ALPA/main_ce.py","file_url":"https://github.com/jimzai/mode-ood/blob/HEAD/ALPA/main_ce.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":"2297ed2ca4911b7c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}