{"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/dos-diverse-outlier-sampling-for-out-of","title":"DOS: Diverse Outlier Sampling for Out-of-Distribution Detection","arxiv_id":"2306.02031","date":"2023-06-03","proceeding":null,"authors":["Wenyu Jiang","Hao Cheng","Mingcai Chen","Chongjun Wang","Hongxin Wei"],"abstract":"Modern neural networks are known to give overconfident prediction for out-of-distribution inputs when deployed in the open world. It is common practice to leverage a surrogate outlier dataset to regularize the model during training, and recent studies emphasize the role of uncertainty in designing the sampling strategy for outlier dataset. However, the OOD samples selected solely based on predictive uncertainty can be biased towards certain types, which may fail to capture the full outlier distribution. In this work, we empirically show that diversity is critical in sampling outliers for OOD detection performance. Motivated by the observation, we propose a straightforward and novel sampling strategy named DOS (Diverse Outlier Sampling) to select diverse and informative outliers. Specifically, we cluster the normalized features at each iteration, and the most informative outlier from each cluster is selected for model training with absent category loss. With DOS, the sampled outliers efficiently shape a globally compact decision boundary between ID and OOD data. Extensive experiments demonstrate the superiority of DOS, reducing the average FPR95 by up to 25.79% on CIFAR-100 with TI-300K.","url_abs":"https://arxiv.org/abs/2306.02031v2","url_pdf":"https://arxiv.org/pdf/2306.02031v2.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":"dos-diverse-outlier-sampling-for-out-of","repo_url":"https://github.com/lygjwy/dos","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"dos-diverse-outlier-sampling-for-out-of","repo_url":"https://github.com/o4lc/greg-ood","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"diversity","task_name":"Diversity"},{"task_slug":"out-of-distribution-detection","task_name":"Out-of-Distribution Detection"}],"methods":[{"method_slug":"fail","method_name":"fail"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2306.02031","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2306.02031"}},"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/lygjwy/DOS","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/o4lc/greg-ood","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/lygjwy/dos","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_violates":1,"ran_fixture":8,"ran_draft_wrong":1,"ran_honours":1,"unverified":10},"by_repo_kind":{"official":{"samples":20,"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":1,"samples":[{"code_sha256_prefix":"05eda95f9800a1e9","entry":"cosine_annealing","repo":"lygjwy/dos","repo_kind":"official","path":"train_diverse.py","file_url":"https://github.com/lygjwy/dos/blob/HEAD/train_diverse.py","link_basis":"first_harvest_node","language":"python","status":"ran_violates","verification_level":2,"contract_check":"VIOLATES","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"05eda95f9800a1e9"}},{"code_sha256_prefix":"fc9d1f65e44d5413","entry":"clusterAndChooseSamples","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"fc9d1f65e44d5413"}},{"code_sha256_prefix":"00e569acd6b45ef0","entry":"conv3x3","repo":"lygjwy/DOS","repo_kind":"official","path":"models/wide_resnet.py","file_url":"https://github.com/lygjwy/DOS/blob/HEAD/models/wide_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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"00e569acd6b45ef0"}},{"code_sha256_prefix":"6a3f8cf6f1129061","entry":"get_abs_score","repo":"lygjwy/dos","repo_kind":"official","path":"detect.py","file_url":"https://github.com/lygjwy/dos/blob/HEAD/detect.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6a3f8cf6f1129061"}},{"code_sha256_prefix":"3cdc0f0decb621be","entry":"get_abs_weight","repo":"lygjwy/dos","repo_kind":"official","path":"scores/utils.py","file_url":"https://github.com/lygjwy/dos/blob/HEAD/scores/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3cdc0f0decb621be"}},{"code_sha256_prefix":"080cda42f763c1b8","entry":"get_energy_weight","repo":"lygjwy/dos","repo_kind":"official","path":"scores/utils.py","file_url":"https://github.com/lygjwy/dos/blob/HEAD/scores/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"080cda42f763c1b8"}},{"code_sha256_prefix":"f4d6252717bec207","entry":"get_logit_score","repo":"lygjwy/dos","repo_kind":"official","path":"detect.py","file_url":"https://github.com/lygjwy/dos/blob/HEAD/detect.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f4d6252717bec207"}},{"code_sha256_prefix":"5545fbfd438c5417","entry":"get_msp_score","repo":"lygjwy/dos","repo_kind":"official","path":"detect.py","file_url":"https://github.com/lygjwy/dos/blob/HEAD/detect.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5545fbfd438c5417"}},{"code_sha256_prefix":"4a886b1bdfc7c5de","entry":"get_msp_weight","repo":"lygjwy/dos","repo_kind":"official","path":"scores/utils.py","file_url":"https://github.com/lygjwy/dos/blob/HEAD/scores/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4a886b1bdfc7c5de"}},{"code_sha256_prefix":"b7b09d9d9a19672a","entry":"norm","repo":"lygjwy/DOS","repo_kind":"official","path":"models/wide_resnet.py","file_url":"https://github.com/lygjwy/DOS/blob/HEAD/models/wide_resnet.py","link_basis":"plan_row","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":"b7b09d9d9a19672a"}},{"code_sha256_prefix":"0f638e35e14ffb38","entry":"test","repo":"lygjwy/dos","repo_kind":"official","path":"train_diverse.py","file_url":"https://github.com/lygjwy/dos/blob/HEAD/train_diverse.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0f638e35e14ffb38"}},{"code_sha256_prefix":"4de09f91637454ff","entry":"default_loader","repo":"lygjwy/DOS","repo_kind":"official","path":"datasets/named_dataset_with_meta.py","file_url":"https://github.com/lygjwy/DOS/blob/HEAD/datasets/named_dataset_with_meta.py","link_basis":"first_harvest_node","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":"4de09f91637454ff"}},{"code_sha256_prefix":"6679b57778186c6a","entry":"get_kl_score","repo":"lygjwy/DOS","repo_kind":"official","path":"scores/utils.py","file_url":"https://github.com/lygjwy/DOS/blob/HEAD/scores/utils.py","link_basis":"first_harvest_node","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":"6679b57778186c6a"}},{"code_sha256_prefix":"b5c11ebfae3c544e","entry":"get_weight","repo":"lygjwy/dos","repo_kind":"official","path":"scores/utils.py","file_url":"https://github.com/lygjwy/dos/blob/HEAD/scores/utils.py","link_basis":"first_harvest_node","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":"b5c11ebfae3c544e"}},{"code_sha256_prefix":"70ee124084db90b2","entry":"has_file_allowed_extension","repo":"lygjwy/DOS","repo_kind":"official","path":"datasets/named_dataset_with_meta.py","file_url":"https://github.com/lygjwy/DOS/blob/HEAD/datasets/named_dataset_with_meta.py","link_basis":"first_harvest_node","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":"70ee124084db90b2"}},{"code_sha256_prefix":"6345c661590e2176","entry":"is_img_file","repo":"lygjwy/DOS","repo_kind":"official","path":"datasets/named_dataset_with_meta.py","file_url":"https://github.com/lygjwy/DOS/blob/HEAD/datasets/named_dataset_with_meta.py","link_basis":"first_harvest_node","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":"6345c661590e2176"}},{"code_sha256_prefix":"814bb18230b9180e","entry":"touch_file_if_missing","repo":"lygjwy/DOS","repo_kind":"official","path":"utils/logger.py","file_url":"https://github.com/lygjwy/DOS/blob/HEAD/utils/logger.py","link_basis":"first_harvest_node","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":"814bb18230b9180e"}},{"code_sha256_prefix":"5fef870f31972307","entry":"train_abs","repo":"lygjwy/DOS","repo_kind":"official","path":"trainers/utils.py","file_url":"https://github.com/lygjwy/DOS/blob/HEAD/trainers/utils.py","link_basis":"first_harvest_node","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":"5fef870f31972307"}},{"code_sha256_prefix":"aee74338d16b3a23","entry":"train_energy","repo":"lygjwy/DOS","repo_kind":"official","path":"trainers/utils.py","file_url":"https://github.com/lygjwy/DOS/blob/HEAD/trainers/utils.py","link_basis":"first_harvest_node","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":"aee74338d16b3a23"}},{"code_sha256_prefix":"9028f67f495e27a1","entry":"train_uni","repo":"lygjwy/DOS","repo_kind":"official","path":"trainers/utils.py","file_url":"https://github.com/lygjwy/DOS/blob/HEAD/trainers/utils.py","link_basis":"first_harvest_node","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":"9028f67f495e27a1"}},{"code_sha256_prefix":"937d4f7234113d01","entry":"unpickle","repo":"lygjwy/DOS","repo_kind":"official","path":"datasets/imagenet_64.py","file_url":"https://github.com/lygjwy/DOS/blob/HEAD/datasets/imagenet_64.py","link_basis":"first_harvest_node","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":"937d4f7234113d01"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}