SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1911.02357 · 2019

Uninformed Students: Student-Teacher Anomaly Detection with Discriminative Latent Embeddings

arXiv · PDF · Open in the Atlas

Code that ran

8 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, 1 violated it and 0 have no contract verdict; 6 failures of our instrument; 0 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/1911.02357.json · badge: /api/ran/1911.02357.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
LuyaooChen/uninformed-students-pytorch reimplementation (classifier label)
classifier basis: classifier_2025
5 ran · 0 no recorded run
denguir/student-teacher-anomaly-detection reimplementation (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
FunctionStatusWhere it lives
compactness_loss Ran
ran, violated the contract we drafted
LuyaooChen/uninformed-students-pytorch/teacher_train.py
code served (permissive licence) · get_code("93047fe2e31f686c")
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 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)

# The function expects:
# - output: a tensor that will be indexed with .size(), have mean/std computed,
#   transposed, and used in matrix operations
# Create a small 2D tensor (batch_size=2, n=4)
output = torch.randn(2, 4)

ARGS = {
    "output": output
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
distillation_loss Ran
ran, honoured the contract we drafted
LuyaooChen/uninformed-students-pytorch/teacher_train.py
code served (permissive licence) · get_code("1df330df12a648c5")
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 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)

# The function expects two tensors: output and target
# Both are used in a subtraction operation and then torch.norm is applied with dim=1
# This means they should have shape (batch_size, feature_dim)
# Let's use batch_size=2 and feature_dim=4

output = torch.randn(2, 4)
target = torch.randn(2, 4)

ARGS = {
    "output": output,
    "target": target,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
error Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
LuyaooChen/uninformed-students-pytorch/evaluate.py
code served (permissive licence) · get_code("90288aa22857bfaf")
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 Tensor, ndim 3, dtype family float, shape (2, 4, 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 torch

torch.manual_seed(0)

# Analyzing the function:
# - student_outputs: used with torch.mean(dim=1), then result subtracted from teacher_output
# - teacher_output: subtracted from s_mean, then torch.norm applied with dim=3
# 
# The function does:
# 1. s_mean = torch.mean(student_outputs, dim=1) -> reduces dim 1
# 2. torch.norm(s_mean - teacher_output, dim=3) -> computes norm along dim 3
#
# For torch.norm to work with dim=3, the result of (s_mean - teacher_output) 
# must have at least 4 dimensions (0,1,2,3)
#
# If student_outputs has shape (batch, dim1, dim2, dim3, dim4):
# - mean over dim=1 gives (batch, dim2, dim3, dim4)
# - This needs to match teacher_output shape for broadcasting
# - norm with dim=3 requires at least 4 dims, so (batch, dim2, dim3, dim4) works
#
# Let's use:
# student_outputs: (2, 3, 4, 5, 6) - batch=2, then various dims
# After mean(dim=1): (2, 4, 5, 6)
# teacher_output: (2, 4, 5, 6) - matches for subtraction
# norm(dim=3) on (2, 4, 5, 6) works since dim 3 exists

student_outputs = torch.randn(2, 3, 4, 5, 6)
teacher_output = torch.randn(2, 4, 5, 6)

ARGS = {
    "student_outputs": student_outputs,
    "teacher_output": teacher_output,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 3, dtype family float, shape (2, 4, 5) — shape (2, 4, 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
get_error_map Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
denguir/student-teacher-anomaly-detection/src/anomaly_detection.py
pointer only (licence: NONE) · get_code("f50afd32cd82ba71")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, denguir/student-teacher-anomaly-detection 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.

get_variance_map Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
denguir/student-teacher-anomaly-detection/src/anomaly_detection.py
pointer only (licence: NONE) · get_code("173fea049a824651")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, denguir/student-teacher-anomaly-detection 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.

increment_mean_and_var Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
LuyaooChen/uninformed-students-pytorch/student_train.py
code served (permissive licence) · get_code("d7ddf620faa7c311")
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 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)

# Construct arguments for increment_mean_and_var
# The function expects:
# - mu_N: current mean (scalar tensor)
# - var_N: current variance (scalar tensor)
# - N: current count (integer)
# - batch: new batch of data (4D tensor with shape [B, C, H, W])

# Create a small batch with shape [B=2, C=3, H=4, W=5]
batch = torch.randn(2, 3, 4, 5)

# Current mean and variance (scalars)
mu_N = torch.tensor(0.5)
var_N = torch.tensor(0.1)

# Current count
N = 10

ARGS = {
    "mu_N": mu_N,
    "var_N": var_N,
    "N": N,
    "batch": batch
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
student_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
denguir/student-teacher-anomaly-detection/src/students_training.py
pointer only (licence: NONE) · get_code("43a43a856335ac7d")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, denguir/student-teacher-anomaly-detection 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.

variance Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
LuyaooChen/uninformed-students-pytorch/evaluate.py
code served (permissive licence) · get_code("7327a71150875464")
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 Tensor, ndim 3, dtype family float, shape (2, 4, 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 torch

torch.manual_seed(0)

# Analyze the function:
# - student_outputs is used with:
#   - torch.sum(..., dim=4): needs at least 5 dimensions
#   - torch.mean(..., dim=1): needs at least 2 dimensions
#   - torch.sum(..., dim=3): needs at least 4 dimensions
# So we need a 5D tensor

# Shape analysis:
# - dim=4 is summed over (5th dimension)
# - dim=1 is meaned over (2nd dimension)
# - dim=3 is summed over (4th dimension)
# Let's use shape: (batch=2, dim1=3, dim2=4, dim3=5, dim4=6)

student_outputs = torch.randn(2, 3, 4, 5, 6)

ARGS = {
    "student_outputs": student_outputs
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 3, dtype family float, shape (2, 4, 5) — shape (2, 4, 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

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, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 8 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.

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

We introduce a powerful student-teacher framework for the challenging problem of unsupervised anomaly detection and pixel-precise anomaly segmentation in high-resolution images. Student networks are trained to regress the output of a descriptive teacher network that was pretrained on a large dataset of patches from natural images. This circumvents the need for prior data annotation. Anomalies are detected when the outputs of the student networks differ from that of the teacher network. This happens when they fail to generalize outside the manifold of anomaly-free training data. The intrinsic uncertainty in the student networks is used as an additional scoring function that indicates anomalies. We compare our method to a large number of existing deep learning based methods for unsupervised anomaly detection. Our experiments demonstrate improvements over state-of-the-art methods on a number of real-world datasets, including the recently introduced MVTec Anomaly Detection dataset that was specifically designed to benchmark anomaly segmentation algorithms.

For agents

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

get_harvested_code_for_paper("1911.02357")
get_code_for_paper("1911.02357")
have("1911.02357")

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

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

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

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

Connect an agent — have() is free.