Papers › Efficient Image-to-Image Diffusion Classifier for Adversarial Robustness

Efficient Image-to-Image Diffusion Classifier for Adversarial Robustness

16 Aug 2024arXiv:2408.08502archive 2025-07-28

Hefei Mei, Minjing Dong, Chang Xu

Diffusion models (DMs) have demonstrated great potential in the field of adversarial robustness, where DM-based defense methods can achieve superior defense capability without adversarial training. However, they all require huge computational costs due to the usage of large-scale pre-trained DMs, making it difficult to conduct full evaluation under strong attacks and compare with traditional CNN-based methods. Simply reducing the network size and timesteps in DMs could significantly harm the image generation quality, which invalidates previous frameworks. To alleviate this issue, we redesign the diffusion framework from generating high-quality images to predicting distinguishable image labels. Specifically, we employ an image translation framework to learn many-to-one mapping from input samples to designed orthogonal image labels. Based on this framework, we introduce an efficient Image-to-Image diffusion classifier with a pruned U-Net structure and reduced diffusion timesteps. Besides the framework, we redesign the optimization objective of DMs to fit the target of image classification, where a new classification loss is incorporated in the DM-based image translation framework to distinguish the generated label from those of other classes. We conduct sufficient evaluations of the proposed classifier under various attacks on popular benchmarks. Extensive experiments show that our method achieves better adversarial robustness with fewer computational costs than DM-based and CNN-based methods. The code is available at https://github.com/hfmei/IDC.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2408.08502")

Code

Syntology Ran 16 of 18 code samples harvested from 1 repository linked to this paper; 2 have no recorded run. Of those that ran: 1 ran · honoured contract; 1 ran · violated contract; 8 ran · our draft was wrong; 1 ran · fixture could not drive it; 5 ran with no contract checked.

By repository: official repository: 18 samples from 1 repository, 16 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

hfmei/idc officialmentioned in papermentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

18 samples harvested; 16 ran; 1 honoured the contract we drafted; 2 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · honoured contract
1ran · violated contract
8ran · our draft was wrong
1ran · fixture could not drive it
5ran
2unverified

Licence: 18 of the 18 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from hfmei/idc. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

Normalize hfmei/idc/IDC-BPDA/ddpm/unet_ddpm.py official repository ran · our draft was wrong no licence file found · pointer only · c3a6b977022957cb · report
approx_standard_normal_cdf hfmei/idc/IDC-BPDA/guided_diffusion/losses.py official repository ran · our draft was wrong fingerprinted no licence file found · pointer only · cfd76fd0d89574a4 · report
compute_n_params hfmei/idc/IDC-BPDA/utils.py official repository ran · our draft was wrong no licence file found · pointer only · ad12a494674d23fb · report
dict2namespace hfmei/idc/IDC-BPDA/utils.py official repository ran · our draft was wrong no licence file found · pointer only · bd1f17e427bf51a5 · report
discretized_gaussian_log_likelihood hfmei/idc/IDC-BPDA/guided_diffusion/losses.py official repository ran · our draft was wrong no licence file found · pointer only · cd33283d615fb3d7 · report
get_optimizer hfmei/idc/IDC-BPDA/score_sde/losses.py official repository ran no licence file found · pointer only · 8ff7c24dade9904c · report
get_sde_loss_fn hfmei/idc/IDC-BPDA/score_sde/losses.py official repository ran no licence file found · pointer only · fac494cec4301110 · report
get_timestep_embedding hfmei/idc/IDC-BPDA/ddpm/unet_ddpm.py official repository ran · fixture could not drive it fingerprinted no licence file found · pointer only · cb49209c125de1b4 · report
lerp_clip hfmei/idc/IDC-BPDA/classifiers/attribute_net.py official repository ran no licence file found · pointer only · 195d635db8eb778b · report
max_res_from_state_dict hfmei/idc/IDC-BPDA/classifiers/attribute_net.py official repository ran no licence file found · pointer only · d5eb57879ef1704e · report
nonlinearity hfmei/idc/IDC-BPDA/ddpm/unet_ddpm.py official repository ran · our draft was wrong fingerprinted no licence file found · pointer only · 3137073275f8c21a · report
normal_kl hfmei/idc/IDC-BPDA/guided_diffusion/losses.py official repository ran · honoured contract fingerprinted no licence file found · pointer only · cf2798b666b231ca · report
optimization_manager hfmei/idc/IDC-BPDA/score_sde/losses.py official repository ran no licence file found · pointer only · 366bb8c7035a2fc8 · report
register_corrector hfmei/idc/IDC-BPDA/score_sde/sampling.py official repository ran · our draft was wrong no licence file found · pointer only · a05b1d0cf3f508b4 · report
register_predictor hfmei/idc/IDC-BPDA/score_sde/sampling.py official repository ran · our draft was wrong no licence file found · pointer only · 473066ddf62a075a · report
str2bool hfmei/idc/IDC-BPDA/utils.py official repository ran · violated contract no licence file found · pointer only · 7c508037b40522af · report
from_state_dict hfmei/idc/IDC-BPDA/classifiers/attribute_net.py official repository unverified no licence file found · pointer only · 0dd156dfa78cac88 · report
get_predictor hfmei/idc/IDC-BPDA/score_sde/sampling.py official repository unverified no licence file found · pointer only · a58facb8fe71823a · report

Tasks

Adversarial RobustnessImage ClassificationImage GenerationTranslationimage-classification

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Concatenated Skip ConnectionConvolutionDiffusionMax PoolingReLUU-Net

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections