SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2006.14748 · ICML · 2020

Proper Network Interpretability Helps Adversarial Robustness in Classification

Pin-Yu Chen, Akhilan Boopathy, Sijia Liu, Gaoyuan Zhang, Cynthia Liu, Shiyu Chang, Luca Daniel

arXiv · PDF · Open in the Atlas

Code that ran

6 of 17 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 3 failures of our instrument; 11 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/2006.14748.json · badge: /api/ran/2006.14748.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
akhilanb/proper-interpretability canonical (classifier label)
classifier basis: classifier_2025
3 ran · 5 no recorded run
AkhilanB/Proper-Interpretability marked official in Papers with Code
Papers with Code archive
3 ran · 5 no recorded run
copy not recorded community
not in the paper's declared repositories
0 ran · 1 no recorded run
FunctionStatusWhere it lives
Model Ran
ran on a synthesized input · constructed an object; no result was computed
AkhilanB/Proper-Interpretability/funcs.py
code served (permissive licence) · get_code("248795a472708ab1")
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, Model: 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 torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {}
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 Model — 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 Model 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
extract_data Ran
ran, honoured the contract we drafted
AkhilanB/Proper-Interpretability/funcs.py
code served (permissive licence) · get_code("86c9fa246614e9a9")
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, 28, 28, 1) 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
import gzip
import io

# Create a minimal gzip file containing MNIST-like data
def create_test_gzip_file():
    # MNIST format: 16-byte header + image data
    # Header: magic number (4 bytes) + num images (4 bytes) + rows (4 bytes) + cols (4 bytes)
    header = np.array([2051, 2, 28, 28], dtype='>i4').tobytes()
    
    # Create image data: 2 images of 28x28 pixels
    num_images = 2
    image_data = np.random.randint(0, 256, size=(num_images * 28 * 28), dtype=np.uint8).tobytes()
    
    # Combine header and image data
    full_data = header + image_data
    
    # Compress with gzip and write to BytesIO
    buffer = io.BytesIO()
    with gzip.GzipFile(fileobj=buffer, mode='wb') as gz:
        gz.write(full_data)
    
    buffer.seek(0)
    return buffer

# Create the test gzip file
test_gzip_buffer = create_test_gzip_file()
test_filename = io.BytesIO(test_gzip_buffer.getvalue())

# Monkey-patch gzip.open to return our test file
import gzip as gzip_module
original_open = gzip_module.open

def mock_gzip_open(filename, *args, **kwargs):
    return gzip.GzipFile(fileobj=io.BytesIO(test_gzip_buffer.getvalue()), mode='rb')

gzip_module.open = mock_gzip_open

ARGS = {
    "filename": "test_mnist.gz",
    "num_images": 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, 28, 28, 1) — shape (2, 28, 28, 1) 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
extract_labels Ran
ran, honoured the contract we drafted
AkhilanB/Proper-Interpretability/funcs.py
code served (permissive licence) · get_code("a0cf6bb81ff7819e")
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, 10) 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
import gzip
import io
import tempfile
import os

# Create a temporary gzip file with mock label data
# MNIST label format: 8-byte magic header + 1 byte per label
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "labels.gz")

num_images = 5
magic_number = np.array([0, 0, 0, 8], dtype=np.uint8)  # MNIST magic number
num_images_bytes = np.array([0, 0, 0, num_images], dtype=np.uint8)
labels_data = np.array([0, 1, 2, 3, 4], dtype=np.uint8)

with gzip.open(temp_file, 'wb') as f:
    f.write(magic_number.tobytes())
    f.write(num_images_bytes.tobytes())
    f.write(labels_data.tobytes())

ARGS = {
    'filename': temp_file,
    'num_images': num_images
}
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, 10) — shape (5, 10) 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
network_utils Ran
ran; our contract draft was wrong, not the code
akhilanb/proper-interpretability/funcs.py
code served (permissive licence) · get_code("44b2739698e6b9ff")
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, 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 torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'network_type': 'small'
}
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, ndim 2, 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
pearson_corr Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
akhilanb/proper-interpretability/funcs.py
code served (permissive licence) · get_code("340b076210f6b91b")
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 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
from scipy.stats import pearsonr

torch.manual_seed(0)

# The function expects:
# - true: a 3D array-like with shape (batch, height, channels)
# - adv: a 3D array-like with shape (batch, height, channels)
# Both are indexed with [:, :, i] and flattened, so they need to support
# numpy-like indexing and flattening

# Create small 3D numpy arrays with distinct dimensions
# Shape: (batch=2, height=3, channels=4)
true = np.random.randn(2, 3, 4).astype(np.float32)
adv = np.random.randn(2, 3, 4).astype(np.float32)

