← Open Source
liuzhuang13

slimming

Learning Efficient Convolutional Networks through Network Slimming, In ICCV 2017.

InfrastructureModel optimizationLua
Open on GitHub
Momentum
+0stars in 24 hours0.0%
577
Stars
75
Forks
+1
This week
2
Contributors
Created 2017-08-22 · Updated 2026-10-14 · #16696 today
Top developers

liuzhuang13/slimming is ranked 16,696 with 577 stars.

Same-category comparison

liuzhuang13/slimming is ranked 16,696 among these 8 peers; microsoft/psi is ranked 16,697.

Same-category comparison
NameRankMetrics
goatplatform/goatdb16,658
Language:
TypeScript
Stars:
579
Forks:
22
Description:
A peer-to-peer database that spans devices. For apps and agents that work everywhere.
MPolaris/onnx2tflite16,667
Language:
Python
Stars:
578
Forks:
55
Description:
Tool for onnx->keras or onnx->tflite. Hope this tool can help you.
kreeben/resin16,676
Language:
C#
Stars:
578
Forks:
41
Description:
Language model search engine built on a vector database and an anything key/value store.
tensorflow/tfjs-wechat16,683
Language:
TypeScript
Stars:
578
Forks:
106
Description:
WeChat Mini-program plugin for TensorFlow.js.
microsoft/psi16,697
Language:
C#
Stars:
577
Forks:
103
Description:
Platform for Situated Intelligence.
jankais3r/LLaMA_MPS16,714
Language:
Python
Stars:
576
Forks:
42
Description:
Run LLaMA (and Stanford-Alpaca) inference on Apple Silicon GPUs.
NVIDIA/jitify16,723
Language:
C++
Stars:
575
Forks:
80
Description:
A single-header C++ library for simplifying the use of CUDA Runtime Compilation (NVRTC).
litter-coder/midjourney-proxy-plus16,737
Stars:
575
Forks:
68
Key parameters and specifications
Key parameters and specifications
ParameterValue
LanguageLua
CategoryInfrastructure
SubcategoryModel optimization
KeywordsPruning
Stars577
Forks75
Contributors2
Created date2017-08-22
Updated date2026-10-14
Stars in 1 day0
Stars in 7 days1
Rank16,696
Previous rank16,483
Rank change-213
7-day stars rank11,287
Previous 7-day stars rank11,347
7-day stars rank change60
Total stars rank17,308
Previous total stars rank17,278
Total stars rank change-30
CountryUSA
README summary

