{"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/when-and-how-does-in-distribution-label-help","title":"When and How Does In-Distribution Label Help Out-of-Distribution Detection?","arxiv_id":"2405.18635","date":"2024-05-28","proceeding":null,"authors":["Xuefeng Du","Yiyou Sun","Yixuan Li"],"abstract":"Detecting data points deviating from the training distribution is pivotal for ensuring reliable machine learning. Extensive research has been dedicated to the challenge, spanning classical anomaly detection techniques to contemporary out-of-distribution (OOD) detection approaches. While OOD detection commonly relies on supervised learning from a labeled in-distribution (ID) dataset, anomaly detection may treat the entire ID data as a single class and disregard ID labels. This fundamental distinction raises a significant question that has yet to be rigorously explored: when and how does ID label help OOD detection? This paper bridges this gap by offering a formal understanding to theoretically delineate the impact of ID labels on OOD detection. We employ a graph-theoretic approach, rigorously analyzing the separability of ID data from OOD data in a closed-form manner. Key to our approach is the characterization of data representations through spectral decomposition on the graph. Leveraging these representations, we establish a provable error bound that compares the OOD detection performance with and without ID labels, unveiling conditions for achieving enhanced OOD detection. Lastly, we present empirical results on both simulated and real datasets, validating theoretical guarantees and reinforcing our insights. Code is publicly available at https://github.com/deeplearning-wisc/id_label.","url_abs":"https://arxiv.org/abs/2405.18635v1","url_pdf":"https://arxiv.org/pdf/2405.18635v1.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":"when-and-how-does-in-distribution-label-help","repo_url":"https://github.com/deeplearning-wisc/id_label","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"anomaly-detection","task_name":"Anomaly Detection"},{"task_slug":"ood-detection","task_name":"Out of Distribution (OOD) Detection"},{"task_slug":"out-of-distribution-detection","task_name":"Out-of-Distribution Detection"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2405.18635","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.18635"}},"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":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/deeplearning-wisc/id_label","reach":{"status":"ok"}}],"summary":{"ran_draft_wrong":3,"ran":7,"ran_honours":1,"unverified":1},"by_repo_kind":{"official":{"samples":12,"ran":11,"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":12,"samples":[{"code_sha256_prefix":"cb279c9dbdcb97c0","entry":"D","repo":"deeplearning-wisc/id_label","repo_kind":"official","path":"models/spectral.py","file_url":"https://github.com/deeplearning-wisc/id_label/blob/HEAD/models/spectral.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"cb279c9dbdcb97c0"}},{"code_sha256_prefix":"cd6d57e7c8432808","entry":"D","repo":"deeplearning-wisc/id_label","repo_kind":"official","path":"models/spectral_old.py","file_url":"https://github.com/deeplearning-wisc/id_label/blob/HEAD/models/spectral_old.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"cd6d57e7c8432808"}},{"code_sha256_prefix":"31f45aff0c4290a2","entry":"accuracy","repo":"deeplearning-wisc/id_label","repo_kind":"official","path":"linear_probe.py","file_url":"https://github.com/deeplearning-wisc/id_label/blob/HEAD/linear_probe.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":"31f45aff0c4290a2"}},{"code_sha256_prefix":"1134ab62338793e2","entry":"fpr_and_fdr_at_recall","repo":"deeplearning-wisc/id_label","repo_kind":"official","path":"metric_utils.py","file_url":"https://github.com/deeplearning-wisc/id_label/blob/HEAD/metric_utils.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":"1134ab62338793e2"}},{"code_sha256_prefix":"9b1abfca5a67be06","entry":"get_measures","repo":"deeplearning-wisc/id_label","repo_kind":"official","path":"metric_utils.py","file_url":"https://github.com/deeplearning-wisc/id_label/blob/HEAD/metric_utils.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":"9b1abfca5a67be06"}},{"code_sha256_prefix":"32af8c00b3d09da4","entry":"get_model","repo":"deeplearning-wisc/id_label","repo_kind":"official","path":"models/builder.py","file_url":"https://github.com/deeplearning-wisc/id_label/blob/HEAD/models/builder.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":"32af8c00b3d09da4"}},{"code_sha256_prefix":"55f4568be6fd0df0","entry":"load_ood_dataset","repo":"deeplearning-wisc/id_label","repo_kind":"official","path":"make_dataset.py","file_url":"https://github.com/deeplearning-wisc/id_label/blob/HEAD/make_dataset.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":"55f4568be6fd0df0"}},{"code_sha256_prefix":"b645d731bc4d2de3","entry":"normalized_thresh","repo":"deeplearning-wisc/id_label","repo_kind":"official","path":"models/spectral.py","file_url":"https://github.com/deeplearning-wisc/id_label/blob/HEAD/models/spectral.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b645d731bc4d2de3"}},{"code_sha256_prefix":"a44a1925c2c778ba","entry":"set_optimizer","repo":"deeplearning-wisc/id_label","repo_kind":"official","path":"linear_probe.py","file_url":"https://github.com/deeplearning-wisc/id_label/blob/HEAD/linear_probe.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":"a44a1925c2c778ba"}},{"code_sha256_prefix":"d4acb3120a027622","entry":"stable_cumsum","repo":"deeplearning-wisc/id_label","repo_kind":"official","path":"metric_utils.py","file_url":"https://github.com/deeplearning-wisc/id_label/blob/HEAD/metric_utils.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":"1ae39c289c58b21c","entry":"train","repo":"deeplearning-wisc/id_label","repo_kind":"official","path":"linear_probe.py","file_url":"https://github.com/deeplearning-wisc/id_label/blob/HEAD/linear_probe.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":"1ae39c289c58b21c"}},{"code_sha256_prefix":"d778b5788d9b7914","entry":"load_CIFAR","repo":"deeplearning-wisc/id_label","repo_kind":"official","path":"make_dataset.py","file_url":"https://github.com/deeplearning-wisc/id_label/blob/HEAD/make_dataset.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":"d778b5788d9b7914"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}