Giter Site home page Giter Site logo

trellixvulnteam / ipr-gan_p4tz Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dingsheng-ong/ipr-gan

0.0 0.0 0.0 1.95 MB

This is the code repo of our CVPR2021 on protecting the IPR of Generative Adversarial Networks (GANs) from Ambiguity Attack

License: BSD 3-Clause "New" or "Revised" License

Python 99.94% Dockerfile 0.06%

ipr-gan_p4tz's Introduction

GAN IPR Protection

Official pytorch implementation of the paper: "Protecting Intellectual Property of Generative Adversarial Networks from Ambiguity Attack"

CVPR 2021 | PDF

(Released on September 2021)

Updated on September 26, 2022

Updates

  1. Fix bugs
  2. Our framework on DNN IP protection is accepted in TPAMI 2022, see here.
  3. Our framework on RNN IP protection is accepted in AACL IJCNLP 2022, see here.
  4. Our framework on Multi-modal IP protection is accepted in Pattern Recognition 2022, see here.

Description

Ever since Machine Learning as a Service (MLaaS) emerges as a viable business that utilizes deep learning models to generate lucrative revenue, Intellectual Property Right (IPR) has become a major concern because these deep learning models can easily be replicated, shared, and re-distributed by any unauthorized third parties. To the best of our knowledge, one of the prominent deep learning models - Generative Adversarial Networks (GANs) which has been widely used to create photorealistic image are totally unprotected despite the existence of pioneering IPR protection methodology for Convolutional Neural Networks (CNNs). This paper therefore presents a complete protection framework in both black-box and white-box settings to enforce IPR protection on GANs. Empirically, we show that the proposed method does not compromise the original GANs performance (i.e. image generation, image super-resolution, style transfer), and at the same time, it is able to withstand both removal and ambiguity attacks against embedded watermarks.

Figure 1: Overview of our proposed GANs protection framework in black-box setting.

How to run

The code is tested on Python 3.8.8 and PyTorch 1.8.0.

Dependencies

$ pip install -r requirements.txt

Train

Modify the config files in configs/, then run the following command:

$ python train.py -c configs/<path-to-yaml-file>

Tensorboard

$ tensorboard --logdir log/

Evaluate

$ python eval.py -l log/<directory> -s sample/

To evaluate CycleGAN on CityScapes, you can use the code in scripts/. You need to rename the trained log directory log/CycleGAN-XXXX-CITY-X to scripts/log and run run.py. Next, you need to download the fcn-8s-cityscapes.caffemodel and put it in scripts/caffemodel directory (Please see the original CycleGAN repo). Finally, you should put the cityscapes ground-truth images in scripts/gt/. The file structure should be as shown below:

scripts/
├─ caffemodel/
│  ├─ deploy.prototxt
│  └─ fcn-8s-cityscapes.caffemodel
├─ gt/
│  ├─ 1.png
│  ├─ ...
│  └─ 499.png
├─ log/
│  ├─ samples
│  │  ├─ 1.png
│  │  ├─ ...
│  │  └─ 499.png
│  ├─ metrics.json
│  └─ ...
├─ Dockerfile
├─ labels.py
└─ run.py

Then, run python run.py to start the evaluation.

Attack

Fine-tuning and Overwriting

$ python attack.py -l log/<directory> -m <finetune/overwrite> -w <path-to-new-watermark> -d <to-load-discriminator>

Pruning

$ python prune.py -l log/<directory> -s sample/

Ambiguity Attack

$ python sign_flip.py -l log/<directory> -s sample/

Citation

If you find this work useful for your research, please cite

@inproceedings{GanIPR,
  title={Protecting Intellectual Property of Generative Adversarial Networks from Ambiguity Attack},
  author={Ong, Ding Sheng and Chan, Chee Seng and Ng, Kam Woh and Fan, Lixin and Yang, Qiang},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
  year={2021},
}

Feedback

Suggestions and opinions on this work (both positive and negative) are greatly welcomed. Please contact the authors by sending an email to [email protected] or [email protected].

License and Copyright

The project is open source under BSD-3 license (see the LICENSE file).

©2021 Universiti Malaya and WeBank.

ipr-gan_p4tz's People

Contributors

cs-chan avatar dingsheng-ong avatar trellixvulnteam 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.