Margin-based Neural Network Watermarking

Byungjoo Kim, Suyoung Lee, Seanie Lee, Sooel Son, Sung Ju Hwang

Introduction

As Machine Learning as a Service (MLaaS) platforms become increasingly prevalent, companies are able to monetize proprietary deep neural network (DNN) models by providing API access. However, this exposes models to functionality stealing attacks (also known as model extraction or distillation). In these attacks, an adversary queries the API thousands of times, records the outputs, and trains their own "surrogate" model to mimic the original's behavior—all without ever accessing the original weights or training data.

To protect intellectual property and prove ownership, researchers use watermarking. This typically involves a "trigger set"—a small collection of specific, secret inputs (e.g., a photo of a cat intentionally labeled as an "airplane") known only to the model's owner. If a suspicious third-party model also classifies that specific cat as an airplane, it is highly likely to be a stolen surrogate.

The Vulnerability of Standard Watermarks

Unfortunately, most existing watermarking techniques are "brittle." Because trigger samples are usually outliers compared to the main data distribution, standard training treats them as anomalies. When an attacker trains a surrogate model using the source model's outputs, the surrogate naturally "washes away" these outliers. It focuses on learning the general decision boundaries of the main task, allowing the attacker to steal the model's utility while successfully stripping away its proof of ownership.

Conceptual comparison of watermarking methods and their effectiveness against model extraction.

Margin-Based Watermarking

To address this vulnerability, this paper introduces Margin-based Neural Network Watermarking. The core philosophy is to stop treating trigger samples as mere outliers and instead make them "load-bearing" structural components of the model's decision boundary.

1. From ERM to Margin Maximization

Standard training relies on Empirical Risk Minimization (ERM), which simply tries to predict the correct label. The proposed method instead maximizes the margin—the distance between the trigger sample and the decision boundary. By enforcing a large margin around the trigger samples, the model is forced to deeply embed the watermark into its learned logic.

2. Projected Gradient Ascent (PGA)

During training, the algorithm uses Projected Gradient Ascent (PGA) to find the "worst-case" version of a trigger sample within a small neighborhood ($\epsilon$). It then minimizes the loss on these perturbed samples, ensuring the watermark is robust even if the surrogate model slightly shifts the decision boundaries.

3. Latent Space Alignment

By pushing trigger samples deep into their assigned class regions, the model's latent representation fundamentally changes. The trigger samples are moved away from the fragile boundaries and toward the "cluster centers" of their assigned (fake) labels.

Decision boundaries and latent space representations for standard ERM versus the proposed margin-based method.

To the surrogate model, these high-margin triggers no longer look like anomalies; they look like high-confidence, core features of the class. Consequently, when an attacker tries to imitate the source model, the surrogate model must include these triggers to achieve high imitation accuracy.

Experimental Setup and Key Results

The researchers evaluated their method using standard computer vision benchmarks, including CIFAR-10 and CIFAR-100 for primary training, and SVHN (Street View House Numbers) to test extraction attacks using heterogeneous data distributions.

  • Superior Retention: The margin-based approach significantly outperforms previous methods. On CIFAR-10, while baseline methods like EWE (Entangled Watermark Embedding) saw trigger accuracy drop to ~51% in surrogate models, the margin-based approach maintained a robust ~82% accuracy on the stolen model.
  • Robustness to Architecture Mismatch: The watermark remains effective even if the attacker uses a completely different architecture for their surrogate (e.g., stealing from a ResNet34 to train a VGG11). Because the method protects the functional boundary rather than internal weights, structural mismatches do not break the watermark.
  • Defense Against Compression: The watermark remained sticky even after the stolen model was compressed (pruned) or further trained on new data (fine-tuned).
  • Clean Accuracy: The method maintains high accuracy on the original task (e.g., ~87.8% on CIFAR-10), demonstrating that robust protection does not require sacrificing the model's primary utility.
  • Statistical Significance: The method achieved extremely low p-values ($10^{-12}$ to $10^{-8}$), making it statistically nearly impossible for a surrogate model to have "accidentally" learned the trigger set.

Limitations and Future Work

While highly effective, the authors note an inherent accuracy-margin trade-off. There is a natural tension between maximizing the margin of the trigger set and maintaining peak accuracy on the main task. If the margin is pushed too aggressively, the model's performance on legitimate data can begin to degrade.

Furthermore, while the method is robust against current extraction techniques, an adaptive adversary who specifically knows they are targeting a "margin-watermarked" model might develop new techniques to detect and bypass these artificially high-confidence regions. Future research will need to explore more sophisticated ways to balance the contradiction between main task labels and trigger labels, ensuring watermarks remain both invisible and indelible.

Summary updated

BibTeX
@inproceedings{kim2023margin,
  author = {Byungjoo Kim and Suyoung Lee and Seanie Lee and Sooel Son and Sung Ju Hwang},
  title = {{Margin-based Neural Network Watermarking}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=bwBeCyuFZh},
}
Figure