Skip to content

Implemention of "Robust Watermarking of Neural Network with Exponential Weighting" in TensorFlow.

License

Notifications You must be signed in to change notification settings

dunky11/exponential-weighting-watermarking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Exponential Weighting Watermarking

This is an implemention of "Robust Watermarking of Neural Network with Exponential Weighting" by Ryota Namba and Jun Sakuma in TensorFlow.

What is exponential weighting?

Exponential weighting is the method which was proposed in the paper to make watermarks more robust against watermark removal attacks like pruning or fine-tuning. It works by applying a transformation to the weight matrix of each layer in the network before it is used in the forward pass. The basic concept is:

  1. Train the model on the training dataset until it converges
  2. Enable exponential weighting in the layers of the model, so it first applies a transformation to the weight matrix before it is used in the forward pass
  3. Train the model on the union of the key set and the training set in order to embed the watermark
  4. Disable exponential weighting in the layers of the model

The key set can be any set of inputs. If the accuracy on the key set is above a predefined arbitrary threshold we can verify that the model belongs to us.

How to use

You can create your own exponentially weighted layers by inheriting from EWBase which inherits from keras.layers.Layer. If exponential weighting is enabled, just call EWBase.ew() on the weight matrix before using it in the forward pass of your layer.

A simple example can be found in example.ipynb or example.py.

Contribute

Show your support by ⭐ the project. Pull requests are always welcome.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

About

Implemention of "Robust Watermarking of Neural Network with Exponential Weighting" in TensorFlow.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published