n-ML: Mitigating Adversarial Examples via Ensembles of Topologically Manipulated Classifiers

Mahmood Sharif, Lujo Bauer, Michael K. ReiterarXiv 2019

Introduction

Deep neural networks (DNNs) are highly effective but remain vulnerable to adversarial examples—carefully crafted inputs that cause misclassification through imperceptible perturbations. Existing defenses often face a "robustness-accuracy" trade-off, where protecting the model significantly degrades its performance on normal (benign) data. Additionally, many state-of-the-art detection methods are computationally expensive at inference time.

This paper introduces $n$-ML, a novel ensemble-based defense inspired by $n$-version programming. By employing a technique called "topology manipulation," $n$-ML trains individual networks to agree on benign inputs but explicitly disagree on adversarial ones, enabling robust detection via majority voting without sacrificing benign accuracy.

Methodology: Topology Manipulation

The core of $n$-ML is topology manipulation, which explicitly alters how a DNN behaves in the adversarial subspace. Unlike standard ensembles that might rely on different architectures or training data, $n$-ML forces models to learn divergent decision boundaries for adversarial inputs.

Conceptual illustration of topology manipulation shifting decision boundaries to ensure disagreement on adversarial inputs.

During training, each model in the ensemble is assigned a unique "derangement"—a mathematical permutation where no element maps to itself. The training objective is two-fold:

  1. Benign Accuracy: Correctly classify standard inputs.
  2. Adversarial Divergence: Classify adversarial examples as the specific incorrect class dictated by the model's assigned derangement.

At inference, the $n$-ML ensemble processes an input through $n$ manipulated models. If a threshold number of models ($\\ge \\tau$) agree on a class, the prediction is accepted. If they disagree, the input is flagged as adversarial. Because each model is trained to fail in a different way, an attack that successfully fools one model is highly likely to be detected by the others.

Experimental Evaluation

The authors evaluated $n$-ML on three benchmarks: MNIST, CIFAR10, and the German Traffic Sign Recognition Benchmark (GTSRB). These datasets provide a range of complexity and class counts, which is critical for testing the diversity of derangement-based ensembles.

Example of an adversarial attack on a CIFAR10 image: (a) original, (b) perturbation, (c) adversarial result.

Key Results

  • Robustness vs. Accuracy: On CIFAR10, a 9-model ensemble achieved 94.50% benign accuracy while maintaining a 0.00% success rate for black-box $L_\\infty$ attacks. This significantly outperforms standard adversarial training (AdvPGD), which reached only 87.24% benign accuracy and allowed a 14.02% attack success rate.
  • White-Box Resilience: Even under full-knowledge white-box attacks, $n$-ML remained resilient, particularly on datasets with many classes. On GTSRB (43 classes), an 18-model ensemble kept white-box success rates below 8.20% while maintaining high benign accuracy (86.01%–93.19%).
  • Computational Efficiency: $n$-ML is significantly faster than competing detection methods. At inference time, it demonstrated a speedup of 45$\times$ to 199$\times$ compared to state-of-the-art detectors like LID and NIC.

Discussion and Limitations

$n$-ML effectively breaks the transferability of adversarial examples by design. By forcing models to map adversarial targets to different classes, it prevents attackers from finding a single perturbation that fools the entire ensemble.

However, the method has limitations:

  • Class Count Dependency: The effectiveness of derangements scales with the number of classes. It is difficult to apply to binary classification where only one possible derangement exists.
  • Resource Overhead: While faster than complex detectors, running an ensemble of $n$ models still requires more memory and compute than a single model, which may impact deployment on edge devices.

Future research may explore topology manipulation techniques that do not rely on derangements to support low-class tasks and evaluate the defense against physical-world adversarial perturbations.

Summary updated

BibTeX
@misc{sharif2019n,
  author = {Mahmood Sharif and Lujo Bauer and Michael K. Reiter},
  title = {{n-ML: Mitigating Adversarial Examples via Ensembles of Topologically Manipulated Classifiers}},
  year = {2019},
  eprint = {1912.09059},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1912.09059},
}
Figure