Guardian of the Ensembles: Introducing Pairwise Adversarially Robust Loss for Resisting Adversarial Attacks in DNN Ensembles

Shubhi Shukla, Subhadeep Dalui, Manaar Alam, Shubhajit Datta, Arijit Mondal, Debdeep Mukhopadhyay, Partha Pratim ChakrabartiarXiv 2021

TL;DR

The Pairwise Adversarially Robust Loss (PARL) is a novel training objective that forces neural network ensembles to develop diverse decision boundaries and internal feature representations. By penalizing similarity in gradients and layer outputs between ensemble members, PARL significantly boosts robustness against black-box adversarial attacks—achieving up to a 24.8% improvement over current state-of-the-art methods—without the heavy computational overhead or clean-accuracy trade-offs of traditional adversarial training.

What Problem Does This Paper Address?

Deep Learning models are notoriously fragile. A tiny, human-imperceptible perturbation to an image—an Adversarial Example (AE)—can easily trick a state-of-the-art classifier. Worse yet, these attacks are often "transferable": an AE designed to fool Model A will frequently fool Model B as well.

Ensembles (groups of models voting together) are a natural defense, but they only work if the models are truly different. If every model in your ensemble learns the same decision boundaries, they will all fall for the same tricks. Existing defenses often struggle to enforce this diversity effectively, or they require "Adversarial Training" (training on the attacks themselves), which is computationally expensive and often degrades the model's performance on normal, "clean" data.

Methods

The authors introduce PARL, a loss function designed to be used during the simultaneous training of an ensemble. PARL works by adding a unique penalty term to the standard training loss, focusing on two types of diversity:

  1. Gradient Dissimilarity: The loss penalizes pairs of models if their gradients (with respect to intermediate layer weights) point in the same direction. If gradients are orthogonal (at 90 degrees) or divergent, an attacker trying to find a "vulnerable direction" for one model will likely miss the mark for the others. Visualizing how divergent gradients (d) differ from similar ones (b, c)
Figure 1. (a) Input image; (b) ∇prim: Gradient of loss in the primary model; (c) ∇sim: Gradient of loss in another model with similar decision boundaries; (d) ∇div: Gradient of loss in a model with not so similar de- cision boundaries but comparable accuracy; (e) Symbolic directions of all the gradients in higher dimensions. Gradients are computed with respect to the image shown in (a).
  1. Internal Representation Diversity: PARL also minimizes the correlation between the outputs of intermediate convolutional layers across different models. This ensures that each model "looks" at the features of an image (like edges or textures) in a unique way. Contrasting internal representations (d, e) vs. similar ones (b, c)
Figure 2. (a) Input image; (b) and (c) Similar outputs of an intermediate convolution layer of two classifiers with similar internal representations; (d) and (e) Contrasting outputs of an intermediate convolution layer of two classifiers which are trained simultaneously to have distinct internal representations

The "magic" of PARL lies in multiplying these two terms. A model is only "rewarded" (by a lower penalty) if it achieves both gradient diversity and unique feature representations. This prevents the ensemble from taking shortcuts that optimize one metric while ignoring the other.

Datasets

The researchers evaluated PARL across three standard computer vision benchmarks:

  • CIFAR-10: 10 classes of small images.
  • CIFAR-100: 100 classes of small images.
  • Tiny ImageNet: A more complex dataset with 200 classes.

They tested these using popular architectures like ResNet20 and WideResNet28-10, as well as smaller models like VGG16 and LeNet-5 to prove generalizability.

Key Insights and Ideas

  • Diversity is the Best Defense: The core "aha" moment is that transferability relies on shared vulnerabilities. By explicitly breaking the similarity between models at every layer, the authors make it mathematically difficult for a single adversarial perturbation to fool the majority of the ensemble.
  • Efficiency over Brute Force: Unlike adversarial training (like the popular TRADES method), which requires generating expensive adversarial examples during every step of training, PARL uses standard clean data. It simply looks at the internal state of the models, making it roughly 3x faster to train than TRADES.
  • Layer Selection Matters: The authors found that enforcing diversity in the early and middle layers of a network is most effective. Diversity in the final layers is less helpful because those layers are forced to converge on the same output labels anyway.

Key Results

  • Superior Robustness: On CIFAR-10 using ResNet20, PARL achieved a robust accuracy of 64.6% against strong black-box attacks ($\epsilon = 0.07$). This is a massive 24.8% increase over the previous state-of-the-art ensemble defense (ENSEIO).
  • Better Utility: Compared to TRADES (adversarial training), PARL provided similar robust accuracy but maintained a 3.68% higher clean accuracy.
  • Quantifiable Diversity: Using Centered Kernel Alignment (CKA) analysis, the authors proved that PARL models actually have significantly lower similarity scores across their layers compared to standard ensembles. CKA analysis showing lower similarity (red lines) in PARL models
Figure 3. Layer-wise linear CKA values between each pair of models trained with CIFAR-10 on (a) Resnet20 and (b) WideResnet28-10 showing the similarities at each layer.

Limitations and Future Work

While PARL is a powerhouse against black-box attacks (where the attacker doesn't know the target's exact parameters) and query-based attacks, its performance against white-box attacks (where the attacker has full access to the entire ensemble) is still relatively low. The authors acknowledge this as a primary limitation and plan to focus future research on bridging this gap. Additionally, while the training is faster than adversarial training, it still takes longer than training a standard "unprotected" ensemble due to the pairwise calculations.

Summary updated

BibTeX
@misc{shukla2021guardian,
  author = {Shubhi Shukla and Subhadeep Dalui and Manaar Alam and Shubhajit Datta and Arijit Mondal and Debdeep Mukhopadhyay and Partha Pratim Chakrabarti},
  title = {{Guardian of the Ensembles: Introducing Pairwise Adversarially Robust Loss for Resisting Adversarial Attacks in DNN Ensembles}},
  year = {2021},
  eprint = {2112.04948},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2112.04948},
}
Figure