Git Product home page Git Product logo

datafree-model-extraction's Introduction

Data-Free Model Extraction

This repository complements the Data-Free Model Extraction paper, that will be published at the 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition.

This project was conducted in collaboration between the Cake Lab at Worcester Polytechnic Institute, and the University of Toronto and the Vector Institute.

Updates

  • Jan 14, 2022: Updated the default learning rate parameter for the generator to match the paper's experimental setup.

Citation

@InProceedings{Truong_2021_CVPR,
author = {Truong, Jean-Baptiste and Maini, Pratyush and Walls, Robert J. and Papernot, Nicolas},
title = {Data-Free Model Extraction},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2021}
}

Dependencies

The code requires dependencies that can be installed using the pip environment file provided:

pip install -r requirements.txt

Replicating DFME Results

Load Victim Model Weights

First, download the pretrained victim model weights from this dropbox. The two file names are cifar10-resnet34_8x.pt and svhn-resnet34_8x.pt. The CIFAR10 weights were found on the Data Free Adversarial Distillation dropbox, while we trained the SVHN model ourselves.

Then, store the pre-trained model weights at the following location

dfme/checkpoint/teacher/{victim_dataset}-resnet34_8x.pt

Perform Model Extraction

bash run_cifar_dfme.sh
bash run_svhn_dfme.sh

Logs and saved models can be found at save_results/{victim_dataset}/

Surrogate Benchmarking

Standard model extraction attacks can be performed using the code in the folder surrogate_benchmark.

cd surrogate_benchmark
python train.py --surrogate {surrogate_dataset} --target {target_dataset} --temp {temperature_value} --lr_mode 1 --epochs 50

Typically, using temperature_value in {1,3,5} provides good extraction results. The number of epochs may be reduced to 30 in case the target dataset is svhn.

Attribution

This repository was built on code from the paper Data Free Adversarial Distillation. The weights and model architectures for Resnet34-8x and Resnet18_8x were also found on the repository released with the Data Free Adversarial Distillation paper.

datafree-model-extraction's People

Contributors

jtruongj avatar rjwalls 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.