Blacklight: Scalable Defense for Neural Networks against Query-Based Black-Box Attacks

Huiying Li, Shawn Shan, Emily Wenger, Jiayun Zhang, Haitao Zheng, Ben Y. ZhaoUSENIX Security 2022

TL;DR

This paper introduces Blacklight, a novel defense system that effectively detects and mitigates query-based black-box adversarial attacks on neural networks. By leveraging probabilistic content fingerprints to identify highly similar queries, Blacklight achieves near-perfect detection rates with minimal overhead, even against persistent attackers.

What Problem Does This Paper Address?

Deep neural networks (DNNs) are vulnerable to adversarial examples – inputs subtly modified to fool the model. While white-box attacks assume full model access, black-box attacks are more realistic, interacting with models via APIs. Query-based black-box attacks, in particular, iteratively query a model to craft adversarial examples. Existing defenses often rely on account-level detection, which is easily bypassed by attackers using multiple accounts. This paper addresses the critical need for a scalable, account-oblivious defense that can detect individual attack queries in real-time and prevent attacks from completing, even when attackers are persistent and adaptive.

Methods

Blacklight's core innovation lies in its probabilistic content fingerprinting approach. The fundamental insight is that query-based attacks generate sequences of queries that are highly similar in the input space. Blacklight transforms each input image into a compact fingerprint by:

  1. Salted Pixel Quantization: Pixels are quantized to discrete values, and a random salt is applied to resist reverse engineering. This step also increases similarity between attack queries.
  2. Sliding Window Hashing: The quantized image is processed by a sliding window, generating a set of hash values for overlapping segments.
  3. Probabilistic Fingerprint Selection: A small, fixed-size subset of these hash values is probabilistically selected as the fingerprint.

An incoming query's fingerprint is then compared against a database of previously seen fingerprints. If a high degree of overlap is detected (exceeding a threshold), the query is flagged as adversarial. This approach is designed to be fast, scalable, and robust against attackers trying to evade detection.

Datasets

The paper evaluates Blacklight on four standard image classification datasets:

  • MNIST: For digit recognition.
  • GTSRB: For traffic sign recognition.
  • CIFAR-10: For object recognition (small images).
  • ImageNet: For object recognition (large images).

Additionally, Blacklight's generalization to text classification is demonstrated using the IMDB dataset.

Key Insights and Ideas

  • Query Similarity is the Key: The core insight is that adversarial attacks, by their iterative nature, produce queries that are remarkably similar to each other. This similarity is the Achilles' heel of these attacks.
  • Account-Oblivious Defense is Crucial: Defenses that rely on tracking accounts are insufficient against persistent attackers who can easily switch accounts. Blacklight's per-query detection bypasses this limitation.
  • Probabilistic Fingerprinting Balances Sensitivity and Efficiency: The probabilistic fingerprinting method is designed to be highly sensitive to small changes (detecting attacks) while remaining robust to minor variations in benign images and being computationally efficient.
  • Salted Quantization Enhances Robustness: The use of salted pixel quantization is critical for resisting adaptive attackers who try to reverse-engineer the defense parameters.
  • Defense Can Be Generalizable: The core fingerprinting idea can be adapted to other domains like text classification, demonstrating its broad applicability.

Key Results

  • Near-Perfect Detection: Blacklight achieved 100% attack detection rate against eight state-of-the-art query-based black-box attacks across various models and datasets.
  • High Detection Coverage: Blacklight detected over 96% of attack queries, except for the slower Boundary attack.
  • Rapid Detection: Attacks were typically detected after only 2-9 queries, significantly reducing the attacker's ability to probe the model.
  • 0% Attack Success Rate with Mitigation: By rejecting detected attack queries, Blacklight prevented any attack from completing, even when attackers persisted.
  • Scalability and Low Overhead: Blacklight's per-query runtime was minimal (4-8ms on an Intel i7 for CIFAR10 with 1 million queries in the database), and storage requirements were negligible.
  • Robustness: Blacklight demonstrated robustness against adaptive attacks, including those attempting to reduce query similarity, increase perturbation budgets, or exploit reset windows.
  • Generalization: Blacklight successfully generalized to text classification, achieving 100% detection and >99.7% coverage.

Limitations and Future Work

  • Substitute Model Attacks: Blacklight is designed for query-based attacks and does not defend against substitute model attacks. The authors suggest combining Blacklight with defenses like ensemble adversarial training for a hybrid solution.
  • Future-Proofing: Blacklight relies on the assumption that query-based attacks will continue to produce highly similar queries. A future attack that breaks this assumption would evade Blacklight.
  • Adaptive Attack Research: The paper explored several adaptive attacks and found Blacklight to be robust, but acknowledges the ongoing arms race between attackers and defenders. Future work could involve further exploring more sophisticated adaptive attacks.

Summary updated

BibTeX
@inproceedings{li2022blacklight,
  author = {Huiying Li and Shawn Shan and Emily Wenger and Jiayun Zhang and Haitao Zheng and Ben Y. Zhao},
  title = {{Blacklight: Scalable Defense for Neural Networks against Query-Based Black-Box Attacks}},
  booktitle = {USENIX Security},
  year = {2022},
  url = {https://openreview.net/forum?id=ubLeIJtmts},
}
Figure