Understanding Adversarial Robustness from Feature Maps of Convolutional Layers

Cong Xu, Min Yang

TL;DR

This paper proposes a novel approach to improve the adversarial robustness of neural networks by analyzing and manipulating convolutional feature maps. They theoretically demonstrate that larger feature maps before average pooling enhance robustness, leading to simple yet effective architectural modifications that boost both natural and adversarial accuracy across various CNNs.

What Problem Does This Paper Address?

Deep neural networks (DNNs), despite their impressive performance, are notoriously vulnerable to adversarial attacks. These attacks involve making imperceptible perturbations to input data, causing DNNs to misclassify them. This vulnerability hinders their deployment in security-critical applications. While existing defenses like adversarial training improve robustness, they often come at the cost of reduced natural accuracy. This paper aims to bridge this gap by understanding and enhancing the inherent anti-perturbation ability of neural networks, specifically focusing on the role of convolutional feature maps.

Methods

The core of this paper lies in its theoretical analysis of how convolutional feature maps influence adversarial robustness. The authors propose that the size of these feature maps, particularly before pooling layers, plays a crucial role.

  • Theoretical Analysis: They mathematically demonstrate that larger convolutional feature maps, when combined with average pooling, lead to better resistance against perturbations. Conversely, this relationship does not hold for max pooling, where larger feature maps can actually be detrimental to robustness.
  • Architectural Modifications: Based on their theoretical findings, they introduce two simple, plug-and-play methods to enlarge convolutional feature maps:
  • Upsampling Inputs: Increasing the resolution of the input image before feeding it into the network. This can be done using standard interpolation techniques or learnable deconvolution.
  • Shrinking Sliding Strides: Modifying the stride configurations of downsampling operations (like pooling or strided convolutions) within the network. This effectively increases the spatial dimensions of the feature maps.

Datasets

The paper uses the following datasets for training and evaluation:

  • CIFAR-10: A widely-used dataset for image classification, consisting of 60,000 32x32 real-world images in 10 classes.
  • CIFAR-100: Similar to CIFAR-10 but with 100 classes.
  • CIFAR-10-C: A dataset designed to evaluate robustness against common corruptions (e.g., noise, blur) that are semantically invariant.
  • ImageNette: A subset of ImageNet, used for evaluating the proposed modifications on high-resolution datasets (128x128 images).

Key Insights and Ideas

  • Average Pooling is Key: The paper strongly suggests that average pooling, in conjunction with larger feature maps, is a more effective strategy for enhancing adversarial robustness compared to max pooling.
  • Feature Map Size Matters: Enlarging convolutional feature maps before average pooling can simultaneously improve both model capacity (leading to higher natural accuracy) and anti-perturbation ability.
  • Shrinking Strides are Preferable: While upsampling inputs can enlarge feature maps, shrinking sliding strides is found to be more efficient and avoids potential issues like feature redundancy.
  • Orthogonality to Existing Defenses: The proposed architectural modifications are orthogonal to existing defense mechanisms, meaning they can be combined with methods like adversarial training to achieve even greater robustness gains.
  • Trade-off Re-evaluation: The paper challenges the common assumption that improving adversarial robustness necessarily degrades natural accuracy. Their method demonstrates improvements in both.

Key Results

  • Significant Robustness Gains: The proposed modifications, particularly shrinking sliding strides, led to non-trivial improvements in adversarial robustness across various benchmark architectures (AlexNet, VGG, ResNet18, PreActResNet18) and defense mechanisms. For instance, on CIFAR-10, modified ResNet18 with the 1-1-2-2 stride configuration achieved better natural and adversarial accuracy compared to the baseline.
  • Improved Natural Accuracy: Contrary to typical robustness-accuracy trade-offs, the proposed methods also resulted in enhanced natural accuracy, indicating improved model capacity.
  • Effectiveness on Diverse Attacks: The improvements were observed across a range of attacks, including FGSM, PGD, DeepFool, and the comprehensive AutoAttack.
  • Generalizability: The approach was shown to be effective on different network architectures and even extended to Vision Transformers (ViTs).
  • Computational Efficiency: Shrinking sliding strides was found to be more computationally efficient than upsampling inputs, especially in adversarial training scenarios.

Limitations and Future Work

  • High-Resolution Data Challenges: For high-resolution datasets, enlarging feature maps needs careful consideration of receptive field degradation. The authors suggest that optimal stride configurations should be determined in conjunction with a sufficient receptive field, an area for further research.
  • Gradient Obfuscation: While the paper claims their modifications do not suffer from gradient obfuscation, this is an area that warrants further investigation, especially with more complex layer transformations.
  • Theoretical Assumptions: The theoretical analysis relies on assumptions like independence between feature map entries, which might not always hold in practice. However, the authors note that their proposed modifications still show effectiveness even when these assumptions are violated.

Summary updated

Abstract

The adversarial robustness of a neural network mainly relies on two factors: model capacity and anti-perturbation ability. In this paper, we study the anti-perturbation ability of the network from the feature maps of convolutional layers. Our theoretical analysis discovers that larger convolutional feature maps before average pooling can contribute to better resistance to perturbations, but the conclusion is not true for max pooling. It brings new inspiration to the design of robust neural networks and urges us to apply these findings to improve existing architectures. The proposed modifications are very simple and only require upsampling the inputs or slightly modifying the stride configurations of downsampling operators. We verify our approaches on several benchmark neural network architectures, including AlexNet, VGG, RestNet18, and PreActResNet18. Non-trivial improvements in terms of both natural accuracy and adversarial robustness can be achieved under various attack and defense mechanisms. The code is available at \url{https://github.com/MTandHJ/rcm}.
BibTeX
@article{xu2025understanding,
  author = {Cong Xu and Min Yang},
  title = {{Understanding Adversarial Robustness from Feature Maps of Convolutional Layers}},
  journal = {IEEE Trans. Neural Networks Learn. Syst.},
  year = {2025},
  url = {https://openreview.net/forum?id=RYsmlj145B},
}
Figure