https://github.com/iamhankai/full-stack-filters
Pytorch code for paper: Full-Stack Filters to Build Minimum Viable CNNs
https://github.com/iamhankai/full-stack-filters
convolutional-neural-networks model-compression
Last synced: 9 months ago
JSON representation
Pytorch code for paper: Full-Stack Filters to Build Minimum Viable CNNs
- Host: GitHub
- URL: https://github.com/iamhankai/full-stack-filters
- Owner: iamhankai
- License: bsd-3-clause
- Created: 2019-09-04T14:22:01.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-09-10T13:13:53.000Z (over 6 years ago)
- Last Synced: 2025-03-20T13:22:08.375Z (about 1 year ago)
- Topics: convolutional-neural-networks, model-compression
- Language: Python
- Homepage:
- Size: 3.23 MB
- Stars: 16
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: License.txt
Awesome Lists containing this project
README
## Full-Stack Filters
Code for Paper: [Full-Stack Filters to Build Minimum Viable CNNs (MVNet)](https://arxiv.org/abs/1908.02023)
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.

### Description
- 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, including `1.0 MB` `float32` weights and `14.0 MB` binary masks stored in `int8` format (so it's `1.75 MB` in `bool` format which is not supported in PyTorch yet).
### Files description
Requirements: Python 3.6, PyTorch 0.4
- `MaskConv2d` in `mask_conv.py` is the new convolution class with full-stack filters used for replacing `nn.Conv2d`.
- `mask_vgg.py` is the VGG-16 using the proposed full-stack filters.
- `test.py` is the test script on CIFAR-10 dataset.
### Usage
1. Download CIFAR-10 python version from [cifar-10-python.tar.gz](https://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz), put it in anywhere you like such as `$data/cifar-10-python.tar.gz`.
2. Run `python test.py --resume=models/cifar10-s64.th --data-dir=$data` in default setting, you will get `93.1%` accuracy.
### Performance
Performance on CIFAR-10 with VGG-16 as architecture:

For other experimental results, please refer to the original paper.
### Citation
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}
}
```