SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1804.05296 · 2018

Adversarial Attacks Against Medical Deep Learning Systems

arXiv · PDF · Open in the Atlas

Code that ran

3 of 7 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; 3 failures of our instrument; 4 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/1804.05296.json · badge: /api/ran/1804.05296.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
sgfin/adversarial-medicine canonical (classifier label)
classifier basis: classifier_2025
3 ran · 4 no recorded run
FunctionStatusWhere it lives
load_data Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
sgfin/adversarial-medicine/train_models/train_model.py
code served (permissive licence) · get_code("484ed1833bc0eb76")
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 numpy as np
from unittest.mock import Mock, MagicMock

# Create mock ImageDataGenerator that behaves like Keras
class MockImageDataGenerator:
    def __init__(self, **kwargs):
        self.kwargs = kwargs
    
    def flow(self, X, y, batch_size=32):
        # Return a mock generator with n attribute
        mock_gen = Mock()
        mock_gen.n = X.shape[0]
        return mock_gen
    
    def flow_from_directory(self, directory, target_size=None, batch_size=32, class_mode=None, shuffle=True):
        # Return a mock generator with n attribute
        mock_gen = Mock()
        mock_gen.n = 100  # Arbitrary number of samples
        return mock_gen

# Mock the keras imports
import sys
keras_mock = Mock()
keras_mock.preprocessing.image.ImageDataGenerator = MockImageDataGenerator
keras_mock.applications.inception_resnet_v2.preprocess_input = lambda x: x
sys.modules['keras'] = keras_mock
sys.modules['keras.preprocessing'] = Mock()
sys.modules['keras.preprocessing.image'] = Mock()
sys.modules['keras.applications'] = Mock()
sys.modules['keras.applications.inception_resnet_v2'] = Mock()

# Mock the mixup_generator module
class MockMixupGenerator:
    def __init__(self, X, y, batch_size=32, alpha=0.2, datagen=None):
        self.X = X
        self.y = y
        self.batch_size = batch_size
        self.alpha = alpha
        self.datagen = datagen
    
    def __call__(self):
        mock_gen = Mock()
        mock_gen.n = self.X.shape[0]
        return mock_gen

sys.modules['mixup_generator'] = Mock()
sys.modules['mixup_generator'].MixupGenerator = MockMixupGenerator

# Define arguments for load_data function
ARGS = {
    'batch_size': 32,
    'mixup': False,
    'vFlip': True,
    'rotation': 20
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
keras, mixup_generator, numpy — 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
load_data Ran
ran; our contract draft was wrong, not the code
sgfin/adversarial-medicine/pgd_attacks/craft_attacks.py
code served (permissive licence) · get_code("7308858d214bf0d2")
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. 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 numpy as np
import tempfile
import os

# Create temporary directory and dummy data files
temp_dir = tempfile.mkdtemp()

# Create small dummy numpy arrays for testing
X_dummy = np.random.rand(100, 224, 224, 3).astype(np.float32)
y_dummy = np.concatenate([np.zeros(50, dtype=np.int32), np.ones(50, dtype=np.int32)])

# Save dummy data to temporary files
x_path = os.path.join(temp_dir, 'val_test_x_preprocess.npy')
y_path = os.path.join(temp_dir, 'val_test_y.npy')

np.save(x_path, X_dummy)
np.save(y_path, y_dummy)

ARGS = {
    'limit100': True,
    'preprocess': False,
    'x_path': x_path,
    'y_path': y_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
keras, numpy — 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
mean_ci Ran
ran; our contract draft was wrong, not the code
sgfin/adversarial-medicine/pgd_attacks/craft_attacks.py
code served (permissive licence) · get_code("2e369fe32f07c987")
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 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
import scipy.stats as st

# The function mean_ci takes a single parameter x
# It expects x to be array-like (used with np.mean, len, st.sem)
# We'll create a small numpy array with some sample data

x_data = np.array([1.2, 2.3, 3.1, 2.8, 3.5, 2.9, 3.2, 2.7])

ARGS = {
    'x': x_data
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, scipy — 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
construct_model Not yet run
unverified (harvested, no recorded run)
sgfin/adversarial-medicine/train_models/train_model.py
code served (permissive licence) · get_code("826517c053cb6c3b")
How it ran

no invocation recorded.

deprocess_inception Not yet run
unverified (harvested, no recorded run)
sgfin/adversarial-medicine/pgd_attacks/craft_attacks.py
code served (permissive licence) · get_code("a8c1efc6d0ca0501")
How it ran

no invocation recorded.

generateCallbacks Not yet run
unverified (harvested, no recorded run)
sgfin/adversarial-medicine/train_models/train_model.py
code served (permissive licence) · get_code("c4f8f1a53760ab2f")
How it ran

no invocation recorded.

mean_ci Not yet run
unverified (harvested, no recorded run)
sgfin/adversarial-medicine/patch_attacks/execute_patch_attacks.py
code served (permissive licence) · get_code("ff598d2b0694857e")
How it ran

no invocation recorded.

Also present in other papers' code

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

The discovery of adversarial examples has raised concerns about the practical deployment of deep learning systems. In this paper, we demonstrate that adversarial examples are capable of manipulating deep learning systems across three clinical domains. For each of our representative medical deep learning classifiers, both white and black box attacks were highly successful. Our models are representative of the current state of the art in medical computer vision and, in some cases, directly reflect architectures already seeing deployment in real world clinical settings. In addition to the technical contribution of our paper, we synthesize a large body of knowledge about the healthcare system to argue that medicine may be uniquely susceptible to adversarial attacks, both in terms of monetary incentives and technical vulnerability. To this end, we outline the healthcare economy and the incentives it creates for fraud and provide concrete examples of how and why such attacks could be realistically carried out. We urge practitioners to be aware of current vulnerabilities when deploying deep learning systems in clinical settings, and encourage the machine learning community to further investigate the domain-specific characteristics of medical learning systems.

For agents

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

get_harvested_code_for_paper("1804.05296")
get_code_for_paper("1804.05296")
have("1804.05296")

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

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

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

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

Connect an agent — have() is free.