SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1608.00530 · 2016

Early Methods for Detecting Adversarial Images

arXiv · PDF · Open in the Atlas

Code that ran

9 of 10 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, 1 violated it and 7 have no contract verdict; 1 failure of our instrument; 1 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/1608.00530.json · badge: /api/ran/1608.00530.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
hendrycks/fooling canonical (classifier label)
classifier basis: census
9 ran · 1 no recorded run
FunctionStatusWhere it lives
get_freq_stats Ran
ran on a synthesized input
hendrycks/fooling/CIFAR/fooler_generator_constrained.py
code served (permissive licence) · get_code("31f53bfabcded184")
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 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 numpy as np

# The function uses u and s which are global/module-level variables
# These appear to be from a whitening transform (likely from ZCA whitening)
# u should be a matrix of shape (32*32*3, k) and s should be eigenvalues of shape (k,)

# Create synthetic u and s for whitening
np.random.seed(0)
u = np.random.randn(32 * 32 * 3, 32 * 32 * 3)
# Perform QR decomposition to get orthonormal u
u, _ = np.linalg.qr(u)
s = np.abs(np.random.randn(32 * 32 * 3)) + 0.1  # eigenvalues, positive

# Inject u and s into the module namespace so whiten() can access them
import sys
current_module = sys.modules[__name__]
setattr(current_module, 'u', u)
setattr(current_module, 's', s)

# Create a small unwhitened batch
# Shape: (batch_size, 32, 32, 3) representing images
unwhitened = np.random.randn(2, 32, 32, 3).astype(np.float32)

ARGS = {
    "unwhitened": unwhitened
}
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 1, dtype family float — 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
load_batch Ran
ran on a synthesized input
hendrycks/fooling/CIFAR/load_cifar10.py
code served (permissive licence) · get_code("8633f606824fb007")
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 pickle
import tempfile
import os

# Create a temporary file with pickled data
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, 'batch.pkl')

# Create sample data that matches what load_batch expects
sample_data = {
    'data': [[1, 2, 3, 4], [5, 6, 7, 8]],
    'labels': [0, 1]
}

# Write the pickle file
with open(temp_file, 'wb') as f:
    pickle.dump(sample_data, f)

