Abstract
Binary Neural Networks (BNNs) rely on a real-valued auxiliary variable $W$ to help binary training. However, pioneering binary works only use $W$ to accumulate gradient updates during backward propagation, which can not fully exploit its power and may hinder novel advances in BNNs. In this work, we explore the role of $W$ in training besides acting as a latent variable. Notably, we propose to add $W$ into the computation graph, making it perform as a real-valued feature extractor to aid the binary training. We make different attempts on how to utilize the real-valued weights and propose a specialized supervision. Visualization experiments qualitatively verify the effectiveness of our approach in making it easier to distinguish between different categories. Quantitative experiments show that our approach outperforms current state-of-the-arts, further closing the performance gap between floating-point networks and BNNs. Evaluation on ImageNet with ResNet-18 (Top-1 63.4%), ResNet-34 (Top-1 67.0%) achieves new state-of-the-art.
Introduction
Binary Neural Networks (BNNs) represent the "holy grail" of efficient deep learning, utilizing 1-bit weights and activations ($\pm1$). This extreme quantization offers up to $32\times$ memory compression and significant speedups by replacing expensive floating-point operations with cheap bitwise XNOR and popcount. Despite these benefits, a persistent "accuracy gap" remains between BNNs and their full-precision counterparts.
Traditional BNN training maintains a real-valued auxiliary variable $W$ (the latent weight) solely to accumulate small gradient updates. These are binarized into $B$ for the forward pass, and $W$ is typically discarded after training. This paper argues that $W$ is an underutilized resource. By integrating $W$ into the forward pass during training, it can serve as a high-quality "internal teacher" to guide binary weights toward superior feature representations.
Methodology
The proposed framework fully utilizes latent weights through two primary innovations: Latent Weight Inference and Label-aware Representation Approximation (LARA).
Latent Weight Inference
Instead of restricting the forward pass to binary weights $B$, the authors introduce a parallel path using latent weights $W$. They discovered that while $W$ initially appears to perform poorly, its effectiveness as a feature extractor can be "restored" by updating Batch Normalization statistics and employing a hard_tanh activation. This allows $W$ to provide rich, real-valued feature information that the binary model can leverage.
Label-aware Representation Approximation (LARA)
LARA is the core supervision strategy, designed to align the features of the binary path with those of the latent path.
As shown in Figure 2, the LARA loss function operates at two levels:
- Instance-level: It ensures that for a specific input, the binary model captures similar details to the real-valued model.
- Category-level: It pulls features of the same class closer together in the feature space, similar to "center loss," making the representation more compact and linearly separable.
To prevent optimization instability, gradients from the latent weight path are detached. This ensures the supervision aids the binary weights without interfering with the optimization of the latent weights themselves.
Experimental Results
The researchers evaluated their approach on CIFAR-10 and ImageNet benchmarks, setting new state-of-the-art (SOTA) benchmarks for BNN performance.
Key Results on ImageNet
- ResNet-18: Achieved 63.4% Top-1 accuracy, a 1.7% improvement over the previous SOTA (SA-BNN).
- ResNet-34: Achieved 67.0% Top-1 accuracy. When combined with traditional Knowledge Distillation (Ours+KD), this reached 67.3%.
Key Insights
- Internal Teacher: Unlike standard Knowledge Distillation which requires a separate heavy teacher model, this approach uses the latent weights already present in the training loop, significantly reducing complexity.
- Feature Alignment: The results suggest that aligning feature outputs is more effective than directly approximating weight values.
- Batch Norm Impact: A critical finding was that latent weights only underperform when forced to use Batch Norm statistics calculated for binary weights. Recalculating these statistics unlocks their potential.
Conclusion
This work demonstrates that latent weights in BNNs are more than just gradient accumulators; they are powerful internal teachers. By bringing them into the computation graph and using LARA for feature alignment, the performance gap between BNNs and full-precision networks is further narrowed. While training time increases by approximately 1.33$\times$ due to the dual forward passes, inference speed remains unaffected, making this a highly practical advancement for deploying efficient neural networks.
Summary updated