Countering Adversarial Examples: Combining Input Transformation and Noisy Training

Cheng Zhang, Pan Gao · DOI

Abstract

Recent studies have shown that neural network (NN) based image classifiers are highly vulnerable to adversarial examples, which poses a threat to security-sensitive image recognition tasks. Prior work has shown that JPEG compression can combat the drop in classification accuracy on adversarial examples to some extent. However, as the compression ratio increases, traditional JPEG compression is insufficient to defend against those attacks and can cause an abrupt accuracy decline on benign images. In this paper, we first modify the traditional JPEG compression algorithm to be more favorable for NNs. Specifically, based on an analysis of frequency coefficients, we design an NN-favored quantization table. We then combine this model-agnostic preprocessing with noisy training, fine-tuning the model with images encoded at different compression levels to generate multiple classifiers. Finally, we use an ensemble of these models, adopting a majority vote for final predictions. Experimental results show our method improves defense efficiency while maintaining original accuracy.

The Vulnerability of Neural Networks

Deep Neural Networks (DNNs) are notoriously fragile when faced with adversarial examples—images with imperceptible perturbations designed to trigger misclassification. While researchers have attempted to use standard JPEG compression to "wash away" these perturbations, they often encounter a trade-off: standard JPEG is optimized for the Human Visual System (HVS). To a human, losing high-frequency data is acceptable, but for a neural network, that data may contain vital features. Consequently, aggressive standard JPEG compression destroys adversarial noise but also significantly degrades the model’s accuracy on legitimate ("benign") images.

Proposed Defense Framework

To bridge the gap between noise removal and feature preservation, the authors propose a three-pronged approach combining input transformation, noisy training, and model ensembling.

Overview of the proposed defense framework combining transformations, noisy training, and model ensembling.

1. NN-Favored JPEG Transformation

The core technical contribution lies in redesigning the JPEG transformation to respect how NNs learn features:

  • RGB Domain Processing: Unlike standard JPEG which converts images to YCbCr (causing data loss), NNs perform better when quantization is applied directly in the RGB domain.
  • Frequency Band Partitioning: The authors analyzed the distribution of Discrete Cosine Transform (DCT) coefficients to categorize frequency bands into Original Favored (OF) bands (essential for clean accuracy) and Adversarial Favored (AF) bands (where perturbations typically reside).
  • Optimized Quantization: An iterative algorithm finds ideal quantization steps for these bands, specifically setting larger steps for AF bands to filter noise while preserving OF features.
Frequency analysis and division of DCT coefficients into Original Favored (OF) and Adversarial Favored (AF) bands.

2. Noisy Training

Instead of computationally expensive adversarial training, the framework utilizes Gaussian noise and compression as a form of data augmentation. Pre-trained models are fine-tuned using a modified cost function that balances the gradients of original images with those of compressed, noisy images.

3. Model Ensemble

Since no single compression level is optimal for all attack strengths, the researchers trained a "Model Set" (M, M90, M70, M50, M30) representing different quality factors. Lower compression ratios remove slight perturbations, while higher ratios tackle aggressive ones. The final prediction is determined by an ensemble (majority vote), allowing the system to be adaptive to varying attack intensities.

Key Results and Insights

The study, conducted primarily on the ImageNet dataset using ResNet-v2-50 and Inception-v4, yielded several critical insights:

  • Humans ≠ Networks: HVS-based compression is sub-optimal for NNs. Standard JPEG downsamples color channels (Cb, Cr) because humans don't notice the loss; NNs do, leading to significant feature degradation.
  • Robustness Across Attack Types: The method consistently outperformed existing model-agnostic defenses like Feature Distillation (FD). It maintained a 66.5% accuracy on benign images, slightly improving over the "No Defense" baseline in some cases due to the denoising effect.
  • Resilience to White-Box Attacks: Most transformation defenses fail against BPDA (Backward Pass Differentiable Approximation) attacks. However, this ensemble approach maintained 60% accuracy against BPDA, whereas other defenses like FD and TVM dropped to near 0%.

Conclusion

By aligning image transformation with the specific needs of neural networks rather than human vision, this dual-layered defense provides a robust shield against adversarial perturbations. While the ensemble approach increases inference latency, its ability to maintain high clean-image accuracy while resisting sophisticated white-box attacks marks a significant advancement in secure image recognition.

Summary updated

BibTeX
@inproceedings{zhang2021countering,
  author = {Cheng Zhang and Pan Gao},
  title = {{Countering Adversarial Examples: Combining Input Transformation and Noisy Training}},
  booktitle = {ICCVW},
  year = {2021},
  doi = {10.1109/iccvw54120.2021.00017},
}
Figure