SA-BNN: State-Aware Binary Neural Network

Chunlei Liu, Peng Chen, Bohan Zhuang, Chunhua Shen, Baochang Zhang, Wenrui Ding

Abstract

Binary Neural Networks (BNNs) represent a significant frontier in efficient deep learning, offering up to 32× memory compression and 58× speedups on standard hardware. However, the transition from full-precision to 1-bit weights typically incurs a substantial accuracy penalty. This paper identifies "weight flipping"—the unproductive oscillation of weights between binary states during training—as a primary driver of this performance gap. We introduce SA-BNN, a state-aware gradient approach that assigns independent, learnable coefficients to different quantization states. This mechanism breaks gradient symmetry, stabilizes the optimization landscape, and significantly reduces the clipped gradient ratio. Our results on ImageNet demonstrate state-of-the-art performance, with SA-BNN achieving 61.7% Top-1 accuracy on ResNet-18, outperforming prior benchmarks by over 5%.

Introduction

The deployment of deep neural networks on resource-constrained edge devices necessitates extreme model compression. BNNs, which constrain weights and activations to $\{-1, 1\}$, are the ultimate realization of this goal. Despite their theoretical efficiency, BNNs are notoriously difficult to train. The discrete nature of the sign function used for binarization prevents the use of standard backpropagation, requiring the maintenance of "latent" full-precision weights that are updated via a Straight-Through Estimator (STE). This discrepancy between the continuous latent weights and the discrete binary weights used in the forward pass often leads to unstable training trajectories.

The Weight Flipping Problem

The authors identify frequent weight flipping as a central challenge in BNN optimization. Because the gradient is calculated based on discrete binary values but applied to continuous latent weights, small updates can cause a weight to jump across the zero-threshold, flipping from $-1$ to $1$ and potentially back again in the subsequent iteration. This oscillatory behavior prevents the model from converging to a high-quality local minimum and effectively "misleads" the training process.

Conceptual diagram of the binarization process and the resulting weight trajectories during training.

Proposed Method: State-Aware Gradient

The core innovation of SA-BNN is the State-Aware Gradient. Traditional BNN training treats both binary states ($-1$ and $1$) identically during backpropagation, maintaining a symmetric gradient magnitude. SA-BNN breaks this symmetry by introducing independent, learnable coefficients, $\tau_{-1}$ and $\tau_{1}$, for the activation gradients based on their current state.

By making these coefficients learnable and per-channel, the network can automatically calibrate the sensitivity of each state. This imposes a mild constraint that discourages unnecessary weight flips without halting the learning process entirely. Furthermore, this approach significantly improves gradient flow; in standard BNNs, gradients are often "clipped" (set to zero) when values fall outside a specific range. SA-BNN reduces this clipped gradient ratio dramatically—in some layers from 0.69 down to as low as 0.02—preserving more useful information for optimization.

Experimental Results

We evaluated SA-BNN on the ImageNet (ILSVRC12) dataset using ResNet architectures. The state-aware approach consistently outperformed existing state-of-the-art binary networks like XNOR-Net and Bi-Real Net.

Top-1 and Top-5 validation accuracy curves on ImageNet, comparing SA-BNN against Bi-Real Net and XNOR-Net.

Performance Benchmarks

  • ResNet-18: SA-BNN achieved 61.7% Top-1 accuracy, a 5.3% improvement over Bi-Real Net.
  • ResNet-34 & 50: The method scaled effectively, reaching 65.5% and 68.7% Top-1 accuracy, respectively.
  • Efficiency: These gains were achieved while maintaining massive resource savings, including an 11.10× memory reduction and a 10.71× speedup for the ResNet-18 model compared to its full-precision counterpart.

Conclusion

SA-BNN addresses the fundamental instability of binary network training by introducing state-awareness into the gradient calculation. By breaking the symmetry of the optimization landscape, the method suppresses unproductive weight flipping and improves gradient information retention. The resulting models set new benchmarks for accuracy on large-scale datasets while preserving the extreme efficiency that makes BNNs attractive for real-world deployment. Future research may extend this state-aware logic to multi-bit quantization schemes to further bridge the gap between binary and full-precision models.

Summary updated

BibTeX
@inproceedings{liu2021sa,
  author = {Chunlei Liu and Peng Chen and Bohan Zhuang and Chunhua Shen and Baochang Zhang and Wenrui Ding},
  title = {{SA-BNN: State-Aware Binary Neural Network}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.1609/aaai.v35i3.16306},
}
Figure