SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2203.03818 · CVPR · 2022

Shadows can be Dangerous: Stealthy and Effective Physical-world Adversarial Attack by Natural Phenomenon

Xianming Liu, Junjun Jiang, Xiangyang Ji, Yiqi Zhong, Deming Zhai

arXiv · PDF · Open in the Atlas

Code that ran

5 of 8 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; 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/2203.03818.json · badge: /api/ran/2203.03818.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
hncszyq/ShadowAttack canonical (classifier label)
classifier basis not recorded on the link
5 ran · 3 no recorded run
FunctionStatusWhere it lives
cal_angle Ran
ran on a synthesized input
hncszyq/ShadowAttack/schedule_attack.py
code served (permissive licence) · get_code("ec98f8f12abafdf5")
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, 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
from datetime import datetime

def cal_angle(year, month, day, h, m, s, lon, lat, timezone):
    doy = (datetime(year, month, day) - datetime(year, 1, 1)).days + 1
    n0 = 79.6764 + 0.2422 * (year - 1985) - int((year - 1985) / 4.0)
    sitar = 2 * np.pi * (doy - n0) / 365.2422
    ed1 = 0.3723 + 23.2567 * np.sin(sitar) + 0.1149 * np.sin(2 * sitar) - 0.1712 * np.sin(3 * sitar) - 0.758 * np.cos(sitar) + 0.3656 * np.cos(2 * sitar) + 0.0201 * np.cos(3 * sitar)
    ed = ed1 * np.pi / 180
    if lon >= 0:
        if timezone == -13:
            d_lon = lon - (np.floor((lon * 10 - 75) / 150) + 1) * 15.0
        else:
            d_lon = lon - timezone * 15.0
    elif timezone == -13:
        d_lon = (np.floor((lon * 10 - 75) / 150) + 1) * 15.0 - lon
    else:
        d_lon = timezone * 15.0 - lon
    et = 0.0028 - 1.9857 * np.sin(sitar) + 9.9059 * np.sin(2 * sitar) - 7.0924 * np.cos(sitar) - 0.6882 * np.cos(2 * sitar)
    gtd_t1 = h + m / 60.0 + s / 3600.0 + d_lon / 15
    gtd_t = gtd_t1 + et / 60.0
    d_time_angle1 = 15.0 * (gtd_t - 12)
    d_time_angle = d_time_angle1 * np.pi / 180
    latitude_arc = lat * np.pi / 180
    height_angle_arc = np.arcsin(np.sin(latitude_arc) * np.sin(ed) + np.cos(latitude_arc) * np.cos(ed) * np.cos(d_time_angle))
    cos_azimuth_angle = (np.sin(height_angle_arc) * np.sin(latitude_arc) - np.sin(ed)) / np.cos(height_angle_arc) / np.cos(latitude_arc)
    azimuth_angle_arc = np.arccos(cos_azimuth_angle)
    height_angle = height_angle_arc * 180 / np.pi
    azimuth_angle1 = azimuth_angle_arc * 180 / np.pi
    if d_time_angle < 0:
        azimuth_angle = 180 - azimuth_angle1
    else:
        azimuth_angle = 180 + azimuth_angle1
    return (height_angle, azimuth_angle)

ARGS = {
    "year": 2023,
    "month": 6,
    "day": 21,
    "h": 12,
    "m": 30,
    "s": 45,
    "lon": 120.5,
    "lat": 35.7,
    "timezone": 8
}
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, 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
cal_delta Ran
ran on a synthesized input
hncszyq/ShadowAttack/schedule_attack.py
code served (permissive licence) · get_code("dcf76eaf2f50e8e6")
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, 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

# Analyze the function:
# - height_angle: used in np.tan(), expects a scalar or array-like number
# - azimuth_angle: used in np.sin() and np.tan(), expects a scalar or array-like number
# - dis: used in division, expects a scalar or array-like number
# All operations are element-wise numpy operations, so scalars work fine

