SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1812.09803 · 2018

Guessing Smart: Biased Sampling for Efficient Black-Box Adversarial Attacks

arXiv · PDF · Open in the Atlas

Code that ran

5 of 10 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 4 have no contract verdict; 1 failure of our instrument; 5 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.09803.json · badge: /api/ran/1812.09803.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
ttbrunner/biased_boundary_attack_avc canonical (classifier label)
classifier basis: census
3 ran · 2 no recorded run
ttbrunner/biased_boundary_attack canonical (classifier label)
classifier basis: census
2 ran · 3 no recorded run
FunctionStatusWhere it lives
fixed_padding Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ttbrunner/biased_boundary_attack_avc/models/resnet18_baseline/resnet_model.py
code served (permissive licence) · get_code("5756d6bfbcce2dfc")
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 EagerTensor, ndim 4, dtype family float, shape (2, 3, 6, 7) 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 tensorflow as tf

# Create a small tensor with batch=2, channels=3, height=4, width=5
# Using channels_first format: [batch, channels, height, width]
inputs_channels_first = tf.constant(
    [[[[1, 2, 3, 4, 5],
       [6, 7, 8, 9, 10],
       [11, 12, 13, 14, 15],
       [16, 17, 18, 19, 20]],
      [[21, 22, 23, 24, 25],
       [26, 27, 28, 29, 30],
       [31, 32, 33, 34, 35],
       [36, 37, 38, 39, 40]],
      [[41, 42, 43, 44, 45],
       [46, 47, 48, 49, 50],
       [51, 52, 53, 54, 55],
       [56, 57, 58, 59, 60]]],
     [[[61, 62, 63, 64, 65],
       [66, 67, 68, 69, 70],
       [71, 72, 73, 74, 75],
       [76, 77, 78, 79, 80]],
      [[81, 82, 83, 84, 85],
       [86, 87, 88, 89, 90],
       [91, 92, 93, 94, 95],
       [96, 97, 98, 99, 100]],
      [[101, 102, 103, 104, 105],
       [106, 107, 108, 109, 110],
       [111, 112, 113, 114, 115],
       [116, 117, 118, 119, 120]]]],
    dtype=tf.float32
)

# Create tensor with channels_last format: [batch, height, width, channels]
inputs_channels_last = tf.constant(
    [[[[1, 2, 3],
       [4, 5, 6],
       [7, 8, 9],
       [10, 11, 12],
       [13, 14, 15]],
      [[16, 17, 18],
       [19, 20, 21],
       [22, 23, 24],
       [25, 26, 27],
       [28, 29, 30]],
      [[31, 32, 33],
       [34, 35, 36],
       [37, 38, 39],
       [40, 41, 42],
       [43, 44, 45]],
      [[46, 47, 48],
       [49, 50, 51],
       [52, 53, 54],
       [55, 56, 57],
       [58, 59, 60]]],
     [[[61, 62, 63],
       [64, 65, 66],
       [67, 68, 69],
       [70, 71, 72],
       [73, 74, 75]],
      [[76, 77, 78],
       [79, 80, 81],
       [82, 83, 84],
       [85, 86, 87],
       [88, 89, 90]],
      [[91, 92, 93],
       [94, 95, 96],
       [97, 98, 99],
       [100, 101, 102],
       [103, 104, 105]],
      [[106, 107, 108],
       [109, 110, 111],
       [112, 113, 114],
       [115, 116, 117],
       [118, 119, 120]]]],
    dtype=tf.float32
)

