SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2111.05956 · 2021

Feature Generation for Long-tail Classification

arXiv · PDF · Open in the Atlas

Code that ran

5 of 6 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 4 have no contract verdict; 1 failure 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.05956.json · badge: /api/ran/2111.05956.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
rahulvigneswaran/tailcalibx canonical (classifier label)
classifier basis not recorded on the link
5 ran · 1 no recorded run
FunctionStatusWhere it lives
conv3x3 Ran
ran; our contract draft was wrong, not the code
rahulvigneswaran/tailcalibx/libs/models/ResNextFeature.py
pointer only (licence: MIT); the stored copy get_code serves, from lixiaotong97/DSU, is pointer only (licence: NONE) · get_code("fac5364e2f53c6db")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from lixiaotong97/DSU, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

create_model Ran
ran on a synthesized input
rahulvigneswaran/tailcalibx/libs/models/CosineDotProductClassifier.py
code served (permissive licence) · get_code("9402b63618d1a522")
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 CosineDotProduct_Classifier. 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)

# Mock wandb_log function since it's called in the forward method
def wandb_log(data):
    pass

# Make wandb_log available globally
import builtins
builtins.wandb_log = wandb_log

ARGS = {
    'feat_dim': 128,
    'num_classes': 10,
    'scale': 10.0,
    'pretrain': False,
    'pretrain_dir': None,
}
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 CosineDotProduct_Classifier — a CosineDotProduct_Classifier output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a CosineDotProduct_Classifier 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
create_model Ran
ran on a synthesized input
rahulvigneswaran/tailcalibx/libs/models/DotProductClassifier.py
code served (permissive licence) · get_code("4693423b6a44b0d8")
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 DotProduct_Classifier. 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
from unittest.mock import MagicMock

torch.manual_seed(0)

# Define the arguments dictionary
ARGS = {
    'feat_dim': 2048,
    'num_classes': 10,
    'pretrain': False,
    'pretrain_dir': None,
}
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 DotProduct_Classifier — a DotProduct_Classifier output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DotProduct_Classifier 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
create_model Ran
ran on a synthesized input
rahulvigneswaran/tailcalibx/libs/models/ResNet32Feature.py
code served (permissive licence) · get_code("1f7771ddc9823b0a")
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 BBN_ResNet_Cifar. 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
import tempfile
import os

torch.manual_seed(0)

# Create a minimal pretrain file for testing
pretrain_dir = tempfile.mktemp(suffix='.pth')
pretrain_state = {
    'state_dict_best': {
        'feat_model': {
            'conv1.weight': torch.randn(16, 3, 3, 3),
            'bn1.weight': torch.randn(16),
            'bn1.bias': torch.randn(16),
            'layer1.0.conv1.weight': torch.randn(16, 16, 3, 3),
            'layer1.0.bn1.weight': torch.randn(16),
            'layer1.0.bn1.bias': torch.randn(16),
            'layer1.0.conv2.weight': torch.randn(16, 16, 3, 3),
            'layer1.0.bn2.weight': torch.randn(16),
            'layer1.0.bn2.bias': torch.randn(16),
        }
    }
}
torch.save(pretrain_state, pretrain_dir)

ARGS = {
    'pretrain': False,
    'pretrain_dir': None,
}
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 BBN_ResNet_Cifar — a BBN_ResNet_Cifar output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a BBN_ResNet_Cifar 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
load_model Ran
ran on a synthesized input
rahulvigneswaran/tailcalibx/libs/models/ResNext50Feature.py
code served (permissive licence) · get_code("1ba831f456a905ab")
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 OrderedDict. 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 tempfile
import os
from collections import OrderedDict

torch.manual_seed(0)

# Create a temporary directory and a mock pretrained model file
temp_dir = tempfile.mkdtemp()
pretrain_path = os.path.join(temp_dir, "pretrain.pth")

# Create a mock state dict with the structure expected by load_model
mock_state_dict = OrderedDict()
mock_state_dict['module.layer1.weight'] = torch.randn(4, 3)
mock_state_dict['module.layer2.weight'] = torch.randn(3, 2)
mock_state_dict['module.fc.weight'] = torch.randn(2, 4)
mock_state_dict['module.classifier.bias'] = torch.randn(4)
mock_state_dict['layer3.weight'] = torch.randn(5, 3)

# Save as the expected nested structure
checkpoint = {
    'state_dict_best': {
        'feat_model': mock_state_dict
    }
}
torch.save(checkpoint, pretrain_path)

ARGS = {
    'pretrain_dir': pretrain_path
}
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 OrderedDict — a OrderedDict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OrderedDict 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
create_model Not yet run
unverified (harvested, no recorded run)
rahulvigneswaran/tailcalibx/libs/models/ResNext50Feature.py
code served (permissive licence) · get_code("aa721c36d2d710f8")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 1 the same month, 1 later) and 5 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
conv3x3 686 other papers
339 dated earlier, 6 the same month, 335 later, 6 same year, order not determinable · 31 only as an assembly brick
1406.2661 (2014-06)
Generative Adversarial Networks
1409.0575 (2014-09)
ImageNet Large Scale Visual Recognition Challenge
1412.6572 (2014-12)
Explaining and Harnessing Adversarial Examples
and 683 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

The visual world naturally exhibits an imbalance in the number of object or scene instances resulting in a \emph{long-tailed distribution}. This imbalance poses significant challenges for classification models based on deep learning. Oversampling instances of the tail classes attempts to solve this imbalance. However, the limited visual diversity results in a network with poor representation ability. A simple counter to this is decoupling the representation and classifier networks and using oversampling only to train the classifier. In this paper, instead of repeatedly re-sampling the same image (and thereby features), we explore a direction that attempts to generate meaningful features by estimating the tail category's distribution. Inspired by ideas from recent work on few-shot learning, we create calibrated distributions to sample additional features that are subsequently used to train the classifier. Through several experiments on the CIFAR-100-LT (long-tail) dataset with varying imbalance factors and on mini-ImageNet-LT (long-tail), we show the efficacy of our approach and establish a new state-of-the-art. We also present a qualitative analysis of generated features using t-SNE visualizations and analyze the nearest neighbors used to calibrate the tail class distributions. Our code is available at https://github.com/rahulvigneswaran/TailCalibX.

For agents

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

get_harvested_code_for_paper("2111.05956")
get_code_for_paper("2111.05956")
have("2111.05956")

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

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

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

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

Connect an agent — have() is free.