gaohuang/MSDNet
关于
用于高效图像分类的多尺度稠密网络(ICLR 2018 口头报告论文)
系统与基础设施实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文MSDNet
This repository provides the code for the paper Multi-Scale Dense Networks for Resource Efficient Image Classification.
Update on April 3, 2019 -- PyTorch implementation released!
A PyTorch implementation of MSDNet can be found from here.
Introduction
This paper studies convolutional networks that require limited computational resources at test time. We develop a new network architecture that performs on par with state-of-the-art convolutional networks, whilst facilitating prediction in two settings: (1) an anytime-prediction setting in which the network's prediction for one example is progressively updated, facilitating the output of a prediction at any time; and (2) a batch computational budget setting in which a fixed amount of computation is available to classify a set of examples that can be spent unevenly across 'easier' and 'harder' examples.
Figure 1: MSDNet layout (2D).

Figure 2: MSDNet layout (3D).

Results
(a) anytime-prediction setting
Figure 3: Anytime prediction on ImageNet.

(b) batch computational budget setting
Figure 4: Prediction under batch computational budget on ImageNet.

Figure 5: Random example images from the ImageNet classes Red wine and Volcano. Top row: images exited from the first classification layer of an MSDNet with correct prediction; Bottom row: images failed to be correctly classified at the first classifier but were correctly predicted and exited at the last layer.

Usage
Our code is written under the framework of Torch ResNet (https://github.com/facebook/fb.resnet.torch). The training scripts come with several options, which can be listed with the --help flag.
th main.lua --help
Configuration
In all the experiments, we use a validation set for model selection. We hold out 5000 training images on CIFAR, and
50000
images on ImageNet as the validation set.
Training recipe
Train an MSDNet with 10 classifiers attached to every other layer for anytime prediction:
th main.lua -netType msdnet -dataset cifar10 -batchSize 64 -nEpochs 300 -nBlocks 10 -stepmode even -step 2 -base 4
Train an MSDNet with 7 classifiers with the span linearly increases for efficient batch computation:
th main.lua -netType msdnet -dataset cifar10 -batchSize 64 -nEpochs 300 -nBlocks 7 -stepmode lin_grow -step 1 -base 1
Pre-trained ImageNet Models
Download model checkpoints and the validation set indeces.
Testing script:
th main.lua -dataset imagenet -testOnly true -resume <path-to-.t7-model> -data <path-to-image-net-data> -gen <path-to-validation-set-indices>
FAQ
- How to calculate the FLOPs (or mul-add op) of a model?
We strongly recommend doing it automatically. Please refer to the op-counter project (LuaTorch), or the script in ConDenseNet (PyTorch). The basic idea of these op counters is to add a hook before the forward pass of a model.
探索相关项目
加载中…