ARGS = {
    "height_angle": 30.0,
    "azimuth_angle": 135.0,
    "dis": 10.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 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
gen_extra_data Ran
ran on a synthesized input
hncszyq/ShadowAttack/gtsrb.py
code served (permissive licence) · get_code("abac5e96acc4f012")
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 cv2
import numpy as np

# Create small test images (3x4 pixels, 3 channels - uint8 for OpenCV)
# Make them distinct sizes to probe dimensions later
x_train = [
    np.random.randint(0, 256, (4, 5, 3), dtype=np.uint8),
    np.random.randint(0, 256, (4, 5, 3), dtype=np.uint8),
]

y_train = [0, 1]

ARGS = {
    "x_train": x_train,
    "y_train": y_train,
    "n_each": 2,
    "ang_range": 15,
    "shear_range": 10,
    "trans_range": 5,
    "randomize_var": 1,
    "preprocess": True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, 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
pre_process_image Ran
ran on a synthesized input
hncszyq/ShadowAttack/gtsrb.py
code served (permissive licence) · get_code("ab977c63868abbdc")
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 cv2
import numpy as np

def pre_process_image(image):
    image[:, :, 0] = cv2.equalizeHist(image[:, :, 0])
    image[:, :, 1] = cv2.equalizeHist(image[:, :, 1])
    image[:, :, 2] = cv2.equalizeHist(image[:, :, 2])
    image = image / 255.0 - 0.5
    return image

# Create a valid image argument
# The function expects a 3D numpy array with shape (height, width, 3) for BGR channels
# Values should be in uint8 range [0, 255] for cv2.equalizeHist to work
image = np.random.randint(0, 256, size=(4, 3, 3), dtype=np.uint8)

ARGS = {
    "image": image
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, 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
transform_image Ran
ran on a synthesized input
hncszyq/ShadowAttack/gtsrb.py
code served (permissive licence) · get_code("4a028dbff86b13d5")
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 (32, 32, 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 cv2
import numpy as np

# Create a small test image (height=32, width=32, channels=3)
# Use uint8 format as expected by cv2.equalizeHist
test_image = np.random.randint(0, 256, (32, 32, 3), dtype=np.uint8)

ARGS = {
    "image": test_image,
    "ang_range": 15,
    "shear_range": 10,
    "trans_range": 5,
    "preprocess": True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, 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 (32, 32, 3) — shape (32, 32, 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_gtsrb Not yet run
unverified (harvested, no recorded run)
hncszyq/ShadowAttack/utils.py
code served (permissive licence) · get_code("f28d4cce5caf9fe2")
How it ran

no invocation recorded.

load_lisa Not yet run
unverified (harvested, no recorded run)
hncszyq/ShadowAttack/utils.py
code served (permissive licence) · get_code("a4b5ac6c784d663e")
How it ran

no invocation recorded.

test_single_image Not yet run
unverified (harvested, no recorded run)
hncszyq/ShadowAttack/lisa.py
code served (permissive licence) · get_code("60edf4a9e18d112a")
How it ran

no invocation recorded.

Also present in other papers' code

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

Estimating the risk level of adversarial examples is essential for safely deploying machine learning models in the real world. One popular approach for physical-world attacks is to adopt the "sticker-pasting" strategy, which however suffers from some limitations, including difficulties in access to the target or printing by valid colors. A new type of non-invasive attacks emerged recently, which attempt to cast perturbation onto the target by optics based tools, such as laser beam and projector. However, the added optical patterns are artificial but not natural. Thus, they are still conspicuous and attention-grabbed, and can be easily noticed by humans. In this paper, we study a new type of optical adversarial examples, in which the perturbations are generated by a very common natural phenomenon, shadow, to achieve naturalistic and stealthy physical-world adversarial attack under the black-box setting. We extensively evaluate the effectiveness of this new attack on both simulated and real-world environments. Experimental results on traffic sign recognition demonstrate that our algorithm can generate adversarial examples effectively, reaching 98.23% and 90.47% success rates on LISA and GTSRB test sets respectively, while continuously misleading a moving camera over 95% of the time in real-world scenarios. We also offer discussions about the limitations and the defense mechanism of this attack 1 .

For agents

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

get_harvested_code_for_paper("2203.03818")
get_code_for_paper("2203.03818")
have("2203.03818")

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

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

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

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

Connect an agent — have() is free.