Rethinking Target Label Conditioning in Adversarial Attacks: A 2D Tensor-Guided Generative Approach

Hangyu Liu, Bo Peng, Pengxiang Ding, Donglin Wang

TL;DR

The 2D Tensor-Guided Adversarial Fusion (TGAF) framework significantly improves the transferability of multi-target adversarial attacks by encoding target labels as 2D semantic tensors instead of traditional 1D vectors. By leveraging pre-trained diffusion models to preserve spatial and structural information, combined with a block-wise masking strategy, TGAF generates highly robust perturbations that successfully deceive black-box models and bypass advanced defenses.

What Problem Does This Paper Address?

Adversarial attacks expose vulnerabilities in deep neural networks (DNNs) by adding imperceptible noise to images, causing misclassifications. In targeted attacks, the goal is to force a model to predict a specific incorrect label chosen by the attacker. To be practical in the real world, these attacks must possess transferability—the ability of an adversarial image generated on a known "surrogate" model to successfully fool an entirely unknown "black-box" victim model.

Multi-target generative attacks train a single network to generate perturbations for many different target classes. However, current state-of-the-art methods encode the target labels as 1D tensors (like one-hot encodings or CLIP text embeddings). Because images are inherently two-dimensional, squeezing this information into a 1D vector discards crucial spatial and structural details. As a result, the generator overfits to the surrogate model's specific decision boundaries, leading to poor transferability when tested against other architectures.

Methods

The authors introduce TGAF (2D Tensor-Guided Adversarial Fusion) to bridge the dimensionality gap between 1D label conditioning and 2D image space.

Comparison of 1D vs 2D label encoding approaches

The architecture consists of four primary components:

  1. Image Encoder: Extracts multi-scale feature maps from the source image.
  2. Text-to-Image Encoder (Generator): Uses the encoder and denoising U-Net from a pre-trained diffusion model (Stable Diffusion 2) to convert text prompts of the target class into a rich 2D latent tensor. This tensor is then projected to match the spatial dimensions of the image features.
  3. Feature Integration Module: Fuses the source image features with the 2D target condition features. The authors propose two variants: Convolution-based Fusion (CbF) for local feature interactions and Transformer-based Fusion (TbF) to capture global spatial-channel dependencies.
  4. Image Decoder: Upsamples the fused features to construct the final adversarial perturbation.

Additionally, they implement a Dynamic Block-wise Masking Strategy during training. By randomly zeroing out blocks of the generated noise, the network is forced to distribute the target semantic information across the entire image rather than relying on localized shortcuts.

Datasets

The framework was trained and evaluated using standard computer vision benchmarks:

  • Training: ImageNet training set.
  • Evaluation: ImageNet-NeurIPS (1k) dataset, the full ImageNet Validation Set (50k), and the Microsoft COCO dataset.

Key Insights and Ideas

  • Adversarial Noise as "Feature Implantation": The authors demonstrate that targeted attacks work by essentially grafting target-class features onto the source image. Through empirical testing, they show that feature quality (structural integrity) and feature quantity (spatial abundance) directly dictate an attack's success rate across different models.
  • The Power of 2D Blueprints: 1D label encodings often cause generators to dump noise along image boundaries or overfit to easy-to-map regions. By using a diffusion model to generate a 2D latent tensor, the attack retains a structural blueprint of the target object (e.g., preserving the pointer and scale markings of a "barometer"), making the perturbation far more recognizable to black-box models.
Visualizing how TGAF captures superior semantic details compared to 1D methods

Key Results

TGAF achieves state-of-the-art (SOTA) performance across a wide variety of testing environments:

  • Normally Trained Models: When using an Inception-v3 surrogate model, TGAF outperforms the previous SOTA method (CGNC) by 16.11% on CNN-based victim models and 11.17% on Vision Transformers (ViTs).
  • Robust Models: Against adversarially trained models, TGAF delivers an average Attack Success Rate (ASR) improvement of 16.92% (Inc-v3 surrogate) and 5.66% (Res-152 surrogate) over CGNC.
  • Defense Mechanisms: TGAF demonstrates strong resilience against input transformations (JPEG compression, BitSqueezing, Smoothing) and advanced purification defenses (DiffPure, NRP). For example, against the Neural Representation Purifier (NRP) on a Swin Transformer, TGAF achieves a 13.56% ASR—nearly double CGNC's 7.43%.
  • Efficiency: Because the 2D diffusion latents are pre-computed once before training, TGAF adds negligible computational overhead (~1.07x relative training time) and generates attacks in a single forward pass during inference.

Limitations and Future Work

While TGAF sets a new benchmark for generative multi-target attacks, it still faces challenges from heavy purification defenses like DiffPure, which drop the success rates of all transfer attacks significantly by stripping out high-frequency noise. Furthermore, while it vastly outperforms other generation-based methods, certain computationally expensive iterative instance-specific attacks can occasionally achieve higher absolute success rates at the cost of running optimization loops for every single image. Future work could focus on optimizing the text prompts used for the 2D latent generation or exploring multi-modal target conditioning.

Summary updated

BibTeX
@inproceedings{liu2026rethinking,
  author = {Hangyu Liu and Bo Peng and Pengxiang Ding and Donglin Wang},
  title = {{Rethinking Target Label Conditioning in Adversarial Attacks: A 2D Tensor-Guided Generative Approach}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2026},
  doi = {10.1609/aaai.v40i9.37651},
}
Figure