Dataset Inference for Self-Supervised Models

Adam Dziedzic, Haonan Duan, Muhammad Ahmad Kaleem, Nikita Dhawan, Jonas Guan, Yannis Cattan, Franziska Boenisch, Nicolas Papernot

Abstract

Self-supervised learning (SSL) has revolutionized the development of foundation models, yet the high cost of training these encoders makes them lucrative targets for model stealing. Traditional defenses, such as watermarking or those relying on decision boundaries, are often impractical or inapplicable to SSL encoders. This paper presents a novel defense mechanism based on "dataset inference." By leveraging the subtle overfitting of a model to its private training data, the proposed method can statistically prove ownership of a suspect model without requiring retraining or access to the model's internal weights. Experimental results across multiple vision benchmarks, including ImageNet, demonstrate that this approach is robust to obfuscation and highly efficient in identifying stolen derivatives.

Introduction

In the current machine learning landscape, self-supervised learning (SSL) is the primary driver for creating powerful encoders like CLIP or SimCLR. These models are trained on massive datasets to produce high-dimensional embeddings that serve a variety of downstream tasks. However, the computational resources required for training are immense, leading to a rise in "model stealing" attacks. In these scenarios, an adversary queries a victim model's API to train a student model that mimics the victim's performance at a fraction of the original cost.

Protecting these assets is challenging. Unlike supervised classifiers, SSL encoders do not have explicit decision boundaries to analyze. Furthermore, proactive defenses like watermarking are often discarded due to the prohibitive cost of retraining foundation models. This work introduces a reactive defense that uses the victim's training data as a unique signature to identify stolen copies.

Methodology: Dataset Inference for Encoders

The core premise of the defense is that a model inherently behaves differently on its training data compared to unseen data. This "fingerprint" of knowledge remains present even in stolen copies. The researchers adapt the concept of Dataset Inference to the SSL domain through a multi-step process:

  1. Density Estimation: The model owner uses a portion of their private training data to train a Gaussian Mixture Model (GMM). This GMM characterizes the distribution of the embeddings produced by the encoder for its specific training set.
  2. Log-Likelihood Testing: To evaluate a suspect model, the owner feeds it both the private training data and an independent test set. If the suspect model is a stolen derivative, the log-likelihood of the embeddings generated from the training data will be significantly higher than those from the test data, as the model "recognizes" the training distribution.
  3. Ownership Resolution: A statistical t-test is applied to the log-likelihood values. A sufficiently low p-value allows the owner to reject the null hypothesis (that the model is independent) and claim ownership.

To address potential obfuscation—such as linear transformations or shuffling of the embedding space—the authors introduce two additional metrics: a Mutual Information (MI) score and a Cosine Similarity score. These metrics focus on the underlying information content and relational structure of the embeddings rather than their exact coordinate values.

Experimental Evaluation

The defense was evaluated using five vision benchmarks: CIFAR10, CIFAR100, SVHN, STL10, and ImageNet. The results indicate that the defense is both highly confident and query-efficient.

  • Statistical Significance: On the CIFAR10 dataset, the defense identified stolen models with a p-value of $5.61 \times 10^{-82}$, providing near-certainty in ownership claims.
  • Efficiency on Large-Scale Data: For ImageNet-scale models, the defense required only 50,000 to 100,000 queries (approximately 4% of the original training set) to successfully prove ownership.
  • Specificity: Models trained independently on the same tasks but using different data consistently failed the t-test, ensuring that the defense does not produce false positives against legitimate competitors.

Key Insights

One of the most compelling findings is that the defense becomes more effective as the quality of the theft increases. As an attacker improves the fidelity of their stolen model to better match the victim's performance, they inadvertently capture more of the victim's training data signature, making the theft easier to detect.

Additionally, the use of Mutual Information proved vital for robustness. While simple distance-based checks can be defeated by basic vector transformations, MI remains stable because it measures the shared information between the victim and the suspect model's representation spaces.

Limitations and Future Directions

Despite its success, the method faces limitations in the context of heavy data augmentation. Aggressive techniques like extreme cropping or color jittering improve model generalization to the point where the overfitting signal becomes faint, potentially masking the ownership signature. Furthermore, while the defense is highly effective in vision, its application to Natural Language Processing (NLP) remains an area for future research, particularly given the scale and value of modern Large Language Models (LLMs).

Conclusion

Dataset inference provides a robust, post-hoc solution for protecting the intellectual property of SSL encoders. By turning the traditionally negative trait of overfitting into a security feature, this method allows model owners to defend their investments without the need for expensive retraining or intrusive watermarking.

Summary updated

BibTeX
@inproceedings{dziedzic2022dataset,
  author = {Adam Dziedzic and Haonan Duan and Muhammad Ahmad Kaleem and Nikita Dhawan and Jonas Guan and Yannis Cattan and Franziska Boenisch and Nicolas Papernot},
  title = {{Dataset Inference for Self-Supervised Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
}
Figure