SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1805.11770 · 2018

AutoZOOM: Autoencoder-based Zeroth Order Optimization Method for Attacking Black-box Neural Networks

arXiv · PDF · Open in the Atlas

Code that ran

3 of 6 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; 2 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 0 failures of our instrument; 3 no recorded run), measured 2026-11-23; 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/1805.11770.json · badge: /api/ran/1805.11770.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
IBM/Autozoom-Attack canonical (classifier label)
classifier basis: census
3 ran · 3 no recorded run
FunctionStatusWhere it lives
extract_data Ran
ran, honoured the contract we drafted
IBM/Autozoom-Attack/setup_mnist.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
IBM/Autozoom-Attack/setup_mnist.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
generate_data Ran
ran on a synthesized input
IBM/Autozoom-Attack/Utils.py
code served (permissive licence) · get_code("f8fb91c06db9efe1")
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

class MockData:
    def __init__(self):
        # test_data: list/array of input samples
        # Each sample should be indexable by id
        self.test_data = [
            np.random.randn(4, 3),  # sample 0
            np.random.randn(4, 3),  # sample 1
        ]
        # test_labels: 2D array where shape[1] is number of classes
        # Used to create one-hot encoding via np.eye(data.test_labels.shape[1])
        self.test_labels = np.zeros((2, 5))  # 2 samples, 5 classes

data = MockData()
id = 0
target_label = 2

ARGS = {
    "data": data,
    "id": id,
    "target_label": target_label,
}
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 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_batch Not yet run
unverified (harvested, no recorded run)
IBM/Autozoom-Attack/setup_cifar.py
code served (permissive licence) · get_code("ab7faf0047f2c872")
How it ran

no invocation recorded.

load_batch Not yet run
unverified (harvested, no recorded run)
IBM/Autozoom-Attack/setup_cifar.py
code served (permissive licence) · get_code("3b4fb87c66244ebf")
How it ran

no invocation recorded.

readimg Not yet run
unverified (harvested, no recorded run)
IBM/Autozoom-Attack/setup_inception.py
code served (permissive licence) · get_code("4545dacbce07b4fc")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 5 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 4 the same month, 4 later) and 1 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 8 other papers
1 dated earlier, 2 the same month, 5 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 8 other papers
1 dated earlier, 2 the same month, 5 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 5 other papers
1 the same month, 4 later
1805.11090 (2018-05)
GenAttack: Practical Black-box Attacks with Gradient-Free Optimization
1811.00866 (2018-11)
Efficient Neural Network Robustness Certification with General Activation Functions
1902.03229 (2019-02)
Adaptive and Safe Bayesian Optimization in High Dimensions via One-Dimensional Subspaces
and 2 more not named here
load_batch 4 other papers
1 the same month, 3 later
1805.11090 (2018-05)
GenAttack: Practical Black-box Attacks with Gradient-Free Optimization
1811.00866 (2018-11)
Efficient Neural Network Robustness Certification with General Activation Functions
1902.03229 (2019-02)
Adaptive and Safe Bayesian Optimization in High Dimensions via One-Dimensional Subspaces
and 1 more not named here
generate_data 1 other paper
1 dated earlier
1802.07623 (2018-02)
Explanations based on the Missing: Towards Contrastive Explanations with Pertinent Negatives

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-23.

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 studies have shown that adversarial examples in state-of-the-art image classifiers trained by deep neural networks (DNN) can be easily generated when the target model is transparent to an attacker, known as the white-box setting. However, when attacking a deployed machine learning service, one can only acquire the input-output correspondences of the target model; this is the so-called black-box attack setting. The major drawback of existing black-box attacks is the need for excessive model queries, which may give a false sense of model robustness due to inefficient query designs. To bridge this gap, we propose a generic framework for query-efficient black-box attacks. Our framework, AutoZOOM, which is short for Autoencoder-based Zeroth Order Optimization Method, has two novel building blocks towards efficient black-box attacks: (i) an adaptive random gradient estimation strategy to balance query counts and distortion, and (ii) an autoencoder that is either trained offline with unlabeled data or a bilinear resizing operation for attack acceleration. Experimental results suggest that, by applying AutoZOOM to a state-of-the-art black-box attack (ZOO), a significant reduction in model queries can be achieved without sacrificing the attack success rate and the visual quality of the resulting adversarial examples. In particular, when compared to the standard ZOO method, AutoZOOM can consistently reduce the mean query counts in finding successful adversarial examples (or reaching the same distortion level) by at least 93% on MNIST, CIFAR-10 and ImageNet datasets, leading to novel insights on adversarial robustness.

For agents

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

get_harvested_code_for_paper("1805.11770")
get_code_for_paper("1805.11770")
have("1805.11770")

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

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

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

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

Connect an agent — have() is free.