SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1904.08653 · 2019

Fooling automated surveillance cameras: adversarial patches to attack person detection

arXiv · PDF · Open in the Atlas

Code that ran

7 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 7 have no contract verdict; 0 failures of our instrument; 3 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/1904.08653.json · badge: /api/ran/1904.08653.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
Zhang-Jack/adversarial_yolo2 community (classifier label)
classifier basis not recorded on the link
7 ran · 3 no recorded run
FunctionStatusWhere it lives
distort_image Ran
ran on a synthesized input
Zhang-Jack/adversarial_yolo2/image.py
code served (permissive licence) · get_code("90b2ef0e95527027")
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 Image. 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.

from PIL import Image
import numpy as np

# Create a small test image
img_array = np.random.randint(0, 256, (10, 10, 3), dtype=np.uint8)
im = Image.fromarray(img_array, 'RGB')

ARGS = {
    'im': im,
    'hue': 0.1,
    'sat': 1.2,
    'val': 0.9
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Image — a Image output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Image output the recorded ndim 3 and dtype family int describe that coercion, not the output, and are not 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
get_max_probability Ran
ran on a synthesized input
Zhang-Jack/adversarial_yolo2/craft_adv.py
code served (permissive licence) · get_code("fcefecd930437474")
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 Tensor, ndim 1, dtype family float, 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

torch.manual_seed(0)

# Parameters for get_max_probability function
# output: tensor of shape (batch, (5 + num_classes) * 5, h, w)
# cls_id: integer class id to extract
# num_classes: number of classes

num_classes = 3
batch_size = 2
h = 4
w = 5

# Create output tensor with shape (batch, (5 + num_classes) * 5, h, w)
# (5 + 3) * 5 = 40 channels (5 anchors * 8 values per anchor)
output = torch.randn(batch_size, (5 + num_classes) * 5, h, w)

# Class id to query (must be < num_classes)
cls_id = 1

ARGS = {
    "output": output,
    "cls_id": cls_id,
    "num_classes": num_classes
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 float, 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
get_printability_array Ran
ran on a synthesized input
Zhang-Jack/adversarial_yolo2/craft_adv.py
code served (permissive licence) · get_code("cd1c26da502bc987")
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 Tensor, ndim 4, dtype family float, shape (3, 3, 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 tempfile
import os

# Create a temporary printability file with RGB color triplets
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
temp_file.write("255,0,0\n")  # Red
temp_file.write("0,255,0\n")  # Green
temp_file.write("0,0,255\n")  # Blue
temp_file.close()

printability_file = temp_file.name
height = 4
width = 3

ARGS = {
    "printability_file": printability_file,
    "height": height,
    "width": width,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float, shape (3, 3, 4, 3) — shape (3, 3, 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
load_conv Ran
ran on a synthesized input
Zhang-Jack/adversarial_yolo2/cfg.py
code served (permissive licence) · get_code("2329e9023f218b7e")
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 int, ndim 0, dtype family int, 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 torch
import numpy as np
import torch.nn as nn

torch.manual_seed(0)

# Create a small Conv2d model
conv_model = nn.Conv2d(
    in_channels=3,
    out_channels=4,
    kernel_size=2,
    bias=True
)

# Create a buffer with random values (numpy array)
num_w = conv_model.weight.numel()
num_b = conv_model.bias.numel()
buf = np.random.randn(num_b + num_w).astype(np.float32)

# Define arguments
ARGS = {
    "buf": buf,
    "start": 0,
    "conv_model": conv_model
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, 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
load_conv_bn Ran
ran on a synthesized input
Zhang-Jack/adversarial_yolo2/cfg.py
code served (permissive licence) · get_code("bff835defe62db44")
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 int, ndim 0, dtype family int, 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 torch
import torch.nn as nn
import numpy as np

torch.manual_seed(0)

# Create a small Conv2d model
conv_model = nn.Conv2d(in_channels=3, out_channels=4, kernel_size=2)

# Create a small BatchNorm2d model
bn_model = nn.BatchNorm2d(num_features=4)

# Create a buffer with numpy data
# The buffer needs to contain:
# - bn_bias: 4 elements
# - bn_weight: 4 elements
# - bn_running_mean: 4 elements
# - bn_running_var: 4 elements
# - conv_weight: 4 * 3 * 2 * 2 = 48 elements (out_channels * in_channels * kernel_h * kernel_w)
# Total: 4 + 4 + 4 + 4 + 48 = 64 elements

total_elements = 4 + 4 + 4 + 4 + (4 * 3 * 2 * 2)
buf = np.random.randn(total_elements).astype(np.float32)

start = 0

ARGS = {
    "buf": buf,
    "start": start,
    "conv_model": conv_model,
    "bn_model": bn_model
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, 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
rand_scale Ran
ran on a synthesized input
Zhang-Jack/adversarial_yolo2/image.py
code served (permissive licence) · get_code("6a4124c294bed05b")
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

# Set seed for reproducibility
random.seed(0)

# The function rand_scale takes one parameter: s
# It uses s in random.uniform(1, s)
# s should be a number greater than 1 for the uniform distribution to work properly

ARGS = {
    "s": 5.0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
scale_image_channel Ran
ran on a synthesized input
Zhang-Jack/adversarial_yolo2/image.py
code served (permissive licence) · get_code("835b72f71b599016")
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 Image. 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.

from PIL import Image
import numpy as np

# Create a small RGB image
img_array = np.array([
    [[255, 0, 0], [0, 255, 0]],
    [[0, 0, 255], [128, 128, 128]]
], dtype=np.uint8)
im = Image.fromarray(img_array, mode='RGB')

# Channel index (0 for R, 1 for G, 2 for B)
c = 1

# Scale factor
v = 0.5

ARGS = {
    'im': im,
    'c': c,
    'v': v
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Image — a Image output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Image output the recorded ndim 3 and dtype family int describe that coercion, not the output, and are not 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
build_targets Not yet run
unverified (harvested, no recorded run)
Zhang-Jack/adversarial_yolo2/region_loss.py
pointer only (licence: MIT); the stored copy get_code serves, from lintotao/out-of-bbox-attack, is pointer only (licence: NONE) · get_code("bafb242ad7347214")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from lintotao/out-of-bbox-attack, and GitHub detected no licence in that repository when it was checked. 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.

calc_nps Not yet run
unverified (harvested, no recorded run)
Zhang-Jack/adversarial_yolo2/craft_adv.py
code served (permissive licence) · get_code("7c3e3f84afa179de")
How it ran

no invocation recorded.

parse_cfg Not yet run
unverified (harvested, no recorded run)
Zhang-Jack/adversarial_yolo2/cfg.py
code served (permissive licence) · get_code("93c283a4f6e6c40f")
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, 7 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 7 later) and 3 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
build_targets 3 other papers
3 later
2203.03373 (2022-03)
Adversarial Texture for Fooling Person Detectors in the Physical World
2210.16765 (2022-10)
Benchmarking Adversarial Patch Against Aerial Detection
2410.10091 (2024-10)
Out-of-Bounding-Box Triggers: A Stealthy Approach to Cheat Object Detectors
parse_cfg 3 other papers
3 later
1910.00068 (2019-10)
Role of Spatial Context in Adversarial Robustness for Object Detection
2004.10934 (2020-04)
YOLOv4: Optimal Speed and Accuracy of Object Detection
2203.03373 (2022-03)
Adversarial Texture for Fooling Person Detectors in the Physical World
load_conv 2 other papers
2 later
1910.00068 (2019-10)
Role of Spatial Context in Adversarial Robustness for Object Detection
2203.03373 (2022-03)
Adversarial Texture for Fooling Person Detectors in the Physical World
load_conv_bn 2 other papers
2 later
1910.00068 (2019-10)
Role of Spatial Context in Adversarial Robustness for Object Detection
2203.03373 (2022-03)
Adversarial Texture for Fooling Person Detectors in the Physical World
distort_image 1 other paper
1 later
1910.00068 (2019-10)
Role of Spatial Context in Adversarial Robustness for Object Detection
rand_scale 1 other paper
1 later
1910.00068 (2019-10)
Role of Spatial Context in Adversarial Robustness for Object Detection
scale_image_channel 1 other paper
1 later
1910.00068 (2019-10)
Role of Spatial Context in Adversarial Robustness for Object Detection

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

Adversarial attacks on machine learning models have seen increasing interest in the past years. By making only subtle changes to the input of a convolutional neural network, the output of the network can be swayed to output a completely different result. The first attacks did this by changing pixel values of an input image slightly to fool a classifier to output the wrong class. Other approaches have tried to learn "patches" that can be applied to an object to fool detectors and classifiers. Some of these approaches have also shown that these attacks are feasible in the real-world, i.e. by modifying an object and filming it with a video camera. However, all of these approaches target classes that contain almost no intra-class variety (e.g. stop signs). The known structure of the object is then used to generate an adversarial patch on top of it. In this paper, we present an approach to generate adversarial patches to targets with lots of intra-class variety, namely persons. The goal is to generate a patch that is able successfully hide a person from a person detector. An attack that could for instance be used maliciously to circumvent surveillance systems, intruders can sneak around undetected by holding a small cardboard plate in front of their body aimed towards the surveillance camera. From our results we can see that our system is able significantly lower the accuracy of a person detector. Our approach also functions well in real-life scenarios where the patch is filmed by a camera. To the best of our knowledge we are the first to attempt this kind of attack on targets with a high level of intra-class variety like persons.

For agents

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

get_harvested_code_for_paper("1904.08653")
get_code_for_paper("1904.08653")
have("1904.08653")

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

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

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

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

Connect an agent — have() is free.