Sparsity-Inducing Binarized Neural Networks

Peisong Wang, Xiangyu He, Gang Li, Tianli Zhao, Jian Cheng

Introduction

Binarized Neural Networks (BNNs) represent a significant frontier in efficient deep learning. By quantizing weights and activations to a single bit, BNNs can achieve up to 32x memory savings and 64x theoretical speedups compared to full-precision models. These gains stem from replacing computationally expensive floating-point operations with efficient bitwise XNOR and popcount operations. Despite these advantages, BNNs have historically suffered from a substantial "accuracy gap" when applied to large-scale datasets like ImageNet.

While previous research often attributed this performance drop to quantization error or training instability, this work investigates the fundamental choice of the binarization function. Standard BNNs typically employ the sign function, mapping activations to $\{-1, +1\}$. This creates a dense representation where every neuron is active. In contrast, full-precision networks benefit from the sparsity induced by functions like ReLU. This paper proposes Sparsity-Inducing Binarized Neural Networks (Si-BNN), which introduce sparsity into binary activations to bridge the accuracy gap.

Methodology

The core innovation of Si-BNN is the transition from $\{-1, +1\}$ quantization to a sparsity-inducing $\{0, 1\}$ scheme.

Sparsity-Inducing Binarization

Instead of the traditional sign(x) function, Si-BNN utilizes a threshold-based binarization:

$$f(x) = \begin{cases} 1 & \text{if } x \ge \theta \\ 0 & \text{otherwise} \end{cases}$$

By allowing activations to be zero, the network can effectively "deactivate" uninformative features, mimicking the information-filtering properties of ReLU in full-precision networks. Mutual information analysis conducted by the authors suggests that a threshold $\theta > 0$ can preserve more relevant information than a threshold at zero by filtering out low-magnitude noise.

Trainable Thresholds and Gradient Estimation

Si-BNN introduces learnable parameters to optimize the binarization process:

  1. Forward Pass: The threshold $\theta$ is a learnable parameter, allowing the network to adaptively determine the optimal cutoff for each layer.
  2. Backward Pass: To handle the non-differentiable nature of the threshold function, a modified Straight-Through Estimator (STE) is used. A second learnable parameter, $\Delta$, defines the "clip interval" for gradients, ensuring that updates are focused on neurons near the decision boundary.
Comparison of forward and backward passes between standard BNNs and the proposed Si-BNNs.

Hardware Efficiency

A critical requirement for BNNs is maintaining hardware efficiency. While bitwise XNOR operations are designed for $\{-1, +1\}$ values, the authors demonstrate that dot products involving $\{0, 1\}$ activations and $\{-1, +1\}$ weights can be mathematically refactored. By adding a pre-computed bias, the operation remains compatible with standard XNOR-popcount hardware, ensuring that Si-BNN incurs no additional computational overhead during inference.

Experimental Results

The effectiveness of Si-BNN was evaluated on several benchmarks, most notably the ImageNet (ILSVRC 2012) dataset.

ImageNet Performance

Si-BNN established new state-of-the-art results for 1-bit networks:

  • AlexNet: Achieved 50.5% Top-1 accuracy, significantly outperforming the previous benchmark of 44.2% set by XNOR-Net.
  • ResNet-18: Reached 59.7% Top-1 accuracy, a 3% improvement over the previous state-of-the-art, Bi-Real Net.

Insights and Efficiency

Analysis of the trained models revealed that shallow layers tend to favor denser representations (lower $\theta$), while deeper layers evolve to be more sparse (higher $\theta$), focusing on high-level semantic features. Furthermore, practical implementation on a standard CPU demonstrated a 14x speedup over full-precision counterparts, validating the real-world utility of the approach.

Conclusion

Si-BNN demonstrates that the lack of sparsity was a primary bottleneck for binarized neural networks. By adopting a $\{0, 1\}$ activation scheme with trainable thresholds, the proposed method significantly narrows the accuracy gap on large-scale tasks while preserving the extreme efficiency of bitwise operations. This work highlights the importance of "information filtering" in neural representations and paves the way for more effective low-bitwidth architectures.

Summary updated

BibTeX
@inproceedings{wang2020sparsity,
  author = {Peisong Wang and Xiangyu He and Gang Li and Tianli Zhao and Jian Cheng},
  title = {{Sparsity-Inducing Binarized Neural Networks}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2020},
  doi = {10.1609/aaai.v34i07.6900},
}
Figure