SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2105.11645 · IJCAI · 2021

Feature Space Targeted Attacks by Statistic Alignment

Qilong Zhang, Jingkuan Song, Lianli Gao, Yaya Cheng, Xing Xu

arXiv · PDF · Open in the Atlas

Code that ran

4 of 4 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 0 have no contract verdict; 4 failures of our instrument; 0 no recorded run), measured 2026-11-23; 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/2105.11645.json · badge: /api/ran/2105.11645.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
yaya-cheng/PAA-GAA canonical (classifier label)
classifier basis: census
4 ran · 0 no recorded run
FunctionStatusWhere it lives
gaussian_kernel Ran
ran; our contract draft was wrong, not the code
yaya-cheng/PAA-GAA/fp_attack_den121.py
code served (permissive licence) · get_code("f783efd94b081745")
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 2, dtype family float, shape (2, 4) 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 a small tensor representing squared differences between vectors
# Shape: (2, 4) - batch of 2 samples, 4 dimensions
diff_ = torch.rand(2, 4)

# Gamma parameter for the Gaussian kernel (positive scalar)
gamma = 0.5

ARGS = {
    "diff_": diff_,
    "gamma": gamma,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
h Ran
ran; our contract draft was wrong, not the code
yaya-cheng/PAA-GAA/fp_attack_den121.py
code served (permissive licence) · get_code("bfb638b15b8dce5b")
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 2, dtype family float, shape (2, 4) 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)

# Analyzing the function h:
# - x_odd, y_odd, x_even, y_even: tensors used with operations like torch.sum(..., axis=2) and torch.sum(..., axis=1, keepdim=True)
#   This suggests they are 3D tensors with shape (batch, n, features)
# - n0: scalar parameter used in gamma computation

# Create small 3D tensors with distinct dimensions for clarity
batch_size = 2
n_samples = 4  # number of samples (odd and even entries)
feature_dim = 3  # feature dimension

x_odd = torch.randn(batch_size, n_samples, feature_dim)
y_odd = torch.randn(batch_size, n_samples, feature_dim)
x_even = torch.randn(batch_size, n_samples, feature_dim)
y_even = torch.randn(batch_size, n_samples, feature_dim)
n0 = 1.0

ARGS = {
    "x_odd": x_odd,
    "y_odd": y_odd,
    "x_even": x_even,
    "y_even": y_even,
    "n0": n0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
split_even_odd Ran
ran; our contract draft was wrong, not the code
yaya-cheng/PAA-GAA/fp_attack_den121.py
code served (permissive licence) · get_code("e499781079a1dcfa")
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. 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

torch.manual_seed(0)

# The function expects a tensor x with size() returning (n, M, c)
# It accesses dimensions and slices along dimension 1
# Create a 3D tensor with shape (batch=2, sequence=4, channels=3)
x = torch.randn(2, 4, 3)

ARGS = {
    "x": x
}
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 — a tuple output has no array shape of its own; none is 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
test Ran
ran; our contract draft was wrong, not the code
yaya-cheng/PAA-GAA/utils.py
code served (permissive licence) · get_code("a240eab698972155")
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. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Small model that takes input and produces class logits
class SimpleModel(nn.Module):
    def __init__(self, input_dim=4, num_classes=3):
        super().__init__()
        self.linear = nn.Linear(input_dim, num_classes)
    
    def forward(self, x):
        return self.linear(x)

# Create batch of adversarial examples (batch_size=2, feature_dim=4)
x_adv = torch.randn(2, 4)

# True labels
y = torch.tensor([0, 1])

# Target labels for attack
target_y = torch.tensor([2, 0])

# Create models
whitebox = SimpleModel(input_dim=4, num_classes=3)
blackbox1 = SimpleModel(input_dim=4, num_classes=3)
blackbox2 = SimpleModel(input_dim=4, num_classes=3)
blackbox3 = SimpleModel(input_dim=4, num_classes=3)

# Initialize lists for collecting successful adversarial examples
list_white = []
list_y = []

# Counters: [whitebox, blackbox1, blackbox2, blackbox3]
num = [0, 0, 0, 0]
utr = [0, 0, 0]  # universal transfer rate
tsuc = [0, 0, 0, 0]  # targeted success
ttr = [0, 0, 0]  # targeted transfer rate

ARGS = {
    'x_adv': x_adv,
    'y': y,
    'target_y': target_y,
    'whitebox': whitebox,
    'blackbox1': blackbox1,
    'blackbox2': blackbox2,
    'blackbox3': blackbox3,
    'list_white': list_white,
    'list_y': list_y,
    'num': num,
    'utr': utr,
    'tsuc': tsuc,
    'ttr': ttr
}
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 — a tuple output has no array shape of its own; none is 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

Also present in other papers' code

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

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

By adding human-imperceptible perturbations to images, DNNs can be easily fooled. As one of the mainstream methods, feature space targeted attacks perturb images by modulating their intermediate feature maps, for the discrepancy between the intermediate source and target features is minimized. However, the current choice of pixelwise Euclidean Distance to measure the discrepancy is questionable because it unreasonably imposes a spatial-consistency constraint on the source and target features. Intuitively, an image can be categorized as "cat" no matter the cat is on the left or right of the image. To address this issue, we propose to measure this discrepancy using statistic alignment. Specifically, we design two novel approaches called Pair-wise Alignment Attack and Global-wise Alignment Attack, which attempt to measure similarities between feature maps by high-order statistics with translation invariance. Furthermore, we systematically analyze the layerwise transferability with varied difficulties to obtain highly reliable attacks. Extensive experiments verify the effectiveness of our proposed method, and it outperforms the state-of-the-art algorithms by a large margin. Our code is publicly available at https://github.com/yaya-cheng/PAA-GAA.

For agents

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

get_harvested_code_for_paper("2105.11645")
get_code_for_paper("2105.11645")
have("2105.11645")

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

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

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

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

Connect an agent — have() is free.