SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1905.09591 · 2019

A Direct Approach to Robust Deep Learning Using Adversarial Networks

arXiv · PDF · Open in the Atlas

Code that ran

3 of 15 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 3 have no contract verdict; 0 failures of our instrument; 12 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/1905.09591.json · badge: /api/ran/1905.09591.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
whxbergkamp/RobustDL_GAN canonical (classifier label)
classifier basis: census
3 ran · 12 no recorded run
FunctionStatusWhere it lives
gen_examples_fgs Ran
ran on a synthesized input
whxbergkamp/RobustDL_GAN/cifar10/adversarial_networks/gen_static_adversarial_examples.py
code served (permissive licence) · get_code("6424b3d06b575ff1")
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 SymbolicTensor. 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 tensorflow as tf
import numpy as np

# Build a minimal discriminator model
class SimpleDiscriminator(tf.Module):
    def __init__(self):
        super().__init__()
        self.dense1 = tf.keras.layers.Dense(8, activation='relu')
        self.dense2 = tf.keras.layers.Dense(10)
    
    def __call__(self, x):
        x = self.dense1(x)
        x = self.dense2(x)
        return x

# Create discriminator instance
discriminator = SimpleDiscriminator()

# Create train_data with a small batch
# The function expects train_data[0] to be a tensor of shape (batch_size, feature_dim)
# Values should be in [0, 1] range since the function scales them to [-1, 1]
batch_size = 2
feature_dim = 4
x_data = tf.constant(np.random.uniform(0, 1, (batch_size, feature_dim)).astype(np.float32))
train_data = [x_data]

# Create config with epsilon parameter
config = {
    'epsilon': 0.1
}

