SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2111.03874 · NeurIPS · 2021

Towards Calibrated Model for Long-Tailed Visual Recognition from Prior Perspective

Zhengzhuo Xu, Zenghao Chai, Chun Yuan

arXiv · PDF · 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 3 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/2111.03874.json · badge: /api/ran/2111.03874.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
XuZhengzhuo/Prior-LT canonical (classifier label)
classifier basis not recorded on the link
6 ran · 1 no recorded run
FunctionStatusWhere it lives
accuracy Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
XuZhengzhuo/Prior-LT/utils.py
code served (permissive licence) · get_code("654d94efeb48a502")
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 list, ndim 2, 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

torch.manual_seed(0)

# Construct tensors for accuracy function
# output: logits/scores, shape (batch_size, num_classes)
# target: ground truth class indices, shape (batch_size,)

batch_size = 2
num_classes = 4

output = torch.randn(batch_size, num_classes)
target = torch.randint(0, num_classes, (batch_size,))
topk = (1, 2)

ARGS = {
    "output": output,
    "target": target,
    "topk": topk,
}
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 list, ndim 2, dtype family float — a list 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
plot_confusion_matrix Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
XuZhengzhuo/Prior-LT/utils.py
code served (permissive licence) · get_code("46490b0cfc522d35")
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 Axes. The image it ran in was 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 numpy as np
import matplotlib.pyplot as plt
from sklearn.metrics import confusion_matrix

# Create sample data for a multi-class classification problem
np.random.seed(0)

# True labels and predicted labels for 50 samples, 3 classes
n_samples = 50
n_classes = 3

y_true = np.random.randint(0, n_classes, n_samples)
y_pred = np.random.randint(0, n_classes, n_samples)

# Class names
classes = ['Class_0', 'Class_1', 'Class_2']

ARGS = {
    'y_true': y_true,
    'y_pred': y_pred,
    'classes': classes,
    'normalize': False,
    'title': 'Test Confusion Matrix',
    'cmap': plt.cm.Blues
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, numpy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Axes — a Axes output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Axes 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
resnet32 Ran
ran; our contract draft was wrong, not the code
XuZhengzhuo/Prior-LT/models/resnet_cifar.py
code served (permissive licence) · get_code("11d038f53d77a8d2")
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_s. The image it ran in was 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,
    'use_norm': 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_s — a ResNet_s output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ResNet_s 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
unimix Ran
ran on a synthesized input
XuZhengzhuo/Prior-LT/core.py
code served (permissive licence) · get_code("f55a4c23f8b712ea")
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. 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 numpy as np

torch.manual_seed(0)
np.random.seed(0)

# Create small tensors for testing
batch_size = 2
num_classes = 3
image_channels = 4
image_height = 3
image_width = 3

# Images: (batch_size, channels, height, width)
images = torch.randn(batch_size, image_channels, image_height, image_width)

# Labels: (batch_size,) with values in range [0, num_classes)
labels = torch.tensor([0, 1], dtype=torch.long)

# cls_num_list: number of samples per class
cls_num_list = [10, 15, 20]

# alpha: parameter for beta distribution
alpha = 1.0

# tau: temperature parameter for power operation
tau = 0.5

ARGS = {
    "images": images,
    "labels": labels,
    "cls_num_list": cls_num_list,
    "alpha": alpha,
    "tau": tau,
}
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 — 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
unimix_factor Ran
ran on a synthesized input
XuZhengzhuo/Prior-LT/core.py
code served (permissive licence) · get_code("09a850cb0450e158")
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 1, dtype family float, shape (2,) as a later run recorded it. 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, 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
import numpy as np

torch.manual_seed(0)

# labels_1: tensor of class indices
labels_1 = torch.tensor([0, 1], dtype=torch.long)

# labels_2: tensor of class indices
labels_2 = torch.tensor([1, 2], dtype=torch.long)

# cls_num_list: list of class counts
cls_num_list = [100, 50, 25]

# alpha: parameter for beta distribution
alpha = 1.5

ARGS = {
    "labels_1": labels_1,
    "labels_2": labels_2,
    "cls_num_list": cls_num_list,
    "alpha": alpha,
}
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 1, dtype family float, shape (2,) — shape (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
unimix_sampler Ran
ran on a synthesized input
XuZhengzhuo/Prior-LT/core.py
code served (permissive licence) · get_code("bba89af97cc42385")
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 1, dtype family int, shape (8,) 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
import numpy as np

torch.manual_seed(0)

batch_size = 8
labels = torch.tensor([0, 1, 0, 2, 1, 0, 2, 1])
cls_num_list = [3, 3, 2]
tau = 0.5

ARGS = {
    "batch_size": batch_size,
    "labels": labels,
    "cls_num_list": cls_num_list,
    "tau": tau
}
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 1, dtype family int, shape (8,) — shape (8,) 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
calibration Not yet run
unverified (harvested, no recorded run)
XuZhengzhuo/Prior-LT/utils.py
code served (permissive licence) · get_code("8d1edfc879be5d6f")
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, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 1 the same month, 3 later) and 4 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
accuracy 17 other papers
6 dated earlier, 1 the same month, 10 later
1805.03438 (2018-05)
Robust Classification with Convolutional Prototype Learning
1905.11926 (2019-05)
Network Deconvolution
2003.04297 (2020-03)
Improved Baselines with Momentum Contrastive Learning
and 14 more not named here
resnet32 9 other papers
3 dated earlier, 6 later
1906.07413 (2019-06)
Learning Imbalanced Datasets with Label-Distribution-Aware Margin Loss
2104.00466 (2021-04)
Improving Calibration for Long-Tailed Recognition
2106.10891 (2021-06)
Open-set Label Noise Can Improve Robustness Against Inherent Label Noise
and 6 more not named here
plot_confusion_matrix 3 other papers
1 dated earlier, 2 later
1906.07413 (2019-06)
Learning Imbalanced Datasets with Label-Distribution-Aware Margin Loss
2304.09426 (2023-04)
Decoupled Training for Long-Tailed Classification With Stochastic Representations

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

Real-world data universally confronts a severe class-imbalance problem and exhibits a long-tailed distribution, i.e., most labels are associated with limited instances. The naïve models supervised by such datasets would prefer dominant labels, encounter a serious generalization challenge and become poorly calibrated. We propose two novel methods from the prior perspective to alleviate this dilemma. First, we deduce a balance-oriented data augmentation named Uniform Mixup (UniMix) to promote mixup in long-tailed scenarios, which adopts advanced mixing factor and sampler in favor of the minority. Second, motivated by the Bayesian theory, we figure out the Bayes Bias (Bayias), an inherent bias caused by the inconsistency of prior, and compensate it as a modification on standard cross-entropy loss. We further prove that both the proposed methods ensure the classification calibration theoretically and empirically. Extensive experiments verify that our strategies contribute to a better-calibrated model and their combination achieves state-of-the-art performance on CIFAR-LT, ImageNet-LT, and iNaturalist 2018.

For agents

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

get_harvested_code_for_paper("2111.03874")
get_code_for_paper("2111.03874")
have("2111.03874")

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

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

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

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

Connect an agent — have() is free.