SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2108.11941 · ICCV · 2021

Semantically Coherent Out-of-Distribution Detection

Ziwei Liu, Jingkang Yang, Haoqi Wang, Wayne Zhang, Litong Feng, Huabin Zheng, Xiaopeng Yan

arXiv · PDF · Open in the Atlas

Code that ran

7 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 4 violated it and 2 have no contract verdict; 1 failure of our instrument; 4 no recorded run); 1 of them was also run on the host, not in the jail, by the peer-agreement lane that set its level, 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/2108.11941.json · badge: /api/ran/2108.11941.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
Jingkang50/ICCV21_SCOOD marked official in Papers with Code
Papers with Code archive
6 ran · 4 no recorded run
copy not recorded community
not in the paper's declared repositories
1 ran · 0 no recorded run
FunctionStatusWhere it lives
cosine_annealing Ran
ran, violated the contract we drafted
this paper's copy was not recorded; identical code first harvested from lygjwy/dos
pointer only · get_code("05eda95f9800a1e9")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

BaseTrainer Ran
ran on a synthesized input · constructed an object; no result was computed
Jingkang50/ICCV21_SCOOD/scood/trainers/udg_trainer.py
code served (permissive licence) · get_code("ca74574f5cf44300")
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 an instance of its own class, BaseTrainer: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn
import torch.utils.data as data_utils
import numpy as np

torch.manual_seed(0)

# Define a minimal neural network that takes data and outputs logits
class MinimalNet(nn.Module):
    def __init__(self, input_dim=4, num_classes=3):
        super().__init__()
        self.fc = nn.Linear(input_dim, num_classes)
    
    def forward(self, x):
        return self.fc(x)

# Create a minimal dataset with dict-based batches
class DictDataset(data_utils.Dataset):
    def __init__(self, num_samples=8, input_dim=4, num_classes=3):
        self.num_samples = num_samples
        self.input_dim = input_dim
        self.num_classes = num_classes
    
    def __len__(self):
        return self.num_samples
    
    def __getitem__(self, idx):
        data = torch.randn(self.input_dim)
        label = torch.randint(0, self.num_classes, (1,)).item()
        return {'data': data, 'label': label}

# Create instances
net = MinimalNet(input_dim=4, num_classes=3)

dataset = DictDataset(num_samples=8, input_dim=4, num_classes=3)
labeled_train_loader = data_utils.DataLoader(
    dataset, 
    batch_size=2, 
    shuffle=False
)

ARGS = {
    'net': net,
    'labeled_train_loader': labeled_train_loader,
    'learning_rate': 0.1,
    'momentum': 0.9,
    'weight_decay': 0.0005,
    'epochs': 100
}
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 BaseTrainer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a BaseTrainer 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
KMeans Ran
ran on a synthesized input · constructed an object; no result was computed
Jingkang50/ICCV21_SCOOD/scood/trainers/udg_trainer.py
code served (permissive licence) · get_code("65ba1d56e5e30f5c")
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 an instance of its own class, KMeans: the run constructed the object and did not call it, so no result was computed. 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

np.random.seed(0)

k = 3
pca_dim = 2