ARGS = {
    'discriminator': discriminator,
    'train_data': train_data,
    'config': config
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SymbolicTensor — a SymbolicTensor 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
gen_examples_ll Ran
ran on a synthesized input
whxbergkamp/RobustDL_GAN/cifar10/adversarial_networks/gen_static_adversarial_examples.py
code served (permissive licence) · get_code("0068794d5c938949")
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 SymbolicTensor. 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 tensorflow as tf
import numpy as np

class SimpleDiscriminator(tf.Module):
    def __init__(self):
        super().__init__()
        self.dense1 = tf.keras.layers.Dense(16)
        self.dense2 = tf.keras.layers.Dense(10)
    
    def __call__(self, x):
        x = self.dense1(x)
        x = tf.nn.relu(x)
        x = self.dense2(x)
        return x

# Create a small batch of training data
# Shape: [batch_size=2, features=4]
train_data_np = np.random.rand(2, 4).astype(np.float32)
train_data = [tf.constant(train_data_np)]

# Create discriminator
discriminator = SimpleDiscriminator()

# Create config dict
config = {
    'epsilon': 0.1
}

ARGS = {
    'discriminator': discriminator,
    'train_data': train_data,
    'config': config
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SymbolicTensor — a SymbolicTensor 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
run_test Ran
ran on a synthesized input
whxbergkamp/RobustDL_GAN/svhn/adversarial_networks/train_gan_svhn.py
code served (permissive licence) · get_code("e45c8e8b0a36a79e")
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 float, 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 random
import numpy as np

# Mock TensorFlow session and ops
class MockTensor:
    def __init__(self, value=None):
        self.value = value

class MockOp:
    def __init__(self, return_value=None):
        self.return_value = return_value
    
    def __call__(self, *args, **kwargs):
        return self.return_value

class MockSession:
    def run(self, op, feed_dict=None):
        if callable(op):
            return op()
        if isinstance(op, MockOp):
            return op.return_value
        return 0.95

# Setup test data
random.seed(0)
np.random.seed(0)

# Create small test tensors
num_test_examples = 8
batch_size = 2
test_image = np.random.rand(num_test_examples, 4, 3, 3).astype(np.float32)
test_label = np.random.randint(0, 2, num_test_examples).astype(np.int32)

# Create placeholders (mock TensorFlow placeholders)
test_image_placeholder = MockTensor()
test_label_placeholder = MockTensor()

# Create mock metric and update op
tf_metric = MockOp(return_value=0.95)
tf_metric_update = MockOp(return_value=None)

# Create running variables initializer
running_vars_initializer = MockOp(return_value=None)

# Create session
sess = MockSession()

# Create config
config = {
    'batch_size': batch_size
}

ARGS = {
    'tf_metric': tf_metric,
    'tf_metric_update': tf_metric_update,
    'running_vars_initializer': running_vars_initializer,
    'sess': sess,
    'config': config,
    'test_image': test_image,
    'test_label': test_label,
    'test_image_placeholder': test_image_placeholder,
    'test_label_placeholder': test_label_placeholder
}
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 float, 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
build_test Not yet run
unverified (harvested, no recorded run)
whxbergkamp/RobustDL_GAN/cifar10/adversarial_networks/train_gan_cifar10.py
code served (permissive licence) · get_code("766b5797d0bafbcf")
How it ran

no invocation recorded.

build_test Not yet run
unverified (harvested, no recorded run)
whxbergkamp/RobustDL_GAN/svhn/adversarial_networks/train_gan_svhn.py
code served (permissive licence) · get_code("5dfa4b0bde710c19")
How it ran

no invocation recorded.

build_test_G Not yet run
unverified (harvested, no recorded run)
whxbergkamp/RobustDL_GAN/cifar10/adversarial_networks/train_gan_cifar10.py
code served (permissive licence) · get_code("86463d67d8e936de")
How it ran

no invocation recorded.

build_test_G Not yet run
unverified (harvested, no recorded run)
whxbergkamp/RobustDL_GAN/svhn/adversarial_networks/train_gan_svhn.py
code served (permissive licence) · get_code("594775fbb367d5fd")
How it ran

no invocation recorded.

build_test_fgs Not yet run
unverified (harvested, no recorded run)
whxbergkamp/RobustDL_GAN/cifar10/adversarial_networks/run_attacks_black_box_cifar10.py
code served (permissive licence) · get_code("3c85910e4305517f")
How it ran

no invocation recorded.

build_test_fgs Not yet run
unverified (harvested, no recorded run)
whxbergkamp/RobustDL_GAN/cifar10/adversarial_networks/train_eat_standard_cifar10.py
code served (permissive licence) · get_code("bb84d2ff0c2fca50")
How it ran

no invocation recorded.

build_test_fgs Not yet run
unverified (harvested, no recorded run)
whxbergkamp/RobustDL_GAN/cifar10/adversarial_networks/train_pgd_cifar10.py
code served (permissive licence) · get_code("b4148b33916fd982")
How it ran

no invocation recorded.

create_batch Not yet run
unverified (harvested, no recorded run)
whxbergkamp/RobustDL_GAN/cifar10/adversarial_networks/inputs.py
code served (permissive licence) · get_code("aba11452314b3900")
How it ran

no invocation recorded.

gen_examples_pgd Not yet run
unverified (harvested, no recorded run)
whxbergkamp/RobustDL_GAN/cifar10/adversarial_networks/gen_static_adversarial_examples.py
code served (permissive licence) · get_code("35465850ceccfb82")
How it ran

no invocation recorded.

get_filename_queue Not yet run
unverified (harvested, no recorded run)
whxbergkamp/RobustDL_GAN/cifar10/adversarial_networks/inputs.py
code served (permissive licence) · get_code("cbed6007d1eb22af")
How it ran

no invocation recorded.

get_input_image Not yet run
unverified (harvested, no recorded run)
whxbergkamp/RobustDL_GAN/cifar10/adversarial_networks/inputs.py
code served (permissive licence) · get_code("2cb5908799753a36")
How it ran

no invocation recorded.

run_test Not yet run
unverified (harvested, no recorded run)
whxbergkamp/RobustDL_GAN/cifar10/adversarial_networks/train_gan_cifar10.py
code served (permissive licence) · get_code("afb91a2794a82aa9")
How it ran

no invocation recorded.

Also present in other papers' code

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

Deep neural networks have been shown to perform well in many classical machine learning problems, especially in image classification tasks. However, researchers have found that neural networks can be easily fooled, and they are surprisingly sensitive to small perturbations imperceptible to humans. Carefully crafted input images (adversarial examples) can force a well-trained neural network to provide arbitrary outputs. Including adversarial examples during training is a popular defense mechanism against adversarial attacks. In this paper we propose a new defensive mechanism under the generative adversarial network (GAN) framework. We model the adversarial noise using a generative network, trained jointly with a classification discriminative network as a minimax game. We show empirically that our adversarial network approach works well against black box attacks, with performance on par with state-of-art methods such as ensemble adversarial training and adversarial training with projected gradient descent.

For agents

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

get_harvested_code_for_paper("1905.09591")
get_code_for_paper("1905.09591")
have("1905.09591")

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

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

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

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

Connect an agent — have() is free.