ARGS = {
    "inputs": inputs_channels_first,
    "kernel_size": 3,
    "data_format": "channels_first"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 4, dtype family float, shape (2, 3, 6, 7) — shape (2, 3, 6, 7) 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
line_search_to_boundary Ran
ran on a synthesized input
ttbrunner/biased_boundary_attack/utils/util.py
code served (permissive licence) · get_code("bb9fbab9e6ad0e45")
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 3, dtype family float, shape (3, 32, 32) 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

class BlackBoxModel:
    """Minimal black-box model that returns predictions for images."""
    def predictions(self, x):
        """Return a predictions array where argmax gives a class label."""
        # Return predictions of shape (10,) with class labels 0-9
        # We'll return deterministic predictions based on input
        predictions = np.random.rand(10).astype(np.float32)
        return predictions

# Create instances
bb_model = BlackBoxModel()

# Create image arrays of shape (3, 32, 32) - small images
x_orig = np.random.randint(0, 256, size=(3, 32, 32), dtype=np.uint8).astype(np.float32)
x_start = np.random.randint(0, 256, size=(3, 32, 32), dtype=np.uint8).astype(np.float32)

# Label (target or correct label)
label = 3

# Is targeted attack
is_targeted = True

ARGS = {
    'bb_model': bb_model,
    'x_orig': x_orig,
    'x_start': x_start,
    'label': label,
    'is_targeted': is_targeted,
}
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 3, dtype family float, shape (3, 32, 32) — shape (3, 32, 32) 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
refine_jitter Ran
ran on a synthesized input
ttbrunner/biased_boundary_attack_avc/attacks/methods/refinement_tricks.py
code served (permissive licence) · get_code("8d6535e1a0fbad04")
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 3, dtype family float, shape (64, 64, 3) 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

class RemoteModel:
    """Minimal mock of a remote model that has a predictions method."""
    def predictions(self, X):
        # Return predictions for input X
        # X is shape (64, 64, 3), return logits of shape (10,) for 10 classes
        batch_size = 1 if X.ndim == 3 else X.shape[0]
        return np.random.randn(batch_size, 10)

# Create a minimal remote model
remote_model = RemoteModel()

# Create image data: 64x64x3 images with uint8 values
X_orig = np.random.randint(0, 256, (64, 64, 3), dtype=np.uint8)
X_aex = np.random.randint(0, 256, (64, 64, 3), dtype=np.uint8)

# Target label (class index)
label = 3

# Whether this is a targeted attack
is_targeted = True

# Optional parameters
optimistic = True
stop_early_diff = 0.0

ARGS = {
    'remote_model': remote_model,
    'X_orig': X_orig,
    'X_aex': X_aex,
    'label': label,
    'is_targeted': is_targeted,
    'optimistic': optimistic,
    'stop_early_diff': stop_early_diff
}
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 3, dtype family float, shape (64, 64, 3) — shape (64, 64, 3) 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
refine_pixels Ran
ran on a synthesized input
ttbrunner/biased_boundary_attack_avc/attacks/methods/refinement_tricks.py
code served (permissive licence) · get_code("284410a741ab221f")
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 3, dtype family float, shape (4, 3, 3) 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

class MockRemoteModel:
    """Mock model that provides predictions method."""
    def predictions(self, X):
        """Return mock predictions (logits/probabilities)."""
        # X shape: (batch_size, ...) - we'll return 10 class predictions
        batch_size = X.shape[0] if X.ndim > 0 else 1
        return np.random.rand(batch_size, 10)

# Create a small adversarial example and original image
# Using 4x3 images (small, distinct dimensions)
X_orig = np.random.randint(0, 256, size=(4, 3, 3), dtype=np.uint8)
X_aex = X_orig.astype(np.float32) + np.random.randn(4, 3, 3) * 5
X_aex = np.clip(X_aex, 0, 255)

remote_model = MockRemoteModel()
label = 2
is_targeted = True

ARGS = {
    "remote_model": remote_model,
    "X_orig": X_orig,
    "X_aex": X_aex,
    "label": label,
    "is_targeted": is_targeted,
    "optimistic": True,
    "stop_early_diff": 0.0,
}
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 3, dtype family float, shape (4, 3, 3) — shape (4, 3, 3) 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
sample_hypersphere Ran
ran on a synthesized input
ttbrunner/biased_boundary_attack/utils/util.py
code served (permissive licence) · get_code("2facf483973d66d6")
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 3, dtype family float, shape (2, 4, 3) 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

class MockSampleGen:
    """Mock random number generator with get_normal() method"""
    def __init__(self, shape):
        self.shape = shape
        self.counter = 0
    
    def get_normal(self):
        """Return a normal distribution sample of the specified shape"""
        result = np.random.normal(size=self.shape).astype(np.float32)
        return result

ARGS = {
    "n_samples": 2,
    "sample_shape": (4, 3),
    "radius": 1.5,
    "sample_gen": None,
    "seed": 42
}
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 3, dtype family float, shape (2, 4, 3) — shape (2, 4, 3) 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
batch_norm Not yet run
unverified (harvested, no recorded run)
ttbrunner/biased_boundary_attack_avc/models/resnet18_baseline/resnet_model.py
code served (permissive licence) · get_code("f4fba27e3fd641f2")
How it ran

no invocation recorded.

conv2d_fixed_padding Not yet run
unverified (harvested, no recorded run)
ttbrunner/biased_boundary_attack_avc/models/resnet18_baseline/resnet_model.py
code served (permissive licence) · get_code("c756a6986ed2d1b8")
How it ran

no invocation recorded.

find_closest_img Not yet run
unverified (harvested, no recorded run)
ttbrunner/biased_boundary_attack/utils/util.py
code served (permissive licence) · get_code("fb5ea6b124795904")
How it ran

no invocation recorded.

label_to_name Not yet run
unverified (harvested, no recorded run)
ttbrunner/biased_boundary_attack/utils/imagenet_labels.py
code served (permissive licence) · get_code("3ac662a79b2c646a")
How it ran

no invocation recorded.

name_to_label Not yet run
unverified (harvested, no recorded run)
ttbrunner/biased_boundary_attack/utils/imagenet_labels.py
code served (permissive licence) · get_code("5808c5dd79a489ef")
How it ran

no invocation recorded.

Also present in other papers' code

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

FunctionAlso present inEarliest-datedOthers named
conv2d_fixed_padding 6 other papers
2 dated earlier, 4 later
1512.03385 (2015-12)
Deep Residual Learning for Image Recognition
1710.05941 (2017-10)
SEARCHING FOR ACTIVATION FUNCTIONS
1905.05393 (2019-05)
Population Based Augmentation: Efficient Learning of Augmentation Policy Schedules
and 3 more not named here
fixed_padding 6 other papers
2 dated earlier, 4 later
1512.03385 (2015-12)
Deep Residual Learning for Image Recognition
1710.05941 (2017-10)
SEARCHING FOR ACTIVATION FUNCTIONS
1905.05393 (2019-05)
Population Based Augmentation: Efficient Learning of Augmentation Policy Schedules
and 3 more not named here
batch_norm 4 other papers
2 dated earlier, 2 later
1512.03385 (2015-12)
Deep Residual Learning for Image Recognition
1811.06964 (2018-11)
Grasp2Vec: Learning Object Representations from Self-Supervised Grasping
1905.05393 (2019-05)
Population Based Augmentation: Efficient Learning of Augmentation Policy Schedules
and 1 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

We consider adversarial examples for image classification in the black-box decision-based setting. Here, an attacker cannot access confidence scores, but only the final label. Most attacks for this scenario are either unreliable or inefficient. Focusing on the latter, we show that a specific class of attacks, Boundary Attacks, can be reinterpreted as a biased sampling framework that gains efficiency from domain knowledge. We identify three such biases, image frequency, regional masks and surrogate gradients, and evaluate their performance against an ImageNet classifier. We show that the combination of these biases outperforms the state of the art by a wide margin. We also showcase an efficient way to attack the Google Cloud Vision API, where we craft convincing perturbations with just a few hundred queries. Finally, the methods we propose have also been found to work very well against strong defenses: Our targeted attack won second place in the NeurIPS 2018 Adversarial Vision Challenge.

For agents

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

get_harvested_code_for_paper("1812.09803")
get_code_for_paper("1812.09803")
have("1812.09803")

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

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

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

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

Connect an agent — have() is free.