Network Slimming This repository contains the code for the following paper Learning Efficient Convolutional Networks through Network Slimming (ICCV 2017). Zhuang Liu, Jianguo Li, Zhiqiang Shen, Gao Huang, Shoumeng Yan, Changshui Zhang. We have now released another [[PyTorch implementation]]( which supports ResNet and DenseNet, based on Qiang Wang's Pytorch implementation listed below. Other Implementations: [[Pytorch]]( by Qiang Wang. [[Pytorch hand detection using YOLOv3]]( by Lam1360. [[Pytorch object detection using YOLOv3]]( by talebolano. Citation: Introduction Network Slimming is a neural network

training scheme that can simultaneously reduce the model size, run-time memory, computing operations, while introducing no accuracy loss to and minimum overhead to the training process. The resulting models require no special libraries/hardware for efficient inference. Approach Figure 1: The channel pruning process. We associate a scaling factor (reused from batch normalization layers) with each channel in convolutional layers. Sparsity regularization is imposed on these scaling factors during training to automatically identify unimportant channels. The channels with small

scaling factor values (in orange color) will be pruned (left side). After pruning, we obtain compact models (right side), which are then fine-tuned to achieve comparable (or even higher) accuracy as normally trained full network. Figure 2: Flow-chart of the network slimming procedure. The dotted line is for the multi-pass version of the procedure. Example Usage This repo holds the example code for VGGNet on CIFAR-10 dataset. Prepare the directories to save the results 1. Train

vgg network with channel level sparsity, S is the lambda in the paper which controls the significance of sparsity 2. Identify a certain percentage of relatively unimportant channels and set their scaling factors to 0 3. Re-build a real compact network and copy the weights from the model in the last stage 4. Fine-tune the compact network Note The original paper has a bug on the VGG results on ImageNet (Table 2). Please refer to this [[issue]]( The

correct result was presented in Table 4 of this paper.

Frequently asked questions

How many stars and forks are recorded?

liuzhuang13/slimming has 577 stars and 75 forks.

What is the repository rank?

liuzhuang13/slimming is ranked 16,696.

What language and category are recorded?

liuzhuang13/slimming has 577 stars, uses Lua and belongs to Infrastructure.

Which repository is closest in rank?

liuzhuang13/slimming is compared with microsoft/psi, ranked 16,697 with 577 stars.

README

Network Slimming

This repository contains the code for the following paper

Learning Efficient Convolutional Networks through Network Slimming (ICCV 2017).

Zhuang Liu, Jianguo Li, Zhiqiang Shen, Gao Huang, Shoumeng Yan, Changshui Zhang.

The code is based on fb.resnet.torch.

We have now released another [PyTorch implementation] which supports ResNet and DenseNet, based on Qiang Wang's Pytorch implementation listed below.

Other Implementations: [Pytorch] by Qiang Wang. [Chainer] by Daiki Sanno. [Pytorch hand detection using YOLOv3] by Lam1360. [Pytorch object detection using YOLOv3] by talebolano.

Citation:

@inproceedings{Liu2017learning,
	title = {Learning Efficient Convolutional Networks through Network Slimming},
	author = {Liu, Zhuang and Li, Jianguo and Shen, Zhiqiang and Huang, Gao and Yan, Shoumeng and Zhang, Changshui},
	booktitle = {ICCV},
	year = {2017}
}

Introduction

Network Slimming is a neural network training scheme that can simultaneously reduce the model size, run-time memory, computing operations, while introducing no accuracy loss to and minimum overhead to the training process. The resulting models require no special libraries/hardware for efficient inference.

Approach

Figure 1: The channel pruning process.

We associate a scaling factor (reused from batch normalization layers) with each channel in convolutional layers. Sparsity regularization is imposed on these scaling factors during training to automatically identify unimportant channels. The channels with small scaling factor values (in orange color) will be pruned (left side). After pruning, we obtain compact models (right side), which are then fine-tuned to achieve comparable (or even higher) accuracy as normally trained full network.

Figure 2: Flow-chart of the network slimming procedure. The dotted line is for the multi-pass version of the procedure.

Example Usage

This repo holds the example code for VGGNet on CIFAR-10 dataset.

  1. Prepare the directories to save the results
mkdir vgg_cifar10/
mkdir vgg_cifar10/pruned
mkdir vgg_cifar10/converted
mkdir vgg_cifar10/fine_tune
  1. Train vgg network with channel level sparsity, S is the lambda in the paper which controls the significance of sparsity
th main.lua -netType vgg -save vgg_cifar10/ -S 0.0001
  1. Identify a certain percentage of relatively unimportant channels and set their scaling factors to 0
th prune/prune.lua -percent 0.7 -model vgg_cifar10/model_160.t7  -save vgg_cifar10/pruned/model_160_0.7.t7
  1. Re-build a real compact network and copy the weights from the model in the last stage
th convert/vgg.lua -model vgg_cifar10/pruned/model_160_0.7.t7 -save vgg_cifar10/converted/model_160_0.7.t7
  1. Fine-tune the compact network
th main_fine_tune.lua -retrain vgg_cifar10/converted/model_160_0.7.t7 -save vgg_cifar10/fine_tune/

Note

The original paper has a bug on the VGG results on ImageNet (Table 2). Please refer to this [issue]. The correct result was presented in Table 4 of this paper.

Contact

liuzhuangthu at gmail.com

Nearby in the ranking
Similar items