SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.00816 · 2024

Invisible Backdoor Attacks on Diffusion Models

arXiv · PDF · Open in the Atlas

Code that ran

24 of 35 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; 3 honoured the contract we drafted, 0 violated it and 9 have no contract verdict; 12 failures of our instrument; 11 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/2406.00816.json · badge: /api/ran/2406.00816.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
invisibletriggerdiffusion/invisible_triggers_for_diffusion canonical (classifier label)
classifier basis: census
14 ran · 5 no recorded run
linweiii/backdoordm community (classifier label)
classifier basis not recorded on the link
10 ran · 6 no recorded run
FunctionStatusWhere it lives
PreActResNet18 Ran
ran; our contract draft was wrong, not the code
linweiii/backdoordm/classifier_models/preact_resnet.py
code served (permissive licence) · get_code("4427a19ae0928cb2")
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 PreActResNet. 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 torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    "num_classes": 10
}
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 PreActResNet — a PreActResNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PreActResNet output the recorded ndim 0 and dtype family float 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
add_label_column Ran
ran on a synthesized input
linweiii/backdoordm/classifier_models/train_classifiers.py
code served (permissive licence) · get_code("098c7b352e3b9513")
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 Dataset. 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 torch
import numpy as np
from datasets import Dataset

torch.manual_seed(0)

# Create a minimal dataset with the required columns
# The function iterates through records and accesses 'Heavy_Makeup', 'Mouth_Slightly_Open', 'Smiling'
ds = Dataset.from_dict({
    'Heavy_Makeup': [1, 0, 1, 0],
    'Mouth_Slightly_Open': [0, 1, 1, 0],
    'Smiling': [1, 1, 0, 0],
})

