Abstract
We cannot guarantee that training datasets are representative of the distribution of inputs that will be encountered during deployment. So we must have confidence that our models do not over-rely on this assumption. To this end, we introduce a new method that identifies context-sensitive feature perturbations (e.g. shape, location, texture, colour) to the inputs of image classifiers. We produce these changes by performing small adjustments to the activation values of different layers of a trained generative neural network. Perturbing at layers earlier in the generator causes changes to coarser-grained features; perturbations further on cause finer-grained changes. Unsurprisingly, we find that state-of-the-art classifiers are not robust to any such changes. More surprisingly, when it comes to coarse-grained feature changes, we find that adversarial training against pixel-space perturbations is not just unhelpful: it is counterproductive.
Introduction: The Robustness Gap
Modern machine learning relies heavily on the i.i.d. (independent and identically distributed) assumption, which posits that training and deployment data share the same distribution. In real-world scenarios, this assumption frequently fails. Distributional shifts—such as changes in lighting, object orientation, or environmental context—can lead to catastrophic performance drops in otherwise high-performing models.
To evaluate robustness, researchers typically employ adversarial attacks that introduce imperceptible pixel-level noise bounded by an $L_p$ norm. However, these attacks are often criticized for being unrealistic. A true real-world shift is rarely a cloud of random noise; it is more likely to be a semantic change, such as a building having a different texture or a dog standing in a different pose. This paper addresses the need for evaluating robustness against these "context-sensitive" feature perturbations at varying levels of granularity.
Methodology: Perturbing the Generative Pipeline
The authors propose a novel framework that leverages pre-trained Generative Adversarial Networks (GANs) to create realistic semantic shifts. Unlike previous methods that might only tweak the initial latent noise vector ($z$), this approach involves dynamically perturbing the intermediate activation values within the GAN's layers during the image generation process.
By selecting specific layers to perturb, the researchers can precisely control the "granularity" of the resulting change. The hierarchical nature of generative models means that early layers generally dictate coarse-grained features (e.g., global structure, object size, and position), while later layers handle fine-grained details (e.g., local textures, edges, and color gradients). To find the smallest effective perturbation, the authors use gradient descent to minimize the magnitude of the activation change while maximizing the likelihood of a target classifier mislabeling the output.
Results: Universal Vulnerability and Granularity
The method was tested on ImageNet-1K using state-of-the-art classifiers like ResNet50 and EfficientNet-B4. The results revealed a universal vulnerability: the method successfully induced misclassifications in over 80% of the generated images across all tested models, even with relatively small perturbation magnitudes.
As illustrated in the figure above, the granularity of the attack is highly controllable. Perturbing the "First six layers" can fundamentally alter the pose of a Pomeranian or the structure of a volcano. In contrast, perturbing the "Last six layers" results in subtle shifts in texture and lighting that are often difficult for the human eye to distinguish from the original, yet remain highly effective at fooling the classifier.
The Adversarial Training Paradox
The most striking finding of the study involves models specifically trained for robustness against standard pixel-space attacks (e.g., PGD-trained models). While these "pixel-robust" models showed improved resistance to fine-grained semantic changes (like texture shifts), they became significantly more vulnerable to coarse-grained structural changes compared to standard models.
For instance, an $L_2$-robust ResNet50 required an average perturbation magnitude of 141 to be fooled at the fine-grained level, but only 33 at the coarse-grained level. This suggests that adversarial training, which encourages models to ignore fragile fine-grained features (reducing "texture bias"), inadvertently forces them to over-rely on coarse-grained features. Consequently, the model becomes hypersensitive to any manipulation of those structural features, making it easier to attack at a semantic level.
Conclusion and Future Directions
This research demonstrates that current robustness paradigms are insufficient for handling the complexity of real-world semantic shifts. While pixel-level adversarial training provides a defense against high-frequency noise, it may actually degrade a model's resilience to structural and contextual changes.
Future work should explore training strategies that balance robustness across all feature granularities. Additionally, while this method relies on the generative capabilities of GANs—which can suffer from mode collapse—it provides a powerful new tool for auditing models before they are deployed in unpredictable real-world environments.
Summary updated