Abstract
We propose a conceptually simple and lightweight framework for improving the robustness of vision models through the combination of knowledge distillation and data augmentation. We address the conjecture that larger models do not make for better teachers by showing strong gains in out-of-distribution robustness when distilling from pretrained foundation models. Following this finding, we propose Discrete Adversarial Distillation (DAD), which leverages a robust teacher to generate adversarial examples and a VQGAN to discretize them, creating more informative samples than standard data augmentation techniques. We provide a theoretical framework for the use of a robust teacher in the knowledge distillation with data augmentation setting and demonstrate strong gains in out-of-distribution robustness and clean accuracy across different student architectures. Notably, our method adds minor computational overhead compared to similar techniques and can be easily combined with other data augmentations for further improvements.
Introduction
In modern computer vision, foundation models like CLIP have demonstrated remarkable zero-shot capabilities and resilience to distribution shifts. However, their massive parameter counts make them impractical for deployment in resource-constrained environments, such as mobile devices or embedded systems. Conversely, smaller "student" models (e.g., ResNet-50 or ViT-Tiny) are efficient but notoriously fragile when encountering out-of-distribution (OOD) data, such as sketches, artistic renditions, or common image corruptions.
Traditional knowledge distillation (KD) focuses on transferring clean accuracy from a teacher to a student. This research introduces Discrete Adversarial Distillation (DAD), a framework designed specifically to distill the robustness of foundation models into lightweight architectures. By combining adversarial search with generative discretization, DAD enables small models to inherit the diverse "worldview" of their larger counterparts.
Methodology: Discrete Adversarial Distillation
DAD operates on the principle that a student model becomes more robust when exposed to challenging, yet semantically meaningful, variations of training data. The process consists of three primary stages:
- Adversarial "Worst-Case" Search: Rather than using standard data augmentations, DAD utilizes the robust teacher (CLIP) to identify adversarial perturbations. These are tiny, calculated changes to an image that are specifically designed to challenge the model's recognition capabilities.
- Generative Discretization: Raw adversarial perturbations often manifest as high-frequency digital noise that lacks semantic meaning. DAD addresses this by passing the perturbed images through a VQGAN (Vector Quantized Generative Adversarial Network). This step "discretizes" the noise, transforming it into realistic textures and patterns that remain challenging but are visually grounded in the natural image manifold.
- The Distillation Loop: The student model is trained to match the teacher’s soft predictions on both the original images and these generated discrete adversarial versions. Crucially, the teacher acts as an "oracle," filtering out any augmented images it cannot correctly identify, ensuring the student only learns from "hard but valid" examples.
One of the primary advantages of DAD is its efficiency. The challenging images are generated offline prior to the training phase. This decoupling allows the student to train without the computational burden of running a massive foundation model in every iteration, resulting in only a 2x training overhead compared to the 11x overhead typically associated with online adversarial training.
Theoretical Insights
A significant contribution of this work is the debunking of the "capacity gap" conjecture, which suggested that the performance gap between a massive teacher and a small student prevents effective distillation. The authors demonstrate that for OOD robustness, the opposite is true: the superior feature representations of foundation models provide a more comprehensive "coverage" of the data manifold, which is essential for teaching robustness.
Experimental Results
The DAD framework was evaluated across several rigorous OOD benchmarks, including ImageNet-A (natural adversarial examples), ImageNet-Sketch, and ImageNet-R (renditions).
- Robustness Gains: When distilling CLIP into a Vision Transformer (ViT-B), DAD achieved a 46.1% accuracy on ImageNet-Sketch, representing a 17.8% improvement over baseline methods. On ImageNet-R, the model reached 65.1%, an 11.3% increase.
- Architecture Agnosticism: The benefits were not limited to Transformers; standard architectures like ResNet-50 also showed significant robustness gains, proving the method's versatility.
- Efficiency: Compared to traditional adversarial training, DAD provides a much more scalable path to robustness, requiring significantly fewer computational resources while delivering superior OOD performance.
Conclusion
Discrete Adversarial Distillation provides a powerful and efficient mechanism for transferring the robustness of foundation models to smaller, deployable architectures. By leveraging generative discretization and adversarial search, DAD bridges the gap between efficiency and resilience. Future work may further enhance these results by incorporating more advanced generative models, such as Diffusion models, or by optimizing the text prompts used by the vision-language teachers.
Summary updated