GithubHelp home page GithubHelp logo

mortal12138 / deepdig Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hamidkarimi/deepdig

0.0 0.0 0.0 42.18 MB

This repository contains the code for Characterizing the Decision Boundary of Deep Neural Networks

Home Page: https://arxiv.org/pdf/1912.11460.pdf

Python 100.00%

deepdig's Introduction

This document explains the instructions to run the DeepDIG project

DeepDIG

Initialization

  1. Download the zip file of the code from this repository. Unzip it and rename the directory to DeepDIGCode. Let's assume this directory in /home/user/Downloads/
  2. In config.py change the variable PATH to /home/user/Downloads/DeepDIGCode/
  3. Data for MNIST and FASHIONMNIST are already uploaded. For CIFAR10, download the data from here, unzip it and copy the files into /home/user/Downloads/DeepDIGCode/Data/CIFAR10

Training the base model

  1. Open a terminal and go to the upper-level directory containing the DeepDIG code where you cloned the code e.g., /home/user/Downloads/

  2. run python -m DeepDIGCode.PreTrainedModels.{DATASET}.{MODEL}.train --dataset {DATASET} --pre-trained-model {MODEL} where DATASET is the name of the dataset and MODEL is the name of the model

    Example: python -m DeepDIGCode.PreTrainedModels.FASHIONMNIST.CNN.train --dataset FASHIONMNIST --pre-trained-model CNN this will train the CNN model for FASHIONMNIST and then saves it.

Please refer to here to see how you can run DeepDIG against your new dataset/model.

Running the DeepDIG framework (Figure 2)

  1. Open a terminal and go to the upper-level directory containing DeepDIG code where you cloned the code e.g., /home/user/Downloads/
  2. Run python -m DeepDIGCode.main --dataset {DATASET} --pre-trained-model {MODEL} --classes {s};{t} where DATASET is the name of the dataset, MODEL is the name of the model, and s and t are two classes in the dataset for which you intend to DeepDIG

Example : python -m DeepDIGCode.main --dataset FASHIONMNIST --pre-trained-model CNN --classes "1;2"

this will run DeepDIG against the trained CNN on FASHIONMNIST to characterize the decision boundary of classes 1 and 2 (i.e., Trouser and Pullover)

Note 1. See here for the explantion of DeepDIG's arguments.

Note 2. Classes are referred numerically from 0 to n-1 where n is the number of classes. For instance, you can find the classes of CIFAR10 here. See the following examples

Example : python -m DeepDIGCode.main --dataset CIFAR10 --pre-trained-model GoogleNet --classes "1;2" (automobile, bird)

Example : python -m DeepDIGCode.main --dataset CIFAR10 --pre-trained-model ResNet --classes "4;8" (deer, ship)

  1. All results including visualizations will be saved in the /home/user/Downloads/DeepDIGCode/PreTrainedModels/{DATASET}/{MODEL}/{(s,t)} where DATASET is the input dataset, MODEL is the base model, and s and t are input classes for which you intend to genderate the borderline examples

e.g. /home/user/Downloads/DeepDIGCode/PreTrainedModels/FASHIONMNIST/CNN/(1,2)

Citations

If you use the code in this repository, please cite the following papers

@article{karimi2019characterizing, title={Characterizing the Decision Boundary of Deep Neural Networks}, author={Karimi, Hamid and Derr, Tyler and Tang, Jiliang}, journal={arXiv preprint arXiv:1912.11460}, year={2019} }

@inproceedings{karimi2020decision, title={Decision Boundary of Deep Neural Networks: Challenges and Opportunities}, author={Karimi, Hamid and Tang, Jiliang}, booktitle={Proceedings of the 13th International Conference on Web Search and Data Mining}, pages={919--920}, year={2020} }

Contact

Web page: http://cse.msu.edu/~karimiha/ Email: [email protected]

deepdig's People

Contributors

hamidkarimi 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.