SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2106.00209 · 2021

Rethinking Re-Sampling in Imbalanced Semi-Supervised Learning

arXiv · PDF · Open in the Atlas

Code that ran

5 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; 1 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 2 failures of our instrument; 3 no recorded run), measured 2026-11-22; 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/2106.00209.json · badge: /api/ran/2106.00209.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
TACJu/Bi-Sampling canonical (classifier label)
classifier basis: census
5 ran · 3 no recorded run
FunctionStatusWhere it lives
conv3x3 Ran
ran; our contract draft was wrong, not the code
TACJu/Bi-Sampling/models/wrn.py
code served (permissive licence) · get_code("a4917ae1314a3442")
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 Conv2d. 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 = {
    "i_c": 3,
    "o_c": 16,
    "stride": 1
}
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 Conv2d — a Conv2d output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Conv2d 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
make_imb_data Ran
ran, honoured the contract we drafted
TACJu/Bi-Sampling/fix_finetune.py
pointer only (licence: MIT); the stored copy get_code serves, from renzhenwang/bias-adaptive-classifier, is pointer only (licence: NONE) · get_code("5feba68f8f5d8648")
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 renzhenwang/bias-adaptive-classifier, 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.

plot_overlap Ran
ran; our contract draft was wrong, not the code
TACJu/Bi-Sampling/utils/logger.py
code served (permissive licence) · get_code("50afa2863ffd9fde")
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 list, 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 matplotlib.pyplot as plt
import numpy as np

class MockLogger:
    def __init__(self):
        self.title = "TestPlot"
        self.names = ["loss", "accuracy", "f1_score"]
        self.numbers = {
            "loss": [0.5, 0.4, 0.3, 0.2],
            "accuracy": [0.7, 0.75, 0.8, 0.85],
            "f1_score": [0.65, 0.72, 0.78, 0.82]
        }

logger = MockLogger()

