Defending against Data-Free Model Extraction by Distributionally Robust Defensive Training

Zhenyi Wang, Li Shen, Tongliang Liu, Tiehang Duan, Yanjun Zhu, Donglin Zhan, David Doermann, Mingchen GaoNeurIPS 2023

TL;DR

MeCo (Memory and Computation efficient defense) is a novel framework designed to protect black-box AI models from "Data-Free Model Extraction" (DFME) attacks. By using distributionally robust training to inject data-dependent noise, MeCo effectively "gaslights" attackers with misleading information while maintaining high accuracy and lightning-fast inference for legitimate users.

The Threat of Data-Free Model Extraction

Training state-of-the-art AI models is expensive, making them valuable intellectual property. Attackers often try to "steal" these models through Model Extraction, where they query a public API and use the outputs to train a "clone" model.

The most dangerous variant is Data-Free Model Extraction (DFME). Here, the attacker doesn't even need access to the original training data; they use synthetic or out-of-distribution data to probe the target model. Existing defenses against this are often slow, memory-intensive, or require unrealistic assumptions about what the attacker is doing. The authors set out to create a defense that is effective, efficient, and doesn't require prior knowledge of the attacker's strategy.

How MeCo Works

The authors introduce MeCo (Memory and Computation efficient defense). Its core mechanism is a randomized defense strategy that adds data-dependent perturbations to every query input.

MeCo sabotages the attacker through three main channels:

  1. Mismatching Knowledge Distillation (KD) Loss: It forces a gap between what the attacker thinks the model output should be and what it actually is.
  2. Disturbing Zeroth-Order Gradients: DFME attacks often rely on estimating gradients by slightly tweaking inputs. MeCo’s random noise makes these estimates wildly inaccurate.
  3. Flipping Labels: For decision-based attacks, MeCo shifts queries near the decision boundary just enough to change the predicted label.
The intuition behind MeCo: shifting data points to disturb the attacker's view while keeping benign queries safe.

To ensure this noise doesn't ruin the experience for legitimate users, the authors use Distributionally Robust Optimization (DRO). During training, the model and a "perturbation generator" (a small network) are trained together. The DRO framework simulates "worst-case" scenarios for in-distribution data, ensuring the model remains accurate even when the perturbation is applied to benign queries.

The DRO framework simulates worst-case test distributions to guarantee model utility.

Experimental Setup

The researchers evaluated MeCo across four standard computer vision benchmarks: MNIST, CIFAR-10, CIFAR-100, and MiniImageNet. They tested the defense against various "clone" architectures, including ResNet-18, MobileNetV2, and DenseNet121, to ensure broad applicability.

Key Insights and Results

  • Exploiting the Boundary: Attackers using DFME typically generate synthetic data that sits near the target model's decision boundaries to maximize information gain. MeCo exploits this by injecting noise that specifically targets these "boundary-hugging" queries.
  • Gaslighting as Defense: Rather than just blocking suspicious queries (which attackers can learn to circumvent), MeCo feeds them "junk" information. The attacker's optimization process then converges toward a useless, "stolen" model.
  • Efficiency is Key: Unlike previous defenses that require solving complex optimization problems during every API call, MeCo’s perturbation is a simple forward pass through a tiny network, making it practical for real-world deployment.

Performance Highlights: * Effectiveness: MeCo reduced the accuracy of the attacker's clone model by up to 35% compared to an undefended model. * Speed: MeCo is significantly faster than previous state-of-the-art defenses, achieving a 17x to 172x speedup in inference time. * Utility Preservation: Legitimate users see almost no impact. The drop in accuracy for benign queries was typically less than 1%, and the output probabilities remained stable. * Robustness: Even when tested against "Adaptive Attacks"—where the attacker knows the defense strategy and tries to counter it—MeCo remained effective because the introduced randomness is unpredictable.

Limitations and Future Work

While MeCo is highly effective against data-free attacks, its effectiveness weakens slightly if the attacker has access to data very similar to the original training set (Data-Based Model Extraction). Future work could involve extending this DRO-based defensive training to other domains beyond computer vision, such as Natural Language Processing (NLP), where model extraction is also a growing concern.

Summary updated

BibTeX
@inproceedings{wang2023defending,
  author = {Zhenyi Wang and Li Shen and Tongliang Liu and Tiehang Duan and Yanjun Zhu and Donglin Zhan and David Doermann and Mingchen Gao},
  title = {{Defending against Data-Free Model Extraction by Distributionally Robust Defensive Training}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=7DZAVpOoAK},
}
Figure