Defending Against Machine Learning Model Stealing Attacks Using Deceptive Perturbations

Taesung Lee, Benjamin Edwards, Ian Molloy, Dong SuarXiv 2018

This paper from IBM Research AI presents a clever way to protect proprietary machine learning models from "stealing" attacks without sacrificing the utility of the service for legitimate users.

TL;DR

The authors propose a defense against model stealing by injecting "deceptive perturbations" into the output probability scores of a model. By using a specialized "Reverse Sigmoid" function, they preserve the model's top-1 accuracy while misleading attackers, forcing them to use up to 64x more queries or suffer a significant drop in stolen model performance.

What Problem Does This Paper Address?

Machine Learning as a Service (MLaaS) providers (like Google, Microsoft, and IBM) offer APIs where users pay to get predictions from high-quality, pre-trained models. However, these models are vulnerable to model stealing attacks. An adversary can query the API thousands of times with different inputs, record the outputs, and use that data to train their own "stolen" version of the model for free.

Previous research showed that if an attacker has access to the full probability distribution (e.g., "Class A: 0.85, Class B: 0.10..."), they can steal the model 50–100x faster than if they only had the final label. While a service provider could just hide these probabilities, doing so hurts legitimate users who rely on confidence scores for decision-making. The challenge is: How do you provide useful confidence scores while preventing an attacker from using them to clone your model?

Methods

The authors introduce an add-on layer that applies a Reverse Sigmoid perturbation to the output probabilities.

Standard models typically use a Softmax layer to produce probabilities. The proposed defense modifies these values such that:

  1. The top-1 label remains unchanged: If the model originally predicted "Cat" with the highest probability, it still does. This preserves the model's primary utility.
  2. The probabilities are "deceptive": The noise is specifically designed to maximize the loss function of the attacker’s training process.
  3. Ambiguity is introduced: The Reverse Sigmoid function is non-monotonic (it has "humps"). As shown in Figure 1, multiple different input values can map to the same output probability. This makes it mathematically impossible for an attacker to simply "reverse" the noise, even if they know the exact defense algorithm being used.
Figure 1: Example Reverse Sigmoid and Sigmoid activation functions.

Datasets

The researchers evaluated their defense across a wide range of domains and complexities:

  • Image Classification: MNIST, FASHION-MNIST, CIFAR-10, CIFAR-100, and STL-10.
  • Text Classification: IMDB sentiment analysis.

They split these datasets so that the "base model" (the target) was trained on 67% of the data, while the attacker was given access to the remaining 33% (without labels) to use for their queries.

Key Insights and Ideas

  • Probabilities are the "Secret Sauce": The paper confirms that probabilities provide a much richer signal for training than hard labels. Attackers use this signal to learn the decision boundaries of the target model much faster.
  • Forcing a Suboptimal Attack: The goal of the defense isn't to make stealing impossible, but to make it so inefficient that it's no longer cost-effective. By ruining the probability signal, they force the attacker to use only the top-1 labels (the "Argmax" attack), which is significantly slower to converge.
  • Jacobian Augmentation Pitfalls: Interestingly, the authors found that Jacobian-based attacks—often considered state-of-the-art for generating adversarial examples—are actually less effective for model stealing because they often generate samples that the base model misclassifies, effectively teaching the stolen model the wrong information.

Key Results

The defense proved highly effective against the strongest known attacks:

  • Accuracy Degradation: The defense dropped the accuracy of stolen models by at least 20% across all tested datasets.
  • Increased Query Cost: On the MNIST dataset, the attacker needed 64x more queries to reach the same level of agreement with the base model compared to an unprotected model. On CIFAR-10, the cost increased by 4x.
  • Robustness to "Defense-Aware" Attackers: Even when the attacker knew the defense was in place and tried to use specialized loss functions (like Mean Squared Error) or inversion mappings to recover the original probabilities, they could not beat the performance of a simple labels-only attack.
Figure 2: Performance of three different model stealing approaches.

As seen in Figure 2, the "Probabilities" attack (solid line) is extremely efficient on unprotected models, but the defense aims to push the attacker down to the "Argmax" (circles) or lower performance levels.

Limitations and Future Work

While the defense is strong, the authors acknowledge a few areas for further exploration:

  • Adversarial Examples: While the defense protects the model's weights and logic, the perturbed output distribution might still leak enough information to help an attacker generate adversarial examples (inputs designed to fool the model).
  • Information Leakage: Using a Multi-Layer Perceptron (MLP) for inversion can recover some of the lost information, though the authors showed this still doesn't result in a high-fidelity stolen model.
  • Utility Trade-offs: While top-1 accuracy is preserved, applications that require extremely precise, un-perturbed confidence scores (like certain medical diagnostics) might find the 0.2 Mean Absolute Error (MAE) introduced by the noise to be a hurdle.

Summary updated

BibTeX
@misc{lee2018defending,
  author = {Taesung Lee and Benjamin Edwards and Ian Molloy and Dong Su},
  title = {{Defending Against Machine Learning Model Stealing Attacks Using Deceptive Perturbations}},
  year = {2018},
  eprint = {1806.00054},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1806.00054},
}
Figure