SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · aaai_28217 · AAAI · 2024

Out-of-Distribution Detection in Long-Tailed Recognition with Calibrated Outlier Class Learning

Tianqi Li, Guansong Pang, Xiao Bai, Jin Zheng, Wenjun Miao

Open in the Atlas

Code that ran

6 of 7 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; 6 failures of our instrument; 1 no recorded run), measured 2026-11-22; 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/aaai_28217.json · badge: /api/ran/aaai_28217.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
mala-lab/COCL canonical (classifier label)
classifier basis: census
6 ran · 1 no recorded run
FunctionStatusWhere it lives
ResNet18 Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
mala-lab/COCL/models/resnet.py
code served (permissive licence) · get_code("e2322a484fb268e8")
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 ResNet. 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 as nn
import math

torch.manual_seed(0)

ARGS = {
    'num_classes': 10,
    'pooling': 'avgpool',
    'norm': nn.BatchNorm2d,
    'return_features': False,
}
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 ResNet — a ResNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ResNet output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
ResNet34 Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
mala-lab/COCL/models/resnet.py
code served (permissive licence) · get_code("f0d6d8f321537b23")
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 ResNet. 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 as nn

torch.manual_seed(0)

ARGS = {
    'num_classes': 10,
    'pooling': 'avgpool',
    'norm': nn.BatchNorm2d,
    'return_features': False,
}
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 ResNet — a ResNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ResNet output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
ResNet50 Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
mala-lab/COCL/models/resnet_imagenet.py
code served (permissive licence) · get_code("61c1416b15e45edf")
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 ResNet_ImageNet. 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 as nn
from torchvision.models.resnet import Bottleneck, ResNet
import math

torch.manual_seed(0)

# The ResNet50 function takes num_classes and return_features parameters
# We'll create simple valid arguments for both

