Abstract
Binary Neural Networks (BNNs), which restrict weights and activations to ±1, offer significant potential for mobile AI by reducing model size and enabling fast bitwise operations. However, they often suffer from an accuracy gap on large-scale datasets and limited compression due to full-precision last layers. This paper presents a comprehensive framework for training high-accuracy BNNs on ImageNet. By optimizing learning rates, activation functions, regularization, and architectural designs, the authors achieve a 189× compression rate compared to AlexNet while maintaining competitive accuracy, demonstrating that binarization can be both efficient and effective.
Introduction
The deployment of deep learning models on mobile and edge devices is hindered by memory and computational constraints. BNNs address this by using 1-bit values, theoretically reducing model size by 32× and replacing floating-point multiplications with XNOR-based operations. Despite these benefits, BNNs have historically struggled with accuracy on complex datasets like ImageNet. Furthermore, state-of-the-art methods often keep the first and last layers in 32-bit precision to preserve performance, which creates a "last layer bottleneck" that limits actual compression. This research investigates the causes of these failures and proposes strategies to binarize the entire network, including the last layer, without significant performance degradation.
Methods and Training Strategies
The authors identify several critical factors for training successful BNNs:
- Stabilized Training: High learning rates in BNNs cause frequent "sign flipping" of binary weights, leading to instability. A significantly lower learning rate (e.g., 0.0001) is recommended to stabilize training.
- PReLU Activation: Parametric ReLU (PReLU) is used instead of standard ReLU. The learned scale factor in PReLU is absorbed into the activation, providing precision without the overhead of explicit scale factors.
- Bipolar Regularization: Unlike L2 regularization which pushes weights toward zero, the proposed bipolar regularization pushes weights toward +1 or -1, aligning with the binary nature of the network.
- The Scale Layer: To enable binarization of the last layer, a learnable scalar is added before the Softmax function. This prevents the large integer outputs of the binarized layer from saturating the Softmax, which otherwise hinders convergence.
- Multiple Binarizations: Accuracy is further improved by binarizing activations $m$ times (e.g., $m=2$) and summing the results, providing a better approximation of real-valued activations.
Key Insights
A major finding is that sign flipping in BNNs is three orders of magnitude more frequent than in full-precision networks when using standard learning rates. Additionally, the "failure" of binarizing the last layer was found to be a saturation problem rather than purely information loss. By introducing a simple scale factor, the output range is normalized, allowing the Softmax function to operate correctly. The research also suggests that expanding the width of early layers provides a substantial accuracy boost with minimal impact on model size, as early layers are less redundant.
Key Results
On the ImageNet (ILSVRC2012) benchmark, the proposed "NIN-net" configuration achieved:
- Extreme Compression: A model size of 1.23 MB, a 189× reduction from the AlexNet baseline.
- High Accuracy: 75.6% top-5 and 51.4% top-1 accuracy.
- Full Binarization: By binarizing the last layer, the compression rate improved from ~10× (standard BNN/XNOR-Net) to over 23× relative to their baseline, outperforming previous state-of-the-art methods in both efficiency and accuracy.
Conclusion
This work provides a robust blueprint for training BNNs that are viable for large-scale applications. While multiple binarizations introduce a trade-off in inference speed and the first layer remains in full precision, the strategies outlined significantly narrow the gap between binary and full-precision models. Future work may involve developing specialized optimization algorithms tailored for discrete binary weights to further enhance performance.
Summary updated