Ensemble Defenses
What you'll learn: How combining multiple diverse models creates a stronger defense against adversarial attacks than any single model alone.
The Core Idea
Just as a diverse investment portfolio reduces financial risk, an ensemble defense uses multiple neural networks with different architectures, training methods, or randomization strategies to make adversarial attacks significantly harder. An adversary who crafts a perturbation to fool one model will likely fail against others in the ensemble, forcing them to find a perturbation that simultaneously deceives all models—a much harder optimization problem.
Why Diversity Matters
The key insight is diversity breaks transferability. You've learned that adversarial examples often transfer between models, but this transfer weakens when models differ substantially. By training models with:
- Different architectures (ResNet, DenseNet, Vision Transformer)
- Different training procedures (standard training, adversarial training with different attack budgets)
- Different random initializations or augmentations
- Different defensive preprocessing methods
...you create an ensemble where each member has unique decision boundaries. An attacker must now find perturbations in the intersection of all models' vulnerabilities—a dramatically smaller attack surface.
Making Predictions
At inference time, the ensemble aggregates predictions (majority vote for classification, averaging logits, etc.). Even if an adversarial example partially succeeds against one or two models, the collective decision remains correct if the majority are robust.
The Tradeoff
Ensemble defenses increase computational cost linearly with the number of models. You're trading inference speed and memory for robustness. This approach works best when combined with other defenses like adversarial training on each ensemble member.
Key Takeaway: Ensemble defenses leverage model diversity to reduce adversarial transferability, making attacks require simultaneous success against multiple independent models—significantly raising the bar for adversaries at the cost of increased computational resources.