SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2003.03030 · 2020

Clean-Label Backdoor Attacks on Video Recognition Models

arXiv · PDF · Open in the Atlas

Code that ran

6 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; 1 failure of our instrument; 1 no recorded run), measured 2026-11-21; 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/2003.03030.json · badge: /api/ran/2003.03030.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
ShihaoZhaoZSH/Video-Backdoor-Attack canonical (classifier label)
classifier basis: census
6 ran · 1 no recorded run
FunctionStatusWhere it lives
addTrigger Ran
ran on a synthesized input
ShihaoZhaoZSH/Video-Backdoor-Attack/experiments/enhance_trigger.py
code served (permissive licence) · get_code("afde2fce23e904be")
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 list, 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
import tempfile
import os

# Create a temporary directory for this test
temp_dir = tempfile.mkdtemp()

# Create mock trigger files for triggerSize 24
triggerSize = 24
trigger_data = np.random.randint(0, 256, size=(1, 2, 256, 256), dtype=np.uint8)
trigger_path = os.path.join(temp_dir, f'trigger{triggerSize}.npy')
np.save(trigger_path, trigger_data)

# Change to temp directory so np.load can find the trigger file
original_dir = os.getcwd()
os.chdir(temp_dir)

# Create mock image data: 2 images of size 256x256x3 (RGB)
images = [
    np.random.randint(0, 256, size=(256, 256, 3), dtype=np.uint8),
    np.random.randint(0, 256, size=(256, 256, 3), dtype=np.uint8)
]

# Create indices for the images
indices = [0, 1]

# Create a temporary save path
save_path = os.path.join(temp_dir, 'output/')
os.makedirs(save_path, exist_ok=True)

ARGS = {
    'images': images,
    'indices': indices,
    'triggerSize': 24,
    'save_path': save_path
}
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 list, ndim 1, dtype family float — a list 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
average_gradients Ran
ran; our contract draft was wrong, not the code
ShihaoZhaoZSH/Video-Backdoor-Attack/utils.py
code served (permissive licence) · get_code("8553e59eb6f6feab")
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 list. 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 tensorflow as tf

# Create mock tower gradients for multi-GPU simulation
# tower_grads is a list of lists, where each inner list contains (grad, var) tuples
# Structure: tower_grads[tower_idx][param_idx] = (grad_tensor, var_tensor)

# Create gradients and variables for 2 towers and 2 parameters
tower_grads = []

# Tower 0: 2 parameters
tower_0_grads = [
    (tf.constant([[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0]]), tf.Variable([0.0] * 4, name="param_0")),
    (tf.constant([[9.0, 10.0], [11.0, 12.0]]), tf.Variable([0.0] * 2, name="param_1"))
]
tower_grads.append(tower_0_grads)

# Tower 1: 2 parameters (same shape as tower 0)
tower_1_grads = [
    (tf.constant([[13.0, 14.0, 15.0, 16.0], [17.0, 18.0, 19.0, 20.0]]), tf.Variable([0.0] * 4, name="param_0")),
    (tf.constant([[21.0, 22.0], [23.0, 24.0]]), tf.Variable([0.0] * 2, name="param_1"))
]
tower_grads.append(tower_1_grads)

ARGS = {
    "tower_grads": tower_grads
}
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 list — a list 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
get_data Ran
ran on a synthesized input
ShihaoZhaoZSH/Video-Backdoor-Attack/input_data.py
code served (permissive licence) · get_code("2fba3fef686b0192")
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 os
import tempfile
import shutil
from PIL import Image
import numpy as np

# Create a temporary directory with test image files
temp_dir = tempfile.mkdtemp()

# Create subdirectory for test data
test_subdir = os.path.join(temp_dir, 'test_data')
os.makedirs(test_subdir, exist_ok=True)

# Create some dummy image files with 'img_' prefix
for i in range(10):
    img_array = np.random.randint(0, 255, (32, 32, 3), dtype=np.uint8)
    img = Image.fromarray(img_array)
    img_path = os.path.join(test_subdir, f'img_{i:03d}.png')
    img.save(img_path)

# Define ARGS with all required parameters
ARGS = {
    'filename': test_subdir,
    'mode': 'img_',
    'num_frames_per_clip': 4,
    'sample_rate': 2,
    'is_flow': False,
    's_index': -1
}
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 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
get_frames_data Ran
ran on a synthesized input
ShihaoZhaoZSH/Video-Backdoor-Attack/input_data.py
code served (permissive licence) · get_code("8a9994123dd07cf9")
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 os
import tempfile
import shutil
import numpy as np
from PIL import Image

# Create a temporary directory structure with test image files
temp_dir = tempfile.mkdtemp()

# Create a subdirectory for RGB images
rgb_dir = os.path.join(temp_dir, "rgb_frames")
os.makedirs(rgb_dir, exist_ok=True)

