SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2011.08785 · 2020

PaDiM: a Patch Distribution Modeling Framework for Anomaly Detection and Localization

arXiv · PDF · Open in the Atlas

Code that ran

7 of 7 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; 5 failures of our instrument; 0 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/2011.08785.json · badge: /api/ran/2011.08785.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
koheitokda/PaDiM extension (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
FlappyPeggy/Registration-based-PaDiM extension (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
OpenAOI/anodet reimplementation (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
Pangoraw/PaDiM reimplementation (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
copy not recorded community
not in the paper's declared repositories
1 ran · 0 no recorded run
FunctionStatusWhere it lives
denormalization Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
koheitokda/PaDiM/original_data.py
code served (permissive licence) · get_code("e6842b1e038b1c52")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned ndarray, ndim 3, dtype family int, shape (5, 4, 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

# The function expects x to be a normalized image tensor in CHW format (channels, height, width)
# It will transpose to HWC, denormalize using ImageNet mean/std, scale to 0-255, and convert to uint8

# Create a small normalized image: 3 channels, 5 height, 4 width
# Values should be in the normalized range (roughly -2 to 2 after normalization with ImageNet stats)
np.random.seed(0)
x = np.random.randn(3, 5, 4).astype(np.float32)

ARGS = {
    'x': x
}
Setup block drafted by
a language model, Claude Sonnet 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 3, dtype family int, shape (5, 4, 3) — shape (5, 4, 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
embedding_concat Ran
ran; our contract draft was wrong, not the code
koheitokda/PaDiM/original_data.py
code served (permissive licence) · get_code("95dff3e95b0216e4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned Tensor, ndim 4, dtype family float, shape (2, 7, 8, 8) 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)

# The function expects two tensors x and y where:
# - x has shape (B, C1, H1, W1)
# - y has shape (B, C2, H2, W2)
# - H1/H2 must be an integer (s = int(H1 / H2))
# - The unfold operation requires H1 to be divisible by s

# Let's use:
# B = 2 (batch size)
# C1 = 4 (channels for x)
# C2 = 3 (channels for y, different from C1)
# H1 = W1 = 8 (spatial dimensions for x)
# H2 = W2 = 4 (spatial dimensions for y)
# This gives s = 8/4 = 2

B = 2
C1 = 4
C2 = 3
H1 = 8
W1 = 8
H2 = 4
W2 = 4

x = torch.randn(B, C1, H1, W1)
y = torch.randn(B, C2, H2, W2)

ARGS = {
    'x': x,
    'y': y
}
Setup block drafted by
a language model, Claude Sonnet 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 4, dtype family float, shape (2, 7, 8, 8) — shape (2, 7, 8, 8) 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
fused_map Ran
ran; our contract draft was wrong, not the code
FlappyPeggy/Registration-based-PaDiM/regpadim/e2eutils.py
pointer only (licence: NONE) · get_code("62c0eeb67a3daaa8")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, FlappyPeggy/Registration-based-PaDiM 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_indices Ran
ran, honoured the contract we drafted
OpenAOI/anodet/anodet/padim.py
code served (permissive licence) · get_code("1c2fbdd38f225973")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned Tensor, ndim 1, dtype family int, shape (5,) as a later run recorded it. 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, 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 random

torch.manual_seed(0)

choose = 5
total = 20
device = torch.device('cpu')

ARGS = {
    'choose': choose,
    'total': total,
    'device': device
}
Setup block drafted by
a language model, Claude Sonnet 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 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
get_radius Ran
ran; our contract draft was wrong, not the code
Pangoraw/PaDiM/padim/padim_svdd.py
code served (permissive licence) · get_code("def857abe2885673")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned float32, 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 numpy as np

torch.manual_seed(0)

# Create a small tensor of distances (squared distances, since the function takes sqrt)
# Using 6 samples to make quantile calculation meaningful
dist = torch.tensor([0.25, 1.0, 2.25, 4.0, 6.25, 9.0])

# nu is a float representing the fraction for quantile calculation
# Typically between 0 and 1, e.g., 0.1 means we want the 90th percentile
nu = 0.1

ARGS = {
    "dist": dist,
    "nu": nu
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float32, 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
gkern Ran
ran; our contract draft was wrong, not the code
FlappyPeggy/Registration-based-PaDiM/regpadim/e2eutils.py
pointer only (licence: NONE) · get_code("216ef2c2ea151173")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, FlappyPeggy/Registration-based-PaDiM 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.

str2bool Ran
ran, violated the contract we drafted
this paper's copy was not recorded; identical code first harvested from sajadn/Exemplar-VAE
pointer only · get_code("7c508037b40522af")
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.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 2 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 2 later) and 5 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
str2bool 175 other papers
24 dated earlier, 151 later · 2 only as an assembly brick
1406.6247 (2014-06)
Recurrent Models of Visual Attention
1603.09382 (2016-03)
Deep Networks with Stochastic Depth
1710.10196 (2017-10)
Progressive Growing of GANs for Improved Quality, Stability, and Variation
and 172 more not named here
get_radius 2 other papers
2 later
2212.09518 (2022-12)
FedTADBench: Federated Time-Series Anomaly Detection Benchmark
2307.15860 (2023-07)
What can Discriminator do? Towards Box-free Ownership Verification of Generative Adversarial Networks

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

We present a new framework for Patch Distribution Modeling, PaDiM, to concurrently detect and localize anomalies in images in a one-class learning setting. PaDiM makes use of a pretrained convolutional neural network (CNN) for patch embedding, and of multivariate Gaussian distributions to get a probabilistic representation of the normal class. It also exploits correlations between the different semantic levels of CNN to better localize anomalies. PaDiM outperforms current state-of-the-art approaches for both anomaly detection and localization on the MVTec AD and STC datasets. To match real-world visual industrial inspection, we extend the evaluation protocol to assess performance of anomaly localization algorithms on non-aligned dataset. The state-of-the-art performance and low complexity of PaDiM make it a good candidate for many industrial applications.

For agents

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

get_harvested_code_for_paper("2011.08785")
get_code_for_paper("2011.08785")
have("2011.08785")

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

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

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

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

Connect an agent — have() is free.