SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2407.04086 · 2024

Certifiably Robust Image Watermark

arXiv · PDF · Open in the Atlas

Code that ran

6 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; 1 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 4 failures of our instrument; 0 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/2407.04086.json · badge: /api/ran/2407.04086.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
zhengyuan-jiang/Watermark-Library canonical (classifier label)
classifier basis: census
6 ran · 0 no recorded run
FunctionStatusWhere it lives
CertifyRadius Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zhengyuan-jiang/Watermark-Library/multiclass.py
code served (permissive licence) · get_code("2216715425e7bae9")
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 float64, ndim 0, 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 scipy.stats import norm

def binary_search_compute_r(p_sn, p_ls, sigma_value, n):
    p_sn = min(p_sn, 1 - p_ls)
    lower_bound, upper_bound = (0.0, 10.0)
    if p_ls <= p_sn / n:
        return 0.0
    while np.abs(lower_bound - upper_bound) > 1e-05:
        searched_radius = (lower_bound + upper_bound) / 2.0
        if norm.cdf(norm.ppf(p_ls) - searched_radius / sigma_value) >= norm.cdf(norm.ppf(p_sn) + searched_radius / sigma_value) / n:
            lower_bound = searched_radius
        else:
            upper_bound = searched_radius
    return lower_bound

def CertifyRadius(ls, probability_array, topk, sigma_value):
    p_ls = probability_array[ls]
    probability_array[ls] = -1
    sorted_index = np.argsort(probability_array)[::-1]
    sorted_probability_topk = probability_array[sorted_index[0:topk]]
    p_sk = np.zeros([topk], dtype=np.float64)
    radius_array = np.zeros([topk], dtype=np.float64)
    for i in np.arange(sorted_probability_topk.shape[0]):
        p_sk[0:i + 1] += sorted_probability_topk[i]
    for i in np.arange(topk):
        radius_array[i] = binary_search_compute_r(p_sk[i], p_ls, sigma_value, topk - i)
    return np.amax(radius_array)

# Setup code to construct valid arguments
np.random.seed(0)

# Create probability array with 10 classes
# Values should be valid probabilities (between 0 and 1, summing close to 1)
probability_array = np.array([0.3, 0.25, 0.15, 0.1, 0.08, 0.05, 0.03, 0.02, 0.01, 0.01], dtype=np.float64)

# Label index (must be valid index into probability_array)
ls = 0

# Top-k parameter (should be less than or equal to length of probability_array)
topk = 3

# Sigma value for the Gaussian mechanism
sigma_value = 0.5

ARGS = {
    "ls": ls,
    "probability_array": probability_array,
    "topk": topk,
    "sigma_value": sigma_value
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
binary_search_compute_r Ran
ran, honoured the contract we drafted
zhengyuan-jiang/Watermark-Library/multiclass.py
code served (permissive licence) · get_code("34bff314753ce27e")
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 numpy as np
from scipy.stats import norm

# Analyze the function:
# - p_sn: float, probability value (used in comparisons and norm.ppf)
# - p_ls: float, probability value (used in comparisons and norm.ppf)
# - sigma_value: float, standard deviation (used in division)
# - n: int or float, a divisor (used in division and comparison)

# All parameters are scalars used in mathematical operations
# The function performs binary search with norm.cdf and norm.ppf operations

ARGS = {
    "p_sn": 0.3,      # probability value between 0 and 1
    "p_ls": 0.7,      # probability value between 0 and 1, should be > p_sn/n
    "sigma_value": 1.5,  # standard deviation, positive float
    "n": 2.0           # divisor, positive number
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — 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
multi_ci Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zhengyuan-jiang/Watermark-Library/multiclass.py
code served (permissive licence) · get_code("8860b430c8a625a2")
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 2, dtype family float, shape (4, 2) 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

# Create small counts array for the function
counts = np.array([10, 20, 15, 5])

# Create alpha parameter
alpha = 0.05

# Map all parameters to their values
ARGS = {
    'counts': counts,
    'alpha': alpha
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, statsmodels — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (4, 2) — shape (4, 2) 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
multi_ci Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zhengyuan-jiang/Watermark-Library/multilabel.py
code served (permissive licence) · get_code("a1abe9dac9a725cd")
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 2, dtype family float, shape (4, 2) 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

# Construct valid arguments for multi_ci function
counts = np.array([10, 20, 30, 15])  # Array of counts for multinomial proportions
alpha = 0.05  # Significance level

ARGS = {
    'counts': counts,
    'alpha': alpha
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, statsmodels — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (4, 2) — shape (4, 2) 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
reverse_sort Ran
ran, violated the contract we drafted
zhengyuan-jiang/Watermark-Library/multilabel.py
code served (permissive licence) · get_code("6bac40608a76196d")
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 (6,) 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

# reverse_sort takes a single parameter 'd' which should be a numpy array
# The function sorts it in descending order by negating, sorting ascending, and negating back
# We need a simple numpy array

d = np.array([3.5, 1.2, 4.8, 2.1, 0.9, 5.3])

ARGS = {
    'd': d
}
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 (6,) — shape (6,) 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
sum_ Ran
ran; our contract draft was wrong, not the code
zhengyuan-jiang/Watermark-Library/multilabel.py
code served (permissive licence) · get_code("c28e6ab92c0dbffe")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# - sum_(p, l, r) iterates from index (l-1) to (r-1) inclusive
# - accesses p[i] for each i in that range
# - sums up the elements
# - p needs to be indexable (list, array, tensor)
# - l and r are integers representing range boundaries

# Create a simple list of numbers
p = [10, 20, 30, 40, 50]

# l and r define the range [l-1, r)
# Let's use l=2, r=4 which gives indices 1, 2, 3
l = 2
r = 4

ARGS = {
    "p": p,
    "l": l,
    "r": r
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

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

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

Generative AI raises many societal concerns such as boosting disinformation and propaganda campaigns. Watermarking AI-generated content is a key technology to address these concerns and has been widely deployed in industry. However, watermarking is vulnerable to removal attacks and forgery attacks. In this work, we propose the first image watermarks with certified robustness guarantees against removal and forgery attacks. Our method leverages randomized smoothing, a popular technique to build certifiably robust classifiers and regression models. Our major technical contributions include extending randomized smoothing to watermarking by considering its unique characteristics, deriving the certified robustness guarantees, and designing algorithms to estimate them. Moreover, we extensively evaluate our image watermarks in terms of both certified and empirical robustness. Our code is available at \url{https://github.com/zhengyuan-jiang/Watermark-Library}.

For agents

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

get_harvested_code_for_paper("2407.04086")
get_code_for_paper("2407.04086")
have("2407.04086")

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

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

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

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

Connect an agent — have() is free.