SSLGuard: A Watermarking Scheme for Self-supervised Learning Pre-trained Encoders

Tianshuo Cong, Xinlei He, Yang Zhang

TL;DR

SSLGuard is the first watermarking scheme designed specifically to protect the intellectual property of self-supervised learning (SSL) encoders. By injecting a "secret handshake" into the encoder’s embedding space and using a "shadow training" technique to anticipate theft, it provides a robust way to claim ownership even after an adversary performs model stealing or attempts to strip the watermark.

What Problem Does This Paper Address?

Self-supervised learning (SSL) has revolutionized AI by allowing models to learn from massive, unlabeled datasets. However, training these high-performance encoders (like SimCLR or MoCo) is incredibly expensive, often requiring thousands of GPU hours and specialized expertise. This makes the resulting encoder a valuable piece of intellectual property.

The authors identify a major threat: model stealing attacks. An adversary can query a victim's cloud-hosted encoder, collect the resulting embeddings, and train their own "surrogate" model to mimic the victim's behavior for a fraction of the original cost. While watermarking exists for standard classifiers, it doesn't work for SSL encoders because encoders don't output labels—they output abstract feature vectors (embeddings) used for many different downstream tasks. SSLGuard fills this gap by creating a protection mechanism that survives the transition from the original encoder to a stolen surrogate.

Methods

The core of SSLGuard is a black-box watermarking scheme consisting of a key-tuple: a verification dataset ($D_v$), a secret vector ($sk$), and a specialized decoder ($G$).

  1. Watermark Injection: The defender fine-tunes a clean encoder so that when it sees a specific "trigger" image (a private image with a specific noise pattern), it produces an embedding that the decoder $G$ can transform into the secret vector $sk$.
  2. Shadow Training: This is the "secret sauce" for robustness. During the injection process, the defender simultaneously trains a shadow encoder to mimic the watermarked encoder. By simulating the stealing process, the defender ensures the watermark is "sticky" enough to be transferred to any surrogate model an adversary might train.
  3. Loss Functions: The system optimizes three goals:
  4. Fidelity: Ensuring the encoder still works perfectly for legitimate users.
  5. Correlation: Ensuring trigger images map to the secret vector.
  6. Uncorrelation: Ensuring normal, non-trigger images map to random, orthogonal vectors so the watermark isn't accidentally triggered.
  7. Verification: To catch a thief, the defender passes trigger images through the suspect encoder and the secret decoder. If the output matches the secret vector $sk$ above a certain threshold (the Watermark Rate), ownership is proven.

Datasets

The researchers evaluated SSLGuard across a wide variety of computer vision benchmarks:

  • Pre-training: ImageNet.
  • Downstream Tasks (Fidelity testing): STL-10, CIFAR-10, MNIST, and FashionMNIST.
  • Query Datasets (Stealing attacks): STL-10, CIFAR-10, CIFAR-100, and GTSRB (German Traffic Sign Recognition Benchmark).

Key Insights and Ideas

  • The Cost Disparity: The paper quantifies just how profitable model stealing is. Pre-training a BYOL ResNet-50 model costs roughly $5,713, while stealing it to create a high-quality surrogate costs only $72. This massive gap highlights the urgent need for IP protection.
  • Encoders are "Stealable" by Nature: Because SSL encoders are designed to produce highly informative embeddings, they inadvertently provide an adversary with a very rich signal to train a surrogate model.
  • The Necessity of the Shadow Encoder: A standard watermark often disappears during the model stealing process. By using a shadow encoder to "act out" the theft during the training phase, the watermark is baked into the functional behavior of the embeddings, making it much harder to shake off.

Key Results

  • High Effectiveness: SSLGuard achieved a 1.0 Watermark Rate (WR) across SimCLR, MoCo v2, and BYOL, meaning the watermark was detected with 100% reliability in the owner's models.
  • Negligible Performance Hit: The "Fidelity" test showed that watermarking only decreased downstream task accuracy by a tiny margin (usually less than 1%), meaning legitimate users won't notice a difference.
  • Robustness Against Theft: Even when an adversary used a different architecture (e.g., stealing a ResNet-50's logic into a ResNet-101), the WR remained near 1.0.
  • Resilience to Removal: The watermark survived common "laundering" attempts, including input noising, output truncation, model pruning, and fine-tuning.

Limitations and Future Work

  • Domain Specificity: This study focused exclusively on image encoders. The authors note that extending this to Natural Language Processing (NLP) or graph-based models would require designing new types of "triggers" suitable for those domains.
  • White-box vs. Black-box: While SSLGuard is a robust black-box solution, the authors suggest that future work could explore white-box techniques (examining the internal weights of the model) for even deeper protection.
  • Adaptive Adversaries: While the system is robust against current removal attacks, the "arms race" continues; future work will likely need to address adversaries who specifically try to detect and neutralize the SSLGuard trigger patterns.

Summary updated

BibTeX
@inproceedings{cong2022sslguard,
  author = {Tianshuo Cong and Xinlei He and Yang Zhang},
  title = {{SSLGuard: A Watermarking Scheme for Self-supervised Learning Pre-trained Encoders}},
  booktitle = {CCS},
  year = {2022},
  url = {https://openreview.net/forum?id=-H-GF5Wi3AI},
}

Loading related content...

Figure