Apply the pruning strategy of Network Slimming for MobileNet_v2.
The Caffe implementation of the algorithm is available in link.
The size of the input image is 224x224
.
Step | Prune Ratio | L1 value | Parameters | Top1 Accuracy | Speed |
---|---|---|---|---|---|
0 | 0 | 0 | 9.8MB | 93.24% | 152.0ms |
1 | 0 | 0.001 | 9.8MB | 92.68% | 152.0ms |
2 | 0.3 | 0.001 | 7.2MB | 91.84% | - |
3 | 0.3 + 0.7 * 0.3 = 0.51 | 0.001 | 5.4MB | 91.26% | - |
4 | 0.51 + 0.49 * 0.2 = 0.608 | 0 | 4.6MB | 92.13% | 79.3ms |
5 | 0.608 (merging BN) | - | 4.5MB | 92.13% | 58.0ms |
Model | Speed on PC | Speed on iPhone7p (using NCNN) |
---|---|---|
ResNet50 | about 1000ms | 277.8ms |
MobileNet v2 | 152.0ms | 41.4ms |
Pruned MobileNet v2 (with BN) | 79.3ms | 18.1ms |
Pruned MobileNet v2 (merging BN) | 58.0ms | 13.6ms (about 5ms when the input is resized into 96x96 ) |
If you have any problems, please feel free to contact me via eezywu@163.com.