GithubHelp home page GithubHelp logo

siddsax / visualizemsdnet Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 3.0 5.05 MB

Visualizing the Multi-scale dense network with Grad-CAM

Home Page: http://siddharthasaxena.com/blog/Visualizing-MSD-Net-with-Grad-CAM-Part-1

Python 94.36% Shell 5.64%
grad-cam msd-net paper visualization

visualizemsdnet's Introduction

Grad-CAM Visualizations for MSD-Net

This repository contains the code for visualizing the model proposed in the paper Multi-Scale Dense Networks for Resource Efficient Image Classification link. The base code here for that paper is borrowed from the wonderfully replicated work of @avirambh from here. Also for Grad-CAM, the basic code is taken from here. Here is a more generalized version that can be used for any custom network.

Also checkout my two part blog on this. Part-1, Part-2

Download the trained MSD-Net models for Cifar-10 from here

First we can test the model for accuracies the pre-trained models as

python main.py --model msdnet -b 20  -j 2 cifar10 --growth 6-12-24 --gpu 0 --resume --evaluate-from anytime_cifar_10.pth.tar

This nearly replicates the original paper which reports about 94.5% when budget is averaged.

Classifier No. Accuracy
0: 90.800
1: 92.330
2: 93.180
3: 93.760
4: 94.140
5: 94.130
6: 94.270
7: 94.220
8: 94.210
9: 94.170
Mean 93.521

This table also shows that the accuracy generally increases as number of blocks increase.

Print whether the classifiers are predicting each point correctly or not

python heatmapping.py --model msdnet -b 20  -j 2 cifar10  --growth 6-12-24 --gpu 0 --resume --evaluate-from anytime_cifar_10.pth.tar

Print whether the classifiers after each blocks are predicting correctly or not for a particular class

python heatmapping.py --model msdnet -b 20  -j 2 cifar10  --growth 6-12-24 --gpu 0 --resume --evaluate-from anytime_cifar_10.pth.tar --cl=dog # here dog is the class name

Create the heatmap of a particular classifier and image

python heatmapping.py --model msdnet -b 20  -j 2 cifar10  --growth 6-12-24 --gpu 0 --resume --evaluate-from anytime_cifar_10.pth.tar --imgNo=100 --maxC=5 # this means img 100 predicted with classifier 5 will be generated in folder diags

Some samples of the same are as follows

visualizemsdnet's People

Contributors

avirambh avatar siddsax avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

visualizemsdnet's Issues

链接问题

你好,这个博客和预训练权重两个地址都无法打开

报错

语句: model = getattr(models, args.model)(args)
报以下错误:
AttributeError: module 'torchvision.models' has no attribute 'msdnet'
请问作者碰到了吗?

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.