SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.12688 · ECCV · 2024

Robust-Wide: Robust Watermarking against Instruction-driven Image Editing

Jiwei Li, Jie Zhang, Tianwei Zhang, Runyi Hu, Ting Xu

arXiv · PDF · Open in the Atlas

Code that ran

16 of 19 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 8 have no contract verdict; 6 failures of our instrument; 3 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2402.12688.json · badge: /api/ran/2402.12688.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
hurunyi/robust-wide canonical (classifier label)
classifier basis: census
7 ran · 0 no recorded run
hurunyi/Robust-Wide community
Papers with Code archive
9 ran · 3 no recorded run
FunctionStatusWhere it lives
ConvTBNRelu Ran
ran on a synthesized input
hurunyi/Robust-Wide/model.py
code served (permissive licence) · get_code("210bfe7e3edfaf78")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float, shape (2, 4, 16, 16) 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
from torch import nn

class ConvTBNRelu(nn.Module):

    def __init__(self, channels_in, channels_out, stride=2):
        super(ConvTBNRelu, self).__init__()
        self.layers = nn.Sequential(nn.ConvTranspose2d(channels_in, channels_out, kernel_size=2, stride=stride, padding=0), nn.BatchNorm2d(channels_out), nn.ReLU(inplace=True))

    def forward(self, x):
        return self.layers(x)


INIT_ARGS = {
    'channels_in': 3,
    'channels_out': 4,
    'stride': 2,
}

ARGS = {
    'x': torch.randn(2, 3, 8, 8),
}

model = ConvTBNRelu(**INIT_ARGS)
output = model(**ARGS)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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, 16, 16) — shape (2, 4, 16, 16) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
DecoderResnet Ran
ran on a synthesized input
hurunyi/Robust-Wide/model.py
code served (permissive licence) · get_code("22ca713c2d2b31e2")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float, shape (2, 16) 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
import numpy as np

# Define the classes from the provided code
def GroupNorm32(channels):
    return nn.GroupNorm(32, channels)

class Interpolate(nn.Module):
    def __init__(self, size=None, scale_factor=None):
        super(Interpolate, self).__init__()
        self.function = F.interpolate
        self.size = size
        self.scale_factor = scale_factor

    def forward(self, x):
        return self.function(x, size=self.size, scale_factor=self.scale_factor)

class ResidualBlock(nn.Module):
    def __init__(self, in_channel, channel_num, dilation=1, group=1, norm_type='batch'):
        super(ResidualBlock, self).__init__()
        if norm_type == 'batch':
            normalization = nn.BatchNorm2d
        elif norm_type == 'instance':
            normalization = nn.InstanceNorm2d
        elif norm_type == 'group':
            normalization = GroupNorm32
        else:
            raise NotImplementedError
        self.conv1 = nn.Conv2d(in_channel, channel_num, 3, 1, padding=dilation, dilation=dilation, groups=group, bias=False)
        self.norm1 = normalization(channel_num)
        self.conv2 = nn.Conv2d(channel_num, channel_num, 3, 1, padding=dilation, dilation=dilation, groups=group, bias=False)
        self.norm2 = normalization(channel_num)

    def forward(self, x):
        y = F.relu(self.norm1(self.conv1(x)))
        y = self.norm2(self.conv2(y))
        return F.relu(x + y)

