# ThiNet: A Filter Level Pruning Method for Deep Neural Network Compression

Jian-Hao Luo, Jianxin Wu, Weiyao Lin · arXiv · 2017-7-20

- **Problem** Large CNNs are costly to store and run on phones and embedded hardware. Unstructured pruning leaves sparse weights that standard libraries do not speed up.
- **Method** ThiNet removes whole filters, unlike sparse pruning, so the layer keeps a standard shape. It picks filters by how well the next layer's output is kept, then reweights the kept channels by least squares and fine-tunes.
- **Results** On VGG-16 with ImageNet, ThiNet reaches 16.63× parameter compression and 3.31× FLOPs reduction. Top-5 accuracy drops by 0.52%.

## Why filter pruning for constrained devices

A model of that size is hard to run on phones and embedded hardware, so the authors treat compression as a requirement for deployment.

Early weight pruning removed weights with little loss in accuracy, and Han et al. later removed every connection below a threshold and fine-tuned between rounds to reach very sparse models. Such sparse models need specialised software or hardware, and random connectivity hurts cache locality, so the measured speedup can stay small even when the sparsity is high.

Removing whole filters avoids both problems: the layer keeps a standard shape that off-the-shelf libraries can run, and the intermediate activations shrink along with the weights. The authors add that a filter-pruned network can still be quantised or pruned further, and that dense tasks such as detection and segmentation would also gain.

## Scoring filters from the next layer

The key difference lies in where the scoring statistics come from. Weight sum scores a filter by the absolute sum of its kernel weights, and APoZ scores each channel by how often its post-ReLU activations are zero, so both look only at the layer that owns the filter. ThiNet instead asks what the following layer needs. Each input channel of layer i+1 is produced by one filter of layer i, so dropping that input channel means pruning the matching filter in layer i.

With layer i holding filters \\(W\_i \\in \\mathbb{R}^{D\\times C\\times K\\times K}\\) that act on an input with C channels, removing a filter in layer i also removes the matching slice of the filters in layer i+1, while the number of filters in layer i+1 stays the same. The output of layer i+1, called \\(I\_{i+2}\\), therefore keeps its size, and the criterion becomes how little this output changes.

Minimising the reconstruction error of \\(I\_{i+2}\\) is treated as a proxy for keeping classification performance.

To build training samples, one value y is taken from the output of layer i+2 before ReLU, together with the matching filter \\(\\hat{W}\\) and the sliding window x. Writing \\(\\hat{y}=y-b\\), the channel partial sums \\(\\hat{x}\_c=\\sum\_{k\_1=1}^{K}\\sum\_{k\_2=1}^{K}\\hat{W}\_{c,k\_1,k\_2}\\,x\_{c,k\_1,k\_2}\\) add up to \\(\\hat{y}=\\sum\_{c=1}^{C}\\hat{x}\_c\\). Each \\(\\hat{x}\_c\\) depends only on the input slice of channel c, so the channels of \\(\\hat{x}\\) are treated as independent random variables.

If a subset S of channels satisfies \\(\\hat{y}=\\sum\_{c\\in S}\\hat{x}\_c\\) on every instance, the remaining channels can be removed without changing the result. That equality does not hold exactly in general, so the authors look for an S that holds approximately over many instances drawn from forward runs on different images and spatial locations.

## Greedy search and least-squares reweighting

Choosing the kept set S with \\(\|S\|=C\\times r\\) is equivalent to choosing the removed set T with \\(\|T\|=C\\times(1-r)\\), and the objective becomes the sum of squared partial sums over the removed channels. The objective is \\\[\\arg\\min\_{T}\\ \\sum\_{i=1}^{m}\\Big(\\sum\_{j\\in T}\\hat{x}\_{i,j}\\Big)^{2}\\quad \\text{s.t.}\\quad \|T\|=C\\times(1-r),\\ T\\subset\\{1,2,\\dots,C\\}.\\\] Here m is the number of training examples and r is the fraction of channels kept.

The removed-set form is used because T is usually smaller than S, which makes it faster to evaluate.

