SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · Zhang_Towards_Adversarial_Robustness_via_Debiased_High-Confidence_Logit_Alignment_ICCV_2025_paper · ICCV · 2025

Towards Adversarial Robustness via Debiased High-Confidence Logit Alignment

Zhiming Luo, Shaozi Li, Juanjuan Weng, Kejia Zhang

Open in the Atlas

Code that ran

16 of 22 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, 1 violated it and 10 have no contract verdict; 5 failures of our instrument; 6 no recorded run), measured 2026-11-24; 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/Zhang_Towards_Adversarial_Robustness_via_Debiased_High-Confidence_Logit_Alignment_ICCV_2025_paper.json · badge: /api/ran/Zhang_Towards_Adversarial_Robustness_via_Debiased_High-Confidence_Logit_Alignment_ICCV_2025_paper.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
KejiaZhang-Robust/DHAT canonical (classifier label)
classifier basis: census
16 ran · 6 no recorded run
FunctionStatusWhere it lives
CW_loss Ran
ran on a synthesized input
KejiaZhang-Robust/DHAT/attacks/cw.py
code served (permissive licence) · get_code("722650e26f643d3b")
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 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)

# Construct arguments for CW_loss function
# Parameters: x (logits tensor), y (target labels tensor)

batch_size = 2
num_classes = 4

# x: logits tensor of shape (batch_size, num_classes)
x = torch.randn(batch_size, num_classes)

# y: target class indices of shape (batch_size,)
# Values should be in range [0, num_classes)
y = torch.tensor([0, 2])

ARGS = {
    "x": x,
    "y": y
}
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 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
LabelSmoothLoss Ran
ran; our contract draft was wrong, not the code
KejiaZhang-Robust/DHAT/utils_train.py
code served (permissive licence) · get_code("b3be2a141f44451b")
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 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
import torch.nn.functional as F

torch.manual_seed(0)

# Create a small batch with 2 samples, 4 classes
batch_size = 2
num_classes = 4

# input: logits from model, shape (batch_size, num_classes)
input = torch.randn(batch_size, num_classes)

# target: label smoothed distribution, shape (batch_size, num_classes)
# Typically this would be one-hot encoded labels smoothed with uniform distribution
target = torch.zeros(batch_size, num_classes)
target[0, 1] = 0.9  # First sample, class 1 with smoothing
target[0, :] += 0.1 / num_classes  # Add uniform smoothing
target[1, 2] = 0.9  # Second sample, class 2 with smoothing
target[1, :] += 0.1 / num_classes  # Add uniform smoothing

ARGS = {
    "input": input,
    "target": target,
}
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 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
Normalization Ran
ran; our contract draft was wrong, not the code
KejiaZhang-Robust/DHAT/models/utils.py
code served (permissive licence) · get_code("6f09136a784ff386")
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 (2, 4, 3, 5) as a later run recorded it. 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, 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 small test tensors
# data: batch_size=2, channels=4, height=3, width=5
data = torch.randn(2, 4, 3, 5)

# mean: 4 channels
mean = torch.randn(4)

# std: 4 channels
std = torch.abs(torch.randn(4)) + 0.1  # ensure positive values

ARGS = {
    'data': data,
    'mean': mean,
    'std': std
}
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 4, dtype family float, shape (2, 4, 3, 5) — shape (2, 4, 3, 5) 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
WRN28_10 Ran
ran; our contract draft was wrong, not the code
KejiaZhang-Robust/DHAT/models/wrnnet.py
code served (permissive licence) · get_code("d893ddbba428903a")
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 WideResNet. 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
import math

torch.manual_seed(0)

ARGS = {
    "Num_class": 10,
    "Norm": False,
    "norm_mean": None,
    "norm_std": None,
}
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 WideResNet — a WideResNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a WideResNet 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
adjust_learning_rate Ran
ran on a synthesized input
KejiaZhang-Robust/DHAT/utils_train.py
code served (permissive licence) · get_code("bb0a6e1080e1d6c4")
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
import torch.nn as nn
import torch.optim as optim

