Binary Neural Networks: A Survey

Haotong Qin, Ruihao Gong, Xianglong Liu, Xiao Bai, Jingkuan Song, Nicu Sebe · DOI

TL;DR

This paper surveys the rapidly evolving field of Binary Neural Networks (BNNs), which drastically reduce model size and computation for efficient deployment on resource-constrained devices. It categorizes existing BNN techniques, from naive binarization to advanced optimization strategies, and discusses their impact on performance, hardware-friendliness, and training.

What Problem Does This Paper Address?

Deep neural networks (DNNs) are incredibly powerful but also computationally expensive and memory-hungry, making them unsuitable for deployment on devices like mobile phones or embedded systems. Binary Neural Networks (BNNs) offer a solution by representing weights and activations with just one bit, leading to significant reductions in storage and computation. However, this extreme compression introduces challenges: severe information loss and difficulties in optimizing the highly discontinuous binary functions. This survey aims to provide a comprehensive overview of the methods developed to overcome these challenges and enable practical BNNs.

Methods

The paper categorizes BNN methods into two main groups:

  • Naive Binary Neural Networks: These methods directly binarize weights and activations using fixed functions (like the sign function) and rely on techniques like the Straight-Through Estimator (STE) for training.
  • Optimization-Based Binary Neural Networks: These approaches go beyond naive binarization to mitigate performance degradation. They are further divided into:
  • Minimizing Quantization Error: Techniques that aim to make the binary representations closely approximate the full-precision values, often by introducing learnable scaling factors.
  • Improving the Network Loss Function: Methods that incorporate task-specific objectives or regularization terms into the loss function to guide the binarization process more effectively.
  • Reducing the Gradient Error: Strategies that focus on improving the gradient estimation during backpropagation, often by using smoother approximation functions or specialized optimizers.

The survey also covers hardware-friendly designs and practical training tricks.

Datasets

The paper discusses evaluations on several standard datasets:

  • Image Classification: MNIST, CIFAR-10, and ImageNet.
  • Object Detection: COCO 2017 and PASCAL VOC 2007.
  • Semantic Segmentation: PASCAL VOC 2012.

Key Insights and Ideas

  • The Trade-off is Real: Binarization offers massive gains in efficiency but inevitably leads to some performance degradation, especially on large, complex datasets like ImageNet.
  • Activations are More Sensitive: Binarizing weights alone typically results in a smaller accuracy drop compared to binarizing both weights and activations. This highlights the importance of carefully handling activation binarization.
  • Structure Matters: Network architecture plays a crucial role. Techniques like skip connections and wider blocks can make networks more amenable to binarization and help preserve information flow.
  • Beyond Naive Binarization: Simply quantizing to 1-bit is often insufficient. Optimization strategies that consider quantization error, loss functions, and gradient estimation are essential for achieving competitive performance.
  • Hardware-Friendly is Key: The ultimate goal is practical deployment. Research is increasingly focused on developing BNNs that can be efficiently implemented on hardware like FPGAs and ASICs.
  • Versatility is Valuable: Methods that are simple to implement and have low coupling (e.g., scale factors, smooth transitions) tend to become widely adopted practices.

Key Results

  • BNNs can achieve significant speedups (e.g., 58x faster convolutional operations) and memory savings (e.g., 32x) compared to full-precision models.
  • On smaller datasets like MNIST and CIFAR-10, BNNs can achieve accuracy comparable to full-precision models.
  • On larger datasets like ImageNet, BNNs still face a performance gap, though many methods are closing this gap. For instance, some methods achieve competitive accuracy on ImageNet with only a small percentage of accuracy loss.
  • Specific BNN implementations have demonstrated impressive performance on object detection and semantic segmentation tasks, sometimes matching or nearing full-precision model performance while offering substantial acceleration.

Limitations and Future Work

  • Unclear Optimal Architecture: It's still not fully understood what network structures are inherently best suited for binarization, making it challenging to preserve information flow post-binarization.
  • Discrete Optimization Difficulty: Optimizing in a discrete space remains a challenge, even with gradient estimators and approximation functions.
  • Large-Scale Performance Gap: BNNs still struggle to match full-precision models on large datasets and complex tasks, indicating a need for further research into delicate binarization and optimization solutions.
  • Future Directions:
    • Developing more practical and theoretical studies to address the challenges of network structure suitability and discrete optimization.
  • Exploring applications of BNNs to various tasks and deployment on diverse hardware.
  • Customizing or transferring BNNs for specific tasks.
  • Designing hardware-friendly or energy-economic binarization algorithms.
  • Investigating the feasibility of binarized backward calculation for faster training.
  • Designing mixed-precision strategies based on layer importance and exploring new architectures friendly to binary information flow.

Summary updated

BibTeX
@article{qin2020binary,
  author = {Haotong Qin and Ruihao Gong and Xianglong Liu and Xiao Bai and Jingkuan Song and Nicu Sebe},
  title = {{Binary Neural Networks: A Survey}},
  journal = {Pattern Recognition},
  year = {2020},
  doi = {10.1016/j.patcog.2020.107281},
}
Figure