Solving this exactly is NP hard, so the search is greedy: it starts from an empty T and adds, at each step, the channel that gives the smallest objective value, until \\(C\\times(1-r)\\) channels are removed. The authors call the greedy result sub-optimal and expect fine-tuning to close the gap. They also tried sparse coding with the homotopy method, but the greedy search performed better and ran faster in their experiments.

After the removed set is fixed, the kept channels are reweighted by minimising the sum over samples of \\((\\hat{y}\_i-w^T\\hat{x}^\*\_i)^2\\), where \\(\\hat{x}^\*\_i\\) contains only the selected channels. This is ordinary least squares with closed form \\(\\hat{w}=(X^TX)^{-1}X^Ty\\). Each element of \\(\\hat{w}\\) scales the corresponding channel of the filters, so the least-squares step changes the starting point for fine-tuning rather than the set of removed channels.

Pruning runs layer by layer with a predefined compression rate. After each layer is pruned, the network is fine-tuned for one or two epochs, and more epochs follow once all layers have been pruned.

## Pruning plain and residual networks differently

In VGG-16 more than 90% of the FLOPs lie in the first 10 layers, from conv1-1 to conv4-3, while the FC layers hold nearly 86.41% of the parameters. The authors therefore prune only those first 10 layers and replace the FC layers with a global average pooling layer. The criterion could also be applied to FC layers, but the authors judge removing them to be simpler and more efficient.

In residual networks, blocks in the same group must have matching channel counts for the sum operation, which makes the last convolution of each residual block hard to prune directly. Most parameters sit in the first two layers of each block, so those two layers are pruned, while the block output and the projection shortcuts stay unchanged.

## Filter criteria compared on CUB-200

The comparison uses CUB-200, which has 11,788 images of 200 bird species split into 5994 training and 5794 test images, with labels as the only supervision. A VGG-16-GAP model is pruned layer by layer, with one epoch of fine-tuning after each step and 12 epochs at the final layer. Only the selection method changes between runs, and ThiNet is repeated four times with the results averaged.

Random selection sometimes beats the heuristic criteria, which the authors link to distributed representations. It is not reliable, however: at high compression its accuracy falls very low after all layers are pruned.

Weight sum performs poorly on CUB-200. The authors reason that weight magnitude is not directly tied to final accuracy and that removing many small filters at once can cause a large loss. For the case of removing 60% of conv1-1 filters, the text gives 40.99% top-1 for Weight sum before fine-tuning, 51.26% for random selection, 68.24% for ThiNet without least squares and 70.75% for ThiNet.

The authors say the least-squares step helps most when the compression rate is high. This ablation was run only in the CUB-200 setting with VGG-16-GAP, so its effect elsewhere is not shown here.

## VGG-16 on ImageNet: size, FLOPs and accuracy

Selection samples come from 10 training images per class, with 10 locations per image, giving 100,000 samples for Algorithm 1. Accuracy is measured on the 50k validation set with a single central crop. Fine-tuning resizes images to 256×256, takes random 224×224 crops with horizontal flips, and uses SGD with mini-batch size 128.

ThiNet-Conv prunes the first ten convolutional layers at compression rate 0.5, leaving the FC layers in place. It reaches 69.80% top-1 and 89.53% top-5, compared with 68.34% and 88.44% for the original VGG-16. The original model's accuracy is computed on resized center-cropped images with the pre-trained model, following the evaluation used in prior work.

The authors attribute the higher accuracy of the pruned model to discarding useless filters.

Relative to the original model, top-5 is 0.52 lower, parameters are reduced 16.63 times and FLOPs 3.31 times.

Forward and backward times on one M40 GPU at batch size 32 with cuDNN v5.1 fall from 189.92 and 407.56 ms for the original model to 76.71 and 152.05 ms for ThiNet-Conv, and to 71.73 and 145.51 ms for ThiNet-GAP. The authors tie the speedup to convolutions dominating VGG-16's cost, and FLOPs in these tables count only convolution operations.

## Comparison with earlier filter criteria on VGG-16