ARGS = {
    "k": k,
    "pca_dim": pca_dim,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
faiss, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type KMeans — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a KMeans 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
rew_ce Ran
ran, violated the contract we drafted
Jingkang50/ICCV21_SCOOD/scood/trainers/udg_trainer.py
code served (permissive licence) · get_code("d8339d591bbd7f52")
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 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 torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create valid arguments for rew_ce function
batch_size = 2
num_classes = 4

# logits: shape (batch_size, num_classes)
logits = torch.randn(batch_size, num_classes)

# labels: shape (batch_size,) with class indices
labels = torch.tensor([0, 2], dtype=torch.long)

# sample_weights: shape (batch_size,) with positive weights
sample_weights = torch.tensor([1.0, 0.5], dtype=torch.float32)

ARGS = {
    'logits': logits,
    'labels': labels,
    'sample_weights': sample_weights
}
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 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
rew_sce Ran
ran, violated the contract we drafted
Jingkang50/ICCV21_SCOOD/scood/trainers/udg_trainer.py
code served (permissive licence) · get_code("31075b0878f5cb7a")
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 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 torch

torch.manual_seed(0)

# Create small tensors for the function
batch_size = 2
num_classes = 4

# logits: (batch_size, num_classes)
logits = torch.randn(batch_size, num_classes, requires_grad=True)

# soft_labels: same shape as logits, should sum to 1 along class dimension
soft_labels = torch.softmax(torch.randn(batch_size, num_classes), dim=1)

# sample_weights: (batch_size,) - one weight per sample
sample_weights = torch.rand(batch_size)

ARGS = {
    'logits': logits,
    'soft_labels': soft_labels,
    'sample_weights': sample_weights,
}
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 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
soft_cross_entropy Ran
ran; our contract draft was wrong, not the code
Jingkang50/ICCV21_SCOOD/scood/trainers/udg_trainer.py
code served (permissive licence) · get_code("61492b343324d2ea")
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 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 torch

torch.manual_seed(0)

# Create small tensors for testing
# logit: shape (batch_size, num_classes) - raw model outputs
# label: shape (batch_size, num_classes) - soft labels (probabilities)
batch_size = 2
num_classes = 4

logit = torch.randn(batch_size, num_classes, requires_grad=True)
label = torch.rand(batch_size, num_classes)
label = label / label.sum(dim=1, keepdim=True)  # normalize to probabilities

# weight: optional class weights
weight = torch.tensor([0.5, 1.0, 1.5, 2.0], requires_grad=False)

ARGS = {
    'logit': logit,
    'label': label,
    'weight': weight,
    'reduce': None,
    'reduction': 'mean'
}
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 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
sort_array Ran
ran, violated the contract we drafted
Jingkang50/ICCV21_SCOOD/scood/trainers/udg_trainer.py
code served (permissive licence) · get_code("c8756cf28e534c80")
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 int, shape (5,) 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 simple numpy arrays for testing
old_array = np.array([10, 20, 30, 40, 50])
index_array = np.array([2, 0, 4, 1, 3])

ARGS = {
    "old_array": old_array,
    "index_array": index_array
}
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 int, shape (5,) — shape (5,) 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
SoftCrossEntropyFunction Not yet run
unverified (harvested, no recorded run)
Jingkang50/ICCV21_SCOOD/scood/trainers/udg_trainer.py
code served (permissive licence) · get_code("0fccde09ee48cbad")
How it ran

no invocation recorded.

UDGTrainer Not yet run
unverified (harvested, no recorded run)
Jingkang50/ICCV21_SCOOD/scood/trainers/udg_trainer.py
code served (permissive licence) · get_code("71a3dff3d948d9f4")
How it ran

no invocation recorded.

preprocess_features Not yet run
unverified (harvested, no recorded run)
Jingkang50/ICCV21_SCOOD/scood/trainers/udg_trainer.py
code served (permissive licence) · get_code("294d6d9211fbcb70")
How it ran

no invocation recorded.

run_kmeans Not yet run
unverified (harvested, no recorded run)
Jingkang50/ICCV21_SCOOD/scood/trainers/udg_trainer.py
code served (permissive licence) · get_code("b919ef68178b78aa")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 4 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 4 later) and 7 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
cosine_annealing
brick of this paper's assembly: helper
9 other papers
2 dated earlier, 7 later
1901.09960 (2019-01)
Using Pre-Training Can Improve Model Robustness and Uncertainty
2003.09711 (2020-03)
Robust Out-of-distribution Detection for Neural Networks
2110.01200 (2021-10)
AASIST: Audio Anti-Spoofing using Integrated Spectro-Temporal Graph Attention Networks
and 6 more not named here
rew_ce
brick of this paper's assembly: loss
8 other papers
8 later
2210.01742 (2022-10)
CADet: Fully Self-Supervised Out-Of-Distribution Detection With Contrastive Learning
2210.07242 (2022-10)
OpenOOD: Benchmarking Generalized Out-of-Distribution Detection
2303.14531 (2023-03)
SIO: Synthetic In-Distribution Data Benefits Out-of-Distribution Detection
and 5 more not named here
rew_sce
brick of this paper's assembly: loss
8 other papers
8 later
2210.01742 (2022-10)
CADet: Fully Self-Supervised Out-Of-Distribution Detection With Contrastive Learning
2210.07242 (2022-10)
OpenOOD: Benchmarking Generalized Out-of-Distribution Detection
2303.14531 (2023-03)
SIO: Synthetic In-Distribution Data Benefits Out-of-Distribution Detection
and 5 more not named here
soft_cross_entropy
brick of this paper's assembly: loss
7 other papers
7 later
2210.01742 (2022-10)
CADet: Fully Self-Supervised Out-Of-Distribution Detection With Contrastive Learning
2210.07242 (2022-10)
OpenOOD: Benchmarking Generalized Out-of-Distribution Detection
2303.14531 (2023-03)
SIO: Synthetic In-Distribution Data Benefits Out-of-Distribution Detection
and 4 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-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

Current out-of-distribution (OOD) detection benchmarks are commonly built by defining one dataset as indistribution (ID) and all others as OOD. However, these benchmarks unfortunately introduce some unwanted and impractical goals, e.g., to perfectly distinguish CIFAR dogs from ImageNet dogs, even though they have the same semantics and negligible covariate shifts. These unrealistic goals will result in an extremely narrow range of model capabilities, greatly limiting their use in real applications. To overcome these drawbacks, we re-design the benchmarks and propose the semantically coherent out-ofdistribution detection (SC-OOD). On the SC-OOD benchmarks, existing methods suffer from large performance degradation, suggesting that they are extremely sensitive to low-level discrepancy between data sources while ignoring their inherent semantics. To develop an effective SC-OOD detection approach, we leverage an external unlabeled set and design a concise framework featured by unsupervised dual grouping (UDG) for the joint modeling of ID and OOD data. The proposed UDG can not only enrich the semantic knowledge of the model by exploiting unlabeled data in an unsupervised manner, but also distinguish ID/OOD samples to enhance ID classification and OOD detection tasks simultaneously. Extensive experiments demonstrate that our approach achieves the state-of-the-art performance on SC-OOD benchmarks. Code and benchmarks are provided on our project page: https://jingkang50.github.io/projects/scood.

For agents

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

get_harvested_code_for_paper("2108.11941")
get_code_for_paper("2108.11941")
have("2108.11941")

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

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

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

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

Connect an agent — have() is free.