ARGS = {
    "true": true,
    "adv": adv,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, scipy, 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
tau_corr Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
akhilanb/proper-interpretability/funcs.py
code served (permissive licence) · get_code("b0ac43c489760cb7")
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 float64, 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
from scipy.stats import kendalltau

torch.manual_seed(0)

# The function expects:
# - true: a 3D array-like with shape (batch, height, channels)
# - adv: a 3D array-like with shape (batch, height, channels)
# The function iterates over dimension 2 (channels) and computes kendalltau
# on 2D slices (batch x height)

# Create small 3D arrays with distinct dimensions
# Shape: (batch=2, height=3, channels=4)
true = np.random.randn(2, 3, 4)
adv = np.random.randn(2, 3, 4)

ARGS = {
    "true": true,
    "adv": adv,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, scipy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, 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
CIFAR Not yet run
unverified (harvested, no recorded run)
akhilanb/proper-interpretability/funcs.py
code served (permissive licence) · get_code("274315bf19aca6bb")
How it ran

no invocation recorded.

CIFAR Not yet run
unverified (harvested, no recorded run)
AkhilanB/Proper-Interpretability/funcs.py
code served (permissive licence) · get_code("055fc970fd1b2e16")
How it ran

no invocation recorded.

MNIST Not yet run
unverified (harvested, no recorded run)
akhilanb/proper-interpretability/funcs.py
code served (permissive licence) · get_code("ed99dc8820ef0915")
How it ran

no invocation recorded.

MNIST Not yet run
unverified (harvested, no recorded run)
AkhilanB/Proper-Interpretability/funcs.py
code served (permissive licence) · get_code("aeb5bbdc2435ad02")
How it ran

no invocation recorded.

data_utils Not yet run
unverified (harvested, no recorded run)
akhilanb/proper-interpretability/funcs.py
code served (permissive licence) · get_code("d204828ab646c177")
How it ran

no invocation recorded.

data_utils Not yet run
unverified (harvested, no recorded run)
AkhilanB/Proper-Interpretability/funcs.py
code served (permissive licence) · get_code("237912592df9d7cd")
How it ran

no invocation recorded.

isa_cam Not yet run
unverified (harvested, no recorded run)
akhilanb/proper-interpretability/funcs.py
code served (permissive licence) · get_code("4ee0a66577a407fe")
How it ran

no invocation recorded.

isa_cam Not yet run
unverified (harvested, no recorded run)
AkhilanB/Proper-Interpretability/funcs.py
code served (permissive licence) · get_code("30479e7f72f7afb2")
How it ran

no invocation recorded.

load_batch Not yet run
unverified (harvested, no recorded run)
this paper's copy was not recorded; identical code first harvested from eric-vader/HD-BO-Additive-Models
pointer only · get_code("3b4fb87c66244ebf")
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. No invocation recorded.

load_model Not yet run
unverified (harvested, no recorded run)
akhilanb/proper-interpretability/funcs.py
code served (permissive licence) · get_code("08cba5535c33775b")
How it ran

no invocation recorded.

load_model Not yet run
unverified (harvested, no recorded run)
AkhilanB/Proper-Interpretability/funcs.py
code served (permissive licence) · get_code("a6fba14f7d4610ed")
How it ran

no invocation recorded.

Also present in other papers' code

Of 17 samples lifted from this paper's linked repositories, 17 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 3 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.

FunctionAlso present inEarliest-datedOthers named
extract_data
brick of this paper's assembly: helper
8 other papers
6 dated earlier, 2 later
1802.07623 (2018-02)
Explanations based on the Missing: Towards Contrastive Explanations with Pertinent Negatives
1805.10367 (2018-05)
Zeroth-Order Stochastic Variance Reduction for Nonconvex Optimization
1805.11090 (2018-05)
GenAttack: Practical Black-box Attacks with Gradient-Free Optimization
and 5 more not named here
extract_labels
brick of this paper's assembly: helper
8 other papers
6 dated earlier, 2 later
1802.07623 (2018-02)
Explanations based on the Missing: Towards Contrastive Explanations with Pertinent Negatives
1805.10367 (2018-05)
Zeroth-Order Stochastic Variance Reduction for Nonconvex Optimization
1805.11090 (2018-05)
GenAttack: Practical Black-box Attacks with Gradient-Free Optimization
and 5 more not named here
load_batch
brick of this paper's assembly: helper
5 other papers
4 dated earlier, 1 later
1805.11090 (2018-05)
GenAttack: Practical Black-box Attacks with Gradient-Free Optimization
1805.11770 (2018-05)
AutoZOOM: Autoencoder-based Zeroth Order Optimization Method for Attacking Black-box Neural Networks
1811.00866 (2018-11)
Efficient Neural Network Robustness Certification with General Activation Functions
and 2 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

Recent works have empirically shown that there exist adversarial examples that can be hidden from neural network interpretability (namely, making network interpretation maps visually similar), or interpretability is itself susceptible to adversarial attacks. In this paper, we theoretically show that with a proper measurement of interpretation, it is actually difficult to prevent prediction-evasion adversarial attacks from causing interpretation discrepancy, as confirmed by experiments on MNIST, CIFAR-10 and Restricted ImageNet. Spurred by that, we develop an interpretability-aware defensive scheme built only on promoting robust interpretation (without the need for resorting to adversarial loss minimization). We show that our defense achieves both robust classification and robust interpretation, outperforming state-of-theart adversarial training methods against attacks of large perturbation in particular.

For agents

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

get_harvested_code_for_paper("2006.14748")
get_code_for_paper("2006.14748")
have("2006.14748")

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

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

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

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

Connect an agent — have() is free.