SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2306.10485 · CVPR · 2023

Balanced Energy Regularization Loss for Out-of-distribution Detection

Jin Choi, Hyunjun Choi, Hawook Jeong

arXiv · PDF · Open in the Atlas

Code that ran

3 of 4 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 3 failures of our instrument; 1 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2306.10485.json · badge: /api/ran/2306.10485.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
hyunjunChhoi/Balanced_Energy marked official in Papers with Code
Papers with Code archive
3 ran · 1 no recorded run
FunctionStatusWhere it lives
balanced_energy_loss_with_smooth_sparsity Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
hyunjunChhoi/Balanced_Energy/segmentation/code/losses.py
code served (permissive licence) · get_code("259b3ea5b2212293")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned tuple. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# The function expects:
# - logits: tensor with shape (batch, channels, height, width) where channels >= 19
# - targets: tensor with shape (batch, height, width) containing class indices
# - gamma1, gamma2, alpha: scalar floats (already have defaults)

batch_size = 2
num_channels = 20  # At least 19 for num_class, plus 1 for OOD
height = 4
width = 3

# Create logits tensor (batch, channels, height, width)
logits = torch.randn(batch_size, num_channels, height, width)

# Create targets tensor (batch, height, width)
# Values should be in range [0, 255] where:
# - 0-18 are valid classes
# - 254 is OOD_ind
# - 255 is void_ind
targets = torch.randint(0, 19, (batch_size, height, width))
# Add some OOD and void pixels
targets[0, 0, 0] = 254  # OOD
targets[0, 1, 1] = 255  # void

ARGS = {
    "logits": logits,
    "targets": targets,
    "gamma1": 0.0,
    "gamma2": 0.0,
    "alpha": 0.0,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
smooth Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
hyunjunChhoi/Balanced_Energy/segmentation/code/losses.py
code served (permissive licence) · get_code("abedbe9b904a9780")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function expects:
# - arr: a tensor that supports indexing with [:, :, :] (3D tensor)
# - lamda1: a scalar (float or int) for weighting the loss

# Create a small 3D tensor: (batch=2, height=4, width=3)
arr = torch.randn(2, 4, 3)

# Create a scalar lambda parameter
lamda1 = 0.5

ARGS = {
    "arr": arr,
    "lamda1": lamda1,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
sparsity Ran
ran; our contract draft was wrong, not the code
hyunjunChhoi/Balanced_Energy/segmentation/code/losses.py
code served (permissive licence) · get_code("f5a881d694997134")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create a small tensor with shape (batch=2, dim=4)
arr = torch.randn(2, 4)

# Create a scalar lambda parameter
lamda2 = 0.5

ARGS = {
    "arr": arr,
    "lamda2": lamda2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
influence Not yet run
unverified (harvested, no recorded run)
hyunjunChhoi/Balanced_Energy/segmentation/code/losses.py
code served (permissive licence) · get_code("f3ed9ca77d4c5646")
How it ran

no invocation recorded.

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 3 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
smooth
brick of this paper's assembly: helper
4 other papers
4 later · 1 only as an assembly brick
2310.18961 (2023-10)
AnomalyCLIP: Object-agnostic Prompt Learning for Zero-shot Anomaly Detection
2404.13671 (2024-04)
FiLo: Zero-Shot Anomaly Detection by Fine-Grained Description and High-Quality Localization
2410.00320 (2024-10)
PointAD: Comprehending 3D Anomalies from Points and Pixels for Zero-shot 3D Anomaly Detection
and 1 more not named here

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

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-ofthe-art performance in two tasks: OOD detection in semantic segmentation and long-tailed image classification.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2306.10485")
get_code_for_paper("2306.10485")
have("2306.10485")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2306.10485.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2306.10485.svg)](https://syntology.ai/paper/2306.10485)

Connect an agent — have() is free.