Deflecting Adversarial Attacks With Pixel Deflection

Aaditya Prakash, Nick Moran, Solomon Garber, Antonella DiLillo, James A. Storer

Abstract

Convolutional Neural Networks (CNNs) are poised to become integral parts of many critical systems. Despite their robustness to natural variations, image pixel values can be manipulated via small, carefully crafted, imperceptible perturbations to cause a model to misclassify images. We present an algorithm to process an image so that classification accuracy is significantly preserved in the presence of such adversarial manipulations. Image classifiers tend to be robust to natural noise, and adversarial attacks tend to be agnostic to object location. These observations motivate our strategy, which leverages model robustness to defend against adversarial perturbations by forcing the image to match natural image statistics. Our algorithm locally corrupts the image by redistributing pixel values via a process we term pixel deflection. A subsequent wavelet-based denoising operation softens this corruption, as well as some of the adversarial changes. We demonstrate experimentally that the combination of these techniques enables the effective recovery of the true class against a variety of robust attacks. Our results compare favorably with current state-of-the-art defenses, without requiring retraining or modifying the CNN.

Introduction

Deep learning models, particularly Convolutional Neural Networks (CNNs), are notoriously fragile. An attacker can add a tiny, imperceptible amount of "noise" to an image—an adversarial perturbation—that causes a state-of-the-art model to confidently misclassify a "stop sign" as a "yield sign." Most existing defenses fall into two camps: adversarial training, which is computationally expensive, or differentiable transformations, which attackers can easily bypass by "differentiating through" the defense. This research introduces Pixel Deflection, a non-differentiable, stochastic defense that requires no retraining and leverages the inherent robustness of CNNs to natural noise.

The Pixel Deflection Algorithm

The proposed defense is a two-stage pipeline that treats adversarial perturbations as a form of unnatural noise that needs to be "scrambled" and then "smoothed."

1. Pixel Deflection (The Scrambler)

The core idea is to randomly pick a pixel and replace it with another randomly selected pixel from its local neighborhood. This process is repeated $K$ times. Because adversarial attacks rely on precise, pixel-level interactions to fool a network, this random "deflection" breaks the attack's structure.

Visualizing the pixel deflection process with 500 deflections, showing the original image and the resulting pixel-level changes.

To avoid damaging the actual object in the image, the algorithm uses a Robust Activation Map (R-CAM). Standard Class Activation Maps (CAMs) identify the most likely class, but in an adversarial setting, the top class is often incorrect. By averaging the maps of the top-5 classes, the researchers created a "Robust" map that accurately locates the object even when the model is being actively fooled. The algorithm is then more likely to deflect pixels in the background and less likely to touch the object itself.

2. Wavelet Denoising (The Smoother)

Pixel deflection introduces its own "natural" noise. To clean this up, the authors use Adaptive Soft-Thresholding in the wavelet domain (specifically BayesShrink). Wavelet transforms are excellent at separating signal from noise in natural images. This step "softens" both the corruption introduced by the deflection and the original adversarial changes.

Experimental Results

The defense was evaluated on ImageNet using a ResNet-50 classifier against a gauntlet of heavy-hitting attacks, including FGSM, IGSM, DeepFool, and the powerful Carlini & Wagner (C&W) attack.

  • Recovery Rates: On the C&W attack, which usually reduces model accuracy to near 0%, Pixel Deflection restored accuracy to 98.3%.
  • Comparison: It outperformed other state-of-the-art transformation defenses like "Feature Squeezing" and "Image Quilting" across almost every attack category.
  • Clean Image Performance: Importantly, the defense only caused a negligible drop in accuracy (about 1-2%) on "clean" images.
An image after 2000 pixel deflections; despite the noise, the semantic content remains recognizable to the classifier.

Conclusion

Pixel Deflection demonstrates that CNNs are surprisingly robust to local pixel swaps (natural-looking noise) but highly sensitive to the specific, global patterns found in adversarial attacks. By converting crafted noise into natural noise, Pixel Deflection provides a simple, effective pre-processing step that can be integrated into any existing computer vision pipeline without the need for expensive retraining. Future work may explore hardening the system against adaptive attackers using techniques like "Expectation Over Transformation" (EOT).

Summary updated

BibTeX
@inproceedings{prakash2018deflecting,
  author = {Aaditya Prakash and Nick Moran and Solomon Garber and Antonella DiLillo and James A. Storer},
  title = {{Deflecting Adversarial Attacks With Pixel Deflection}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2018},
  url = {https://openreview.net/forum?id=B14vcpWu-B},
}
Figure