Introduction
Deep Neural Networks (DNNs) are notoriously fragile; tiny, human-imperceptible "adversarial perturbations" can trick them into making confident, incorrect predictions. To counter this, researchers often use random defense strategies—injecting randomness into the data or feature maps to "confuse" the attacker.
However, existing random defenses face three major hurdles:
- Data Dependency: Defense performance is often highly sensitive to noise hyperparameters (like variance), making it hard to generalize across datasets without extensive re-tuning.
- The Accuracy Tax: Adding randomness usually degrades a model's performance on clean, non-adversarial data.
- Lack of Theory: There is little formal understanding of the trade-off between natural accuracy and robust defense in randomized settings.
This paper introduces Deformable Convolution with Stochasticity (DCS), a novel defense mechanism that builds adversarial robustness directly into a network's architecture rather than injecting noise into the input data. By replacing fixed convolutional offsets with random sampling masks, DCS achieves state-of-the-art (SOTA) robustness while simultaneously improving "natural" (clean) accuracy, breaking the typical trade-off seen in randomized defenses.
Methodology: Moving Randomness to the Structure
The authors propose moving randomness from the input to the network structure itself. They adapt Deformable Convolutions (DCNs), which normally use learned offsets to sample input pixels. In DCS, these fixed offsets are replaced with stochastic masks.
Key Components
- Stochastic Deformable Kernels: For every forward pass, the model randomly samples a set of points within a defined boundary to form its convolutional kernel. This creates a massive space of possible "inference paths" for the same input.
- Theoretical Bounds: The authors derive a data-independent constraint for the kernel size. They prove that by keeping the size within a specific range, they can minimize gradient cosine similarity (making it harder for attacks to transfer between random paths) while keeping output inconsistency low (preserving clean accuracy).
- Gradient-Selective Adversarial Training (GSAT): Standard adversarial training is modified to identify and mask out pixels that are particularly vulnerable to gradient-based attacks, further stabilizing the model.
Key Insights
- Structural Randomness is More Robust: Unlike additive noise, structural randomness is inherently more independent of the input data distribution. This makes the defense more "plug-and-play" across different datasets.
- The "Inference Path" Concept: By sampling different kernels, the network effectively becomes an ensemble of many sub-networks. An attacker might find a perturbation for one "path," but it is unlikely to transfer to the random path chosen during actual inference.
- Gradient Cosine Similarity as a Metric: Robustness in randomized models is essentially a problem of attack transferability. If the gradients of two different random paths are highly similar, an attack on one will likely succeed on the other. DCS explicitly minimizes this similarity.
Results and Performance
Evaluated on CIFAR-10, CIFAR-100, and ImageNet, DCS achieves a rare "double win": higher robustness and higher clean accuracy compared to previous SOTA random defense methods. The authors also demonstrated that DCS can be adapted to Vision Transformers (ViT) by replacing specific patch-embedding convolutions with DCS layers.
- CIFAR-10 (ResNet-18): DCS improved robust accuracy under the AutoAttack (AA) benchmark by 26.07% and boosted natural accuracy by 7.94% compared to a standard model.
- SOTA Comparison: On CIFAR-10, DCS achieved 75.46% accuracy under AutoAttack, outperforming other structural defenses like SAF (67.40%) and randomized methods like LWTA (74.71%).
- Stability: DCS maintains high accuracy even as the strength (epsilon) or duration (steps) of the adversarial attack increases.
Limitations and Future Work
While highly effective, DCS does increase training time. For example, training a DCS model took approximately 380 minutes compared to 213 minutes for the baseline. However, the inference overhead is negligible (6.67s vs 5.94s), which is the more critical metric for real-world deployment. Additionally, finding the optimal kernel size requires some empirical validation for different architectures. Future work will explore applying these data-independent structural defenses to zero-shot inference scenarios, where the model must defend against attacks on entirely unseen categories of data.
Summary updated