Robustness Verification of Quantum Classifiers

Ji Guan, Wang Fang, Mingsheng Ying

TL;DR

This paper introduces a formal framework for verifying the robustness of quantum machine learning (QML) classifiers against unknown quantum noise. They develop an algorithm that can efficiently check if a QML classifier is robust and, if not, identify adversarial examples, which are crucial for improving classifier resilience.

What Problem Does This Paper Address?

Quantum machine learning (QML) holds immense promise for accelerating computations and solving complex problems. However, a major hurdle to its practical implementation is quantum noise, which can significantly degrade performance. In classical machine learning, "adversarial examples" are inputs subtly altered to cause misclassification, and robust classifiers are designed to resist these. This paper addresses the analogous problem in QML: how to ensure quantum classifiers remain accurate even when faced with unknown quantum noise, which acts as a form of adversary. The authors aim to provide a formal method to verify this robustness and to find these "quantum adversarial examples" to improve QML models.

Methods

The core contribution is a formal framework for robustness verification of QML classifiers. They define a metric for robustness based on fidelity, arguing it's more suitable than trace distance for QML due to the availability of many quantum state copies.

Key methodological contributions include:

  • Robustness Bound (Lemma 1): A quick, analytical bound that can efficiently under-approximate the robust accuracy. This is derived from the measurement outcomes of a quantum state.
  • Semidefinite Programming (SDP) Formulation: They show that computing the optimal robust bound for a quantum state can be reduced to solving an SDP problem. This allows for exact verification.
  • Robustness Verification Algorithm (Algorithm 1 & 2): Based on the SDP formulation, they develop an algorithm to precisely check if a quantum state is $\epsilon$-robust. If not, the algorithm can output an adversarial example. Algorithm 2 extends this to verify the robustness of the entire classifier.
  • TensorFlow Quantum Implementation: The proposed algorithms are implemented using Google's TensorFlow Quantum, demonstrating practical applicability.

Datasets

The paper evaluates their approach on several datasets:

  • Quantum Bits Classification: A synthetic dataset for binary classification on a single qubit, used as a "Hello World" example.
  • Quantum Phase Recognition: Data derived from simulating Hamiltonians for one-dimensional many-body systems.
  • Cluster Excitation Detection: Data generated to classify whether a prepared cluster state is "excited" or not.
  • MNIST: A downscaled version (16x16 pixels) of the classic handwritten digit dataset, encoded into pure quantum states. This serves as a comparison to classical robustness verification.

Key Insights and Ideas

  • Fidelity as the Right Metric: The paper makes a strong case for using fidelity as the primary metric for quantifying noise in QML, arguing it better reflects the scenario where many quantum state copies are available for analysis.
  • SDP for Exact Robustness: Reducing the problem of finding optimal robust bounds to an SDP is a significant theoretical advancement, enabling exact verification of $\epsilon$-robustness.
  • Adversarial Examples for Training: The ability to automatically generate quantum adversarial examples is crucial. These can be fed back into the training process (analogous to adversarial training in classical ML) to create more resilient QML models.
  • Efficiency of Robust Bound: The analytical robust bound (Lemma 1) provides a fast way to under-approximate robust accuracy, significantly speeding up the verification process by pre-filtering potential non-robust states.

Key Results

The paper demonstrates the effectiveness of their framework through experimental results on various QML tasks:

  • Quantum Bits Classification: Achieved 100% training and validation accuracy. Robustness verification showed that for small $\epsilon$ values (e.g., $10^{-3}$), the robust accuracy was high (around 90%), with verification times under a second for the robust bound method and around 2-7 seconds for the full SDP-based algorithm.
  • Quantum Phase Recognition: Achieved high accuracy (97.7% training, 95.25% validation). Robustness verification for $\epsilon = 10^{-4}$ showed robust accuracy around 99%, with verification times significantly faster using the robust bound (around 1.5s) compared to the SDP method (around 20-30s).
  • Cluster Excitation Detection: Achieved very high accuracy (99.76% training, 99.44% validation). Robustness verification for $\epsilon = 10^{-4}$ yielded robust accuracy around 99.2%, with verification times again showing a substantial speedup with the robust bound method.
  • MNIST Classification: Achieved 98.4% training and 97.5% validation accuracy. Robustness verification for $\epsilon = 10^{-4}$ showed robust accuracy around 99.2%, with very fast verification times for the robust bound method (under 0.1s) compared to the SDP method (under 0.9s).

Across all experiments, the robust bound method consistently provided a good under-approximation of robust accuracy and was significantly faster than the exact SDP-based verification.

Limitations and Future Work

  • Pure State Robustness: The paper notes that verifying robustness for pure states is harder, as it leads to a Quadratically Constrained Quadratic Program (QCQP), which is NP-hard. While they outline the QCQP formulation, efficiently solving it remains an open research problem.
  • Over-approximation: The current work focuses on under-approximating robust accuracy. Future work could explore methods for over-approximating robust accuracy, which, when combined with their under-approximation, could provide tighter bounds.
  • Scalability: For very large quantum systems (e.g., 50+ qubits), current methods might become computationally prohibitive. Incorporating tensor networks into their robustness verification algorithm is suggested to address this.
  • Practical Applications: Further research is needed to better understand the role of robustness in real-world QML applications and to explore more efficient methods for practical deployment.

Summary updated

BibTeX
@inproceedings{guan2021robustness,
  author = {Ji Guan and Wang Fang and Mingsheng Ying},
  title = {{Robustness Verification of Quantum Classifiers}},
  booktitle = {Cav},
  year = {2021},
  doi = {10.1007/978-3-030-81685-8\_7},
}
Figure