Extracting Cloud-based Model with Prior Knowledge

Shiqian Zhao, Kangjie Chen, Meng Hao, Jian Zhang, Guowen Xu, Hongwei Li, Tianwei ZhangarXiv 2023 · DOI

Abstract

Machine Learning-as-a-Service (MLaaS) platforms are increasingly vulnerable to Model Extraction Attacks (MEAs) that seek to replicate proprietary black-box models. This paper introduces a novel framework that leverages prior knowledge from unlabeled proxy datasets to "clone" these models with unprecedented efficiency. By integrating self-supervised learning with entropy-based active sampling, the proposed method achieves over 95% fidelity on commercial APIs at minimal cost, significantly outperforming existing state-of-the-art techniques.

Introduction: The MLaaS Landscape and the Extraction Threat

Platforms such as Microsoft Azure, Google Cloud, and Clarifai offer powerful machine learning models via APIs, allowing users to perform complex tasks like image recognition without managing underlying infrastructure. However, these APIs expose a critical vulnerability: Model Extraction Attacks. In an MEA, an adversary queries the victim model to build a substitute model that mimics its behavior.

The primary metric for a successful MEA is fidelity—the degree to which the substitute model matches the victim's predictions, including its errors. This differs from standard accuracy, which measures correctness against ground truth labels.

Distinction between accuracy and fidelity in model extraction.

The Challenge of Query Budgets

Existing extraction methods face a significant hurdle: the "query budget." Commercial APIs are not only expensive but also employ fraud detection systems to flag high volumes of suspicious queries. Current "data-free" attacks require millions of queries, while others suffer from high generalization errors because they rely solely on posterior knowledge—the specific labels returned by the victim model after a query is made. The authors identify a missed opportunity in the structural information hidden within unlabeled "proxy" datasets that can be learned before the first query is ever sent.

Methodology: Bridging Prior and Posterior Knowledge

The researchers propose a three-stage framework designed to maximize the utility of every query by combining Prior Knowledge Learning with Active Stealing.

Overview of the proposed extraction framework, from prior knowledge embedding to iterative active stealing.

1. Prior Knowledge Embedding

Instead of initializing a substitute model with random weights, the attacker uses Self-Supervised Learning (SSL) on an unlabeled proxy dataset. The study found that contrastive approaches, such as SimCLR and MoCo, are particularly effective. These methods "pre-compile" the intrinsic properties and natural relationships of the data into the substitute model’s feature extractor, providing a superior starting point for identifying decision boundaries.

2. Entropy-Based Active Sampling

To optimize the query budget, the system employs an entropy-based metric to identify the most "informative" samples. These are data points where the substitute model is most uncertain. By focusing queries on these samples, the attacker can more rapidly map the victim model's specific decision boundaries.

3. Iterative Extraction

The attacker queries the victim API with these informative samples, obtains the labels (posterior knowledge), and fine-tunes the substitute model. This creates a feedback loop where the model's decision-making power shifts from general prior knowledge to the specific logic of the victim.

Experimental Results and Commercial Validation

The framework was evaluated against local benchmarks (CIFAR10, STL10) and real-world commercial APIs on Microsoft Azure and Clarifai.

  • High Efficiency: On the Clarifai NSFW Recognition API, the attack achieved 95.1% fidelity with only 1.8K queries, costing just $2.16.
  • Superior Performance: The method improved fidelity by up to 35% compared to existing baselines like "ActiveThief" under identical query budgets.
  • Downstream Lethality: Substitute models created via this method proved highly effective for generating transferable adversarial examples. Adversarial images crafted using the substitute model had a 26% higher success rate in fooling the original victim model compared to traditional methods.

Conclusion and Future Directions

This research demonstrates that general prior knowledge is a powerful tool for model extraction, even when proxy data is "Out-of-Distribution" (OOD). While the study primarily utilized ResNet50 architectures for image classification, future work will explore Vision Transformers (ViT) and other modalities such as audio transcription. As these attacks become more efficient and harder to detect via traditional rate-limiting, MLaaS platforms may need to explore advanced defenses like similarity encoders to protect their intellectual property.

Summary updated

BibTeX
@misc{zhao2023extracting,
  author = {Shiqian Zhao and Kangjie Chen and Meng Hao and Jian Zhang and Guowen Xu and Hongwei Li and Tianwei Zhang},
  title = {{Extracting Cloud-based Model with Prior Knowledge}},
  year = {2023},
  eprint = {2306.04192},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2306.04192},
}
Figure