ARGS = {
    'fpath': temp_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
random_contrast Ran
ran on a synthesized input
hendrycks/fooling/tiny-imagenet/cs231n/data_augmentation.py
code served (permissive licence) · get_code("9c69acb187af1a3c")
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 4, dtype family float, shape (2, 3, 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 numpy as np

# Create a small batch of image data
# Shape: (N, C, H, W) = (2, 3, 4, 5)
# N=2 images, C=3 channels, H=4 height, W=5 width
X = np.random.rand(2, 3, 4, 5).astype(np.float32)

ARGS = {
    'X': X,
    'scale': (0.8, 1.2)
}
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 4, dtype family float, shape (2, 3, 4, 5) — shape (2, 3, 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
random_crops Ran
ran on a synthesized input
hendrycks/fooling/tiny-imagenet/cs231n/data_augmentation.py
code served (permissive licence) · get_code("828f8462c52a552f")
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 4, dtype family float, shape (2, 3, 4, 6) 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

np.random.seed(0)

# X: (N, C, H, W) array of image data
# crop_shape: Tuple (HH, WW)
# The function needs H > HH and W > WW for the assertions to pass

X = np.random.rand(2, 3, 8, 10).astype(np.float32)  # (N=2, C=3, H=8, W=10)
crop_shape = (4, 6)  # (HH=4, WW=6) - smaller than H and W

ARGS = {
    "X": X,
    "crop_shape": crop_shape,
}
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 4, dtype family float, shape (2, 3, 4, 6) — shape (2, 3, 4, 6) 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
random_flips Ran
ran on a synthesized input
hendrycks/fooling/tiny-imagenet/cs231n/data_augmentation.py
code served (permissive licence) · get_code("137e1bd3e77f19a9")
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 4, dtype family float, shape (2, 3, 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 numpy as np

# Create a small batch of image data
# Shape: (N, C, H, W) = (2, 3, 4, 5)
# N=2 images, C=3 channels, H=4 height, W=5 width
X = np.random.randn(2, 3, 4, 5).astype(np.float32)

ARGS = {
    "X": X
}
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 4, dtype family float, shape (2, 3, 4, 5) — shape (2, 3, 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
str2bool Ran
ran, violated the contract we drafted
hendrycks/fooling/CIFAR/fooler_generator.py
code served (permissive licence) · get_code("25c7475539e39da4")
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 bool, 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

def str2bool(v):
    return v.lower() in ('yes', 'true', 't', '1')

ARGS = {
    'v': 'true'
}
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 bool, 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
to_categorical Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
hendrycks/fooling/CIFAR/load_cifar10.py
code served (permissive licence) · get_code("70f5b5175a23f59d")
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 2, dtype family float, shape (5, 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 to_categorical takes:
# - y: array-like of class indices
# - nb_classes: number of classes (int or None/falsy)

# Create a small sample of class indices
y_sample = np.array([0, 1, 2, 1, 0])

# Set number of classes
nb_classes_value = 3

ARGS = {
    'y': y_sample,
    'nb_classes': nb_classes_value
}
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 2, dtype family float, shape (5, 3) — shape (5, 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
unpickle Ran
ran on a synthesized input
hendrycks/fooling/CIFAR/resnet_32.py
code served (permissive licence) · get_code("9cf114efaf65dc13")
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 pickle
import tempfile
import os

# Create a temporary pickle file for the unpickle function to read
temp_dir = tempfile.mkdtemp()
test_data = {"key1": "value1", "key2": [1, 2, 3], "key3": {"nested": "dict"}}
test_file = os.path.join(temp_dir, "test.pkl")

with open(test_file, 'wb') as f:
    pickle.dump(test_data, f)

ARGS = {
    "file": test_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
whiten Ran
ran on a synthesized input
hendrycks/fooling/CIFAR/fooler_generator_constrained.py
code served (permissive licence) · get_code("7ee03f4b0eaf7da6")
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 2, 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 numpy as np

# The function uses u and s which are module-level variables
# They appear to be from PCA whitening (likely from ZCA whitening)
# u should be orthonormal vectors and s should be eigenvalues

# Create small stand-in PCA components
# For 32x32x3 images flattened to 3072 dimensions
np.random.seed(0)

# Create orthonormal matrix u (3072 x 3072)
u, _ = np.linalg.qr(np.random.randn(3072, 3072))

# Create eigenvalues s (3072,)
s = np.abs(np.random.randn(3072)) + 0.1

# Make these available at module level so the function can access them
import sys
current_module = sys.modules[__name__]
setattr(current_module, 'u', u)
setattr(current_module, 's', s)

# Create a valid input: a batch of 2 images of size 32x32x3
unwhitened = np.random.randn(2, 32, 32, 3).astype(np.float32)

ARGS = {
    "unwhitened": unwhitened
}
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 2, dtype family float — no output shape is stated: observe_signature.py could not observe it (fixture:KeyError)
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
load_data10 Not yet run
unverified (harvested, no recorded run)
hendrycks/fooling/CIFAR/load_cifar10.py
code served (permissive licence) · get_code("9db68167799bea76")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 5 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 0 the same month, 5 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 23 other papers
3 dated earlier, 20 later
1410.5401 (2014-10)
Neural Turing Machines
1502.04623 (2015-02)
DRAW: A Recurrent Neural Network For Image Generation
1504.06852 (2015-04)
FlowNet: Learning Optical Flow with Convolutional Networks
and 20 more not named here
to_categorical 3 other papers
1 dated earlier, 2 later
1606.08415 (2016-06)
Gaussian Error Linear Units (GELUs)
1610.02136 (2016-10)
A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural Networks
aaai_28047 (2024 (year only))
Rethinking Robustness of Model Attributions
load_batch 2 other papers
1 dated earlier, 1 later
1606.08415 (2016-06)
Gaussian Error Linear Units (GELUs)
1610.02136 (2016-10)
A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural Networks
load_data10 2 other papers
1 dated earlier, 1 later
1606.08415 (2016-06)
Gaussian Error Linear Units (GELUs)
1610.02136 (2016-10)
A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural Networks
unpickle 2 other papers
1 dated earlier, 1 later
1606.08415 (2016-06)
Gaussian Error Linear Units (GELUs)
1610.02136 (2016-10)
A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural 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

Many machine learning classifiers are vulnerable to adversarial perturbations. An adversarial perturbation modifies an input to change a classifier's prediction without causing the input to seem substantially different to human perception. We deploy three methods to detect adversarial images. Adversaries trying to bypass our detectors must make the adversarial image less pathological or they will fail trying. Our best detection method reveals that adversarial images place abnormal emphasis on the lower-ranked principal components from PCA. Other detectors and a colorful saliency map are in an appendix.

For agents

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

get_harvested_code_for_paper("1608.00530")
get_code_for_paper("1608.00530")
have("1608.00530")

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

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

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

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

Connect an agent — have() is free.