Benchmarking Adversarially Robust Quantum Machine Learning at Scale

Maxwell T. West, Sarah M. Erfani, Christopher Leckie, Martin Sevior, Lloyd C. L. Hollenberg, Muhammad Usman · DOI

TL;DR

Researchers have demonstrated that Quantum Machine Learning (QML) models exhibit a unique "one-way" robustness: they are remarkably resilient to classical adversarial attacks that easily fool standard neural networks. By learning "classically intractable" features that are semantically meaningful rather than relying on high-frequency noise, these quantum models offer a new pathway toward a "quantum advantage" centered on security and reliability rather than just raw speed.

What Problem Does This Paper Address?

Deep learning has a well-known Achilles' heel: adversarial attacks. By adding tiny, often imperceptible perturbations to an input (like an image), an attacker can cause a high-performing neural network to make confident, incorrect predictions. This poses a massive hurdle for deploying AI in safety-critical areas like autonomous vehicles or cybersecurity.

While classical defenses like adversarial training exist, they are often computationally expensive and not universally effective. This paper investigates whether Quantum Machine Learning—specifically Quantum Variational Classifiers (QVCs)—might be inherently more robust. Crucially, the authors move beyond previous "toy" studies to benchmark these models at scale using full-sized, complex image datasets.

Methods

The authors developed a comprehensive framework to compare classical architectures (a standard ConvNet and ResNet18) against QVCs of varying depths (200 to 1000 layers).

