Soft Threshold Ternary Networks

Weixiang Xu, Xiangyu He, Tianli Zhao, Qinghao Hu, Peisong Wang +1 more
4/4/2022
cs.CV

Official code: WeixiangXu/STTN (17 stars, Python, last commit 2022-10-25).

Abstract

Large neural networks are difficult to deploy on mobile devices because of intensive computation and storage. To alleviate it, we study ternarization, a balance between efficiency and accuracy that quantizes both weights and activations into ternary values.

Show full abstract

In previous ternarized neural networks, a hard threshold Δ is introduced to determine quantization intervals. Although the selection of Δ greatly affects the training results, previous works estimate Δ via an approximation or treat it as a hyper-parameter, which is suboptimal. In this paper, we present the Soft Threshold Ternary Networks (STTN), which enables the model to automatically determine quantization intervals instead of depending on a hard threshold. Concretely, we replace the original ternary kernel with the addition of two binary kernels at training time, where ternary values are determined by the combination of two corresponding binary values. At inference time, we add up the two binary kernels to obtain a single ternary kernel. Our method dramatically outperforms current state-of-the-arts, lowering the performance gap between full-precision networks and extreme low bit networks. Experiments on ImageNet with ResNet-18 (Top-1 66.2%) achieves new state-of-the-art. Update: In this version, we further fine-tune the experimental hyperparameters and training procedure. The latest STTN shows that ResNet-18 with ternary weights and ternary activations achieves up to 68.2% Top-1 accuracy on ImageNet. Code is available at: github.com/WeixiangXu/STTN.

View on arXivView PDF

Code Implementations(1)

WeixiangXu/STTNOfficial100%
170Python, CudaApr 2, 20224 years ago

Similar Papers

Cite this paper

@article{xu2022soft,
  title  = {Soft Threshold Ternary Networks},
  author = {Weixiang Xu and Xiangyu He and Tianli Zhao and Qinghao Hu and Peisong Wang and Jian Cheng},
  year   = {2022},
  eprint = {2204.01234},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2204.01234}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2204.01234.svg)](https://codeofpaper.com/paper/2204.01234)

Discussion