torch.manual_seed(0)

# Create a simple model
model = nn.Linear(4, 3)

# Create an optimizer
optimizer = optim.SGD(model.parameters(), lr=0.1)

# Define arguments for adjust_learning_rate
ARGS = {
    'learning_rate': 0.1,
    'optimizer': optimizer,
    'epoch': 50,
    'change_epoch1': 100,
    'change_epoch2': 105
}
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
cw_Linf_attack Ran
ran on a synthesized input
KejiaZhang-Robust/DHAT/attacks/cw.py
code served (permissive licence) · get_code("28c934b02808a5e6")
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
import torch.nn as nn
from torch import Tensor

torch.manual_seed(0)

# Define a simple model that takes input and outputs 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 model
model = SimpleModel(input_dim=4, num_classes=3)

# Create input tensor: batch_size=2, input_dim=4
x = torch.randn(2, 4)

# Create target labels: batch_size=2, labels in range [0, 2]
y = torch.tensor([0, 2])

# Attack parameters
epsilon = 0.1
alpha = 0.01
iters = 5

ARGS = {
    "model": model,
    "x": x,
    "y": y,
    "epsilon": epsilon,
    "alpha": alpha,
    "iters": iters
}
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
eot_pgd_attack Ran
ran on a synthesized input
KejiaZhang-Robust/DHAT/attacks/eot_pgd.py
code served (permissive licence) · get_code("426f285a31ef641a")
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
import torch.nn as nn

torch.manual_seed(0)

# Create a simple model that takes input and produces 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 model instance
model = SimpleModel(input_dim=4, num_classes=3)

# Create input tensor: batch_size=2, input_dim=4
x = torch.rand(2, 4)

# Create target labels: batch_size=2, with class indices in range [0, 2]
y = torch.tensor([0, 2])

# Attack parameters
epsilon = 0.3
alpha = 0.1
iters = 5
eot = 2

ARGS = {
    "model": model,
    "x": x,
    "y": y,
    "epsilon": epsilon,
    "alpha": alpha,
    "iters": iters,
    "eot": eot
}
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
eot_pgd_attack_l2 Ran
ran on a synthesized input
KejiaZhang-Robust/DHAT/attacks/eot_pgd.py
code served (permissive licence) · get_code("855f7dd3b708c25b")
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 (2, 1, 2, 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 torch
import torch.nn as nn

torch.manual_seed(0)

# Define a minimal model that takes input and produces logits
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)  # input dim 4, output dim 3 (3 classes)
    
    def forward(self, x):
        # x shape: (batch, 4) or (batch, 1, 2, 2) flattened to (batch, 4)
        batch_size = x.shape[0]
        x_flat = x.view(batch_size, -1)
        return self.linear(x_flat)

# Create model instance
model = SimpleModel()

# Create batch of images: batch_size=2, 1 channel, 2x2 spatial dims
# This gives shape (2, 1, 2, 2) which flattens to (2, 4)
x = torch.rand(2, 1, 2, 2)

# Create labels: batch_size=2, with class indices in range [0, 2]
y = torch.tensor([0, 1])

# Attack parameters
epsilon = 0.3
alpha = 0.1
iters = 2
eot = 2

