Skip to content

davidsonic/Interpretable_CNNs_via_Feedforward_Design

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Interpretable_CNNs_via_Feedforward_design

This is an implementation of the paper Interpretable Convolutional Neural Networks via Feedforward Design, maintained by Min Zhang and Jiali Duan.

Table of Content

  • [Requirements]

  • [Dataset] ( Hand-written digits classification)

    • [MNIST] ( train set: 60000, 28x28. Downloaded from Keras)
    • [CIFAR10] ( train set: 50000, 32*32. Downloaded from Keras)
  • [Installation] (rensorflow, keras, pickle, sklearn and skimage)

  • [Feedforward Steps]

    • Command python Getkernel.py, getting convolutional layers kernels
    • Command python Getfeature.py, getting feature after convolution
    • Command python Getweight.py, getting fully connected layers kernels and training accuracy
    • Command python mnist_test.py or python test.py, getting test accuracy
  • [Adversarial attacks]

    • BP/ff models are provided for cifar10 and mnist dataset under folder dataset_structure_model
    • Models can be trained from scratch if no filename is specified
    • By changing adversarial attack methods, different algorithms can be tested
    • Refer to show_sample.ipynb to visualize generated adversarial samples
  • [Example usage]

    • python cifar_keras.py -train_dir cifar_BP_model -filename cifar.ckpt -method FGSM
    • python cifar_keras.py -train_dir cifar_ff_model -filename FF_init_model.ckpt -method BIM
cifar_keras.py:
  --batch_size: Size of training batches
    (default: '128')
    (an integer)
  --filename: Checkpoint filename.
    (default: 'FF_init_model.ckpt')
  --learning_rate: Learning rate for training
    (default: '0.001')
    (a number)
  --[no]load_model: Load saved model or train.
    (default: 'true')
  --method: Adversarial attack method
    (default: 'FGSM')
  --nb_epochs: Number of epochs to train model
    (default: '40')
    (an integer)
  --train_dir: Directory where to save model.
    (default: 'cifar_ff_model')

Contact me

Jiali Duan (Email: jialidua@usc.edu)
Min Zhang (Email: zhan980@usc.edu)

About

Official Implementation of Interpretable Convolutional Neural Networks via Feedforward Design Arxiv: https://arxiv.org/abs/1810.02786

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published