SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2106.09708 · CVPR · 2021

Multi-Label Learning from Single Positive Labels

Caltech, Nebojsa Jojic, Pietro Perona, Elijah Cole, Oisin Aodha, Dan Morris, Titouan Lorieul

arXiv · PDF · Open in the Atlas

Code that ran

12 of 13 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 7 have no contract verdict; 5 failures of our instrument; 1 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.09708.json · badge: /api/ran/2106.09708.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
elijahcole/single-positive-multi-label canonical (classifier label)
classifier basis: census
10 ran · 1 no recorded run
correr-zhou/spml-acktheunknown canonical (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
FunctionStatusWhere it lives
compute_avg_precision Ran
ran on a synthesized input
elijahcole/single-positive-multi-label/metrics.py
code served (permissive licence) · get_code("49dd609fa1a505c6")
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 float, ndim 0, dtype family float, shape () 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

# Set random seed for reproducibility
np.random.seed(0)

# Create binary targets (only 0s and 1s, at least one 1 to avoid all-zeros case)
targs = np.array([0, 1, 1, 0, 1], dtype=np.float64)

# Create predicted probability scores (values between 0 and 1)
preds = np.array([0.1, 0.9, 0.8, 0.2, 0.7], dtype=np.float64)

ARGS = {
    "targs": targs,
    "preds": preds,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () 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
compute_precision_at_k Ran
ran on a synthesized input
elijahcole/single-positive-multi-label/metrics.py
code served (permissive licence) · get_code("b13a333afd489a8b")
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 float, ndim 0, dtype family float, shape () 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

# Set random seeds for reproducibility
np.random.seed(0)

# Create binary target array with some positive examples
targs = np.array([1.0, 0.0, 1.0, 0.0, 1.0, 0.0], dtype=np.float32)

# Create predicted probability scores (values between 0 and 1)
preds = np.array([0.9, 0.1, 0.8, 0.2, 0.7, 0.3], dtype=np.float32)

# Define k as the number of top predictions to consider
k = 3

ARGS = {
    "targs": targs,
    "preds": preds,
    "k": k
}
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 float, ndim 0, dtype family float, shape () — shape () 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
compute_recall_at_k Ran
ran on a synthesized input
elijahcole/single-positive-multi-label/metrics.py
code served (permissive licence) · get_code("20006cdd5ff4c9e6")
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 float, ndim 0, dtype family float, shape () 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

# Set random seed for reproducibility
np.random.seed(0)

# Create binary target array with some positive and negative examples
targs = np.array([1, 0, 1, 0, 1, 0, 0, 1], dtype=np.float32)

# Create predicted probability scores in [0, 1] range
preds = np.array([0.9, 0.1, 0.8, 0.2, 0.7, 0.3, 0.4, 0.6], dtype=np.float32)

# Set k parameter
k = 3

ARGS = {
    "targs": targs,
    "preds": preds,
    "k": k
}
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 float, ndim 0, dtype family float, shape () — shape () 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
expected_positive_regularizer Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
elijahcole/single-positive-multi-label/losses.py
pointer only (licence: MIT); the stored copy get_code serves, from palm-ml/smile, is pointer only (licence: NONE) · get_code("fd9787c5dee571b5")
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 palm-ml/smile, 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.

generate_split Ran
ran on a synthesized input
elijahcole/single-positive-multi-label/datasets.py
code served (permissive licence) · get_code("710fec7dc17f5069")
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. 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

# Set random seed for reproducibility
np.random.seed(42)

# Create a numpy random number generator
rng = np.random.RandomState(42)

# Define arguments
num_ex = 100
frac = 0.3

ARGS = {
    "num_ex": num_ex,
    "frac": frac,
    "rng": rng
}
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 — 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
get_metadata Ran
ran on a synthesized input
elijahcole/single-positive-multi-label/datasets.py
code served (permissive licence) · get_code("1255b14983c0b14e")
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 dict. 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

ARGS = {
    'dataset_name': 'pascal'
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
get_random_label_indices Ran
ran; our contract draft was wrong, not the code
correr-zhou/spml-acktheunknown/preproc/generate_observed_labels.py
code served (permissive licence) · get_code("acb5be644ff9589f")
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 ndarray, ndim 1, dtype family int, shape (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

# Create a label vector with some repeated values
label_vec = np.array([0, 1, 2, 1, 0, 1, 2, 0, 1, 2])

# Choose a label value to select from
label_value = 1

# Number of selections to make
num_sel = 3

# Create a random number generator
rng = np.random.RandomState(42)

ARGS = {
    "label_vec": label_vec,
    "label_value": label_value,
    "num_sel": num_sel,
    "rng": rng
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 1, dtype family int, shape (3,) — shape (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
inverse_sigmoid Ran
ran on a synthesized input
elijahcole/single-positive-multi-label/models.py
code served (permissive licence) · get_code("1d978fb1ef9ac6b3")
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 1, dtype family float, shape (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 numpy as np

# The function takes a single parameter 'p' which should be a numpy array
# The function applies element-wise operations: minimum, maximum, and log
# So we need to provide a numpy array with values between 0 and 1

p = np.array([0.1, 0.5, 0.9, 0.3])

ARGS = {
    "p": p
}
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 1, dtype family float, shape (4,) — shape (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
log_loss Ran
ran; our contract draft was wrong, not the code
elijahcole/single-positive-multi-label/losses.py
code served (permissive licence) · get_code("b19f196f194e428a")
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

torch.manual_seed(0)

# Create small tensors for predictions and targets
# preds: model predictions (probabilities), shape (2, 4)
preds = torch.tensor([[0.1, 0.2, 0.3, 0.4],
                      [0.5, 0.2, 0.1, 0.2]], dtype=torch.float32)

# targs: target values (typically one-hot or binary labels), shape (2, 4)
targs = torch.tensor([[1.0, 0.0, 0.0, 0.0],
                      [0.0, 1.0, 0.0, 0.0]], dtype=torch.float32)

ARGS = {
    'preds': preds,
    'targs': targs
}
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
neg_log Ran
ran; our contract draft was wrong, not the code
elijahcole/single-positive-multi-label/losses.py
code served (permissive licence) · get_code("fec97abec81fb6c1")
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

torch.manual_seed(0)

def neg_log(x):
    return -torch.log(x + 1e-05)

# Create a small tensor with positive values (since log requires positive input)
x_tensor = torch.rand(2, 4) + 0.1  # Values between 0.1 and 1.1 to ensure positivity

ARGS = {
    "x": x_tensor
}
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
observe_uniform Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
correr-zhou/spml-acktheunknown/preproc/generate_observed_labels.py
code served (permissive licence) · get_code("ae55452446d2adda")
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 ndarray, 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 numpy as np

# Set random seed for reproducibility
np.random.seed(0)
rng = np.random.RandomState(42)

# Create a small binary label matrix with shape (num_items=2, num_classes=4)
# Each entry is either -1 or +1
label_matrix = np.array([
    [1, -1, 1, -1],
    [-1, 1, -1, 1]
], dtype=np.float64)

num_pos = 2
num_neg = 1

ARGS = {
    "label_matrix": label_matrix,
    "num_pos": num_pos,
    "num_neg": num_neg,
    "rng": rng
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 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
parse_categories Ran
ran on a synthesized input
elijahcole/single-positive-multi-label/preproc/format_coco.py
code served (permissive licence) · get_code("80aadadec5852973")
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. 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

torch.manual_seed(0)

# The function parse_categories expects a list of dicts
# Each dict must have 'name' and 'id' keys
# The function iterates through the list, accessing these keys

categories = [
    {'name': 'cat', 'id': 101},
    {'name': 'dog', 'id': 202},
    {'name': 'bird', 'id': 303},
]

ARGS = {
    'categories': categories
}
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 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
get_data Not yet run
unverified (harvested, no recorded run)
elijahcole/single-positive-multi-label/datasets.py
code served (permissive licence) · get_code("349f715cf5270d52")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 3 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 3 later) and 10 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
expected_positive_regularizer 1 other paper
1 later
2206.00517 (2022-06)
One Positive Label is Sufficient: Single-Positive Multi-Label Learning with Label Enhancement
log_loss 1 other paper
1 later
2206.00517 (2022-06)
One Positive Label is Sufficient: Single-Positive Multi-Label Learning with Label Enhancement
neg_log 1 other paper
1 later
2405.03501 (2024-05)
Boosting Single Positive Multi-label Classification with Generalized Robust Loss *

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

Predicting all applicable labels for a given image is known as multi-label classification. Compared to the standard multi-class case (where each image has only one label), it is considerably more challenging to annotate training data for multi-label classification. When the number of potential labels is large, human annotators find it difficult to mention all applicable labels for each training image. Furthermore, in some settings detection is intrinsically difficult e.g. finding small object instances in high resolution images. As a result, multi-label training data is often plagued by false negatives. We consider the hardest version of this problem, where annotators provide only one relevant label for each image. As a result, training sets will have only one positive label per image and no confirmed negatives. We explore this special case of learning from missing labels across four different multi-label image classification datasets for both linear classifiers and end-to-end finetuned deep networks. We extend existing multi-label losses to this setting and propose novel variants that constrain the number of expected positive labels during training. Surprisingly, we show that in some cases it is possible to approach the performance of fully labeled classifiers despite training with significantly fewer confirmed labels.

For agents

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

get_harvested_code_for_paper("2106.09708")
get_code_for_paper("2106.09708")
have("2106.09708")

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

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

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

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

Connect an agent — have() is free.