ARGS = {
    "model": model,
    "x": x,
    "y": y,
    "epsilon": epsilon,
    "alpha": alpha,
    "iters": iters,
    "eot": eot,
}
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 4, dtype family float, shape (2, 1, 2, 2) — shape (2, 1, 2, 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
evaluate_normal Ran
ran on a synthesized input
KejiaZhang-Robust/DHAT/attacks/normal.py
code served (permissive licence) · get_code("ef3f7d3b8e5b0e20")
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. 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, 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
from torch.utils.data import DataLoader

torch.manual_seed(0)

# Create a minimal neural network that takes inputs and outputs class predictions
class SimpleNet(nn.Module):
    def __init__(self, input_dim=4, num_classes=3):
        super().__init__()
        self.fc1 = nn.Linear(input_dim, 8)
        self.fc2 = nn.Linear(8, num_classes)
    
    def forward(self, x):
        x = torch.relu(self.fc1(x))
        x = self.fc2(x)
        return x

# Create a simple test loader
# Each batch contains (inputs, targets) tuples
inputs = torch.randn(2, 4)  # batch_size=2, input_dim=4
targets = torch.tensor([0, 2])  # 2 samples, class labels
test_data = [(inputs, targets)]
test_loader = test_data

# Create model instance
net = SimpleNet(input_dim=4, num_classes=3)

ARGS = {
    'net': net,
    'test_loader': test_loader
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, tqdm — 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
extract_subset Ran
ran on a synthesized input
KejiaZhang-Robust/DHAT/utils.py
code served (permissive licence) · get_code("09f021c29f862dec")
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 Subset. 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 random
from torch.utils.data import Dataset

torch.manual_seed(0)

class DummyDataset(Dataset):
    def __init__(self, size=10):
        self.size = size
    
    def __len__(self):
        return self.size
    
    def __getitem__(self, idx):
        return torch.randn(4), idx

dataset = DummyDataset(size=10)

ARGS = {
    "dataset": dataset,
    "num_subset": 5,
    "random_subset": True
}
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 Subset — a Subset 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
get_2d_projection Ran
ran, violated the contract we drafted
KejiaZhang-Robust/DHAT/models/imagenet_model.py
code served (permissive licence) · get_code("47b385e3a8e7a62a")
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 float, shape (2, 3, 5) 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 a small activation batch
# The function expects: activation_batch with shape (batch_size, channels, height, width)
# or similar multi-dimensional structure where:
# - First iteration: activations.shape[0] is channels
# - activations.shape[1:] is the spatial/remaining dimensions

batch_size = 2
channels = 4
height = 3
width = 5

# Create activation batch with some NaN values to test NaN handling
activation_batch = np.random.randn(batch_size, channels, height, width).astype(np.float32)
activation_batch[0, 1, 0, 0] = np.nan  # Add a NaN to test the replacement

ARGS = {
    "activation_batch": activation_batch
}
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 3, dtype family float, shape (2, 3, 5) — shape (2, 3, 5) 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_txt Ran
ran; our contract draft was wrong, not the code
KejiaZhang-Robust/DHAT/utils.py
code served (permissive licence) · get_code("72e987352ce9827d")
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 list, ndim 1, 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 tempfile
import os

# Create a temporary text file with some content
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test.txt")

with open(temp_file, 'w') as f:
    f.write("line 1\n")
    f.write("line 2\n")
    f.write("line 3\n")

ARGS = {
    "path": temp_file
}
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 list, ndim 1, dtype family float — a list 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
pgd_attack Ran
ran on a synthesized input
KejiaZhang-Robust/DHAT/attacks/pgd.py
code served (permissive licence) · get_code("d101fe77bd873ee2")
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
import torch.nn as nn
from torch import Tensor

torch.manual_seed(0)

# Define a simple model that takes input and produces logits for classification
class SimpleClassifier(nn.Module):
    def __init__(self, input_dim: int, num_classes: int):
        super().__init__()
        self.fc = nn.Linear(input_dim, num_classes)
    
    def forward(self, x: Tensor) -> Tensor:
        return self.fc(x)

# Create model
model = SimpleClassifier(input_dim=4, num_classes=3)

# Create batch of input data (batch_size=2, features=4)
# Values in [0, 1] range as typical for images
x = torch.rand(2, 4)

# Create batch of labels (batch_size=2, labels in range [0, 2])
y = torch.tensor([0, 1], dtype=torch.long)

# PGD attack hyperparameters
epsilon = 0.3  # perturbation budget
alpha = 0.1    # step size
iters = 5      # number of iterations

ARGS = {
    "model": model,
    "x": x,
    "y": y,
    "epsilon": epsilon,
    "alpha": alpha,
    "iters": iters
}
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
pgd_attack_l2 Ran
ran on a synthesized input
KejiaZhang-Robust/DHAT/attacks/pgd.py
code served (permissive licence) · get_code("5f1ccc98b0c89ab2")
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 (2, 1, 2, 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 torch
import torch.nn as nn

torch.manual_seed(0)

# Create a simple model that takes input and produces logits
class SimpleClassifier(nn.Module):
    def __init__(self, input_size=4, num_classes=3):
        super().__init__()
        self.fc1 = nn.Linear(input_size, 8)
        self.fc2 = nn.Linear(8, num_classes)
    
    def forward(self, x):
        # Flatten spatial dimensions if needed
        x = x.view(x.shape[0], -1)
        x = torch.relu(self.fc1(x))
        x = self.fc2(x)
        return x

# Create model instance
model = SimpleClassifier(input_size=4, num_classes=3)

# Create small batch of input data (batch_size=2, channels=1, height=2, width=2)
# This flattens to 4 features, matching the model input
x = torch.rand(2, 1, 2, 2)

# Create labels for 3-class classification (batch_size=2)
y = torch.tensor([0, 2], dtype=torch.long)

# Define attack parameters
epsilon = 0.1  # perturbation budget
alpha = 0.02   # step size
iters = 3      # number of iterations

ARGS = {
    "model": model,
    "x": x,
    "y": y,
    "epsilon": epsilon,
    "alpha": alpha,
    "iters": iters
}
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 4, dtype family float, shape (2, 1, 2, 2) — shape (2, 1, 2, 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
shuffle_labels Ran
ran; our contract draft was wrong, not the code
KejiaZhang-Robust/DHAT/utils.py
code served (permissive licence) · get_code("847b62b8a61671a9")
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 1, dtype family int, shape (6,) as a later run recorded it. 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, 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)

device = 'cpu'

# Create a small label tensor with integer values
# The function expects a tensor with integer labels
label = torch.tensor([0, 1, 2, 1, 0, 2], dtype=torch.long)

ARGS = {
    'label': label
}
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 1, dtype family int, 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
train_adversarial Ran
ran on a synthesized input
KejiaZhang-Robust/DHAT/utils_train.py
code served (permissive licence) · get_code("e17ea9f784ec98d0")
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
from torch.utils.data import DataLoader
from torch.optim import SGD

torch.manual_seed(0)

# Minimal model that matches how train_adversarial uses it
class MinimalNet(nn.Module):
    def __init__(self, num_classes=10):
        super().__init__()
        self.fc = nn.Linear(4, num_classes)
    
    def forward(self, x):
        # Flatten if needed and pass through fc layer
        x = x.view(x.size(0), -1)
        return self.fc(x)

# Minimal config class with required attributes
class Config:
    class Train:
        clip_eps = 8.0
        fgsm_step = 2.0
        pgd_train = 2
        Factor = 0.1
    
    class DATA:
        num_class = 10

# Create tiny dataset - batch size 2, input dim 4
def create_tiny_loader():
    batch_size = 2
    num_batches = 2
    input_dim = 4
    num_classes = 10
    
    batches = []
    for _ in range(num_batches):
        x = torch.randn(batch_size, 1, input_dim)
        y = torch.randint(0, num_classes, (batch_size,))
        batches.append((x, y))
    
    return batches

net = MinimalNet(num_classes=10)
epoch = 1
train_loader = create_tiny_loader()
optimizer = SGD(net.parameters(), lr=0.01)
config = Config()

ARGS = {
    'net': net,
    'epoch': epoch,
    'train_loader': train_loader,
    'optimizer': optimizer,
    'config': config
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, tqdm — 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
Inc_V3 Not yet run
unverified (harvested, no recorded run)
KejiaZhang-Robust/DHAT/models/Inception.py
code served (permissive licence) · get_code("db0d9e6ce9a6aed3")
How it ran

no invocation recorded.

evaluate_autoattack Not yet run
unverified (harvested, no recorded run)
KejiaZhang-Robust/DHAT/attacks/aa.py
code served (permissive licence) · get_code("1b2c09723b153996")
How it ran

no invocation recorded.

evaluate_autoattack_l2 Not yet run
unverified (harvested, no recorded run)
KejiaZhang-Robust/DHAT/attacks/aa.py
code served (permissive licence) · get_code("d05b01d1bd722d7c")
How it ran

no invocation recorded.

evaluate_cw Not yet run
unverified (harvested, no recorded run)
KejiaZhang-Robust/DHAT/attacks/cw.py
code served (permissive licence) · get_code("68ee3ef3e973c64c")
How it ran

no invocation recorded.

evaluate_eot_pgd Not yet run
unverified (harvested, no recorded run)
KejiaZhang-Robust/DHAT/attacks/eot_pgd.py
code served (permissive licence) · get_code("3ff729c086ca395e")
How it ran

no invocation recorded.

evaluate_pgd Not yet run
unverified (harvested, no recorded run)
KejiaZhang-Robust/DHAT/attacks/pgd.py
code served (permissive licence) · get_code("0d14553fea24301c")
How it ran

no invocation recorded.

Also present in other papers' code

Of 22 samples lifted from this paper's linked repositories, 22 carry a function identity and 0 do not. Of the 22 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 0 later) and 21 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
LabelSmoothLoss 3 other papers
3 dated earlier
2207.08859 (2022-07)
Prior-Guided Adversarial Initialization for Fast Adversarial Training
2308.12857 (2023-08)
Fast Adversarial Training with Smooth Convergence
2407.12443 (2024-07)
Preventing Catastrophic Overfitting in Fast Adversarial Training: A Bi-level Optimization Perspective

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

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Despite the remarkable progress of deep neural networks (DNNs) in various visual tasks, their vulnerability to adversarial examples raises significant security concerns. Recent adversarial training methods leverage inverse adversarial attacks to generate high-confidence examples, aiming to align adversarial distributions with high-confidence class regions. However, our investigation reveals that under inverse adversarial attacks, high-confidence outputs are influenced by biased feature activations, causing models to rely on background features that lack a causal relationship with the labels. This spurious correlation bias leads to overfitting irrelevant background features during adversarial training, thereby degrading the model's robust performance and generalization capabilities. To address this issue, we propose Debiased High-Confidence Adversarial Training (DHAT), a novel approach that aligns adversarial logits with debiased high-confidence logits and restores proper attention by enhancing foreground logit orthogonality. Extensive experiments demonstrate that DHAT achieves state-of-the-art robustness on both CIFAR and ImageNet-1K benchmarks, while significantly improving generalization by mitigating the feature bias inherent in inverse adversarial training approaches. Code is available at https: //github.com/KejiaZhang-Robust/DHAT.

For agents

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

get_harvested_code_for_paper("Zhang_Towards_Adversarial_Robustness_via_Debiased_High-Confidence_Logit_Alignment_ICCV_2025_paper")
get_code_for_paper("Zhang_Towards_Adversarial_Robustness_via_Debiased_High-Confidence_Logit_Alignment_ICCV_2025_paper")
have("Zhang_Towards_Adversarial_Robustness_via_Debiased_High-Confidence_Logit_Alignment_ICCV_2025_paper")

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

curl https://syntology.ai/api/ran/Zhang_Towards_Adversarial_Robustness_via_Debiased_High-Confidence_Logit_Alignment_ICCV_2025_paper.json

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

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

Connect an agent — have() is free.