Table 2 places reported changes for earlier filter-level methods beside ThiNet's on VGG-16. Several exact values are missing in the original reports and are marked as approximate, so these rows are not one controlled experiment. APoZ-1 shows a top-1 change of -2.16% and a top-5 change of -0.84%, with 2.04× parameter reduction and about 1× FLOPs reduction.

APoZ-2 shows +1.81% top-1 and +1.25% top-5 with 2.70× parameter reduction, but it barely reduces FLOPs, which the authors use to argue that convolution layers need compression.

Taylor-1 and Taylor-2 show top-5 changes of -1.44% and -3.94%, with FLOPs reductions of 2.68× and 3.86×. ThiNet-Conv shows +1.09% top-5 with 3.23× FLOPs reduction, and the authors describe it as clearly better than the Taylor method on this comparison.

Replacing only the selection criterion with Weight sum in the same framework gives ThiNet-WS +1.01% top-1 and +0.69% top-5 at 1.05× parameter reduction and 3.23× FLOPs reduction. ThiNet-Conv with the same reductions gives +1.46% top-1 and +1.09% top-5. Because only the criterion differs, the two ThiNet rows are compared fairly. The authors note that the original Weight sum work used its own fine-tuning, which could give different results.

## A 5.05MB VGG-16 variant

ThiNet-Tiny uses a larger compression rate of 0.25, which gives a 16 times parameter reduction in the convolutional layers. Conv5 layers are pruned too, and conv5-3 keeps only half its filters for accuracy.

The authors attribute the speed to ThiNet-Tiny's simpler structure, while SqueezeNet's Fire module is parameter-efficient but depends on manual design.

## ResNet-50 pruning and where speedup stops

Fine-tuning runs one epoch at a fixed learning rate of 10−4 after each pruning round. The last round gets 9 epochs with the learning rate moving from 10−3 to 10−5.

The summary states that ThiNet reduces FLOPs by 2.26× and parameters by 2.06× with roughly a 1% top-5 accuracy drop.

The authors note that reduced FLOPs do not give the same speedup for ResNet-50, because non-tensor layers such as batch normalization and pooling take more than 40% of GPU inference time.

## Transfer to CUB-200 and Indoor-67

Two strategies are compared for a small domain-specific model: pruning a pre-trained VGG-16 on the new data, or training a small network from scratch. The authors argue for a third option, fine-tuning a model already pruned on ImageNet. The datasets are CUB-200 for fine-grained classification and Indoor-67 for scene recognition, with Indoor-67 using its official split of 5360 training and 1340 test images.

The authors explain that with small training sets a pruned model cannot recover its accuracy fully and can fall into poor local minima.

## Limitations

The greedy channel search is sub-optimal, and the authors rely on fine-tuning to compensate for the resulting gap.

For ResNet-50 only the first two layers of each block are pruned, with the block output and projection shortcuts left unchanged. The authors call pruning those parts difficult, if not impossible, and leave it to future work. Non-tensor layers take more than 40% of GPU inference time in ResNet-50, which the authors identify as an open need.

The criterion comparison and the least-squares ablation use one setting: CUB-200 with a VGG-16-GAP model and the 60% conv1-1 case. The ThiNet curves are averages over four runs.

Table 2 compares against earlier methods whose settings differ from this study's, and the authors note that a different fine-tuning framework could change the Weight sum result.

Speed numbers come from one M40 GPU at batch size 32 with cuDNN v5.1. Transfer is tested only on CUB-200 and Indoor-67.

## Paper info