ARGS = {
    'num_classes': 1000,
    'return_features': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ResNet_ImageNet — a ResNet_ImageNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ResNet_ImageNet output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
compute_dist Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
mala-lab/COCL/utils/distance.py
code served (permissive licence) · get_code("7d2d217faa906bdf")
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 2, dtype family float, shape (2, 3) 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 numpy as np
import torch

torch.manual_seed(0)

# Create sample numpy arrays for testing
# array1: shape [m1, n] = [2, 4]
array1 = np.random.randn(2, 4).astype(np.float32)

# array2: shape [m2, n] = [3, 4]
array2 = np.random.randn(3, 4).astype(np.float32)

# However, looking at the function body, for euclidean distance it uses torch operations
# So we need to convert these to torch tensors
array1_torch = torch.from_numpy(array1).float()
array2_torch = torch.from_numpy(array2).float()

# The function expects numpy arrays as inputs based on the docstring,
# but the euclidean branch uses torch. Let's provide torch tensors since
# that's what the code actually operates on
ARGS = {
    'array1': array1_torch,
    'array2': array2_torch,
    'type': 'euclidean'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 3) — shape (2, 3) 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
normalize Ran
ran; our contract draft was wrong, not the code
mala-lab/COCL/utils/distance.py
code served (permissive licence) · get_code("a7e6f0604f589937")
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 ndarray, ndim 3, dtype family float, shape (4, 3, 2) 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 numpy as np

# Create a small N-D numpy array for testing
nparray = np.random.randn(4, 3, 2).astype(np.float32)

# Define arguments dict with all parameters
ARGS = {
    "nparray": nparray,
    "order": 2,
    "axis": 0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family float, shape (4, 3, 2) — shape (4, 3, 2) 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
shot_acc Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
mala-lab/COCL/utils/ltr_metrics.py
code served (permissive licence) · get_code("a7d912dd30b6673e")
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 tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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 numpy as np

torch.manual_seed(0)

# Create predictions and labels as numpy arrays
# 10 classes, 20 samples total
num_classes = 10
num_samples = 20

# Create predictions (class indices)
preds = np.random.randint(0, num_classes, size=num_samples)

# Create labels (class indices) - ensure some classes have samples
labels = np.array([0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9])

# Create train_class_count - number of training samples per class
# Should have num_classes elements
# Using varied counts to create many-shot, median-shot, and low-shot classes
train_class_count = [100, 90, 80, 70, 60, 50, 40, 30, 20, 10]

ARGS = {
    'preds': preds,
    'labels': labels,
    'train_class_count': train_class_count,
    'acc_per_cls': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
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
tinyimages300k_dataloaders Not yet run
unverified (harvested, no recorded run)
mala-lab/COCL/datasets/tinyimages_300k.py
code served (permissive licence) · get_code("0ddb7c161e4f4ff3")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 7 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 0 the same month, 0 later) and 0 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
ResNet50 3 other papers
2 dated earlier, 1 same year, order not determinable
2312.08939 (2023-12)
EAT: Towards Long-Tailed Out-of-Distribution Detection
2312.10686 (2023-12)
Out-of-Distribution Detection in Long-Tailed Recognition with Calibrated Outlier Class Learning
2408.06742 (2024-08)
Long-Tailed Out-of-Distribution Detection: Prioritizing Attention to Tail
ResNet18 2 other papers
1 dated earlier, 1 same year, order not determinable
2312.10686 (2023-12)
Out-of-Distribution Detection in Long-Tailed Recognition with Calibrated Outlier Class Learning
2408.06742 (2024-08)
Long-Tailed Out-of-Distribution Detection: Prioritizing Attention to Tail
ResNet34 2 other papers
1 dated earlier, 1 same year, order not determinable
2312.10686 (2023-12)
Out-of-Distribution Detection in Long-Tailed Recognition with Calibrated Outlier Class Learning
2408.06742 (2024-08)
Long-Tailed Out-of-Distribution Detection: Prioritizing Attention to Tail
tinyimages300k_dataloaders 2 other papers
1 dated earlier, 1 same year, order not determinable
2312.10686 (2023-12)
Out-of-Distribution Detection in Long-Tailed Recognition with Calibrated Outlier Class Learning
2408.06742 (2024-08)
Long-Tailed Out-of-Distribution Detection: Prioritizing Attention to Tail
compute_dist 1 other paper
1 dated earlier
2312.10686 (2023-12)
Out-of-Distribution Detection in Long-Tailed Recognition with Calibrated Outlier Class Learning
normalize 1 other paper
1 dated earlier
2312.10686 (2023-12)
Out-of-Distribution Detection in Long-Tailed Recognition with Calibrated Outlier Class Learning
shot_acc 1 other paper
1 dated earlier
2312.10686 (2023-12)
Out-of-Distribution Detection in Long-Tailed Recognition with Calibrated Outlier Class Learning

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-22.

Repositories linked to this paper

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

Abstract

Existing out-of-distribution (OOD) methods have shown great success on balanced datasets but become ineffective in long-tailed recognition (LTR) scenarios where 1) OOD samples are often wrongly classified into head classes and/or 2) tail-class samples are treated as OOD samples. To address these issues, current studies fit a prior distribution of auxiliary/pseudo OOD data to the long-tailed in-distribution (ID) data. However, it is difficult to obtain such an accurate prior distribution given the unknowingness of real OOD samples and heavy class imbalance in LTR. A straightforward solution to avoid the requirement of this prior is to learn an outlier class to encapsulate the OOD samples. The main challenge is then to tackle the aforementioned confusion between OOD samples and head/tail-class samples when learning the outlier class. To this end, we introduce a novel calibrated outlier class learning (COCL) approach, in which 1) a debiased large margin learning method is introduced in the outlier class learning to distinguish OOD samples from both head and tail classes in the representation space and 2) an outlierclass-aware logit calibration method is defined to enhance the long-tailed classification confidence. Extensive empirical results on three popular benchmarks CIFAR10-LT, CIFAR100-LT, and ImageNet-LT demonstrate that COCL substantially outperforms state-of-the-art OOD detection methods in LTR while being able to improve the classification accuracy on ID data. Code is available at https://github.com/mala-lab/COCL.

For agents

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

get_harvested_code_for_paper("aaai_28217")
get_code_for_paper("aaai_28217")
have("aaai_28217")

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

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

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

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

Connect an agent — have() is free.