Abstract
This paper introduces a novel, lightweight defense against black-box "model theft" attacks. In these attacks, adversaries query a machine learning API to train a substitute model, which is then used to craft transferable adversarial examples. The proposed defense strategy, label poisoning, subtly perturbs the output probability distribution of the API's predictions. This perturbation is designed to maximize the error in the attacker's training gradients, effectively neutralizing the attack. Experimental results demonstrate that this method can degrade substitute model accuracy to near-random levels and maintain the target model's robustness, all while preserving the top predicted label for legitimate users in over 99.9% of cases.
Introduction
Machine learning models are often proprietary assets exposed to users via paid APIs. A significant security threat to these systems is model theft, where an attacker queries the API to observe input-output pairs and trains a "substitute model" that mimics the original. Due to the property of adversarial transferability, examples designed to fool the substitute model often succeed against the original black-box model. While traditional defenses focus on input modification, this research explores a proactive approach: subtly altering the model's outputs to sabotage the attacker's learning process.
Methods: Label Poisoning via Gradient Manipulation
The core of the proposed defense is a counter-attack strategy based on label poisoning. Since APIs typically return soft labels (probability distributions), the defender can manipulate these confidence scores. The goal is to maximize the error in the attacker's gradient descent process.
The authors identify that the defender's own model serves as an excellent proxy for any potential substitute model. The defense operates as follows:
- For an input $x$, the model computes the true distribution $y_x$.
- An adversarial perturbation is calculated using a variant of the Fast Gradient Sign Method (FGSM), shifting the distribution in a direction that maximizes the loss gradient: $y^*_x = y_x + \epsilon \text{sign}(\nabla_y ||\nabla_\theta c(F_\theta, x, y_x)||_2)$.
- The perturbed distribution $y^*_x$ is returned to the user.
With a small perturbation magnitude ($\epsilon \approx 0.003$), the top-1 predicted class remains unchanged for benign users. However, for an attacker using these probabilities to train a substitute model, the resulting gradients become highly unstable, derailing the optimization process.
Key Results and Analysis
The defense was evaluated on MNIST, CIFAR10, and SVHN benchmarks. The results highlight a significant degradation in the attacker's capabilities without impacting legitimate service utility.
As shown in the figure above, when the defense is inactive, substitute models (architectures X through L) achieve high accuracy, and adversarial examples generated from them significantly reduce the black-box model's accuracy. Conversely, when the defense is active:
- Substitute Model Degradation: Attacker models fail to learn effectively. While they might achieve >60% accuracy without defense, they degrade to near-random levels (approximately 10-20% in some tests) when the defense is active.
- Black-Box Robustness: The target API maintains its baseline accuracy (~99%) because the poorly trained substitute models cannot generate effective transferable attacks.
- Zero Impact on Benign Use: Across 11 different attacker architectures, the argmax of the output distribution remained identical to the original in over 99.9% of tested cases, ensuring no loss in utility for standard users.
Discussion and Limitations
While highly effective against soft-label attacks, the defense has limitations. If an attacker uses only "hard labels" (the top predicted class), they bypass the gradient poisoning. However, training on hard labels is significantly less efficient for the attacker. Additionally, the raw mathematical perturbation can result in un-normalized distributions (e.g., values not summing to 1 or negative values). While heuristic workarounds like "Winner Takes All" mass reallocation exist, they can sometimes weaken the defense. Future research aims to develop generation procedures that natively incorporate normalization and positivity constraints.
Conclusion
Label poisoning represents a powerful "offensive" defense for black-box models. By strategically sabotaging the information leaked through probability distributions, providers can protect their intellectual property and maintain robustness against adversarial attacks without sacrificing performance for legitimate customers.
Summary updated