SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1812.06371 · 2018

Trust Region Based Adversarial Attack on Neural Networks

arXiv · PDF · Open in the Atlas

Code that ran

7 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 0 have no contract verdict; 7 failures of our instrument; 2 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/1812.06371.json · badge: /api/ran/1812.06371.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
amirgholami/trattack canonical (classifier label)
classifier basis: classifier_2025
3 ran · 1 no recorded run
copy not recorded community
not in the paper's declared repositories
2 ran · 1 no recorded run
jeromerony/adversarial-library extension (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
FunctionStatusWhere it lives
generate_random_targets Ran
ran; our contract draft was wrong, not the code
this paper's copy was not recorded; identical code first harvested from jeromerony/adversarial-library
pointer only · get_code("0832e3bf9440362b")
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.

get_all_targets Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
this paper's copy was not recorded; identical code first harvested from jeromerony/adversarial-library
pointer only · get_code("c6344b8a7b36aea8")
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.

select_index Ran
ran; our contract draft was wrong, not the code
amirgholami/trattack/trattack/attack_methods.py
pointer only (licence: GPL-3.0) · get_code("7e05207456819752")
How it ran

The body of this sample is withheld: GPL-3.0, as GitHub detects it on this paper's repository, amirgholami/trattack, is not in the permissive set Syntology serves inline. 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.

select_index Ran
ran; our contract draft was wrong, not the code
jeromerony/adversarial-library/adv_lib/attacks/trust_region.py
code served (permissive licence) · get_code("185c5c2ef9d08b2a")
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 1, dtype family int, shape (2,) 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
from torch import nn

torch.manual_seed(0)

# Create a minimal model that takes inputs and returns logits
class SimpleModel(nn.Module):
    def __init__(self, input_dim=4, num_classes=5):
        super().__init__()
        self.linear = nn.Linear(input_dim, num_classes)
    
    def forward(self, x):
        return self.linear(x)

# Create model instance
model = SimpleModel(input_dim=4, num_classes=5)

# Create input tensor: batch_size=2, input_dim=4
inputs = torch.randn(2, 4, requires_grad=False)

# Define arguments
ARGS = {
    'model': model,
    'inputs': inputs,
    'c': 3,
    'p': 2,
    'worst_case': False
}
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 1, dtype family int, shape (2,) — shape (2,) 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
tr Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
jeromerony/adversarial-library/adv_lib/attacks/trust_region.py
code served (permissive licence) · get_code("e6e18b5b8e968918")
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 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
import torch.nn as nn

torch.manual_seed(0)

# Create a simple model that takes inputs and produces logits
class SimpleModel(nn.Module):
    def __init__(self, input_dim=4, num_classes=10):
        super().__init__()
        self.fc = nn.Linear(input_dim, num_classes)
    
    def forward(self, x):
        return self.fc(x)

# Instantiate the model
model = SimpleModel(input_dim=4, num_classes=10)

# Create small tensors for inputs and labels
batch_size = 2
input_dim = 4
num_classes = 10

# inputs: batch of 2 samples, each with 4 features, normalized to [0, 1]
inputs = torch.rand(batch_size, input_dim)

# labels: batch of 2 class labels (values in range [0, 9])
labels = torch.tensor([1, 3], dtype=torch.long)

# Define ARGS dictionary with all parameters for the tr function
ARGS = {
    'model': model,
    'inputs': inputs,
    'labels': labels,
    'iter': 10,
    'adaptive': False,
    'p': 2,
    'eps': 0.001,
    'c': 9,
    'worst_case': False,
    'targeted': False
}
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 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
tr_attack Ran
ran; our contract draft was wrong, not the code
amirgholami/trattack/trattack/attack_methods.py
pointer only (licence: GPL-3.0) · get_code("4fb4201dc645a9ff")
How it ran

The body of this sample is withheld: GPL-3.0, as GitHub detects it on this paper's repository, amirgholami/trattack, is not in the permissive set Syntology serves inline. 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.

tr_attack_iter Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
amirgholami/trattack/trattack/attack_methods.py
pointer only (licence: GPL-3.0) · get_code("4b45cc8bd22e2100")
How it ran

The body of this sample is withheld: GPL-3.0, as GitHub detects it on this paper's repository, amirgholami/trattack, is not in the permissive set Syntology serves inline. 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.

accuracy Not yet run
unverified (harvested, no recorded run)
this paper's copy was not recorded; identical code first harvested from zbh2047/clipping-algorithms
pointer only; the stored copy get_code serves, from zbh2047/clipping-algorithms, is pointer only (licence: NONE) · get_code("9b8289076669fe4f")
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.

validate_all Not yet run
unverified (harvested, no recorded run)
amirgholami/trattack/trattack_imagenet.py
pointer only (licence: GPL-3.0) · get_code("1e784fb45861ad6a")
How it ran

The body of this sample is withheld: GPL-3.0, as GitHub detects it on this paper's repository, amirgholami/trattack, is not in the permissive set Syntology serves inline. 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.

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, 3 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 3 later) and 6 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
accuracy 80 other papers
12 dated earlier, 68 later
1307.0414 (2013-07)
Challenges in Representation Learning: A report on three machine learning contests
1412.6553 (2014-12)
Speeding-up Convolutional Neural Networks Using Fine-tuned CP-Decomposition
1503.02531 (2015-03)
Distilling the Knowledge in a Neural Network
and 77 more not named here
generate_random_targets 3 other papers
3 later
1907.02044 (2019-07)
Minimally distorted Adversarial Examples with a Fast Adaptive Boundary Attack
2003.01690 (2020-03)
Reliable Evaluation of Adversarial Robustness with an Ensemble of Diverse Parameter-free Attacks
2103.01208 (2021-03)
Mind the Box: l 1 -APGD for Sparse Adversarial Attacks on Image Classifiers
get_all_targets 3 other papers
3 later
1907.02044 (2019-07)
Minimally distorted Adversarial Examples with a Fast Adaptive Boundary Attack
2003.01690 (2020-03)
Reliable Evaluation of Adversarial Robustness with an Ensemble of Diverse Parameter-free Attacks
2103.01208 (2021-03)
Mind the Box: l 1 -APGD for Sparse Adversarial Attacks on Image Classifiers

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

Deep Neural Networks are quite vulnerable to adversarial perturbations. Current state-of-the-art adversarial attack methods typically require very time consuming hyper-parameter tuning, or require many iterations to solve an optimization based adversarial attack. To address this problem, we present a new family of trust region based adversarial attacks, with the goal of computing adversarial perturbations efficiently. We propose several attacks based on variants of the trust region optimization method. We test the proposed methods on Cifar-10 and ImageNet datasets using several different models including AlexNet, ResNet-50, VGG-16, and DenseNet-121 models. Our methods achieve comparable results with the Carlini-Wagner (CW) attack, but with significant speed up of up to $37\times$, for the VGG-16 model on a Titan Xp GPU. For the case of ResNet-50 on ImageNet, we can bring down its classification accuracy to less than 0.1\% with at most $1.5\%$ relative $L_\infty$ (or $L_2$) perturbation requiring only $1.02$ seconds as compared to $27.04$ seconds for the CW attack. We have open sourced our method which can be accessed at [1].

For agents

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

get_harvested_code_for_paper("1812.06371")
get_code_for_paper("1812.06371")
have("1812.06371")

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

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

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

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

Connect an agent — have() is free.