{"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/energy-based-out-of-distribution-detection-1","title":"Energy-based Out-of-distribution Detection","arxiv_id":"2010.03759","date":"2020-10-08","proceeding":"NeurIPS 2020 12","authors":["Weitang Liu","XiaoYun Wang","John D. Owens","Yixuan Li"],"abstract":"Determining whether inputs are out-of-distribution (OOD) is an essential building block for safely deploying machine learning models in the open world. However, previous methods relying on the softmax confidence score suffer from overconfident posterior distributions for OOD data. We propose a unified framework for OOD detection that uses an energy score. We show that energy scores better distinguish in- and out-of-distribution samples than the traditional approach using the softmax scores. Unlike softmax confidence scores, energy scores are theoretically aligned with the probability density of the inputs and are less susceptible to the overconfidence issue. Within this framework, energy can be flexibly used as a scoring function for any pre-trained neural classifier as well as a trainable cost function to shape the energy surface explicitly for OOD detection. On a CIFAR-10 pre-trained WideResNet, using the energy score reduces the average FPR (at TPR 95%) by 18.03% compared to the softmax confidence score. With energy-based training, our method outperforms the state-of-the-art on common benchmarks.","url_abs":"https://arxiv.org/abs/2010.03759v4","url_pdf":"https://arxiv.org/pdf/2010.03759v4.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":"energy-based-out-of-distribution-detection-1","repo_url":"https://github.com/wetliu/energy_ood","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"energy-based-out-of-distribution-detection-1","repo_url":"https://github.com/HussainAther/potts","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"energy-based-out-of-distribution-detection-1","repo_url":"https://github.com/lancopku/avg-avg","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"energy-based-out-of-distribution-detection-1","repo_url":"https://github.com/marclafon/heatood","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"energy-based-out-of-distribution-detection-1","repo_url":"https://github.com/ml-jku/hopfield-boosting","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"energy-based-out-of-distribution-detection-1","repo_url":"https://github.com/omegafragger/DDU","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"out-of-distribution-detection","task_name":"Out-of-Distribution Detection"}],"methods":[{"method_slug":"average-pooling","method_name":"Average Pooling"},{"method_slug":"batch-normalization","method_name":"Batch Normalization"},{"method_slug":"convolution","method_name":"Convolution"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"global-average-pooling","method_name":"Global Average Pooling"},{"method_slug":"kaiming-initialization","method_name":"Kaiming Initialization"},{"method_slug":"relu","method_name":"ReLU"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"wide-residual-block","method_name":"Wide Residual Block"},{"method_slug":"wideresnet","method_name":"WideResNet"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2010.03759","atlas_url":"https://app.syntology.ai/?focus=2010.03759","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2010.03759"}},"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/wetliu/energy_ood","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/marclafon/heatood","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/HussainAther/potts","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ml-jku/hopfield-boosting","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/omegafragger/DDU","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/lancopku/avg-avg","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":1,"ran_draft_wrong":2,"unverified":3},"by_repo_kind":{"official":{"samples":1,"ran":1,"repositories":1},"listed":{"samples":5,"ran":2,"repositories":3}},"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":"ef8c66b811cfff22","entry":"BorderEnergy","repo":"ml-jku/hopfield-boosting","repo_kind":"listed","path":"hopfield_boosting/energy.py","file_url":"https://github.com/ml-jku/hopfield-boosting/blob/HEAD/hopfield_boosting/energy.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ef8c66b811cfff22"}},{"code_sha256_prefix":"a76900b1a35e1215","entry":"centered_cov_torch","repo":"omegafragger/DDU","repo_kind":"listed","path":"utils/gmm_utils.py","file_url":"https://github.com/omegafragger/DDU/blob/HEAD/utils/gmm_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a76900b1a35e1215"}},{"code_sha256_prefix":"09d6eb1b24af40a5","entry":"sample_estimator","repo":"wetliu/energy_ood","repo_kind":"official","path":"utils/score_calculation.py","file_url":"https://github.com/wetliu/energy_ood/blob/HEAD/utils/score_calculation.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":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"09d6eb1b24af40a5"}},{"code_sha256_prefix":"bed24a9fdc107664","entry":"AbastractOODScorer","repo":"marclafon/heatood","repo_kind":"listed","path":"heat/scorers/energy_logits_scorer.py","file_url":"https://github.com/marclafon/heatood/blob/HEAD/heat/scorers/energy_logits_scorer.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"bed24a9fdc107664"}},{"code_sha256_prefix":"39c737b741eb10d1","entry":"EnergyLogitsScorer","repo":"marclafon/heatood","repo_kind":"listed","path":"heat/scorers/energy_logits_scorer.py","file_url":"https://github.com/marclafon/heatood/blob/HEAD/heat/scorers/energy_logits_scorer.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"39c737b741eb10d1"}},{"code_sha256_prefix":"3f1fbfd9e791bb48","entry":"gmm_fit","repo":"omegafragger/DDU","repo_kind":"listed","path":"utils/gmm_utils.py","file_url":"https://github.com/omegafragger/DDU/blob/HEAD/utils/gmm_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":"3f1fbfd9e791bb48"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}