SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2502.07225 · 2025

CAT: Contrastive Adversarial Training for Evaluating the Robustness of Protective Perturbations in Latent Diffusion Models

arXiv · PDF · Open in the Atlas

Code that ran

2 of 6 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 1 has no contract verdict; 1 failure of our instrument; 4 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/2502.07225.json · badge: /api/ran/2502.07225.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
senp98/cat canonical (classifier label)
classifier basis not recorded on the link
2 ran · 4 no recorded run
FunctionStatusWhere it lives
create_tmp_train_dir Ran
ran; our contract draft was wrong, not the code
senp98/cat/code/finetune_cat_adapter/finetune_cat_adapter.py
code served (permissive licence) · get_code("ff7da9accf5006b5")
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) 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 shutil
import os
import tempfile

# Create a temporary input directory with some test files
in_dir = tempfile.mkdtemp()
test_file_1 = os.path.join(in_dir, 'file1.txt')
test_file_2 = os.path.join(in_dir, 'file2.txt')
with open(test_file_1, 'w') as f:
    f.write('test content 1')
with open(test_file_2, 'w') as f:
    f.write('test content 2')

ARGS = {
    'in_dir': in_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 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
get_precomputed_embedding Ran
ran on a synthesized input
senp98/cat/code/evaluate/eval_ism.py
code served (permissive licence) · get_code("781f28d7bcf3c157")
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 1, dtype family float, shape (128,) 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 numpy as np
import tempfile
import os

# Create a temporary directory and a temporary numpy file
temp_dir = tempfile.mkdtemp()
temp_path = os.path.join(temp_dir, "embedding.npy")

# Create a small numpy array to save as the embedding
embedding_array = np.random.randn(128).astype(np.float32)
np.save(temp_path, embedding_array)

ARGS = {
    "path": temp_path
}
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 ndarray, ndim 1, dtype family float, shape (128,) — shape (128,) 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
import_model_class_from_model_name_or_path Not yet run
unverified (harvested, no recorded run)
senp98/cat/code/finetune_dreambooth_cat/train_dreambooth_cat.py
pointer only (licence: MIT); the stored copy get_code serves, from KU-VGI/APDM, is pointer only (licence: NONE) · get_code("0eb3e94e8635150e")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from KU-VGI/APDM, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

log_validation Not yet run
unverified (harvested, no recorded run)
senp98/cat/code/finetune_cat_adapter/train_cat_adapter.py
code served (permissive licence) · get_code("016374a7e217bff3")
How it ran

no invocation recorded.

log_validation Not yet run
unverified (harvested, no recorded run)
senp98/cat/code/finetune_lora_cat/train_lora_cat.py
code served (permissive licence) · get_code("1f1d2b9b8c5b51f3")
How it ran

no invocation recorded.

parse_args Not yet run
unverified (harvested, no recorded run)
senp98/cat/code/finetune_dreambooth_cat/train_dreambooth_cat.py
code served (permissive licence) · get_code("b1627dd5bbfc3e21")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 1 later) and 4 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
import_model_class_from_model_name_or_path 13 other papers
11 dated earlier, 2 later
2305.19327 (2023-05)
Cones 2: Customizable Image Synthesis with Multiple Subjects
2307.06949 (2023-07)
HyperDreamBooth: HyperNetworks for Fast Personalization of Text-to-Image Models
2311.18815 (2023-11)
IMMA: Immunizing text-to-image Models against Malicious Adaptation
and 10 more not named here
create_tmp_train_dir 1 other paper
1 dated earlier
2406.12027 (2024-06)
Adversarial Perturbations Cannot Reliably Protect Artists From Generative AI

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

Latent diffusion models have recently demonstrated superior capabilities in many downstream image synthesis tasks. However, customization of latent diffusion models using unauthorized data can severely compromise the privacy and intellectual property rights of data owners. Adversarial examples as protective perturbations have been developed to defend against unauthorized data usage by introducing imperceptible noise to customization samples, preventing diffusion models from effectively learning them. In this paper, we first reveal that the primary reason adversarial examples are effective as protective perturbations in latent diffusion models is the distortion of their latent representations, as demonstrated through qualitative and quantitative experiments. We then propose the Contrastive Adversarial Training (CAT) utilizing lightweight adapters as an adaptive attack against these protection methods, highlighting their lack of robustness. Extensive experiments demonstrate that our CAT method significantly reduces the effectiveness of protective perturbations in customization, urging the community to reconsider and improve the robustness of existing protective perturbations. The code is available at https://github.com/senp98/CAT.

For agents

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

get_harvested_code_for_paper("2502.07225")
get_code_for_paper("2502.07225")
have("2502.07225")

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

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

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

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

Connect an agent — have() is free.