class DecoderResnet(nn.Module):
    def __init__(self, image_size=64, message_length=16, in_channels=3, norm_type='batch'):
        super(DecoderResnet, self).__init__()
        stride_blocks = int(np.log2(image_size // int(np.sqrt(message_length))))
        interpolate_scale = 1
        max_blocks_num = 6
        if stride_blocks > max_blocks_num:
            interpolate_scale = 2 ** (max_blocks_num - stride_blocks)
            stride_blocks = max_blocks_num
        if norm_type == 'batch':
            normalization = nn.BatchNorm2d
        elif norm_type == 'instance':
            normalization = nn.InstanceNorm2d
        elif norm_type == 'group':
            normalization = GroupNorm32
        else:
            raise NotImplementedError
        self.first_layers = nn.Sequential(nn.Conv2d(in_channels, 128, 3, 1, 1, bias=False), normalization(128), nn.ReLU(inplace=True))
        self.down_layers = nn.ModuleList([nn.Sequential(nn.Conv2d(128 * 2 ** i, 128 * 2 ** (i + 1), 3, 2, 1, bias=False), normalization(128 * 2 ** (i + 1)), nn.ReLU(inplace=True)) for i in range(stride_blocks)])
        self.down_layers.append(nn.Sequential(nn.Conv2d(128 * 2 ** stride_blocks, 128, 3, 1, 1, bias=False), normalization(128), nn.ReLU(inplace=True)))
        if interpolate_scale != 1:
            self.down_layers.append(Interpolate(scale_factor=interpolate_scale))
        self.keep_layers = nn.Sequential(ResidualBlock(128, 128, dilation=2, norm_type=norm_type), ResidualBlock(128, 128, dilation=2, norm_type=norm_type), ResidualBlock(128, 128, dilation=2, norm_type=norm_type), ResidualBlock(128, 128, dilation=2, norm_type=norm_type), ResidualBlock(128, 128, dilation=4, norm_type=norm_type), ResidualBlock(128, 128, dilation=4, norm_type=norm_type), ResidualBlock(128, 128, dilation=4, norm_type=norm_type), ResidualBlock(128, 128, dilation=4, norm_type=norm_type), ResidualBlock(128, 128, dilation=1, norm_type=norm_type))
        self.final_layers = nn.Sequential(nn.Conv2d(128, 1, 3, 1, 1, bias=False), normalization(1) if norm_type != 'group' else nn.GroupNorm(1, 1), nn.ReLU(inplace=True))

    def forward(self, x):
        y = self.first_layers(x)
        for down_layer in self.down_layers:
            y = down_layer(y)
        y = self.keep_layers(y)
        y = self.final_layers(y)
        y = y.view(y.shape[0], -1)
        return y

INIT_ARGS = {
    'image_size': 64,
    'message_length': 16,
    'in_channels': 3,
    'norm_type': 'batch'
}

ARGS = {
    'x': torch.randn(2, 3, 64, 64)
}

if __name__ == '__main__':
    model = DecoderResnet(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output: {output}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 16) — shape (2, 16) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
DoubleConv Ran
ran on a synthesized input
hurunyi/Robust-Wide/model.py
code served (permissive licence) · get_code("3bc37018ec7a5a7e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float, shape (2, 4, 16, 16) 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
from torch import nn

def GroupNorm32(channels):
    return nn.GroupNorm(32, channels)

class DoubleConv(nn.Module):

    def __init__(self, in_channels, out_channels, mid_channels=None, norm_type='batch'):
        super().__init__()
        if not mid_channels:
            mid_channels = out_channels
        if norm_type == 'batch':
            normalization = nn.BatchNorm2d
        elif norm_type == 'instance':
            normalization = nn.InstanceNorm2d
        elif norm_type == 'group':
            normalization = GroupNorm32
        else:
            raise NotImplementedError
        self.double_conv = nn.Sequential(nn.Conv2d(in_channels, mid_channels, kernel_size=3, padding=1, bias=False), normalization(mid_channels), nn.ReLU(inplace=True), nn.Conv2d(mid_channels, out_channels, kernel_size=3, padding=1, bias=False), normalization(out_channels), nn.ReLU(inplace=True))

    def forward(self, x):
        return self.double_conv(x)


INIT_ARGS = {
    'in_channels': 3,
    'out_channels': 4,
    'mid_channels': 8,
    'norm_type': 'batch'
}

ARGS = {
    'x': torch.randn(2, 3, 16, 16)
}

model = DoubleConv(**INIT_ARGS)
output = model(**ARGS)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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, 16, 16) — shape (2, 4, 16, 16) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
Down Ran
ran on a synthesized input
hurunyi/Robust-Wide/model.py
code served (permissive licence) · get_code("9eca04b186a73e7b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float, shape (2, 8, 8, 10) 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
from torch import nn

class GroupNorm32(nn.Module):
    def __init__(self, channels):
        super().__init__()
        self.norm = nn.GroupNorm(32, channels)
    
    def forward(self, x):
        return self.norm(x)

class DoubleConv(nn.Module):

    def __init__(self, in_channels, out_channels, mid_channels=None, norm_type='batch'):
        super().__init__()
        if not mid_channels:
            mid_channels = out_channels
        if norm_type == 'batch':
            normalization = nn.BatchNorm2d
        elif norm_type == 'instance':
            normalization = nn.InstanceNorm2d
        elif norm_type == 'group':
            normalization = GroupNorm32
        else:
            raise NotImplementedError
        self.double_conv = nn.Sequential(nn.Conv2d(in_channels, mid_channels, kernel_size=3, padding=1, bias=False), normalization(mid_channels), nn.ReLU(inplace=True), nn.Conv2d(mid_channels, out_channels, kernel_size=3, padding=1, bias=False), normalization(out_channels), nn.ReLU(inplace=True))

    def forward(self, x):
        return self.double_conv(x)

class Down(nn.Module):

    def __init__(self, in_channels, out_channels, norm_type='batch'):
        super().__init__()
        self.maxpool_conv = nn.Sequential(nn.MaxPool2d(2), DoubleConv(in_channels, out_channels, norm_type=norm_type))

    def forward(self, x):
        return self.maxpool_conv(x)

INIT_ARGS = {
    'in_channels': 3,
    'out_channels': 8,
    'norm_type': 'batch'
}

ARGS = {
    'x': torch.randn(2, 3, 16, 20)
}

if __name__ == '__main__':
    model = Down(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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, 8, 8, 10) — shape (2, 8, 8, 10) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
ExpandNet Ran
ran on a synthesized input
hurunyi/Robust-Wide/model.py
code served (permissive licence) · get_code("0c1e41d36661e780")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float, shape (2, 4, 32, 32) 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
from torch import nn

class ConvTBNRelu(nn.Module):

    def __init__(self, channels_in, channels_out, stride=2):
        super(ConvTBNRelu, self).__init__()
        self.layers = nn.Sequential(nn.ConvTranspose2d(channels_in, channels_out, kernel_size=2, stride=stride, padding=0), nn.BatchNorm2d(channels_out), nn.ReLU(inplace=True))

    def forward(self, x):
        return self.layers(x)

class ExpandNet(nn.Module):

    def __init__(self, in_channels, out_channels, blocks):
        super(ExpandNet, self).__init__()
        layers = [ConvTBNRelu(in_channels, out_channels)] if blocks != 0 else []
        for _ in range(blocks - 1):
            layer = ConvTBNRelu(out_channels, out_channels)
            layers.append(layer)
        self.layers = nn.Sequential(*layers)

    def forward(self, x):
        return self.layers(x)


INIT_ARGS = {
    'in_channels': 3,
    'out_channels': 4,
    'blocks': 2
}

ARGS = {
    'x': torch.randn(2, 3, 8, 8)
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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, 32, 32) — shape (2, 4, 32, 32) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
GroupNorm32 Ran
ran; our contract draft was wrong, not the code
hurunyi/Robust-Wide/model.py
code served (permissive licence) · get_code("90ffc7b3f94bda72")
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 GroupNorm. 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)

# GroupNorm32 takes one parameter: channels
# It returns nn.GroupNorm(32, channels)
# We need to provide a valid number of channels
# GroupNorm requires: num_groups divides num_channels
# Here num_groups=32, so channels must be divisible by 32
# Let's use 64 channels (divisible by 32)

ARGS = {
    "channels": 64
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type GroupNorm — a GroupNorm output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a GroupNorm 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
Interpolate Ran
ran on a synthesized input
hurunyi/Robust-Wide/model.py
code served (permissive licence) · get_code("2d6fcc19b89b20d5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float, shape (2, 3, 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
from torch import nn
import torch.nn.functional as F

class Interpolate(nn.Module):

    def __init__(self, size=None, scale_factor=None):
        super(Interpolate, self).__init__()
        self.function = F.interpolate
        self.size = size
        self.scale_factor = scale_factor

    def forward(self, x):
        return self.function(x, size=self.size, scale_factor=self.scale_factor)


INIT_ARGS = {
    'size': (8, 8),
    'scale_factor': None
}

ARGS = {
    'x': torch.randn(2, 3, 4, 4)
}

if __name__ == '__main__':
    model = Interpolate(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Input shape: {ARGS['x'].shape}")
    print(f"Output shape: {output.shape}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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, 3, 8, 8) — shape (2, 3, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
ResidualBlock Ran
ran on a synthesized input
hurunyi/Robust-Wide/model.py
code served (permissive licence) · get_code("fb889d8e2f339b39")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) 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
from torch import nn
import torch.nn.functional as F

def GroupNorm32(channels):
    return nn.GroupNorm(32, channels)

class ResidualBlock(nn.Module):

    def __init__(self, in_channel, channel_num, dilation=1, group=1, norm_type='batch'):
        super(ResidualBlock, self).__init__()
        if norm_type == 'batch':
            normalization = nn.BatchNorm2d
        elif norm_type == 'instance':
            normalization = nn.InstanceNorm2d
        elif norm_type == 'group':
            normalization = GroupNorm32
        else:
            raise NotImplementedError
        self.conv1 = nn.Conv2d(in_channel, channel_num, 3, 1, padding=dilation, dilation=dilation, groups=group, bias=False)
        self.norm1 = normalization(channel_num)
        self.conv2 = nn.Conv2d(channel_num, channel_num, 3, 1, padding=dilation, dilation=dilation, groups=group, bias=False)
        self.norm2 = normalization(channel_num)

    def forward(self, x):
        y = F.relu(self.norm1(self.conv1(x)))
        y = self.norm2(self.conv2(y))
        return F.relu(x + y)


INIT_ARGS = {
    'in_channel': 4,
    'channel_num': 4,
    'dilation': 1,
    'group': 1,
    'norm_type': 'batch'
}

ARGS = {
    'x': torch.randn(2, 4, 8, 8)
}

if __name__ == '__main__':
    block = ResidualBlock(**INIT_ARGS)
    output = block(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Expected shape: {ARGS['x'].shape}")
    assert output.shape == ARGS['x'].shape, "Output shape mismatch"
    print("Success!")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
UNet Ran
ran on a synthesized input
hurunyi/Robust-Wide/model.py
code served (permissive licence) · get_code("09d83aed81bca74e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float, shape (2, 3, 64, 64) 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

def GroupNorm32(channels):
    return nn.GroupNorm(32, channels)

class DoubleConv(nn.Module):
    def __init__(self, in_channels, out_channels, mid_channels=None, norm_type='batch'):
        super().__init__()
        if not mid_channels:
            mid_channels = out_channels
        if norm_type == 'batch':
            normalization = nn.BatchNorm2d
        elif norm_type == 'instance':
            normalization = nn.InstanceNorm2d
        elif norm_type == 'group':
            normalization = GroupNorm32
        else:
            raise NotImplementedError
        self.double_conv = nn.Sequential(
            nn.Conv2d(in_channels, mid_channels, kernel_size=3, padding=1, bias=False),
            normalization(mid_channels),
            nn.ReLU(inplace=True),
            nn.Conv2d(mid_channels, out_channels, kernel_size=3, padding=1, bias=False),
            normalization(out_channels),
            nn.ReLU(inplace=True)
        )

    def forward(self, x):
        return self.double_conv(x)

class Down(nn.Module):
    def __init__(self, in_channels, out_channels, norm_type='batch'):
        super().__init__()
        self.maxpool_conv = nn.Sequential(
            nn.MaxPool2d(2),
            DoubleConv(in_channels, out_channels, norm_type=norm_type)
        )

    def forward(self, x):
        return self.maxpool_conv(x)

class OutConv(nn.Module):
    def __init__(self, in_channels, out_channels):
        super(OutConv, self).__init__()
        self.conv = nn.Conv2d(in_channels, out_channels, kernel_size=1)

    def forward(self, x):
        return self.conv(x)

class Up(nn.Module):
    def __init__(self, in_channels, out_channels, bilinear=True, norm_type='batch'):
        super().__init__()
        if bilinear:
            self.up = nn.Upsample(scale_factor=2, mode='bilinear', align_corners=True)
            self.conv = DoubleConv(in_channels, out_channels, in_channels // 2, norm_type=norm_type)
        else:
            self.up = nn.ConvTranspose2d(in_channels, in_channels // 2, kernel_size=2, stride=2)
            self.conv = DoubleConv(in_channels, out_channels, norm_type=norm_type)

    def forward(self, x1, x2):
        x1 = self.up(x1)
        diffY = x2.size()[2] - x1.size()[2]
        diffX = x2.size()[3] - x1.size()[3]
        x1 = F.pad(x1, [diffX // 2, diffX - diffX // 2, diffY // 2, diffY - diffY // 2])
        x = torch.cat([x2, x1], dim=1)
        return self.conv(x)

class UNet(nn.Module):
    def __init__(self, n_channels=4, n_classes=3, bilinear=False, norm_type='batch'):
        super().__init__()
        self.n_channels = n_channels
        self.n_classes = n_classes
        self.bilinear = bilinear
        self.inc = DoubleConv(n_channels, 64, norm_type=norm_type)
        self.down1 = Down(64, 128, norm_type=norm_type)
        self.down2 = Down(128, 256, norm_type=norm_type)
        self.down3 = Down(256, 512, norm_type=norm_type)
        factor = 2 if bilinear else 1
        self.down4 = Down(512, 1024 // factor, norm_type=norm_type)
        self.up1 = Up(1024, 512 // factor, bilinear, norm_type=norm_type)
        self.up2 = Up(512, 256 // factor, bilinear, norm_type=norm_type)
        self.up3 = Up(256, 128 // factor, bilinear, norm_type=norm_type)
        self.up4 = Up(128, 64, bilinear, norm_type=norm_type)
        self.outc = OutConv(64, n_classes)

    def forward(self, x):
        x1 = self.inc(x)
        x2 = self.down1(x1)
        x3 = self.down2(x2)
        x4 = self.down3(x3)
        x5 = self.down4(x4)
        x = self.up1(x5, x4)
        x = self.up2(x, x3)
        x = self.up3(x, x2)
        x = self.up4(x, x1)
        x = self.outc(x)
        return x

INIT_ARGS = {
    'n_channels': 4,
    'n_classes': 3,
    'bilinear': False,
    'norm_type': 'batch'
}

ARGS = {
    'x': torch.randn(2, 4, 64, 64)
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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, 3, 64, 64) — shape (2, 3, 64, 64) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
convert_to_np Ran
ran; our contract draft was wrong, not the code
hurunyi/robust-wide/dataset.py
code served (permissive licence) · get_code("694ad5c8799b9dea")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 3, dtype family int, shape (3, 32, 32) 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 PIL import Image

# Create a small PIL Image object
img_array = np.random.randint(0, 256, (64, 64, 3), dtype=np.uint8)
image = Image.fromarray(img_array, mode='RGB')

# Define arguments
ARGS = {
    'image': image,
    'resolution': 32
}
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 ndarray, ndim 3, dtype family int, shape (3, 32, 32) — shape (3, 32, 32) 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
decoded_message_error_rate Ran
ran; our contract draft was wrong, not the code
hurunyi/robust-wide/utils.py
code served (permissive licence) · get_code("4c738e5fa93f3953")
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

torch.manual_seed(0)

# Create two tensors with float values between 0 and 1
# These will be compared after thresholding at 0.5
message = torch.tensor([0.1, 0.6, 0.3, 0.9], dtype=torch.float32)
decoded_message = torch.tensor([0.2, 0.55, 0.4, 0.85], dtype=torch.float32)

ARGS = {
    "message": message,
    "decoded_message": decoded_message,
}
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
decoded_message_error_rate_batch Ran
ran; our contract draft was wrong, not the code
hurunyi/robust-wide/utils.py
code served (permissive licence) · get_code("312ff076fac287f7")
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

torch.manual_seed(0)

# Create tiny batch of messages and decoded messages
# batch_size = 2, message_length = 4
messages = [
    torch.rand(4),
    torch.rand(4)
]

decoded_messages = [
    torch.rand(4),
    torch.rand(4)
]

ARGS = {
    "messages": messages,
    "decoded_messages": decoded_messages
}
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
load_image Ran
ran; our contract draft was wrong, not the code
hurunyi/robust-wide/evaluate.py
code served (permissive licence) · get_code("e093542bc06414d7")
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 (1, 3, 256, 256) 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
from PIL import Image
import numpy as np

torch.manual_seed(0)

# Create a small test image as a PIL Image object
img_array = np.random.randint(0, 256, (64, 64, 3), dtype=np.uint8)
pil_img = Image.fromarray(img_array, mode='RGB')

ARGS = {
    'imgname': pil_img,
    'target_size': 256
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision — 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 (1, 3, 256, 256) — shape (1, 3, 256, 256) 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
preprocess_images Ran
ran, honoured the contract we drafted
hurunyi/robust-wide/dataset.py
code served (permissive licence) · get_code("6bcd7bd2081d9725")
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 3, dtype family float, shape (6, 16, 16) 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 torch
from torchvision import transforms
from PIL import Image

torch.manual_seed(0)

# Create a small stand-in example dict with PIL Images
# The function expects examples['original_image'] to be a list of PIL Images
def create_dummy_image(size=32):
    """Create a small dummy PIL Image"""
    img_array = np.random.randint(0, 256, (size, size, 3), dtype=np.uint8)
    return Image.fromarray(img_array, mode='RGB')

examples = {
    'original_image': [create_dummy_image(32), create_dummy_image(32)]
}

image_size = 16

ARGS = {
    'examples': examples,
    'image_size': image_size,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (6, 16, 16) — shape (6, 16, 16) 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
preprocess_train Ran
ran; our contract draft was wrong, not the code
hurunyi/robust-wide/dataset.py
code served (permissive licence) · get_code("7ba441437913fb8d")
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 dict. 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 numpy as np
import torch
from torchvision import transforms
from PIL import Image

torch.manual_seed(0)

# Create small PIL images for testing
def create_dummy_image(size=32):
    return Image.new('RGB', (size, size), color=(73, 109, 137))

# Create examples dict with required fields
examples = {
    'original_image': [create_dummy_image(36), create_dummy_image(36)],
    'edit_prompt': ['a cat', 'a dog']
}

image_size = 32

ARGS = {
    'examples': examples,
    'image_size': image_size
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
str2bool Ran
ran, violated the contract we drafted
hurunyi/robust-wide/utils.py
code served (permissive licence) · get_code("7c508037b40522af")
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 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 str2bool(v):
    if isinstance(v, bool):
        return v
    if v.lower() in ('yes', 'true', 't', 'y', '1'):
        return True
    elif v.lower() in ('no', 'false', 'f', 'n', '0'):
        return False
    else:
        raise argparse.ArgumentTypeError('Boolean value expected.')

# Test cases for str2bool
ARGS = {
    'v': 'true'  # string input that should convert to boolean
}
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 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
EncoderUnet Not yet run
unverified (harvested, no recorded run)
hurunyi/Robust-Wide/model.py
code served (permissive licence) · get_code("61d082d3fdf98155")
How it ran

no invocation recorded.

Up Not yet run
unverified (harvested, no recorded run)
hurunyi/Robust-Wide/model.py
code served (permissive licence) · get_code("51e0fb9e015af2d3")
How it ran

no invocation recorded.

WatermarkModel Not yet run
unverified (harvested, no recorded run)
hurunyi/Robust-Wide/model.py
code served (permissive licence) · get_code("a1bb128109808e32")
How it ran

no invocation recorded.

Also present in other papers' code

Of 19 samples lifted from this paper's linked repositories, 19 carry a function identity and 0 do not. Of the 19 distinct functions with an identity, 8 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 1 the same month, 7 later) and 11 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
str2bool 175 other papers
104 dated earlier, 8 the same month, 62 later, 1 same year, order not determinable · 2 only as an assembly brick
1406.6247 (2014-06)
Recurrent Models of Visual Attention
1603.09382 (2016-03)
Deep Networks with Stochastic Depth
1710.10196 (2017-10)
Progressive Growing of GANs for Improved Quality, Stability, and Variation
and 172 more not named here
GroupNorm32
brick of this paper's assembly: helper
2 other papers
1 dated earlier, 1 later
2401.14404 (2024-01)
Deconstructing Denoising Diffusion Models for Self-Supervised Learning
2605.26702 (2026-05)
Rotation-Invariant Spherical Watermarking via Third-Order SO(3) Representation Coupling
ConvTBNRelu
brick of this paper's assembly: helper
1 other paper
1 later
2601.16473 (2026-01)
DEMARK: A Query-Free Black-Box Attack on Deepfake Watermarking Defenses
DoubleConv
brick of this paper's assembly: helper
1 other paper
1 later
2504.12739 (2025-04)
Mask Image Watermarking
Down
brick of this paper's assembly: helper
1 other paper
1 later
2504.12739 (2025-04)
Mask Image Watermarking
UNet
brick of this paper's assembly: helper
1 other paper
1 later
2504.12739 (2025-04)
Mask Image Watermarking
Up
brick of this paper's assembly: helper
1 other paper
1 later
2504.12739 (2025-04)
Mask Image Watermarking
convert_to_np 1 other paper
1 dated earlier
2312.04552 (2023-12)
Generating Illustrated Instructions

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

Instruction-driven image editing allows users to quickly edit an image according to text instructions in a forward pass. Nevertheless, malicious users can easily exploit this technique to create fake images, which could cause a crisis of trust and harm the rights of the original image owners. Watermarking is a common solution to trace such malicious behavior. Unfortunately, instruction-driven image editing can significantly change the watermarked image at the semantic level, making current state-of-the-art watermarking methods ineffective. To remedy it, we propose Robust-Wide, the first robust watermarking methodology against instruction-driven image editing. Specifically, we follow the classic structure of deep robust watermarking, consisting of the encoder, noise layer, and decoder. To achieve robustness against semantic distortions, we introduce a novel Partial Instruction-driven Denoising Sampling Guidance (PIDSG) module, which consists of a large variety of instruction injections and substantial modifications of images at different semantic levels. With PIDSG, the encoder tends to embed the watermark into more robust and semantic-aware areas, which remains in existence even after severe image editing. Experiments demonstrate that Robust-Wide can effectively extract the watermark from the edited image with a low bit error rate of nearly 2.6% for 64-bit watermark messages. Meanwhile, it only induces a neglectable influence on the visual quality and editability of the original images. Moreover, Robust-Wide holds general robustness against different sampling configurations and other popular image editing methods such as ControlNet-InstructPix2Pix, MagicBrush, Inpainting, and DDIM Inversion. Codes and models are available at https://github.com/hurunyi/Robust-Wide.

For agents

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

get_harvested_code_for_paper("2402.12688")
get_code_for_paper("2402.12688")
have("2402.12688")

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

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

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

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

Connect an agent — have() is free.