# Create test RGB images with prefix 'i'
for i in range(30):
    img_array = np.random.randint(0, 255, (64, 64, 3), dtype=np.uint8)
    img = Image.fromarray(img_array)
    img.save(os.path.join(rgb_dir, f"i_{i:05d}.png"))

# Create a subdirectory for flow images
flow_dir = os.path.join(temp_dir, "flow_frames")
os.makedirs(flow_dir, exist_ok=True)

# Create test flow images with prefix 'x' and 'y'
for i in range(30):
    img_array_x = np.random.randint(0, 255, (64, 64), dtype=np.uint8)
    img_x = Image.fromarray(img_array_x)
    img_x.save(os.path.join(flow_dir, f"x_{i:05d}.png"))
    
    img_array_y = np.random.randint(0, 255, (64, 64), dtype=np.uint8)
    img_y = Image.fromarray(img_array_y)
    img_y.save(os.path.join(flow_dir, f"y_{i:05d}.png"))

ARGS = {
    "filename": flow_dir,
    "num_frames_per_clip": 8,
    "sample_rate": 2,
    "add_flow": True,
    "label": 0
}
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 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
sample_data Ran
ran on a synthesized input
ShihaoZhaoZSH/Video-Backdoor-Attack/input_data.py
code served (permissive licence) · get_code("19178582a4611840")
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 list, ndim 1, dtype family int; 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 torch
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# - ori_arr: indexed with integer indices, needs to support __getitem__
# - num_frames_per_clip: used in division and range(), should be int
# - sample_rate: used in division and multiplication, should be int/float

# Create a simple list/array to act as ori_arr with enough elements
ori_arr = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100]

# Set num_frames_per_clip to an integer
num_frames_per_clip = 8

# Set sample_rate to a positive integer/float
sample_rate = 2

ARGS = {
    "ori_arr": ori_arr,
    "num_frames_per_clip": num_frames_per_clip,
    "sample_rate": sample_rate
}
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 list, ndim 1, dtype family int — a list 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
tower_loss Ran
ran on a synthesized input
ShihaoZhaoZSH/Video-Backdoor-Attack/utils.py
code served (permissive licence) · get_code("0be7f8fa62988f87")
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 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 tensorflow as tf
import numpy as np

# Set seed for reproducibility
tf.random.set_seed(0)
np.random.seed(0)

# Create small test tensors
batch_size = 2
num_classes = 4

# logit: shape (batch_size, num_classes) - raw model outputs
logit = tf.constant([
    [0.1, 0.2, 0.3, 0.4],
    [0.5, 0.6, 0.7, 0.8]
], dtype=tf.float32)

# labels: shape (batch_size,) - class indices (sparse format)
# Values must be in range [0, num_classes)
labels = tf.constant([1, 3], dtype=tf.int64)

ARGS = {
    'logit': logit,
    'labels': labels
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, 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
placeholder_inputs Not yet run
unverified (harvested, no recorded run)
ShihaoZhaoZSH/Video-Backdoor-Attack/utils.py
code served (permissive licence) · get_code("3a790fcc84f46286")
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, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 0 later) and 6 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
average_gradients 3 other papers
3 dated earlier
1803.03764 (2018-03)
Variance Networks: When Expectation Does Not Meet Your Expectations
1805.01954 (2018-05)
Behavioral Cloning from Observation
1807.09190 (2018-07)
PReMVOS: Proposal-generation, Refinement and Merging for Video Object Segmentation

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

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Deep neural networks (DNNs) are vulnerable to backdoor attacks which can hide backdoor triggers in DNNs by poisoning training data. A backdoored model behaves normally on clean test images, yet consistently predicts a particular target class for any test examples that contain the trigger pattern. As such, backdoor attacks are hard to detect, and have raised severe security concerns in real-world applications. Thus far, backdoor research has mostly been conducted in the image domain with image classification models. In this paper, we show that existing image backdoor attacks are far less effective on videos, and outline 4 strict conditions where existing attacks are likely to fail: 1) scenarios with more input dimensions (eg. videos), 2) scenarios with high resolution, 3) scenarios with a large number of classes and few examples per class (a "sparse dataset"), and 4) attacks with access to correct labels (eg. clean-label attacks). We propose the use of a universal adversarial trigger as the backdoor trigger to attack video recognition models, a situation where backdoor attacks are likely to be challenged by the above 4 strict conditions. We show on benchmark video datasets that our proposed backdoor attack can manipulate state-of-the-art video models with high success rates by poisoning only a small proportion of training data (without changing the labels). We also show that our proposed backdoor attack is resistant to state-of-the-art backdoor defense/detection methods, and can even be applied to improve image backdoor attacks. Our proposed video backdoor attack not only serves as a strong baseline for improving the robustness of video models, but also provides a new perspective for more understanding more powerful backdoor attacks.

For agents

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

get_harvested_code_for_paper("2003.03030")
get_code_for_paper("2003.03030")
have("2003.03030")

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

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

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

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

Connect an agent — have() is free.