This document explains the instructions to run the DeepDIG project
- 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/
- In
config.py
change the variable PATH to /home/user/Downloads/DeepDIGCode/ - 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
-
Open a terminal and go to the upper-level directory containing the DeepDIG code where you cloned the code e.g., /home/user/Downloads/
-
run
python -m DeepDIGCode.PreTrainedModels.{DATASET}.{MODEL}.train --dataset {DATASET} --pre-trained-model {MODEL}
whereDATASET
is the name of the dataset andMODEL
is the name of the modelExample:
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)
- Open a terminal and go to the upper-level directory containing DeepDIG code where you cloned the code e.g., /home/user/Downloads/
- Run
python -m DeepDIGCode.main --dataset {DATASET} --pre-trained-model {MODEL} --classes {s};{t}
whereDATASET
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)
- 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)
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} }
Web page: http://cse.msu.edu/~karimiha/ Email: [email protected]