Model functionality stealing attacks based on real data awareness

Yanming Li, Changsheng Li, Jiaqi Yu, Ye Yuan, Guoren WangJournal of Image and Graphics 2022

Abstract

Model functionality stealing is a critical security concern in artificial intelligence, where an adversary aims to train a "clone" model that mimics a target black-box model using limited information. Traditional data-free methods often rely on generative models to produce query data; however, these generated images frequently lack semantic meaning, appearing as noise to the target classifier. This paper proposes a novel stealing attack framework that incorporates "real data awareness." By leveraging Generative Adversarial Networks (GANs) pre-trained on public datasets, the method generates query data that resides within the manifold of real-world images, providing more stable and meaningful guidance from the target model. Furthermore, a contrastive learning-based loss function is introduced to optimize the clone model's representation learning. Experimental results on CIFAR-10 and SVHN datasets demonstrate that this approach achieves a 5% accuracy improvement over state-of-the-art methods while significantly reducing query costs.

Introduction

As high-performance AI models become valuable intellectual property, protecting them from functionality stealing has become paramount. In a typical stealing attack, an attacker queries a black-box target model with various inputs and uses the resulting predictions to train a local clone. A major branch of research focuses on "data-free" attacks, where the attacker has no access to the original training data. These methods typically use a generator to synthesize queries.

However, a significant limitation of current data-free approaches is the "semantic gap." Synthetic images often look like uninterpretable noise. Because target models are trained on structured, real-world data, their responses to noise are often erratic, providing poor gradients for the clone model to learn from. This research addresses this by ensuring query data is "real-aware," making the attack more efficient and accurate.

Methodology

The proposed framework enhances the stealing process through two primary mechanisms: Semantic Generation and Contrastive Optimization.

GAN-based Semantic Generation

To bridge the semantic gap, the authors utilize a GAN that is not trained from scratch on the target's unknown distribution, but rather pre-trained on a diverse, publicly available dataset (such as Caltech-101). This pre-training provides the generator with a "prior" knowledge of natural image structures—edges, textures, and object parts.

During the attack phase, the GAN is fine-tuned with a dual-purpose objective:

  1. Realism Constraint: A discriminator ensures that the generated queries remain visually similar to real images, staying within the data manifold the target model was designed to handle.
  2. Discrepancy Maximization: The generator is encouraged to produce images where the target model and the current state of the clone model provide the most divergent predictions. This focuses the learning process on the "uncertainty zones" of the clone, forcing it to resolve ambiguities by mimicking the target's decision boundaries.

Contrastive Learning Optimization

Beyond simple label matching (distillation), the authors propose treating model stealing as a representation learning task. They implement a contrastive loss function, specifically InfoNCE. This loss encourages the clone model to map similar images to similar points in its latent space while pushing dissimilar images apart. By maximizing the mutual information between the target's and the clone's representations, the clone captures the underlying logic of the target model rather than just memorizing its output labels.

Experimental Results

The effectiveness of the "real-aware" attack was evaluated against the Data-Free Model Extraction (DFME) baseline using the CIFAR-10 and SVHN datasets.

Accuracy and Fidelity

On the CIFAR-10 dataset, the proposed method achieved a cloning accuracy of 92.3%, representing a 5% absolute improvement over previous state-of-the-art techniques. This suggests that "real-looking" queries provide much higher quality supervision than synthetic noise.

Query Efficiency

In real-world scenarios, querying a target model (e.g., via a cloud API) is expensive and potentially detectable. The proposed method demonstrated superior efficiency:

  • To reach 85% accuracy on CIFAR-10, it required only 5.8 million queries.
  • The baseline method (DFME) required 8.6 million queries to reach the same threshold.

This 33% reduction in query volume makes the attack significantly more practical and harder to detect.

Robustness to Data Shift

A key finding was the robustness of the public data prior. Even when the GAN was pre-trained on datasets with different distributions (e.g., using grayscale Fashion-MNIST images to attack a color CIFAR-10 model), the attack remained effective. While performance is optimal when the prior is closer to the target domain, the general "realness" of the data is the primary driver of success.

Conclusion

This research highlights a critical vulnerability in black-box classifiers: their reliance on the manifold of real-world data. By using GANs to generate semantically meaningful queries and contrastive learning to refine representations, attackers can steal model functionality with higher precision and lower costs than previously thought possible. These findings underscore the need for more robust defenses that can distinguish between legitimate user queries and "real-aware" adversarial probes.

Summary updated

BibTeX
@article{li2022model,
  author = {Yanming Li and Changsheng Li and Jiaqi Yu and Ye Yuan and Guoren Wang},
  title = {{Model functionality stealing attacks based on real data awareness}},
  journal = {Journal of Image and Graphics},
  year = {2022},
  doi = {10.11834/jig.211265},
}
Figure