{"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/extremely-simple-activation-shaping-for-out","title":"Extremely Simple Activation Shaping for Out-of-Distribution Detection","arxiv_id":"2209.09858","date":"2022-09-20","proceeding":null,"authors":["Andrija Djurisic","Nebojsa Bozanic","Arjun Ashok","Rosanne Liu"],"abstract":"The separation between training and deployment of machine learning models implies that not all scenarios encountered in deployment can be anticipated during training, and therefore relying solely on advancements in training has its limits. Out-of-distribution (OOD) detection is an important area that stress-tests a model's ability to handle unseen situations: Do models know when they don't know? Existing OOD detection methods either incur extra training steps, additional data or make nontrivial modifications to the trained network. In contrast, in this work, we propose an extremely simple, post-hoc, on-the-fly activation shaping method, ASH, where a large portion (e.g. 90%) of a sample's activation at a late layer is removed, and the rest (e.g. 10%) simplified or lightly adjusted. The shaping is applied at inference time, and does not require any statistics calculated from training data. Experiments show that such a simple treatment enhances in-distribution and out-of-distribution distinction so as to allow state-of-the-art OOD detection on ImageNet, and does not noticeably deteriorate the in-distribution accuracy. Video, animation and code can be found at: https://andrijazz.github.io/ash","url_abs":"https://arxiv.org/abs/2209.09858v2","url_pdf":"https://arxiv.org/pdf/2209.09858v2.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":"extremely-simple-activation-shaping-for-out","repo_url":"https://github.com/andrijazz/ash","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"extremely-simple-activation-shaping-for-out","repo_url":"https://github.com/litianliu/fdbd-ood","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"out-of-distribution-detection","task_name":"Out-of-Distribution Detection"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/out-of-distribution-detection-on-imagenet-1k-12","task":"Out-of-Distribution Detection","dataset":"ImageNet-1k vs Curated OODs (avg.)","model":"ASH-S (ResNet-50)","rank_in_archive_order":5,"of":16,"metrics":{"AUROC":"95.12","FPR95":"22.8"},"uses_additional_data":false},{"leaderboard":"/sota/out-of-distribution-detection-on-imagenet-1k-9","task":"Out-of-Distribution Detection","dataset":"ImageNet-1k vs Places","model":"ASH-S (ResNet-50)","rank_in_archive_order":9,"of":25,"metrics":{"AUROC":"90.98","FPR95":"39.78"},"uses_additional_data":false},{"leaderboard":"/sota/out-of-distribution-detection-on-imagenet-1k-8","task":"Out-of-Distribution Detection","dataset":"ImageNet-1k vs SUN","model":"ASH-S (ResNet-50)","rank_in_archive_order":6,"of":22,"metrics":{"AUROC":"94.02","FPR95":"27.98"},"uses_additional_data":false},{"leaderboard":"/sota/out-of-distribution-detection-on-imagenet-1k-10","task":"Out-of-Distribution Detection","dataset":"ImageNet-1k vs Textures","model":"ASH-S (ResNet-50)","rank_in_archive_order":4,"of":34,"metrics":{"AUROC":"97.6","FPR95":"11.93"},"uses_additional_data":false},{"leaderboard":"/sota/out-of-distribution-detection-on-imagenet-1k-3","task":"Out-of-Distribution Detection","dataset":"ImageNet-1k vs iNaturalist","model":"ASH-S (ResNet-50)","rank_in_archive_order":8,"of":28,"metrics":{"AUROC":"97.87","FPR95":"11.49"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2209.09858","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2209.09858"}},"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/andrijazz/ash","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/litianliu/fdbd-ood","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_fixture":1,"ran_draft_wrong":1},"by_repo_kind":{"official":{"samples":1,"ran":1,"repositories":1},"listed":{"samples":1,"ran":1,"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":"3bde09574ad009e3","entry":"ash_b","repo":"andrijazz/ash","repo_kind":"official","path":"ash.py","file_url":"https://github.com/andrijazz/ash/blob/HEAD/ash.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3bde09574ad009e3"}},{"code_sha256_prefix":"c5a227bd263bbe1e","entry":"ash_s","repo":"litianliu/fdbd-ood","repo_kind":"listed","path":"run_imagenet_w_ASH.py","file_url":"https://github.com/litianliu/fdbd-ood/blob/HEAD/run_imagenet_w_ASH.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c5a227bd263bbe1e"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}