- **Authors**: Jian-Hao Luo, Jianxin Wu, Weiyao Lin
- **Venue**: arXiv · Preprint
- **First published**: 2017-7-20
- **Added**: 2026-11-12
- **Updated**: 2017-7-20
- **Version**: v1
- **arXiv**: 1707.06342
- **Category**: cs.CV
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/1707.06342v1) · [PDF ↗](https://arxiv.org/pdf/1707.06342v1)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Jian-Hao Luo, Jianxin Wu, Weiyao Lin (2017). ThiNet: A Filter Level Pruning Method for Deep Neural Network Compression. arXiv:1707.06342v1. https://arxiv.org/abs/1707.06342v1

**BibTeX**

```
@misc{luo2017thinet,
  title = {{ThiNet: A Filter Level Pruning Method for Deep Neural Network Compression}},
  author = {Jian-Hao Luo and Jianxin Wu and Weiyao Lin},
  year = {2017},
  eprint = {1707.06342},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1707.06342v1}
}
```

## Other paper commentary

- [EAST: An Efficient and Accurate Scene Text Detector](https://refivu.com/en/papers/c3f94c0a-3560-4b29-930f-6e881b662882-east-an-efficient-and-accurate-scene-text-detector.md)
- [SCAFFOLD: Stochastic Controlled Averaging for Federated Learning](https://refivu.com/en/papers/a21677f5-6e53-4724-a456-85f6bf3b0caf-scaffold-stochastic-controlled-averaging-for-federated.md)
- [Pruning Convolutional Neural Networks for Resource Efficient Inference](https://refivu.com/en/papers/f9a56d26-44b5-4ea9-af4f-8f00b03fe628-pruning-convolutional-neural-networks-for-resource-efficient.md)
- [M3-Embedding: Multi-Linguality, Multi-Functionality, Multi-Granularity Text Embeddings Through Self-Knowledge Distillation](https://refivu.com/en/papers/c3b40084-e91f-4769-ab5c-b3256a5b92f7-m3-embedding-multi-linguality-multi-functionality-multi.md)
- [Online Learning for Matrix Factorization and Sparse Coding](https://refivu.com/en/papers/1ce2d052-c0f8-40f5-8ef8-2c82aed1ea18-online-learning-for-matrix-factorization-and-sparse-coding.md)
- [Adaptive Federated Learning in Resource Constrained Edge Computing Systems](https://refivu.com/en/papers/75d8bb03-c432-4128-871e-23133be3cbc7-adaptive-federated-learning-in-resource-constrained-edge.md)
- [Representation Learning on Graphs: Methods and Applications](https://refivu.com/en/papers/3ca2c648-5d7e-46c2-be1e-357cc66ab085-representation-learning-on-graphs-methods-and-applications.md)
- [AutoML: A Survey of the State-of-the-Art](https://refivu.com/en/papers/c151a283-ee30-4b90-ae39-a522aa0cfc5f-automl-a-survey-of-the-state-of-the.md)
- [Pyramid Stereo Matching Network](https://refivu.com/en/papers/30a53566-121d-41b6-baca-53b0c10d01cc-pyramid-stereo-matching-network.md)
- [FEVER: a large-scale dataset for Fact Extraction and VERification](https://refivu.com/en/papers/59763d9c-0c11-477a-89ee-abea10ff28a0-fever-a-large-scale-dataset-for-fact-extraction.md)
- [Large Language Models: A Survey](https://refivu.com/en/papers/d8a3f692-1bfe-4a26-b530-c20397434b3c-large-language-models-a-survey.md)
- [Mastering Diverse Domains through World Models](https://refivu.com/en/papers/97c93a7e-84fd-435c-8ada-e4d14f8b7ef3-mastering-diverse-domains-through-world-models.md)

## Terms in this paper

- [Top-1 accuracy](https://refivu.com/en/terms/653c0b9eaa58-top-1-accuracy)
- [ResNet-50](https://refivu.com/en/terms/eb2323a60a89-resnet-50)
- [FLOPs](https://refivu.com/en/terms/14c405888d5b-flops)
- [Fine-tuning](https://refivu.com/en/terms/66a12665f507-fine-tuning)
- [top-5 accuracy](https://refivu.com/en/terms/6de0752ac469-top-5-accuracy)
- [Structured Sparsity Learning (SSL)](https://refivu.com/en/terms/45b2d2fdbdfd-structured-sparsity-learning-ssl)
- [APoZ](https://refivu.com/en/terms/eb32a2b4e2b5-apoz)
- [CUB-200](https://refivu.com/en/terms/34fe25b7d66d-cub-200)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/13501147-4289-4a98-981e-919e37e87fc7-thinet-a-filter-level-pruning-method-for-deep)
