Code for Paper: Full-Stack Filters to Build Minimum Viable CNNs (MVNet)
In this paper, we propose a novel convolution operation with full-stack filters and auxiliary masks to reduce redundancy in convolution filters for building minimum viable CNNs, i.e. MVNets. A series of full-stack filters with additional binary masks which requiring negligible memory resource in the proposed convolution method can generate much more inherited sub-filters and achieve approximate performance to the original convolution.
- MVNet with Full-Stack Filters inference code on CIFAR-10 dataset.
- We provide the trained model in
models/cifar10-s64.th
which occupies 15 MB, including1.0 MB
float32
weights and14.0 MB
binary masks stored inint8
format (so it's1.75 MB
inbool
format which is not supported in PyTorch yet).
Requirements: Python 3.6, PyTorch 0.4
MaskConv2d
inmask_conv.py
is the new convolution class with full-stack filters used for replacingnn.Conv2d
.mask_vgg.py
is the VGG-16 using the proposed full-stack filters.test.py
is the test script on CIFAR-10 dataset.
- Download CIFAR-10 python version from cifar-10-python.tar.gz, put it in anywhere you like such as
$data/cifar-10-python.tar.gz
. - Run
python test.py --resume=models/cifar10-s64.th --data-dir=$data
in default setting, you will get93.1%
accuracy.
Performance on CIFAR-10 with VGG-16 as architecture:
For other experimental results, please refer to the original paper.
If you use these models in your research, please cite:
@article{han2019full,
title={Full-Stack Filters to Build Minimum Viable CNNs},
author={Han, Kai and Wang, Yunhe and Xu, Yixing and Xu, Chunjing and Tao, Dacheng and Xu, Chang},
journal={arXiv preprint arXiv:1908.02023},
year={2019}
}