SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1910.00068 · 2019

Role of Spatial Context in Adversarial Robustness for Object Detection

arXiv · PDF · Open in the Atlas

Code that ran

5 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 5 have no contract verdict; 0 failures of our instrument; 2 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/1910.00068.json · badge: /api/ran/1910.00068.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
UMBCvision/Contextual-Adversarial-Patches canonical (classifier label)
classifier basis: census
5 ran · 2 no recorded run
FunctionStatusWhere it lives
distort_image Ran
ran on a synthesized input
UMBCvision/Contextual-Adversarial-Patches/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
load_conv Ran
ran on a synthesized input
UMBCvision/Contextual-Adversarial-Patches/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
UMBCvision/Contextual-Adversarial-Patches/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
UMBCvision/Contextual-Adversarial-Patches/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
UMBCvision/Contextual-Adversarial-Patches/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)
UMBCvision/Contextual-Adversarial-Patches/region_loss.py
code served (permissive licence) · get_code("03a16656783821f5")
How it ran

no invocation recorded.

parse_cfg Not yet run
unverified (harvested, no recorded run)
UMBCvision/Contextual-Adversarial-Patches/cfg.py
code served (permissive licence) · get_code("93c283a4f6e6c40f")
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, 6 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 0 the same month, 3 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
parse_cfg 3 other papers
1 dated earlier, 2 later
1904.08653 (2019-04)
Fooling automated surveillance cameras: adversarial patches to attack person 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
1 dated earlier, 1 later
1904.08653 (2019-04)
Fooling automated surveillance cameras: adversarial patches to attack person detection
2203.03373 (2022-03)
Adversarial Texture for Fooling Person Detectors in the Physical World
load_conv_bn 2 other papers
1 dated earlier, 1 later
1904.08653 (2019-04)
Fooling automated surveillance cameras: adversarial patches to attack person detection
2203.03373 (2022-03)
Adversarial Texture for Fooling Person Detectors in the Physical World
distort_image 1 other paper
1 dated earlier
1904.08653 (2019-04)
Fooling automated surveillance cameras: adversarial patches to attack person detection
rand_scale 1 other paper
1 dated earlier
1904.08653 (2019-04)
Fooling automated surveillance cameras: adversarial patches to attack person detection
scale_image_channel 1 other paper
1 dated earlier
1904.08653 (2019-04)
Fooling automated surveillance cameras: adversarial patches to attack person 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-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

The benefits of utilizing spatial context in fast object detection algorithms have been studied extensively. Detectors increase inference speed by doing a single forward pass per image which means they implicitly use contextual reasoning for their predictions. However, one can show that an adversary can design adversarial patches which do not overlap with any objects of interest in the scene and exploit contextual reasoning to fool standard detectors. In this paper, we examine this problem and design category specific adversarial patches which make a widely used object detector like YOLO blind to an attacker chosen object category. We also show that limiting the use of spatial context during object detector training improves robustness to such adversaries. We believe the existence of context based adversarial attacks is concerning since the adversarial patch can affect predictions without being in vicinity of any objects of interest. Hence, defending against such attacks becomes challenging and we urge the research community to give attention to this vulnerability.

For agents

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

get_harvested_code_for_paper("1910.00068")
get_code_for_paper("1910.00068")
have("1910.00068")

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

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

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

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

Connect an agent — have() is free.