Training Binary Weight Networks via Semi-Binary Decomposition

Qinghao Hu, Gang Li, Peisong Wang, Yifan Zhang, Jian Cheng

Abstract

Binary Weight Networks (BWNs) offer a promising path toward deploying deep learning models on resource-constrained edge devices by replacing 32-bit weights with 1-bit values. However, the limited representation capacity of binary weights often results in significant accuracy degradation. This paper introduces Semi-Binary Decomposition (SBD), a method that decomposes weight matrices into two binary matrices and a diagonal scaling matrix. By increasing the combinatorial diversity of the weights, SBD significantly closes the gap between full-precision and binary models. Experimental results on ImageNet demonstrate a 5% top-1 accuracy improvement on ResNet-18 and a 9x speedup on FPGA hardware.

Introduction

The proliferation of deep learning in mobile and Internet of Things (IoT) applications has created an urgent need for efficient model compression. Binary Weight Networks (BWNs) represent an extreme form of quantization where weights are constrained to $\pm 1$. While this transformation replaces costly floating-point multiplications with simple additions and subtractions, it typically incurs a steep "accuracy tax." The primary cause is the restricted representation capacity; a single scaling factor per kernel cannot capture the nuanced weight distributions required for complex tasks like ImageNet classification.

Semi-Binary Decomposition (SBD)

To address the capacity bottleneck, we propose Semi-Binary Decomposition (SBD). Rather than approximating a weight matrix $W$ with a single binary matrix $B$ and a scalar $\alpha$, SBD decomposes the weights into three components:

$$W \approx U D V^T$$

In this formulation, $U$ and $V$ are binary matrices (containing only $+1$ and $-1$), and $D$ is a diagonal matrix containing scaling factors.

This decomposition drastically increases the model's expressiveness. In a standard BWN, a weight has only one possible magnitude. In SBD, the product of two binary matrices and a diagonal scaling matrix allows for $2^K$ possible magnitudes (where $K$ is the decomposition rank). This "combinatorial diversity" enables the network to mimic the behavior of full-precision weights much more accurately while remaining compatible with binary operations.

Optimization Strategies

The paper explores two primary methods for learning the SBD components:

1. SBD-Direct

SBD-Direct employs a greedy, alternating optimization strategy. It aims to minimize the Frobenius norm between the original full-precision weights and the decomposed representation: $\min_{U,D,V} \|W - UDV^T\|_F^2$. This approach is computationally efficient but focuses solely on weight reconstruction.

2. SBD-FQ (Featuremap-Oriented)

Recognizing that small errors in weight approximation can accumulate and amplify across layers, we developed SBD-FQ. This method optimizes the decomposition to minimize the error in the output feature maps (activations). By ensuring the "signal" remains consistent as it passes through the network, SBD-FQ achieves superior performance in deeper architectures where error propagation is a significant concern.

Experimental Evaluation

The SBD framework was evaluated on the ImageNet (ILSVRC2012) dataset using AlexNet, ResNet-18, and ResNet-50 architectures.

  • ResNet-18: SBD-FQ achieved a top-1 accuracy of 66.2%, representing a 5% improvement over previous state-of-the-art binarization techniques.
  • AlexNet: The SBD-FQ model reached 58.5% top-1 accuracy, effectively matching the performance of the uncompressed, full-precision baseline.
  • ResNet-50: The featuremap-oriented optimization proved essential for maintaining stability in this deeper network, outperforming weight-only binarization methods.

Hardware Implementation and Efficiency

To validate the practical utility of SBD, the team implemented a binary AlexNet on a Xilinx Virtex-7 FPGA. The architecture leverages the fact that binary matrix multiplications can be mapped to efficient XNOR and Popcount logic. The diagonal matrix $D$ is handled as a simple scaling step. This implementation achieved a ~9x speedup compared to traditional floating-point versions and significantly reduced the reliance on on-chip memory and dedicated Digital Signal Processing (DSP) slices.

Limitations and Future Work

While SBD-FQ provides high accuracy, it is more computationally expensive to train than simpler binarization methods due to the iterative alternating optimization. Additionally, the method introduces a hyperparameter $\beta$ to control the decomposition rank, which may require tuning for new architectures.

Future research will focus on combining SBD with 1-bit activation quantization (e.g., XNOR-Net) to further enhance efficiency, potentially enabling even more complex models to run on ultra-low-power IoT hardware.

Summary updated

BibTeX
@inproceedings{hu2018training,
  author = {Qinghao Hu and Gang Li and Peisong Wang and Yifan Zhang and Jian Cheng},
  title = {{Training Binary Weight Networks via Semi-Binary Decomposition}},
  booktitle = {European Conference on Computer Vision},
  year = {2018},
  doi = {10.1007/978-3-030-01261-8\_39},
}
Figure