SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2001.01385 · 2020

Identifying and Compensating for Feature Deviation in Imbalanced Deep Learning

arXiv · PDF · Open in the Atlas

Code that ran

7 of 8 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 6 have no contract verdict; 1 failure of our instrument; 1 no recorded run), measured 2026-11-21; 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/2001.01385.json · badge: /api/ran/2001.01385.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
zhangyongshun/BagofTricks-LT canonical (classifier label)
classifier basis not recorded on the link
7 ran · 1 no recorded run
FunctionStatusWhere it lives
accuracy Ran
ran on a synthesized input
zhangyongshun/BagofTricks-LT/lib/core/evaluate.py
code served (permissive licence) · get_code("20991a2f2993c1e7")
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)

# The function compares output and label element-wise, then computes accuracy
# output and label should be tensors or arrays that support:
# - equality comparison (==)
# - .sum() method
# - .shape[0] attribute

output = torch.tensor([0, 1, 2, 3])
label = torch.tensor([0, 1, 2, 0])

ARGS = {
    "output": output,
    "label": label,
}
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
conv3x3 Ran
ran; our contract draft was wrong, not the code
zhangyongshun/BagofTricks-LT/lib/backbone/oltr_resnet.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.

reduce_tensor Ran
ran on a synthesized input
zhangyongshun/BagofTricks-LT/lib/core/function.py
code served (permissive licence) · get_code("75000f8601e0929d")
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, 4) 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 torch.distributed as dist
from unittest.mock import Mock, patch

torch.manual_seed(0)

# Mock dist.all_reduce and dist.reduce_op since we're not in a distributed setting
original_all_reduce = dist.all_reduce
original_reduce_op = dist.reduce_op

def mock_all_reduce(tensor, op=None):
    # In a real distributed setting, this would sync across processes
    # For testing, we just leave the tensor as-is
    pass

dist.all_reduce = mock_all_reduce
dist.reduce_op = Mock()
dist.reduce_op.SUM = Mock()

# Create test tensor
tensor = torch.randn(2, 4)

# Create world_size parameter
world_size = 4

ARGS = {
    "tensor": tensor,
    "world_size": world_size,
}
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 2, dtype family float, shape (2, 4) — shape (2, 4) 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
res10 Ran
ran on a synthesized input
zhangyongshun/BagofTricks-LT/lib/backbone/oltr_resnet.py
code served (permissive licence) · get_code("cd77b0f5ea846342")
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. 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)

class ModulatedAttLayer(nn.Module):
    def __init__(self, in_channels):
        super(ModulatedAttLayer, self).__init__()
        self.in_channels = in_channels
    
    def forward(self, x):
        return x

class SimpleConfig:
    def __init__(self):
        self.resnet_depth = 10
        self.num_classes = 1000

cfg = SimpleConfig()

ARGS = {
    'cfg': cfg
}
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
res32_cifar Ran
ran on a synthesized input
zhangyongshun/BagofTricks-LT/lib/backbone/resnet_cifar.py
code served (permissive licence) · get_code("4da6f52731511b02")
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_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

torch.manual_seed(0)

ARGS = {
    'cfg': None,
    'pretrain': False,
    'pretrained_model': '',
    'last_layer_stride': 2,
}
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_Cifar — a ResNet_Cifar output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a 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
res50 Ran
ran on a synthesized input
zhangyongshun/BagofTricks-LT/lib/backbone/resnet.py
code served (permissive licence) · get_code("110330294bf78ea2")
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. 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)

# Create a minimal config dict
cfg = {
    'model_name': 'res50',
    'num_classes': 1000,
}

# Set pretrain and pretrained_model
pretrain = False
pretrained_model = ''

# Set last_layer_stride
last_layer_stride = 2

# Construct ARGS dictionary with all parameters
ARGS = {
    'cfg': cfg,
    'pretrain': pretrain,
    'pretrained_model': pretrained_model,
    'last_layer_stride': last_layer_stride,
}
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
resnext50 Ran
ran on a synthesized input
zhangyongshun/BagofTricks-LT/lib/backbone/resnext.py
code served (permissive licence) · get_code("bdb1deaaf5078648")
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 ResNext. 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 math

