SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2207.07797 · IJCAI · 2022

CARBEN: Composite Adversarial Robustness Benchmark

Pin-Yu Chen, Yun-Yun Tsai, Tsung-Yi Ho, Lei Hsiung

arXiv · PDF · Open in the Atlas

Code that ran

6 of 8 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 6 have no contract verdict; 0 failures of our instrument; 2 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/2207.07797.json · badge: /api/ran/2207.07797.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
IBM/composite-adv canonical (classifier label)
classifier basis not recorded on the link
6 ran · 2 no recorded run
FunctionStatusWhere it lives
eval_test Ran
ran on a synthesized input
IBM/composite-adv/train_cifar10.py
code served (permissive licence) · get_code("2ff09dbc55d1c1a2")
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. 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 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)

# Build a minimal model that accepts input and produces output
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)  # 4 input features, 3 output classes
    
    def forward(self, x):
        return self.linear(x)

model = SimpleModel()

# Build a test_loader as a list of (data, target) tuples
# Each batch has 2 samples, 4 features, and 3 classes
test_loader = [
    (torch.randn(2, 4), torch.randint(0, 3, (2,))),
    (torch.randn(2, 4), torch.randint(0, 3, (2,)))
]

# Add dataset attribute to test_loader for len(test_loader.dataset)
class SimpleDataset:
    def __init__(self, size):
        self.size = size
    
    def __len__(self):
        return self.size

test_loader_obj = test_loader
test_loader = type('TestLoader', (), {
    '__iter__': lambda self: iter(test_loader_obj),
    '__len__': lambda self: len(test_loader_obj),
    'dataset': SimpleDataset(4)  # 2 batches * 2 samples = 4 total
})()

# Build args with gpu set to None (CPU only)
class Args:
    def __init__(self):
        self.gpu = None

args = Args()

ARGS = {
    'model': model,
    'test_loader': test_loader,
    'args': args
}
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 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
list_type Ran
ran on a synthesized input
IBM/composite-adv/evaluate_model.py
code served (permissive licence) · get_code("fffa95de3f8df799")
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 int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

def list_type(s):
    return tuple(sorted(map(int, s.split(','))))

# The function takes a single parameter 's' which is a string
# It splits the string by commas, converts each part to int, sorts them, and returns as tuple
# We need to provide a valid string argument

ARGS = {
    's': '3,1,4,1,5,9,2,6'
}
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 tuple, ndim 1, dtype family int — 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
list_type Ran
ran on a synthesized input
IBM/composite-adv/train_imagenet.py
code served (permissive licence) · get_code("796140347cb0999f")
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 int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import argparse

def list_type(s):
    try:
        return tuple(map(int, s.split(',')))
    except:
        raise argparse.ArgumentTypeError('List must be (x,x,....,x) ')

# The function takes a single parameter 's' which should be a string
# It splits by comma and converts to integers, returning a tuple
# Test with a simple string argument

ARGS = {
    's': '1,2,3,4,5'
}
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 tuple, ndim 1, dtype family int — 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
make_madry_model Ran
ran on a synthesized input
IBM/composite-adv/composite_adv/utilities.py
code served (permissive licence) · get_code("a9a4dc0fe0402eef")
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 MinimalModel. 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
from unittest.mock import Mock, MagicMock, patch
import tempfile
import os

torch.manual_seed(0)

# Create a minimal checkpoint file
checkpoint_data = {
    'epoch': 10,
    'model': {
        'module.layer1.weight': torch.randn(8, 4),
        'module.layer1.bias': torch.randn(8),
        'module.layer2.weight': torch.randn(4, 8),
        'module.layer2.bias': torch.randn(4),
    }
}

# Create a temporary checkpoint file
temp_dir = tempfile.gettempdir()
checkpoint_path = os.path.join(temp_dir, 'test_checkpoint.pt')
torch.save(checkpoint_data, checkpoint_path)

# Create a mock AttackerModel that wraps a model
class MockAttackerModel(nn.Module):
    def __init__(self, model, dataset):
        super().__init__()
        self.model = model
        self.dataset = dataset
    
    def load_state_dict(self, state_dict, strict=True):
        # Simple implementation that accepts state_dict
        for key, value in state_dict.items():
            if hasattr(self.model, key):
                setattr(self.model, key, value)

# Create a minimal model
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.layer1 = nn.Linear(4, 8)
        self.layer2 = nn.Linear(8, 4)
    
    def forward(self, x):
        x = self.layer1(x)
        x = self.layer2(x)
        return x

# Mock the robustness module
mock_dataset = Mock()
mock_model = MinimalModel()
mock_dataset.get_model.return_value = mock_model

ARGS = {
    'arch': 'resnet50',
    'dataset_name': 'cifar10',
    'checkpoint_path': checkpoint_path,
}