Key technical components include:

  • Amplitude Encoding: A method to map high-dimensional classical data (like a $32 \times 32 \times 3$ image) into a quantum state. This allows the researchers to represent complex data using only 10–12 qubits by utilizing the exponentially large Hilbert space of the quantum system.
  • Adversarial Attacks: The models were tested against three heavy-hitters in the adversarial literature: Projected Gradient Descent (PGD), Fast Gradient Sign Method (FGSM), and AutoAttack.
  • Transferability Testing: The researchers generated "white-box" attacks (where the attacker knows the model's internal weights) on one model and applied them to another ("black-box" setting) to see if the vulnerability persisted across different architectures.
FIG. 1. Adversarial Machine Learning Benchmark Framework. A flowchart diagram of the quantum/classical adversarial ML framework developed to benchmark their robustness against a range of sophisticated adversarial attacks. a. A variety of image datasets (MNIST, FMNIST, CIFAR and Celeb-A) are selected to train and test classical and quantum ML networks. b. An example image from the FMNIST dataset along with an adversarial attack and the attacked image is shown. For each image dataset, adversarial attacks (PGD, FGSM, and AutoAttack) are generated with variable strengths controlled by ϵ (with respect to the l∞norm). Importantly, we generate both quantum and classical attacks to test their transferability across networks, i.e., quantum attacks on classical networks and vice versa. c. Schematic diagram of a typical classical neural network is illustrated. In our work, two classical neural networks (ConvNet and ResNet) were trained to directly compare their performance against the quantum ML networks. The exact configurations of the classical networks are described in the Appendix. d. Schematic diagram of a quantum variational classifier (QVC) network trained and tested in this work. The QVC network consists of a data loading layer where the input image data is amplitude encoded into a quantum state. The variational part of the QVC consists of a repeated pattern of layers – only two such layers are shown. We trained and tested a number of QVC networks with varying number of repeated layers, which are labelled based on the number of repeated layers, e.g., a QVC200 network contains 200 layers. The final stage of the network is a measurement layer which determines the classification label. e, f. Here we depict the performance of a quantum and a classical network against an adversarial attack, where a small, carefully chosen perturbation is added to an image (as shown in b) which is then passed to both a neural network and a QVC for classification. The probabilities that are assigned to various labels by the networks are shown as a function of the strength of the attack. At a certain critical attack strength the correct label (“Shirts”, shown in orange) is no longer considered the most probable by the classical network (see e), and the attack has succeeded in fooling the model. Contrarily, the same attacked image when passed to a QVC is still correctly predicted as “Shirts” (see f), even when the attack strength is increased well beyond what is tolerated by the classical network.

Datasets

The study utilized four standard benchmarks, notably avoiding the downscaling common in other QML papers:

  1. MNIST: $28 \times 28$ grayscale digits.
  2. FMNIST (Fashion-MNIST): $28 \times 28$ grayscale clothing items.
  3. CIFAR-10: $32 \times 32$ RGB images (restricted to binary classification: ships vs. trucks).
  4. Celeb-A: $32 \times 32$ RGB celebrity faces (task: identifying black hair).

Key Insights and Ideas

  • The One-Way Resiliency: The most striking finding is an asymmetry in vulnerability. Attacks designed to fool classical networks fail to deceive QVCs. However, attacks designed to fool QVCs successfully deceive classical networks.
  • Meaningful vs. Abstract Features: Classical networks often rely on "non-robust" features—complex, high-frequency patterns that are invisible to humans but informative for the model. Adversarial attacks exploit these. QVCs, however, appear to learn "classically intractable" features.
  • Semantic Perturbations: When you look at the noise generated to fool a QVC, it actually looks like a logical change to a human. For example, to make a QVC misclassify a T-shirt, the attack might add "sleeves" to the image. In contrast, classical attacks just look like incomprehensible static.
FIG. 3. Content of Adversarial Perturbations. The adversarial perturbations generated by ϵ = 0.1 PGD attacks on the convolutional neural network, ResNet and the 500 layer quantum variational classifier (QVC500) are shown for several examples from the FMNIST and Celeb-A databases. In the case of FMNIST the task is to distinguish between classes of images representing various types of clothing, e.g., t-shirts, pants, shoes, while in the case of Celeb-A the classification problem is to determine whether or not the featured person has black hair. The perturbations generated by the classical networks are incomprehensible to humans, exploiting the highly abstract features discovered by these networks. The attack on the QVC, on the other hand, yields perturbations whose semantic content is clear; they constitute concrete steps towards actually changing the label of the clean image (i.e., filling in the gap between the legs of the pants, adding sleeves to the t-shirt, removing sleeves from the jumper, changing the hair colour of the imaged person).
  • A New Quantum Advantage: Traditionally, quantum advantage is sought in speed (algorithmic speedup) or accuracy. This paper proposes a third category: Robustness Advantage.

Key Results

  • Superior Defense: In tests across all datasets, QVCs maintained reasonable accuracy even under intense classical attacks ($\epsilon \ge 0.2$) that reduced classical model accuracy to near zero.
  • Resource Efficiency: Remarkably, QVCs achieved competitive accuracies while using orders of magnitude fewer trainable parameters than their classical counterparts (e.g., 6,000 parameters for QVC200 vs. $\sim 10^7$ for ResNet18).
  • Attack Detection: The authors proposed a hybrid detection system. Because classical and quantum models "see" different features, they tend to disagree only when an adversarial attack is present. This disagreement can be used as a high-accuracy trigger for detecting malicious inputs.
FIG. 2. Transferability and Defence. The accuracy achieved by classical and quantum networks on sets of 250 adversarially attacked test images from each of the considered datasets in the cases of white box PGD attacks on the convolutional network (top row), and 200 layer quantum variational classifier (QVC200, bottom row) as a function of attack strength ϵ (measured with the l∞norm). In both cases we see the accuracy of the network under attack decrease sharply. The tendency of the accuracy of the independent networks to also decrease is a manifestation of the transferability of adversarial examples - they are typically capable of fooling even networks which they were not explicitly designed to attack. We see an exception to this in the top row, with the quantum classifier largely resisting the attacks generated with respect to the convolutional neural network.

Limitations and Future Work

  • Hardware Constraints: The simulations were performed in noiseless environments. The deep circuits required (up to $10^4$ gates) are beyond the reach of current "noisy" (NISQ) quantum hardware. The authors estimate that fault-tolerant quantum computers with $\sim 5000$ qubits will be needed for practical implementation.
  • Data Loading: The amplitude encoding step is currently computationally expensive and remains a bottleneck for real-time applications.
  • Architectural Diversity: Future work is needed to see if these findings hold for other quantum architectures, such as Quantum Convolutional Neural Networks (QCNNs), which might scale even better for image data.

Summary updated

BibTeX
@misc{west2022benchmarking,
  author = {Maxwell T. West and Sarah M. Erfani and Christopher Leckie and Martin Sevior and Lloyd C. L. Hollenberg and Muhammad Usman},
  title = {{Benchmarking Adversarially Robust Quantum Machine Learning at Scale}},
  year = {2022},
  eprint = {2211.12681},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2211.12681},
}
Figure