torch.manual_seed(0)

# Create a minimal config class/dict for the cfg parameter
class MinimalConfig:
    def __init__(self):
        self.name = "test_config"
        self.num_classes = 1000

cfg = MinimalConfig()

# Parameters for resnext50
ARGS = {
    'cfg': cfg,
    'pretrain': False,
    'pretrained_model': '',
    'last_layer_stride': 2
}
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 ResNext — a ResNext output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ResNext 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
init_weights Not yet run
unverified (harvested, no recorded run)
zhangyongshun/BagofTricks-LT/lib/backbone/oltr_resnet.py
code served (permissive licence) · get_code("4826cd3596c12660")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 8 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 1 the same month, 8 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
conv3x3 686 other papers
182 dated earlier, 4 the same month, 499 later, 1 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
init_weights 5 other papers
5 later
2004.03706 (2020-04)
Long-Tailed Recognition Using Class-Balanced Experts
2007.11978 (2020-07)
The Devil is in Classification: A Simple Framework for Long-tail Object Detection and Instance Segmentation
2111.13998 (2021-11)
Targeted Supervised Contrastive Learning for Long-Tailed Recognition
and 2 more not named here
accuracy 2 other papers
1 dated earlier, 1 later
1912.02413 (2019-12)
BBN: Bilateral-Branch Network with Cumulative Learning for Long-Tailed Visual Recognition
reduce_tensor 1 other paper
1 later
Li_FCC_Feature_Clusters_Compression_for_Long-Tailed_Visual_Recognition_CVPR_2023_paper (2023 (year only))
FCC: Feature Clusters Compression for Long-Tailed Visual Recognition
res10 1 other paper
1 later
Li_FCC_Feature_Clusters_Compression_for_Long-Tailed_Visual_Recognition_CVPR_2023_paper (2023 (year only))
FCC: Feature Clusters Compression for Long-Tailed Visual Recognition
res32_cifar 1 other paper
1 later
Li_FCC_Feature_Clusters_Compression_for_Long-Tailed_Visual_Recognition_CVPR_2023_paper (2023 (year only))
FCC: Feature Clusters Compression for Long-Tailed Visual Recognition
res50 1 other paper
1 later
Li_FCC_Feature_Clusters_Compression_for_Long-Tailed_Visual_Recognition_CVPR_2023_paper (2023 (year only))
FCC: Feature Clusters Compression for Long-Tailed Visual Recognition
resnext50 1 other paper
1 later
Li_FCC_Feature_Clusters_Compression_for_Long-Tailed_Visual_Recognition_CVPR_2023_paper (2023 (year only))
FCC: Feature Clusters Compression for Long-Tailed Visual Recognition

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

Repositories linked to this paper

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

Abstract

Classifiers trained with class-imbalanced data are known to perform poorly on test data of the "minor" classes, of which we have insufficient training data. In this paper, we investigate learning a ConvNet classifier under such a scenario. We found that a ConvNet significantly over-fits the minor classes, which is quite opposite to traditional machine learning algorithms that often under-fit minor classes. We conducted a series of analysis and discovered the feature deviation phenomenon -- the learned ConvNet generates deviated features between the training and test data of minor classes -- which explains how over-fitting happens. To compensate for the effect of feature deviation which pushes test data toward low decision value regions, we propose to incorporate class-dependent temperatures (CDT) in training a ConvNet. CDT simulates feature deviation in the training phase, forcing the ConvNet to enlarge the decision values for minor-class data so that it can overcome real feature deviation in the test phase. We validate our approach on benchmark datasets and achieve promising performance. We hope that our insights can inspire new ways of thinking in resolving class-imbalanced deep learning.

For agents

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

get_harvested_code_for_paper("2001.01385")
get_code_for_paper("2001.01385")
have("2001.01385")

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

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

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

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

Connect an agent — have() is free.