{"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/balanced-energy-regularization-loss-for-out-1","title":"Balanced Energy Regularization Loss for Out-of-distribution Detection","arxiv_id":"2306.10485","date":"2023-06-18","proceeding":"CVPR 2023 1","authors":["Hyunjun Choi","Hawook Jeong","Jin Young Choi"],"abstract":"In the field of out-of-distribution (OOD) detection, a previous method that use auxiliary data as OOD data has shown promising performance. However, the method provides an equal loss to all auxiliary data to differentiate them from inliers. However, based on our observation, in various tasks, there is a general imbalance in the distribution of the auxiliary OOD data across classes. We propose a balanced energy regularization loss that is simple but generally effective for a variety of tasks. Our balanced energy regularization loss utilizes class-wise different prior probabilities for auxiliary data to address the class imbalance in OOD data. The main concept is to regularize auxiliary samples from majority classes, more heavily than those from minority classes. Our approach performs better for OOD detection in semantic segmentation, long-tailed image classification, and image classification than the prior energy regularization loss. Furthermore, our approach achieves state-of-the-art performance in two tasks: OOD detection in semantic segmentation and long-tailed image classification. Code is available at https://github.com/hyunjunChhoi/Balanced_Energy.","url_abs":"https://arxiv.org/abs/2306.10485v1","url_pdf":"https://arxiv.org/pdf/2306.10485v1.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":"balanced-energy-regularization-loss-for-out-1","repo_url":"https://github.com/hyunjunChhoi/Balanced_Energy","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"classification-1","task_name":"Classification"},{"task_slug":"image-classification","task_name":"Image Classification"},{"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":"semantic-segmentation","task_name":"Semantic Segmentation"},{"task_slug":"image-classification","task_name":"image-classification"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2306.10485","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2306.10485"}},"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/hyunjunChhoi/Balanced_Energy","reach":null}],"summary":{"ran_fixture":2,"ran_draft_wrong":1,"unverified":1},"by_repo_kind":{"official":{"samples":4,"ran":3,"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":"259b3ea5b2212293","entry":"balanced_energy_loss_with_smooth_sparsity","repo":"hyunjunChhoi/Balanced_Energy","repo_kind":"official","path":"segmentation/code/losses.py","file_url":"https://github.com/hyunjunChhoi/Balanced_Energy/blob/HEAD/segmentation/code/losses.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":"259b3ea5b2212293"}},{"code_sha256_prefix":"abedbe9b904a9780","entry":"smooth","repo":"hyunjunChhoi/Balanced_Energy","repo_kind":"official","path":"segmentation/code/losses.py","file_url":"https://github.com/hyunjunChhoi/Balanced_Energy/blob/HEAD/segmentation/code/losses.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"abedbe9b904a9780"}},{"code_sha256_prefix":"f5a881d694997134","entry":"sparsity","repo":"hyunjunChhoi/Balanced_Energy","repo_kind":"official","path":"segmentation/code/losses.py","file_url":"https://github.com/hyunjunChhoi/Balanced_Energy/blob/HEAD/segmentation/code/losses.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f5a881d694997134"}},{"code_sha256_prefix":"f3ed9ca77d4c5646","entry":"influence","repo":"hyunjunChhoi/Balanced_Energy","repo_kind":"official","path":"segmentation/code/losses.py","file_url":"https://github.com/hyunjunChhoi/Balanced_Energy/blob/HEAD/segmentation/code/losses.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":"f3ed9ca77d4c5646"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}