ARGS = {
    'ds': ds
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
datasets, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Dataset — a Dataset output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Dataset output the recorded ndim 1 and dtype family float 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
batch_sampling Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
invisibletriggerdiffusion/invisible_triggers_for_diffusion/model.py
pointer only (licence: NONE) · get_code("68b412f99839b629")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, invisibletriggerdiffusion/invisible_triggers_for_diffusion 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. A run is recorded.

betas_for_alpha_bar Ran
ran, honoured the contract we drafted
invisibletriggerdiffusion/invisible_triggers_for_diffusion/glide/glide_text2im/gaussian_diffusion.py
pointer only (licence: NONE); the stored copy get_code serves, from NVlabs/DiffPure, is pointer only (licence: NOASSERTION) · get_code("2ab2316ac6fdd869")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, invisibletriggerdiffusion/invisible_triggers_for_diffusion 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. A run is recorded.

check_imports Ran
ran; our contract draft was wrong, not the code
invisibletriggerdiffusion/invisible_triggers_for_diffusion/diffusers/dynamic_modules_utils.py
pointer only (licence: NONE) · get_code("301682fc3342590a")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, invisibletriggerdiffusion/invisible_triggers_for_diffusion 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. A run is recorded.

compute_backdoor_loss Ran
ran on a synthesized input
linweiii/backdoordm/analysis/preactivations/backdoor_loss.py
code served (permissive licence) · get_code("255d89bf31e49ce4")
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 torch
import torch.nn as nn
import torch.nn.functional as F

torch.manual_seed(0)

# Build a minimal noise scheduler with required config
class NoiseScheduler:
    def __init__(self):
        self.config = type('Config', (), {'num_train_timesteps': 1000})()

noise_sched = NoiseScheduler()

# Build a minimal diffusion model
class MinimalDiffusionModel(nn.Module):
    def __init__(self, in_channels=3, sample_size=32):
        super().__init__()
        self.in_channels = in_channels
        self.sample_size = sample_size
        self.device = 'cpu'
        self.linear = nn.Linear(in_channels * sample_size * sample_size + 1, in_channels * sample_size * sample_size)
    
    def forward(self, x, timesteps, return_dict=False):
        batch_size = x.shape[0]
        x_flat = x.view(batch_size, -1)
        t_emb = timesteps.float().unsqueeze(1)
        combined = torch.cat([x_flat, t_emb], dim=1)
        out = self.linear(combined)
        out = out.view(batch_size, self.in_channels, self.sample_size, self.sample_size)
        if return_dict:
            return {'sample': out}
        return (out,)

model = MinimalDiffusionModel(in_channels=3, sample_size=32)
model_clean = MinimalDiffusionModel(in_channels=3, sample_size=32)

# Build a minimal DSL with trigger
class DSL:
    def __init__(self):
        self.trigger = torch.randn(3, 32, 32)

dsl = DSL()

# Build minimal args
class Args:
    def __init__(self):
        self.backdoor_method = 'baddiffusion'
        self.device = 'cpu'

args = Args()

# Create RNG
rng = torch.Generator(device='cpu')
rng.manual_seed(42)

ARGS = {
    'args': args,
    'dsl': dsl,
    'model': model,
    'model_clean': model_clean,
    'noise_sched': noise_sched,
    'rng': rng,
    'sample_n': 4,
    'max_batch_n': 2
}
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 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
convert_pytorch_state_dict_to_flax Ran
ran; our contract draft was wrong, not the code
invisibletriggerdiffusion/invisible_triggers_for_diffusion/diffusers/modeling_flax_pytorch_utils.py
pointer only (licence: NONE); the stored copy get_code serves, from mayuelala/followyourcanvas, is pointer only (licence: NONE) · get_code("7d657d43bf8f10fc")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, invisibletriggerdiffusion/invisible_triggers_for_diffusion 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. A run is recorded.

get_beta_schedule Ran
ran, honoured the contract we drafted
invisibletriggerdiffusion/invisible_triggers_for_diffusion/glide/glide_text2im/gaussian_diffusion.py
pointer only (licence: NONE) · get_code("0996aa0f716afd2d")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, invisibletriggerdiffusion/invisible_triggers_for_diffusion 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. A run is recorded.

get_named_beta_schedule Ran
ran, honoured the contract we drafted
invisibletriggerdiffusion/invisible_triggers_for_diffusion/glide/glide_text2im/gaussian_diffusion.py
pointer only (licence: NONE) · get_code("14e2c5e6c9d5ba6c")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, invisibletriggerdiffusion/invisible_triggers_for_diffusion 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. A run is recorded.

get_parameter_device Ran
ran; our contract draft was wrong, not the code
invisibletriggerdiffusion/invisible_triggers_for_diffusion/diffusers/modeling_utils.py
pointer only (licence: NONE); the stored copy get_code serves, from mayuelala/followyourcanvas, is pointer only (licence: NONE) · get_code("eafa252fd6f86857")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, invisibletriggerdiffusion/invisible_triggers_for_diffusion 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. A run is recorded.

get_parameter_dtype Ran
ran; our contract draft was wrong, not the code
invisibletriggerdiffusion/invisible_triggers_for_diffusion/diffusers/modeling_utils.py
pointer only (licence: NONE); the stored copy get_code serves, from mayuelala/followyourcanvas, is pointer only (licence: NONE) · get_code("dc2045840ce679cb")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, invisibletriggerdiffusion/invisible_triggers_for_diffusion 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. A run is recorded.

get_relative_import_files Ran
ran; our contract draft was wrong, not the code
invisibletriggerdiffusion/invisible_triggers_for_diffusion/diffusers/dynamic_modules_utils.py
pointer only (licence: NONE) · get_code("00cc853a73f3aeb6")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, invisibletriggerdiffusion/invisible_triggers_for_diffusion 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. A run is recorded.

get_relative_imports Ran
ran; our contract draft was wrong, not the code
invisibletriggerdiffusion/invisible_triggers_for_diffusion/diffusers/dynamic_modules_utils.py
pointer only (licence: NONE) · get_code("450aeffe7f80f917")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, invisibletriggerdiffusion/invisible_triggers_for_diffusion 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. A run is recorded.

get_sd_noise Ran
ran on a synthesized input
linweiii/backdoordm/analysis/preactivations/backdoor_loss.py
code served (permissive licence) · get_code("7a4b2e5785b258ca")
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 (2, 4, 8, 8) 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

torch.manual_seed(0)

# Stand-in tokenizer class
class StandInTokenizer:
    def __init__(self):
        self.model_max_length = 77
    
    def __call__(self, prompt, padding=None, max_length=None, return_tensors=None):
        # Return a mock tokenizer output
        class TokenizerOutput:
            def __init__(self):
                self.input_ids = torch.randint(0, 1000, (2, 77))
        return TokenizerOutput()

# Stand-in text encoder
class StandInTextEncoder(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(77, 5)
    
    def forward(self, input_ids):
        # input_ids shape: (2, 77)
        # output shape: (2, 77, 768) - typical CLIP embedding
        batch_size = input_ids.shape[0]
        seq_len = input_ids.shape[1]
        embeddings = torch.randn(batch_size, seq_len, 768)
        return (embeddings,)

# Stand-in UNet
class StandInUNet(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def forward(self, sample, timestep, encoder_hidden_states):
        # sample shape: (2, 4, 8, 8)
        # timestep shape: (2,)
        # encoder_hidden_states shape: (2, 77, 768)
        class Output:
            def __init__(self, sample):
                self.sample = sample
        
        noise_pred = torch.randn_like(sample)
        return Output(noise_pred)

# Stand-in pipe
class StandInPipe:
    def __init__(self):
        self.tokenizer = StandInTokenizer()
        self.text_encoder = StandInTextEncoder()
        self.unet = StandInUNet()

# Build arguments
pipe = StandInPipe()
prompt = "a dog"
init = torch.randn(2, 4, 8, 8)
timesteps = torch.randint(0, 1000, (2,))
device = "cpu"

ARGS = {
    "pipe": pipe,
    "prompt": prompt,
    "init": init,
    "timesteps": timesteps,
    "device": device,
}
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 4, dtype family float, shape (2, 4, 8, 8) — shape (2, 4, 8, 8) 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_target_for_name Ran
ran on a synthesized input
linweiii/backdoordm/evaluation/configs/bdmodel_path.py
code served (permissive licence) · get_code("9b28bdc9071839c4")
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 str. 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 torch
import numpy as np

torch.manual_seed(0)

# Create a minimal args object with the required bd_target_type attribute
class Args:
    def __init__(self, bd_target_type):
        self.bd_target_type = bd_target_type

# Create test backdoor dicts for each target type
backdoor_imagePatch = {
    'target_img_path': '/path/to/images/target_image.png'
}

backdoor_objectRep = {
    'target': 'cat'
}

backdoor_styleAdd = {
    'target_style': 'Van Gogh Starry Night'
}

backdoor_objectAdd = {
    'target': 'red cube'
}

# We'll test with one of the configurations
args = Args(bd_target_type='imagePatch')
backdoor = backdoor_imagePatch

ARGS = {
    'args': args,
    'backdoor': backdoor
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float 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
move_pipe_to_cpu Ran
ran on a synthesized input
linweiii/backdoordm/analysis/preactivations/backdoor_loss.py
code served (permissive licence) · get_code("e118876b938dca06")
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 SimplePipe. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 torch
import torch.nn as nn

torch.manual_seed(0)

class SimpleUNet(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def forward(self, x):
        return self.linear(x)

class SimpleVAE(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def forward(self, x):
        return self.linear(x)

class SimpleTextEncoder(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def forward(self, x):
        return self.linear(x)

class SimplePipe:
    def __init__(self):
        self.unet = SimpleUNet()
        self.vae = SimpleVAE()
        self.text_encoder = SimpleTextEncoder()

pipe = SimplePipe()

ARGS = {
    "pipe": pipe
}
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 SimplePipe — a SimplePipe output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimplePipe output the recorded ndim 0 and dtype family float 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
p_losses_diffuser Ran
ran; our contract draft was wrong, not the code
invisibletriggerdiffusion/invisible_triggers_for_diffusion/loss.py
pointer only (licence: NONE) · get_code("43781d58d40083e9")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, invisibletriggerdiffusion/invisible_triggers_for_diffusion 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. A run is recorded.

q_sample_diffuser Ran
ran; our contract draft was wrong, not the code
invisibletriggerdiffusion/invisible_triggers_for_diffusion/loss.py
pointer only (licence: NONE) · get_code("9735f098c72a930a")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, invisibletriggerdiffusion/invisible_triggers_for_diffusion 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. A run is recorded.

rename_key Ran
ran; our contract draft was wrong, not the code
invisibletriggerdiffusion/invisible_triggers_for_diffusion/diffusers/modeling_flax_pytorch_utils.py
pointer only (licence: NONE); the stored copy get_code serves, from mayuelala/followyourcanvas, is pointer only (licence: NONE) · get_code("fa58367fb507f72f")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, invisibletriggerdiffusion/invisible_triggers_for_diffusion 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. A run is recorded.

rename_key_and_reshape_tensor Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
invisibletriggerdiffusion/invisible_triggers_for_diffusion/diffusers/modeling_flax_pytorch_utils.py
pointer only (licence: NONE); the stored copy get_code serves, from mayuelala/followyourcanvas, is pointer only (licence: NONE) · get_code("5f1d8a0f6c5bcb3e")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, invisibletriggerdiffusion/invisible_triggers_for_diffusion 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. A run is recorded.

str_to_bool Ran
ran on a synthesized input
linweiii/backdoordm/evaluation/main_eval.py
code served (permissive licence) · get_code("8035fbe8d79fa731")
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 bool, 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 argparse

def str_to_bool(value):
    if value.lower() in ('true', 't', '1'):
        return True
    elif value.lower() in ('false', 'f', '0'):
        return False
    else:
        raise argparse.ArgumentTypeError(f"Invalid bool value: '{value}'")

ARGS = {
    "value": "true"
}
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 bool, 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
test Ran
ran on a synthesized input
linweiii/backdoordm/classifier_models/train_classifiers.py
code served (permissive licence) · get_code("5ba3ce200e91c692")
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 torch
import torch.nn as nn

torch.manual_seed(0)

# Create a minimal model that accepts inputs and produces class predictions
class MinimalModel(nn.Module):
    def __init__(self, input_dim=4, num_classes=3):
        super().__init__()
        self.fc = nn.Linear(input_dim, num_classes)
    
    def forward(self, x):
        return self.fc(x)

model = MinimalModel(input_dim=4, num_classes=3)

# Create a minimal test loader with 2 batches of size 2
# Each batch is a dict with 'image' and 'label' keys
test_loader = [
    {
        'image': torch.randn(2, 4),
        'label': torch.tensor([0, 1])
    },
    {
        'image': torch.randn(2, 4),
        'label': torch.tensor([2, 0])
    }
]

# Create a loss function
criterion = nn.CrossEntropyLoss()

# Device (CPU only)
device = torch.device('cpu')

ARGS = {
    'model': model,
    'test_loader': test_loader,
    'criterion': criterion,
    'device': device,
    'key': 'image'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, tqdm — 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
train Ran
ran on a synthesized input
linweiii/backdoordm/classifier_models/train_classifiers.py
code served (permissive licence) · get_code("92cb5c70af1c2002")
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 torch
import torch.nn as nn
import torch.optim as optim

torch.manual_seed(0)

# Define a simple model
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.fc(x)

# Define a simple train loader (list of batches)
train_loader = [
    {
        'image': torch.randn(2, 4),
        'label': torch.tensor([0, 1])
    },
    {
        'image': torch.randn(2, 4),
        'label': torch.tensor([1, 2])
    }
]

# Create model, criterion, optimizer, scheduler
model = SimpleModel()
criterion = nn.CrossEntropyLoss()
optimizer = optim.SGD(model.parameters(), lr=0.01)
scheduler = optim.lr_scheduler.StepLR(optimizer, step_size=1, gamma=0.1)
device = 'cpu'

ARGS = {
    'model': model,
    'train_loader': train_loader,
    'criterion': criterion,
    'optimizer': optimizer,
    'scheduler': scheduler,
    'device': device,
    'key': 'image'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, tqdm — 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
train_model Ran
ran on a synthesized input
linweiii/backdoordm/classifier_models/resnet.py
code served (permissive licence) · get_code("ff87142d35038989")
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 SimpleModel. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 torch
import torch.nn as nn

torch.manual_seed(0)

# Define a simple model
class SimpleModel(nn.Module):
    def __init__(self):
        super(SimpleModel, self).__init__()
        self.fc1 = nn.Linear(4, 8)
        self.fc2 = nn.Linear(8, 3)
    
    def forward(self, x):
        x = torch.relu(self.fc1(x))
        x = self.fc2(x)
        return x

# Create tiny datasets as lists of (input, label) tuples
def create_loader(num_samples=4, batch_size=2):
    data = []
    for i in range(num_samples):
        x = torch.randn(4)
        y = torch.randint(0, 3, (1,)).item()
        data.append((x, y))
    
    # Batch the data
    batches = []
    for i in range(0, len(data), batch_size):
        batch_x = torch.stack([data[j][0] for j in range(i, min(i + batch_size, len(data)))])
        batch_y = torch.tensor([data[j][1] for j in range(i, min(i + batch_size, len(data)))])
        batches.append((batch_x, batch_y))
    
    # Add dataset attribute for len()
    class LoaderWrapper:
        def __init__(self, batches):
            self.batches = batches
            self.dataset = type('Dataset', (), {'__len__': lambda self: sum(b[0].size(0) for b in batches)})()
        
        def __iter__(self):
            return iter(self.batches)
    
    return LoaderWrapper(batches)

model = SimpleModel()
train_loader = create_loader(num_samples=6, batch_size=2)
val_loader = create_loader(num_samples=4, batch_size=2)
criterion = nn.CrossEntropyLoss()
optimizer = torch.optim.SGD(model.parameters(), lr=0.01)
scheduler = torch.optim.lr_scheduler.StepLR(optimizer, step_size=1, gamma=0.1)

ARGS = {
    'model': model,
    'train_loader': train_loader,
    'val_loader': val_loader,
    'criterion': criterion,
    'optimizer': optimizer,
    'scheduler': scheduler,
    'num_epochs': 2,
    'device': 'cpu'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SimpleModel — a SimpleModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleModel output the recorded ndim 0 and dtype family float 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
apply_trigger_with_random_crops Not yet run
unverified (harvested, no recorded run)
linweiii/backdoordm/evaluation/generate_img.py
code served (permissive licence) · get_code("070eb3053dfec545")
How it ran

no invocation recorded.

apply_trigger_with_random_noise Not yet run
unverified (harvested, no recorded run)
linweiii/backdoordm/evaluation/generate_img.py
code served (permissive licence) · get_code("7cee0a9d2949bf77")
How it ran

no invocation recorded.

apply_trojdiff_trigger_with_random_crops Not yet run
unverified (harvested, no recorded run)
linweiii/backdoordm/evaluation/generate_img_trojdiff.py
code served (permissive licence) · get_code("794d443efca3cca9")
How it ran

no invocation recorded.

apply_trojdiff_trigger_with_random_noise Not yet run
unverified (harvested, no recorded run)
linweiii/backdoordm/evaluation/generate_img_trojdiff.py
code served (permissive licence) · get_code("ca9d21906c166b9c")
How it ran

no invocation recorded.

batch_sampling_save Not yet run
unverified (harvested, no recorded run)
invisibletriggerdiffusion/invisible_triggers_for_diffusion/model.py
pointer only (licence: NONE) · get_code("ffd3703863aadaca")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, invisibletriggerdiffusion/invisible_triggers_for_diffusion 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.

calculate_activation_statistics Not yet run
unverified (harvested, no recorded run)
invisibletriggerdiffusion/invisible_triggers_for_diffusion/fid_score.py
pointer only (licence: NONE) · get_code("a17aa1b06ec919e8")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, invisibletriggerdiffusion/invisible_triggers_for_diffusion 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.

calculate_frechet_distance Not yet run
unverified (harvested, no recorded run)
invisibletriggerdiffusion/invisible_triggers_for_diffusion/fid_score.py
pointer only (licence: NONE) · get_code("0def50a351111624")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, invisibletriggerdiffusion/invisible_triggers_for_diffusion 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.

get_activations Not yet run
unverified (harvested, no recorded run)
invisibletriggerdiffusion/invisible_triggers_for_diffusion/fid_score.py
pointer only (licence: NONE) · get_code("9f5980b8530c7409")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, invisibletriggerdiffusion/invisible_triggers_for_diffusion 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.

load_state_dict Not yet run
unverified (harvested, no recorded run)
invisibletriggerdiffusion/invisible_triggers_for_diffusion/diffusers/modeling_utils.py
pointer only (licence: NONE) · get_code("77bd5e6e8ca8c91d")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, invisibletriggerdiffusion/invisible_triggers_for_diffusion 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.

test_model Not yet run
unverified (harvested, no recorded run)
linweiii/backdoordm/classifier_models/resnet.py
code served (permissive licence) · get_code("bd3f866cccaf7c8b")
How it ran

no invocation recorded.

train Not yet run
unverified (harvested, no recorded run)
linweiii/backdoordm/classifier_models/resnet.py
code served (permissive licence) · get_code("c24870633e16b862")
How it ran

no invocation recorded.

Also present in other papers' code

Of 35 samples lifted from this paper's linked repositories, 35 carry a function identity and 0 do not. Of the 35 distinct functions with an identity, 19 are also present in other papers whose code we hold (19 with at least one paper dated earlier, 10 the same month, 16 later) and 16 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
betas_for_alpha_bar 92 other papers
74 dated earlier, 1 the same month, 15 later, 2 same year, order not determinable · 3 only as an assembly brick
2006.11239 (2020-06)
Denoising Diffusion Probabilistic Models
2010.02502 (2020-10)
Denoising Diffusion Implicit Models
2102.09672 (2021-02)
Improved Denoising Diffusion Probabilistic Models
and 89 more not named here
calculate_frechet_distance 74 other papers
61 dated earlier, 3 the same month, 9 later, 1 same year, order not determinable
1610.09585 (2016-10)
Conditional Image Synthesis With Auxiliary Classifier GANs
1706.08500 (2017-06)
GANs Trained by a Two Time-Scale Update Rule Converge to a Local Nash Equilibrium
1807.11458 (2018-07)
To learn image super-resolution, use a GAN to learn how to do image degradation first
and 71 more not named here
get_beta_schedule 31 other papers
10 dated earlier, 1 the same month, 20 later
2202.09671 (2022-02)
TRUNCATED DIFFUSION PROBABILISTIC MODELS AND DIFFUSION-BASED ADVERSARIAL AUTO-ENCODERS
2210.07574 (2022-10)
Is synthetic data from generative models ready for image recognition?
2306.02562 (2023-06)
Video Diffusion Models with Local-Global Context Guidance
and 28 more not named here
get_named_beta_schedule 25 other papers
8 dated earlier, 1 the same month, 16 later
2210.07574 (2022-10)
Is synthetic data from generative models ready for image recognition?
2306.02562 (2023-06)
Video Diffusion Models with Local-Global Context Guidance
2306.12511 (2023-06)
Semi-Implicit Denoising Diffusion Models (SIDDMs)
and 22 more not named here
PreActResNet18 22 other papers
20 dated earlier, 2 later
1710.09412 (2017-10)
mixup: BEYOND EMPIRICAL RISK MINIMIZATION
2003.04887 (2020-03)
ReZero is All You Need: Fast Convergence at Large Depth
2103.14222 (2021-03)
Adversarial Attacks are Reversible with Natural Supervision
and 19 more not named here
get_relative_import_files 18 other papers
13 dated earlier, 2 the same month, 3 later
2211.11694 (2022-11)
Exploring Discrete Diffusion Models for Image Captioning
2304.05568 (2023-04)
Improving Diffusion Models for Scene Text Editing with Dual Encoders
2305.15756 (2023-05)
UniTRec: A Unified Text-to-Text Transformer and Joint Contrastive Learning Framework for Text-based Recommendation
and 15 more not named here
get_relative_imports 18 other papers
13 dated earlier, 2 the same month, 3 later
2211.11694 (2022-11)
Exploring Discrete Diffusion Models for Image Captioning
2304.05568 (2023-04)
Improving Diffusion Models for Scene Text Editing with Dual Encoders
2305.15756 (2023-05)
UniTRec: A Unified Text-to-Text Transformer and Joint Contrastive Learning Framework for Text-based Recommendation
and 15 more not named here
calculate_activation_statistics 10 other papers
6 dated earlier, 4 later
Chou_How_to_Backdoor_Diffusion_Models_CVPR_2023_paper (2023 (year only))
How to Backdoor Diffusion Models?
2305.08192 (2023-05)
Diffusion Models for Imperceptible and Transferable Adversarial Attack
2306.06874 (2023-06)
VillanDiffusion: A Unified Backdoor Attack Framework for Diffusion Models
and 7 more not named here
check_imports 10 other papers
7 dated earlier, 1 the same month, 2 later
2211.11694 (2022-11)
Exploring Discrete Diffusion Models for Image Captioning
2304.05568 (2023-04)
Improving Diffusion Models for Scene Text Editing with Dual Encoders
2305.15756 (2023-05)
UniTRec: A Unified Text-to-Text Transformer and Joint Contrastive Learning Framework for Text-based Recommendation
and 7 more not named here
get_parameter_device 10 other papers
4 dated earlier, 2 the same month, 4 later
2304.05568 (2023-04)
Improving Diffusion Models for Scene Text Editing with Dual Encoders
2306.05720 (2023-06)
Beyond Surface Statistics: Scene Representations in a Latent Diffusion Model
2307.10829 (2023-07)
Exact Diffusion Inversion via Bi-directional Integration Approximation
and 7 more not named here
get_parameter_dtype 10 other papers
4 dated earlier, 2 the same month, 4 later
2304.05568 (2023-04)
Improving Diffusion Models for Scene Text Editing with Dual Encoders
2306.05720 (2023-06)
Beyond Surface Statistics: Scene Representations in a Latent Diffusion Model
2307.10829 (2023-07)
Exact Diffusion Inversion via Bi-directional Integration Approximation
and 7 more not named here
get_activations 6 other papers
3 dated earlier, 2 later, 1 same year, order not determinable
Chou_How_to_Backdoor_Diffusion_Models_CVPR_2023_paper (2023 (year only))
How to Backdoor Diffusion Models?
2306.06874 (2023-06)
VillanDiffusion: A Unified Backdoor Attack Framework for Diffusion Models
2312.12030 (2023-12)
Towards Accurate Guided Diffusion Sampling through Symplectic Adjoint Method
and 3 more not named here
load_state_dict 5 other papers
3 dated earlier, 1 the same month, 1 later
2304.05568 (2023-04)
Improving Diffusion Models for Scene Text Editing with Dual Encoders
2306.05720 (2023-06)
Beyond Surface Statistics: Scene Representations in a Latent Diffusion Model
2307.10829 (2023-07)
Exact Diffusion Inversion via Bi-directional Integration Approximation
and 2 more not named here
convert_pytorch_state_dict_to_flax 3 other papers
2 dated earlier, 1 later
2304.05568 (2023-04)
Improving Diffusion Models for Scene Text Editing with Dual Encoders
2403.08268 (2024-03)
Follow-Your-Click: Open-domain Regional Image Animation via Short Prompts
2409.01055 (2024-09)
Follow-Your-Canvas: Higher-Resolution Video Outpainting with Extensive Content Generation
rename_key 3 other papers
2 dated earlier, 1 later
2304.05568 (2023-04)
Improving Diffusion Models for Scene Text Editing with Dual Encoders
2403.08268 (2024-03)
Follow-Your-Click: Open-domain Regional Image Animation via Short Prompts
2409.01055 (2024-09)
Follow-Your-Canvas: Higher-Resolution Video Outpainting with Extensive Content Generation
rename_key_and_reshape_tensor 3 other papers
2 dated earlier, 1 later
2304.05568 (2023-04)
Improving Diffusion Models for Scene Text Editing with Dual Encoders
2403.08268 (2024-03)
Follow-Your-Click: Open-domain Regional Image Animation via Short Prompts
2409.01055 (2024-09)
Follow-Your-Canvas: Higher-Resolution Video Outpainting with Extensive Content Generation
batch_sampling 1 other paper
1 dated earlier
Chou_How_to_Backdoor_Diffusion_Models_CVPR_2023_paper (2023 (year only))
How to Backdoor Diffusion Models?
batch_sampling_save 1 other paper
1 dated earlier
Chou_How_to_Backdoor_Diffusion_Models_CVPR_2023_paper (2023 (year only))
How to Backdoor Diffusion Models?
p_losses_diffuser 1 other paper
1 dated earlier
Chou_How_to_Backdoor_Diffusion_Models_CVPR_2023_paper (2023 (year only))
How to Backdoor Diffusion Models?

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

In recent years, diffusion models have achieved remarkable success in the realm of high-quality image generation, garnering increased attention. This surge in interest is paralleled by a growing concern over the security threats associated with diffusion models, largely attributed to their susceptibility to malicious exploitation. Notably, recent research has brought to light the vulnerability of diffusion models to backdoor attacks, enabling the generation of specific target images through corresponding triggers. However, prevailing backdoor attack methods rely on manually crafted trigger generation functions, often manifesting as discernible patterns incorporated into input noise, thus rendering them susceptible to human detection. In this paper, we present an innovative and versatile optimization framework designed to acquire invisible triggers, enhancing the stealthiness and resilience of inserted backdoors. Our proposed framework is applicable to both unconditional and conditional diffusion models, and notably, we are the pioneers in demonstrating the backdooring of diffusion models within the context of text-guided image editing and inpainting pipelines. Moreover, we also show that the backdoors in the conditional generation can be directly applied to model watermarking for model ownership verification, which further boosts the significance of the proposed framework. Extensive experiments on various commonly used samplers and datasets verify the efficacy and stealthiness of the proposed framework. Our code is publicly available at https://github.com/invisibleTriggerDiffusion/invisible_triggers_for_diffusion.

For agents

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

get_harvested_code_for_paper("2406.00816")
get_code_for_paper("2406.00816")
have("2406.00816")

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

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

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

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

Connect an agent — have() is free.