SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1810.11580 · 2018

Attacks Meet Interpretability: Attribute-steered Detection of Adversarial Samples

arXiv · PDF · Open in the Atlas

Code that ran

8 of 9 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 8 have no contract verdict; 0 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/1810.11580.json · badge: /api/ran/1810.11580.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
AmIAttribute/AmI canonical (classifier label)
classifier basis: census
8 ran · 1 no recorded run
FunctionStatusWhere it lives
get_data Ran
ran on a synthesized input
AmIAttribute/AmI/src/pytorch/utils.py
code served (permissive licence) · get_code("527026ac594ba84c")
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 4, dtype family float, shape (1, 3, 224, 224) 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
import tempfile
import cv2

torch.manual_seed(0)

# Create a temporary image file for testing
with tempfile.NamedTemporaryFile(suffix='.jpg', delete=False) as tmp:
    # Create a simple 224x224 RGB image
    img_array = np.random.randint(0, 256, (224, 224, 3), dtype=np.uint8)
    cv2.imwrite(tmp.name, img_array)
    img_path = tmp.name

ARGS = {
    'img_path': img_path,
    'is_rgb': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy, 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 (1, 3, 224, 224) — shape (1, 3, 224, 224) 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_identity Ran
ran on a synthesized input
AmIAttribute/AmI/src/utils.py
code served (permissive licence) · get_code("5835046cc604e292")
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 int, ndim 0, dtype family int, 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 re

def get_identity(img_name, names):
    indices = [i.start() for i in re.finditer('_', img_name)]
    name = img_name[:indices[len(indices) - 5]]
    if name in names:
        return names.index(name)

# Construct valid arguments
# The function looks for underscores in img_name and extracts a substring
# It then checks if that substring is in the names list

# img_name needs to have at least 5 underscores so that indices[len(indices) - 5] is valid
# Let's create an img_name with 6 underscores: "person_1_2_3_4_5_6.jpg"
# indices will be [6, 8, 10, 12, 14, 16]
# len(indices) - 5 = 1, so indices[1] = 8
# name = img_name[:8] = "person_1"

img_name = "person_1_2_3_4_5_6.jpg"
names = ["person_1", "person_2", "person_3"]

ARGS = {
    "img_name": img_name,
    "names": names
}
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 int, ndim 0, dtype family int, 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
get_vgg_data Ran
ran on a synthesized input
AmIAttribute/AmI/src/utils.py
code served (permissive licence) · get_code("cbbda0f96bb49df7")
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 (1, 3, 224, 224) 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 cv2
import numpy as np
import tempfile
import os

# Create a temporary image file for testing
# The function reads from disk using cv2.imread
temp_dir = tempfile.mkdtemp()
img_path = os.path.join(temp_dir, "test_image.png")

# Create a simple test image (224x224 RGB image)
test_image = np.random.randint(0, 256, (224, 224, 3), dtype=np.uint8)
# Convert from RGB to BGR for cv2.imwrite
test_image_bgr = cv2.cvtColor(test_image, cv2.COLOR_RGB2BGR)
cv2.imwrite(img_path, test_image_bgr)

ARGS = {
    "img_path": img_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, 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 (1, 3, 224, 224) — shape (1, 3, 224, 224) 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
neuron_AmI Ran
ran on a synthesized input
AmIAttribute/AmI/src/pytorch/ami_model.py
code served (permissive licence) · get_code("a3583af3291bda9f")
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 4, dtype family float, shape (1, 4, 3, 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 to understand parameter requirements:
# x: tensor that gets squeezed and summed, shape should be (1, 4) or (1, 4, 3, 5)
# weaken_neurons: tensor with .device attribute, used in multiplication
# strengthen_neurons: iterable of tensors
# attri_neurons: indices to select from data
# layer_i: integer (not used in function body)
# weaken_param: scalar for weaken function
# strengthen_param0, strengthen_param1: scalars for strengthen function

# Create x as a 4D tensor (batch, channels, height, width)
x = torch.randn(1, 4, 3, 5)

# Create weaken_neurons as a 1D tensor matching first dimension after squeeze/sum
weaken_neurons = torch.tensor([0.1, 0.2, 0.3, 0.4])

# Create strengthen_neurons as a list of 1D tensors (2 strengthen neurons)
strengthen_neurons = [
    torch.tensor([0.5, 0.6, 0.7, 0.8]),
    torch.tensor([0.2, 0.3, 0.4, 0.5])
]

# Create attri_neurons as indices into the data dimension
attri_neurons = torch.tensor([0, 2])

# layer_i as integer
layer_i = 0

# Parameters for weaken and strengthen functions
weaken_param = torch.tensor(0.5)
strengthen_param0 = torch.tensor(1.0)
strengthen_param1 = torch.tensor(0.5)

ARGS = {
    "x": x,
    "weaken_neurons": weaken_neurons,
    "strengthen_neurons": strengthen_neurons,
    "attri_neurons": attri_neurons,
    "layer_i": layer_i,
    "weaken_param": weaken_param,
    "strengthen_param0": strengthen_param0,
    "strengthen_param1": strengthen_param1
}
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 4, dtype family float, shape (1, 4, 3, 5) — shape (1, 4, 3, 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
read_list Ran
ran on a synthesized input
AmIAttribute/AmI/src/utils.py
code served (permissive licence) · get_code("2f2e5dd17df89181")
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 list, 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 tempfile
import os

# Create a temporary file with some test content
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
temp_file.write("line one\n")
temp_file.write("line two\n")
temp_file.write("line three\n")
temp_file.close()

ARGS = {
    'f': temp_file.name
}
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 list, ndim 1, dtype family float — a list 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
strengthen Ran
ran on a synthesized input
AmIAttribute/AmI/src/pytorch/ami_model.py
code served (permissive licence) · get_code("ed7337b1847afb49")
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)

# Analyze the function:
# - x: used with torch.exp(-x / strengthen_param1), so should be a tensor
# - strengthen_param0: subtracted from result, should be a scalar or tensor
# - strengthen_param1: used as divisor in -x / strengthen_param1, should be a scalar or tensor

# Create small tensors
x = torch.randn(2, 4)  # Small batch tensor
strengthen_param0 = torch.tensor(1.0)  # Scalar tensor
strengthen_param1 = torch.tensor(0.5)  # Scalar tensor

ARGS = {
    "x": x,
    "strengthen_param0": strengthen_param0,
    "strengthen_param1": strengthen_param1,
}
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
vgg_face_dag Ran
ran on a synthesized input
AmIAttribute/AmI/src/pytorch/vgg_face_dag.py
code served (permissive licence) · get_code("abe9c8d32f455980")
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 Vgg_face_dag. 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
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'weights_path': None,
}
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 Vgg_face_dag — a Vgg_face_dag output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Vgg_face_dag 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
weaken Ran
ran on a synthesized input
AmIAttribute/AmI/src/pytorch/ami_model.py
code served (permissive licence) · get_code("9171c68c23bef65a")
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)

# Construct arguments for the weaken function
x = torch.randn(2, 4)  # Small tensor: batch size 2, dimension 4
weaken_param = 0.5     # Scalar parameter for exponential decay

ARGS = {
    "x": x,
    "weaken_param": weaken_param
}
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
get_vgg_data Not yet run
unverified (harvested, no recorded run)
AmIAttribute/AmI/src/pytorch/utils.py
code served (permissive licence) · get_code("af280a1f457a32e3")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 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 9 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-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

Adversarial sample attacks perturb benign inputs to induce DNN misbehaviors. Recent research has demonstrated the widespread presence and the devastating consequences of such attacks. Existing defense techniques either assume prior knowledge of specific attacks or may not work well on complex models due to their underlying assumptions. We argue that adversarial sample attacks are deeply entangled with interpretability of DNN models: while classification results on benign inputs can be reasoned based on the human perceptible features/attributes, results on adversarial samples can hardly be explained. Therefore, we propose a novel adversarial sample detection technique for face recognition models, based on interpretability. It features a novel bi-directional correspondence inference between attributes and internal neurons to identify neurons critical for individual attributes. The activation values of critical neurons are enhanced to amplify the reasoning part of the computation and the values of other neurons are weakened to suppress the uninterpretable part. The classification results after such transformation are compared with those of the original model to detect adversaries. Results show that our technique can achieve 94% detection accuracy for 7 different kinds of attacks with 9.91% false positives on benign inputs. In contrast, a state-of-the-art feature squeezing technique can only achieve 55% accuracy with 23.3% false positives.

For agents

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

get_harvested_code_for_paper("1810.11580")
get_code_for_paper("1810.11580")
have("1810.11580")

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

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

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

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

Connect an agent — have() is free.