Skip to content
A lightweight convolutional neural network
Jupyter Notebook Python
Branch: master
Clone or download
Latest commit 22e5615 Sep 16, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
data clean Sep 8, 2018
images clean add initial results Aug 24, 2018
.gitignore preliminary tests Aug 13, 2018
LICENSE fix Sep 16, 2018 refactor and add example Aug 27, 2018
benchmark_speed.ipynb add benchmarks Sep 16, 2018
evaluation.ipynb add benchmarks Sep 16, 2018
inference_with_trained_model.ipynb add benchmarks Sep 16, 2018 final version Aug 20, 2018 clean add initial results Aug 24, 2018 clean Sep 8, 2018

ShuffleNet v2

This is an implementation of ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture Design .

model accuracy top 5 accuracy
0.5x 0.607 0.822
1.0x 0.688 0.886

You can download ImageNet trained checkpoints from here.

How to use the pretrained models

You only need two things:

  1. File It contains a definition of the graph.
  2. Checkpoint. You can load it into the graph using tf.train.Saver or tf.train.init_from_checkpoint.

For an example of using the pretrained model see: inference_with_trained_model.ipynb.

Speed benchmarks

model accuracy images/second
ShuffleNet v2 0.5x 0.607 3192
ShuffleNet v2 1.0x 0.689 2349
ShuffleNet v2 1.5x - 1855
ShuffleNet v2 2.0x - 1570
MobileNet v1 0.5x 0.633 3317
MobileNet v1 0.75x 0.684 2187
MobileNet v1 1.0x 0.709 1685
MobileNet v2 0.35x 0.603 2722
MobileNet v2 0.75x 0.698 1527
MobileNet v2 1.0x 0.718 1292

All measurements were done using batches of size 8, images of size 224x224, and NVIDIA GTX 1080 Ti.
See benchmark_speed.ipynb for the code.

MobileNet v1 results are taken from here. MobileNet v2 results are taken from here.


  1. Using moving averages of weights doesn't increase accuracy for some reason.


  1. for using the pretrained models: tensorflow 1.10
  2. for dataset preparation: pandas, Pillow, tqdm, opencv, ...

How to train

  1. Prepare ImageNet. See data/
  2. Set the right parameters in the beginning of file.
  3. Run python
  4. Run tensorboard to see the loss curves. Examples of loss curves are in images/.
  5. Use evaluation.ipynb for the final evaluation on ImageNet.


The training code is heavily inspired by:


Other implementations

  1. miaow1988/ShuffleNet_V2_pytorch_caffe
  2. tensorpack/examples/ImageNetModels
You can’t perform that action at this time.