NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Towards Understanding and Harnessing the Effect of Image Transformation in Adversarial Detection

Hui Liu, Bo Zhao, Yuefeng Peng, Weidong Li, Peng LiuarXiv 2022

Abstract

Deep neural networks (DNNs) are threatened by adversarial examples. Adversarial detection, which distinguishes adversarial images from benign images, is fundamental for robust DNN-based services. Image transformation is one of the most effective approaches to detect adversarial examples. During the last few years, a variety of image transformations have been studied and discussed to design reliable adversarial detectors. In this paper, we systematically synthesize the recent progress on adversarial detection via image transformations with a novel classification method. Then, we conduct extensive experiments to test the detection performance of image transformations against state-of-the-art adversarial attacks. Furthermore, we reveal that each individual transformation is not capable of detecting adversarial examples in a robust way, and propose a DNN-based approach referred to as AdvJudge, which combines scores of 9 image transformations. Without knowing which individual scores are misleading or not misleading, AdvJudge can make the right judgment, and achieve a significant improvement in detection rate. Finally, we utilize an explainable AI tool to show the contribution of each image transformation to adversarial detection. Experimental results show that the contribution of image transformations to adversarial detection is significantly different, the combination of them can significantly improve the generic detection ability against state-of-the-art adversarial attacks.

Introduction

Deep Neural Networks (DNNs) have revolutionized computer vision but remain notoriously vulnerable to adversarial examples—inputs crafted with imperceptible perturbations that trigger confident misclassifications. Detecting these attacks is critical for deploying secure AI services. A popular defense strategy involves image transformations: if a model's prediction for an image $x$ changes drastically after a transformation (e.g., blurring or rotation), the image is likely adversarial. However, most existing research focuses on single transformations, which often have "blind spots" that sophisticated attackers can exploit. This paper addresses this gap by systematically categorizing transformations and proposing a unified detection framework, AdvJudge.

Methodology: The AdvJudge Framework

The researchers categorized image transformations into two primary groups: Pixel Modification (Gaussian noise, smoothing, bit-depth reduction, and frequency filtering) and Topological Transformation (translation, flipping, rotation, shearing, and scaling).

The core contribution is the AdvJudge detector. Instead of relying on a single transformation, AdvJudge aggregates the outputs of nine different methods. For any input image $x$, the system computes the prediction distribution $Z(x)$ and the distribution $Z(x_t)$ for its transformed version $x_t$. The Kullback-Leibler (KL) divergence between these distributions serves as a measure of instability.

The general framework for adversarial detection using image transformations and KL divergence.

AdvJudge feeds these nine KL divergence scores into a 5-layer fully connected neural network. This secondary model learns to distinguish between benign and adversarial inputs by identifying patterns across multiple transformations, effectively neutralizing the weaknesses of any single method.

Experimental Setup

The framework was evaluated using the ImageNet dataset, with a sample of 1,800 images (1,440 for training, 360 for testing). Adversarial examples were generated against a pre-trained Inception V3 model using three state-of-the-art attack methods:

  • C&W (Carlini & Wagner): Known for high success rates with minimal perturbations.
  • FGSM (Fast Gradient Sign Method): A standard fast attack.
  • BIM (Basic Iterative Method): A more robust, iterative version of FGSM.

Key Results and Insights

The experimental results demonstrate that no single transformation is universally effective. For instance, bit-depth reduction effectively catches C&W attacks but fails against BIM. Conversely, BIM attacks are more robust to pixel modifications but can be exposed by topological changes like flipping or rotation.

AdvJudge significantly outperformed all individual baselines:

  • Performance: It achieved an F1-score of 0.92 and an AUC of 0.97.
  • Improvement: This represents a 9% improvement over the best individual transformation (maximum smoothing, which peaked at an F1-score of 0.83).
  • Robustness: AdvJudge maintained high precision (92%) and recall (94%), proving its ability to ignore "misleading" scores from transformations ill-suited for specific attack types.

To understand the model's decisions, the authors used Integrated Gradients. This explainable AI (XAI) analysis revealed that additive noise is a strong indicator for benign images, while image flipping is highly influential for identifying adversarial ones.

Conclusion and Future Work

AdvJudge demonstrates that while individual image transformations are not "silver bullets," their ensemble can provide a robust defense against diverse adversarial attacks. By learning to weight different transformation signals, AdvJudge achieves state-of-the-art detection performance.

Future research should address the computational overhead of running multiple transformations at inference time, perhaps through "early exit" strategies. Additionally, evaluating the framework against "adaptive attackers" who are aware of the specific transformations used would be a valuable next step in hardening the defense.

Summary updated

BibTeX
@misc{liu2022towards,
  author = {Hui Liu and Bo Zhao and Yuefeng Peng and Weidong Li and Peng Liu},
  title = {{Towards Understanding and Harnessing the Effect of Image Transformation in Adversarial Detection}},
  year = {2022},
  eprint = {2201.01080},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2201.01080},
}
Figure