ARGS = {
    "logger": logger,
    "names": None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
matplotlib, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, 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
train_split Ran
ran on a synthesized input
TACJu/Bi-Sampling/dataset/fix_cifar10.py
code served (permissive licence) · get_code("6f1cd69d7f202f53")
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 2, dtype family int; 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 numpy as np

# The function expects:
# - labels: array-like of class labels (0-9)
# - n_labeled_per_class: array-like with 10 elements specifying count per class
# - n_unlabeled_per_class: array-like with 10 elements specifying count per class

# Create a labels array with samples from each class (0-9)
# We'll create 50 samples total: 5 samples per class
labels = np.array([0, 0, 0, 0, 0,
                   1, 1, 1, 1, 1,
                   2, 2, 2, 2, 2,
                   3, 3, 3, 3, 3,
                   4, 4, 4, 4, 4,
                   5, 5, 5, 5, 5,
                   6, 6, 6, 6, 6,
                   7, 7, 7, 7, 7,
                   8, 8, 8, 8, 8,
                   9, 9, 9, 9, 9])

# n_labeled_per_class: how many labeled samples from each class (10 classes)
n_labeled_per_class = [2, 2, 2, 2, 2, 2, 2, 2, 2, 2]

# n_unlabeled_per_class: how many unlabeled samples from each class (10 classes)
n_unlabeled_per_class = [2, 2, 2, 2, 2, 2, 2, 2, 2, 2]

ARGS = {
    "labels": labels,
    "n_labeled_per_class": n_labeled_per_class,
    "n_unlabeled_per_class": n_unlabeled_per_class
}
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 tuple, ndim 2, dtype family int — 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
train_split Ran
ran on a synthesized input
TACJu/Bi-Sampling/dataset/fix_cifar100.py
code served (permissive licence) · get_code("3de439eab03cba56")
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 2, dtype family int; 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 numpy as np

# Create labels for 100 classes, with some samples per class
np.random.seed(0)
labels = []
for class_id in range(100):
    # Add 5 samples per class
    labels.extend([class_id] * 5)

labels = labels[:500]  # Ensure we have enough samples

# Define n_labeled_per_class: 2 labeled samples per class
n_labeled_per_class = [2] * 100

# Define n_unlabeled_per_class: 2 unlabeled samples per class
n_unlabeled_per_class = [2] * 100

ARGS = {
    "labels": labels,
    "n_labeled_per_class": n_labeled_per_class,
    "n_unlabeled_per_class": n_unlabeled_per_class
}
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 tuple, ndim 2, dtype family int — 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
get_cifar Not yet run
unverified (harvested, no recorded run)
TACJu/Bi-Sampling/dataset/fix_cifar10.py
code served (permissive licence) · get_code("aa3efad86d06847c")
How it ran

no invocation recorded.

get_cifar Not yet run
unverified (harvested, no recorded run)
TACJu/Bi-Sampling/dataset/fix_cifar100.py
code served (permissive licence) · get_code("e716c70039afafd7")
How it ran

no invocation recorded.

get_mean_and_std Not yet run
unverified (harvested, no recorded run)
TACJu/Bi-Sampling/utils/misc.py
pointer only (licence: MIT); the stored copy get_code serves, from LeeHyuck/CDMAD, is pointer only (licence: NONE) · get_code("1d6e2edb8832d7b0")
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 LeeHyuck/CDMAD, 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. 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, 4 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 4 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
plot_overlap 31 other papers
16 dated earlier, 14 later, 1 same year, order not determinable
1612.06321 (2016-12)
Large-Scale Image Retrieval with Attentive Deep Local Features
1805.07925 (2018-05)
Batch-Instance Normalization for Adaptively Style-Invariant Neural Networks
1806.04606 (2018-06)
Knowledge Distillation by On-the-Fly Native Ensemble
and 28 more not named here
get_mean_and_std 21 other papers
13 dated earlier, 8 later
1805.07925 (2018-05)
Batch-Instance Normalization for Adaptively Style-Invariant Neural Networks
1806.04606 (2018-06)
Knowledge Distillation by On-the-Fly Native Ensemble
1811.05850 (2018-11)
Drop-Activation: Implicit Parameter Reduction and Harmonic Regularization
and 18 more not named here
conv3x3 3 other papers
1 dated earlier, 2 later
2002.06815 (2020-02)
Class-Imbalanced Semi-Supervised Learning
2112.04564 (2021-12)
CoSSL: Co-Learning of Representation and Classifier for Imbalanced Semi-Supervised Learning
2403.10391 (2024-03)
CDMAD: Class-Distribution-Mismatch-Aware Debiasing for Class-Imbalanced Semi-Supervised Learning
make_imb_data 1 other paper
1 later
2207.13856 (2022-07)
Imbalanced Semi-supervised Learning with Bias Adaptive Classifier

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

Semi-Supervised Learning (SSL) has shown its strong ability in utilizing unlabeled data when labeled data is scarce. However, most SSL algorithms work under the assumption that the class distributions are balanced in both training and test sets. In this work, we consider the problem of SSL on class-imbalanced data, which better reflects real-world situations. In particular, we decouple the training of the representation and the classifier, and systematically investigate the effects of different data re-sampling techniques when training the whole network including a classifier as well as fine-tuning the feature extractor only. We find that data re-sampling is of critical importance to learn a good classifier as it increases the accuracy of the pseudo-labels, in particular for the minority classes in the unlabeled data. Interestingly, we find that accurate pseudo-labels do not help when training the feature extractor, rather contrariwise, data re-sampling harms the training of the feature extractor. This finding is against the general intuition that wrong pseudo-labels always harm the model performance in SSL. Based on these findings, we suggest to re-think the current paradigm of having a single data re-sampling strategy and develop a simple yet highly effective Bi-Sampling (BiS) strategy for SSL on class-imbalanced data. BiS implements two different re-sampling strategies for training the feature extractor and the classifier and integrates this decoupled training into an end-to-end framework. In particular, BiS progressively changes the data distribution during training such that in the beginning the feature extractor is trained effectively, while towards the end of the training the data is re-balanced such that the classifier is trained reliably. We benchmark our proposed bi-sampling strategy extensively on popular datasets and achieve state-of-the-art performances.

For agents

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

get_harvested_code_for_paper("2106.00209")
get_code_for_paper("2106.00209")
have("2106.00209")

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

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

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

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

Connect an agent — have() is free.