Abstract
Convolutional Neural Networks (CNNs) are notoriously fragile, often failing under adversarial attacks, common corruptions, and backdoor triggers. This vulnerability stems from a bias toward local texture features rather than global shape structures. We investigate whether prioritizing edge-based shape features can enhance model robustness. We propose two pipelines: EdgeNetRob, which trains directly on extracted edge maps, and EdgeGANRob, which reconstructs images from edges using a Generative Adversarial Network (GAN) before classification. To ensure the reliability of edge extraction under attack, we introduce Robust Canny, an edge detection algorithm featuring a noise-masking stage. Our results demonstrate that edge-based features significantly improve robustness across diverse threat models, with EdgeGANRob successfully mitigating the "robustness tax" on clean accuracy.
Introduction
While CNNs achieve superhuman performance on standard benchmarks, they remain fragile. Minor adversarial perturbations, environmental corruptions like fog, or hidden backdoor triggers can easily derail their predictions. Research suggests this is because CNNs are "texture-obsessed," whereas human vision relies more on global shapes. This paper explores whether forcing models to focus on shape—specifically through edge features—can provide a more generalized defense against these varied threats.
Methodology: Edge-Enabled Pipelines
To systematically evaluate shape features, we propose two distinct architectures and a robust feature extraction tool.
EdgeNetRob and EdgeGANRob
- EdgeNetRob: This pipeline simplifies the input by passing images through an edge detector and training the classifier solely on the resulting binary edge maps. By removing all color and texture, the model is forced to learn the intrinsic geometry of objects.
- EdgeGANRob: Recognizing that EdgeNetRob sacrifices "clean" accuracy by discarding useful texture information, EdgeGANRob introduces a GAN-based reconstruction step. The GAN "refills" the texture based on the extracted edges, providing a more familiar input to the classifier while keeping the decision-making process anchored to the global shape.
Robust Canny
Standard edge detectors like Canny are sensitive to noise; adversarial perturbations can create "ghost" edges or erase legitimate ones. To counter this, we developed Robust Canny.
Robust Canny incorporates a Noise Masking stage. By thresholding gradient magnitudes, it ignores small, high-frequency perturbations that do not correspond to significant structural changes. This ensures that the edge map—the "robust proxy" for the image—remains stable even when the input is under attack.
Key Insights
- Edges as a Robust Proxy: It is computationally difficult for an attacker to manipulate a binary edge map within standard $\ell_\infty$ perturbation budgets without making the changes perceptible.
- Backdoor Sanitization: Edge extraction naturally filters out many backdoor triggers that rely on specific pixel textures or colors, as these are "washed away" during the edge detection process.
- The Shape-Texture Trade-off: While EdgeNetRob offers superior robustness, it incurs a performance penalty on clean data. EdgeGANRob serves as a middle ground, leveraging GANs to bridge the gap between abstract edges and realistic imagery.
Results and Discussion
Our evaluation across datasets like Fashion MNIST, CelebA, and ImageNet reveals significant gains:
- Adversarial Defense: On Fashion MNIST, EdgeNetRob maintained 76.75% accuracy under PGD-40 attacks, compared to just 0.48% for a standard model.
- Backdoor Mitigation: EdgeGANRob reduced the Attack Success Rate (ASR) of pixel-pattern backdoors from 94.3% to a mere 0.07%.
- Corruption Robustness: Edge-based models consistently outperformed vanilla CNNs across 15 types of common corruptions, including blur and weather effects.
Conclusion
Forcing CNNs to prioritize global shape over local texture is a powerful strategy for building generalized robustness. While there is a trade-off between clean accuracy and robustness, pipelines like EdgeGANRob and tools like Robust Canny demonstrate that shape features can effectively shield models from adversarial noise, corruptions, and backdoors. Future work will focus on refining semantic feature extractors for more complex, high-resolution scenes.
Summary updated