Evaluating Adversarial Robustness in the Spatial Frequency Domain

Keng-Hsin Liao, Chin-Yuan Yeh, Hsi-Wen Chen, Ming-Syan ChenarXiv 2024 · DOI

Introduction

Deep Convolutional Neural Networks (CNNs) have achieved remarkable success in computer vision but remain notoriously vulnerable to adversarial attacks. These attacks involve subtle, often imperceptible perturbations to input pixels that can cause a model to misclassify an image with high confidence. Interestingly, the Human Visual System (HVS) is largely immune to such manipulations. This discrepancy stems from how visual information is processed: while standard CNNs often over-rely on high-frequency textures, the HVS prioritizes low-frequency structural information. Researchers from National Taiwan University propose bridging this gap by integrating a Spatial Frequency (SF) layer into standard CNN architectures.

The Spatial Frequency (SF) Layer

The core innovation is the replacement of initial convolutional layers with a non-trainable SF layer based on the Discrete Cosine Transform (DCT). This approach mimics the frequency-domain processing found in the HVS and standard image compression techniques like JPEG.

The SF-CNN architecture replaces the standard CNN extractor with an SF layer that utilizes block-wise DCT to transform images into the frequency domain before processing by the backbone.

The SF layer operates in two primary steps:

  1. Block-wise DCT: The input image is partitioned into $8 \times 8$ blocks. Each block undergoes a DCT, transforming pixel values into a spectrum of frequency components.
  2. Integration with Backbone: The resulting frequency data is fed into a standard CNN backbone (such as ResNet18, EfficientNet, or DenseNet). By receiving frequency-domain inputs from the start, the backbone is forced to learn features from the underlying spectral distribution rather than raw pixel intensities.

Experimental Evaluation

The proposed SF-CNNs were evaluated across three diverse datasets: CIFAR10 (small-scale general objects), Imagenette (a 10-class subset of ImageNet), and Flower102 (fine-grained classification). These benchmarks were chosen to test the generalizability of the frequency-domain approach across different image scales and task complexities.

Insights into Robustness

The study provides several key insights into why the SF layer enhances adversarial robustness:

  • Frequency Prioritization: Adversarial perturbations typically reside in high-frequency bands. By focusing on low-frequency components—the "big picture" shapes—SF-CNNs naturally filter out the attacker's noise.
  • Attention Stability: Using Grad-CAM visualizations, the authors demonstrated that SF-CNNs maintain focus on the primary object even under attack, whereas standard CNNs are easily distracted by background noise.
  • Detectability of Frequency Attacks: While attackers can target the frequency domain directly, such attacks often result in highly visible periodic patterns.
An example of an image under a frequency-domain attack, showing the "loud" and detectable periodic patterns that differ significantly from standard pixel-based adversarial noise.

The researchers found that a simple Decision Tree could detect these frequency-domain attacks with near 100% accuracy, providing an additional layer of defense.

Key Results

The SF-CNN architecture demonstrated superior performance in both white-box and black-box (transfer) attack scenarios:

  • White-Box Defense: On CIFAR10, an SF-DenseNet maintained 58.4% accuracy under a Projected Gradient Descent (PGD) attack, compared to just 19.6% for a standard DenseNet.
  • Transfer Attack Resistance: SF-ResNet18 achieved 73.8% accuracy when faced with adversarial examples generated from a different model (VGG11), significantly outperforming the standard ResNet18's 52.2%.
  • Efficiency: By replacing early convolutional layers, SF-CNNs often achieve these robustness gains with fewer trainable parameters than their standard counterparts.

Conclusion

Integrating spatial frequency processing into deep learning architectures offers a promising path toward more robust and human-like computer vision. While not a complete solution to all adversarial threats, the SF layer significantly raises the bar for attackers and provides a foundation for future hybrid defense strategies. Future work will explore combining SF layers with traditional adversarial training and scaling these models to larger datasets like ImageNet-1k.

Summary updated

BibTeX
@misc{liao2024evaluating,
  author = {Keng-Hsin Liao and Chin-Yuan Yeh and Hsi-Wen Chen and Ming-Syan Chen},
  title = {{Evaluating Adversarial Robustness in the Spatial Frequency Domain}},
  year = {2024},
  eprint = {2405.06345},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.06345},
}
Figure