# Patch the robustness imports
import sys
mock_robustness = MagicMock()
mock_robustness.datasets.DATASETS = {
    'cifar': Mock(return_value=mock_dataset),
    'imagenet': Mock(return_value=mock_dataset),
}
mock_robustness.attacker.AttackerModel = MockAttackerModel
sys.modules['robustness'] = mock_robustness
sys.modules['robustness.datasets'] = mock_robustness.datasets
sys.modules['robustness.attacker'] = mock_robustness.attacker
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
robustness, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MinimalModel — a MinimalModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MinimalModel 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
make_model Ran
ran on a synthesized input
IBM/composite-adv/composite_adv/utilities.py
code served (permissive licence) · get_code("a910d37c1ce20592")
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 ModelWrapper. 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)

# Create a minimal model that satisfies how make_model uses it
class MinimalModel(nn.Module):
    def __init__(self):
        super(MinimalModel, self).__init__()
        self.linear = nn.Linear(3, 10)
    
    def forward(self, x):
        return self.linear(x)

# Since the function uses relative imports (from . import models) that won't work,
# we need to use a dataset_name and arch combination that doesn't require those imports.
# The only combination that works without relative imports is imagenet + resnet50,
# since it uses torchvision.models.resnet50().

ARGS = {
    'arch': 'resnet50',
    'dataset_name': 'imagenet',
    'checkpoint_path': None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ModelWrapper — a ModelWrapper output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ModelWrapper 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
validate Ran
ran on a synthesized input
IBM/composite-adv/train_imagenet.py
code served (permissive licence) · get_code("2417ff185fb94b05")
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. 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 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)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc = nn.Linear(4, 10)
    
    def forward(self, x):
        return self.fc(x)

class SimpleArgs:
    def __init__(self):
        self.gpu = None
        self.print_freq = 1

val_loader = [
    (torch.randn(2, 4), torch.randint(0, 10, (2,))),
    (torch.randn(2, 4), torch.randint(0, 10, (2,))),
]

model = SimpleModel()
criterion = nn.CrossEntropyLoss()
args = SimpleArgs()

ARGS = {
    'val_loader': val_loader,
    'model': model,
    'criterion': criterion,
    'args': args,
}
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 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
make_dataloader Not yet run
unverified (harvested, no recorded run)
IBM/composite-adv/composite_adv/utilities.py
code served (permissive licence) · get_code("fb0186900a11e115")
How it ran

no invocation recorded.

train_ep Not yet run
unverified (harvested, no recorded run)
IBM/composite-adv/train_imagenet.py
code served (permissive licence) · get_code("0b57f21bdaa164ad")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 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 8 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

Prior literature on adversarial attack methods has mainly focused on attacking with and defending against a single threat model, e.g., perturbations bounded in Lp ball. However, multiple threat models can be combined into composite perturbations. One such approach, composite adversarial attack (CAA), not only expands the perturbable space of the image, but also may be overlooked by current modes of robustness evaluation. This paper demonstrates how CAA's attack order affects the resulting image, and provides real-time inferences of different models, which will facilitate users' configuration of the parameters of the attack level and their rapid evaluation of model prediction. A leaderboard to benchmark adversarial robustness against CAA is also introduced. Deep neural networks (DNNs) have transformed computer vision and have been used in many fields, including aviation, climate forecasting, and medicine, among others. However, when a DNN encounters carefully crafted images, it can exhibit various vulnerabilities: for instance, lack of robustness in the face of adversarial attack [Szegedy et al., 2013]. By utilizing adversarial attacks to optimize perturbations, one can intentionally derive a perturbed sample from a normal image, and make it imperceptible to human beings. In other words, despite the original and adversarial images looking very much alike to us, the latter can lead well-trained DNN models to make wrong predictions. Previous studies have sought to create bounded perturbations in a metric manner [Goodfellow et al., 2015;Chen et al., 2018]. Most such work has focused on ℓ p -norm perturbation (i.e., ℓ 1 , ℓ 2 , and ℓ ∞ ) and utilized gradient-based optimization -i.e., fast gradient sign method (FGSM), projected gradient descent (PGD), or C&W -to effectively generate the adversarial example. However, it is possible to extend adversarial perturbations beyond the ℓ p -norm bounds. For instance, Laidlaw et al. generated their perturbation in a perceptual distance metric [Laidlaw et al., 2021], and Hosseini and * Contact Author 1. Models and Images Selection 2. Craft Composite Perturbation (Real-time Rendering) 3. Real-time Model Inference 1. Adjustable Perturbation Blocks 2. Order Effect & Model Inference Visualization CARBEN

For agents

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

get_harvested_code_for_paper("2207.07797")
get_code_for_paper("2207.07797")
have("2207.07797")

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

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

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

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

Connect an agent — have() is free.