Regularizing Activation Distribution for Training Binarized Deep Networks

Ruizhou Ding, Ting-Wu Chin, Zeye Liu, Diana Marculescu

Introduction

Binarized Neural Networks (BNNs) represent a significant leap toward deploying deep learning on resource-constrained edge devices. By constraining weights and activations to 1-bit values ($\pm 1$), BNNs replace computationally expensive floating-point multiplications with efficient XNOR and bit-counting operations. Despite these advantages, BNNs are notoriously difficult to train due to the non-differentiable nature of the Sign activation function, which often leads to poor "activation flow."

The Challenges of Binarization

Training BNNs typically involves the Straight-Through Estimator (STE) to approximate gradients. However, this approach frequently encounters three major pathologies in the pre-activation distribution that hinder effective learning:

  1. Degeneration: A channel might output the same value (all $+1$ or all $-1$) for every input, effectively becoming "dead."
  2. Saturation: Pre-activations become so large that gradients become zero, halting the learning process.
  3. Gradient Mismatch: High approximation errors occur when pre-activations cluster near zero, where the STE is most inaccurate.
Pathologies in pre-activation distributions that hinder BNN training.

Previous attempts to mitigate these issues often relied on floating-point scaling factors or multi-bit activations, which compromise the energy efficiency of the final hardware implementation.

Proposed Methodology: Distribution Loss

This paper introduces a novel Distribution Loss ($L_{DL}$) designed to regularize pre-activations during training without requiring additional hardware overhead at inference. The authors propose a systematic three-stage framework to derive this loss:

  1. Hypothesis Formulation: Mathematical conditions are defined to identify "bad" distribution shapes (e.g., identifying degeneration when the distribution does not cross zero).
  2. Adjusting Regularization: To ensure robustness against outliers, the framework utilizes quantiles ($\epsilon$) instead of absolute extrema.
  3. Enabling Differentiability: By assuming pre-activations follow a Gaussian distribution $N(\mu, \sigma^2)$, the quantiles become differentiable functions of the mean and standard deviation, which are easily computed during training.
The three-stage framework for designing differentiable distribution loss terms to address degeneration, saturation, and gradient mismatch.

The resulting loss function, $L_{DL} = L_D + L_S + L_M$, explicitly penalizes the three identified pathologies. This loss is integrated into the standard training objective: $L_{total} = L_{CE} + \lambda L_{DL}$.

Key Results and Insights

The proposed BNN-DL method was evaluated on standard benchmarks including CIFAR-10, SVHN, CIFAR-100, and ImageNet, demonstrating significant improvements over baseline BNNs.

  • Accuracy Gains: On ImageNet, BNN-DL improved Top-1 accuracy from 36.1% to 41.3%. On CIFAR-100, accuracy rose from 60.4% to 68.2%.
  • Hardware Efficiency: Unlike methods like XNOR-Net or ABC-Net, BNN-DL maintains a "pure-logical" structure. It requires zero floating-point scaling factors at inference, preserving the $1\times$ relative energy cost of basic BNNs while achieving higher accuracy.
  • Training Stability: The addition of distribution loss makes BNN training more robust to hyper-parameter choices, such as the selection of optimizers (Adam vs. SGD), which are typically sensitive in binarized settings.

Conclusion

By explicitly regularizing the distribution of pre-activations, BNN-DL overcomes the fundamental training hurdles of binarized networks. This approach achieves state-of-the-art accuracy while maintaining the extreme energy efficiency required for IoT and mobile applications. The use of a Gaussian assumption as a differentiable proxy provides a powerful bridge between theoretical distribution shaping and practical gradient-based optimization.

Summary updated

BibTeX
@inproceedings{ding2019regularizing,
  author = {Ruizhou Ding and Ting-Wu Chin and Zeye Liu and Diana Marculescu},
  title = {{Regularizing Activation Distribution for Training Binarized Deep Networks}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2019},
  doi = {10.1109/cvpr.2019.01167},
}
Figure