Coder Social home page Coder Social logo

entangled-watermark's Introduction

Entangled Watermarks as a Defense against Model Extraction

This repository is an implementation of the paper Entangled Watermarks as a Defense against Model Extraction. In this repository, we show how to train a watermarked DNN model that is robust against model extraction. The high-level idea is that a special watermark is designed such that it could be used to verify the owenrship of the model if it is stolen by model extraction. For more details, please read the paper.

We test our code on three datasets: MNIST, Fashion-MNIST, and Google Speech Commands (10-classes). The code for the two vision datasets (MNIST and Fashion-MNIST) and the audio dataset (Google Speech Commands) are in \vision and \audio respectively.

Dependency

Our code is implemented and tested on Tensorflow. Following packages are used by the training code.

tensorflow==1.14.0

Preprocessing code for Google Speech Commands is modifed based on this github repository. The required packages include:

keras==2.2.5
kapre==0.1.3.1
librosa==0.6
tqdm

Preprocessing and Training

For the vision datasets, MNIST and Fashion-MNIST need to be downloaded as .gz files into the same folder as the scripts. For Google Speech Command dataset, downloading is included in the preprocess.py. To preprocess the datasets, the following line needs to be run.

python preprocess.py

After preprocessing, a watermarked DNN model could be trained by the following line.

python main.py

There are a number of arguments that could be used to set the hyperparameters. The interpretation and configuration of these hyperparameters are explained in our paper. The main.py script also contains a model extraction attack to test the robustness of the watermarks. It is only for testing purpose and is not necessary for training the model.

Questions or suggestions

If you have any questions or suggestions, feel free to send me an email at [email protected]

entangled-watermark's People

Contributors

nick-jia avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.