Coder Social home page Coder Social logo

kdtensordecomp's Introduction

Introduction

This repository contains the implementaion for the paper:

Knowledge Distillation Inspired Fine-Tuning Of Tucker Decomposed CNNS and Adversarial Robustness Analysis Ranajoy Sadhukhan, Avinab Saha, Dr. Jayanta Mukhopadhyay, Dr. Amit Patra IEEE International Conference on Image Processing (ICIP) 2020

Data preparation

  • Download train-val sets of Image-ILSVRC12 for experiments on ImageNet
  • Update data path in run script
 conda env update -n tensordecomp -f environment.yml
 source activate tensordecomp
 pip install -e .
  • Put cifar10 and cifar100 files cifar-10-python.tar.gz and cifar-100-python.tar.gz within same folder cifar

Installation

The training/testing environment can be initialized using conda as:

conda env update -n tensordecomp -f environment.yml
source activate tensordecomp
pip install -e .

Tensor Decomposition methods

There are two Tensor Decomposition methods implemented here

  • CP Decomposition
  • Tucker Decomposition

Adversarial Attacks

The original paper addresses DeepFool attack only. This repository extends experiments on two more adversarial attacks

We have used Foolbox for the implementations of these attacks

Running the code

Update the model and dataset information in TensorDecomp/config/default.py accordingly

cd TensorDecomp
chmod +x run.sh
./run.sh

For decomposing the network, use a pretrained undecomposed checkpoint Update run.sh script as follows

python main.py --pretrained --decompose --gpu <device_id>

Update architecture name and the type of loss function in the config file TensorDecomp/config/default.py In order to use logits loss or KL divergence loss for implementing Knowledge Distillation, Update run.sh script as follows

python main.py --pretrained --decompose --teacher --gpu <device_id>

Update _C.SOLVER.LOSS as 'L2' or 'L1' or 'KD' in TensorDecomp/config/default.py to implement appropriate loss function.

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.