Skip to main content
QUICK REVIEW

[Paper Review] BinaryNet: Training Deep Neural Networks with Weights and Activations Constrained to +1 or -1

Matthieu Courbariaux, Yoshua Bengio|arXiv (Cornell University)|Feb 9, 2016
Advanced Neural Network ApplicationsComputer Science490 citations
TL;DR

BinaryNet proposes training deep neural networks with weights and activations constrained to +1 or -1, enabling efficient inference through XNOR operations instead of multiplications. The method achieves near state-of-the-art accuracy on MNIST, CIFAR-10, and SVHN while reducing memory usage and accelerating inference—demonstrating a 7x speedup on MNIST with a custom GPU kernel without accuracy loss.

ABSTRACT

We introduce BinaryNet, a method which trains DNNs with binary weights and activations when computing parameters' gradient. We show that it is possible to train a Multi Layer Perceptron (MLP) on MNIST and ConvNets on CIFAR-10 and SVHN with BinaryNet and achieve nearly state-of-the-art results. At run-time, BinaryNet drastically reduces memory usage and replaces most multiplications by 1-bit exclusive-not-or (XNOR) operations, which might have a big impact on both general-purpose and dedicated Deep Learning hardware. We wrote a binary matrix multiplication GPU kernel with which it is possible to run our MNIST MLP 7 times faster than with an unoptimized GPU kernel, without suffering any loss in classification accuracy. The code for BinaryNet is available.

Motivation & Objective

  • To enable efficient inference in deep neural networks by constraining both weights and activations to binary values (+1 or -1).
  • To reduce memory usage and computational cost in both general-purpose and dedicated hardware for deep learning.
  • To maintain high classification accuracy despite the extreme weight and activation quantization.
  • To develop a training method that supports backpropagation with binary gradients, enabling end-to-end learning.
  • To demonstrate practical speedups using optimized GPU kernels for binary matrix multiplication.

Proposed method

  • Binary weights and activations are used during forward and backward passes, with gradients computed using a straight-through estimator.
  • The network is trained using stochastic gradient descent with binary weights and activations, where the full-precision weights are used only for gradient computation.
  • A binary matrix multiplication kernel is implemented on GPU to accelerate inference using XNOR and bit-counting operations.
  • The method employs a scaling factor to preserve gradient magnitude during backpropagation, mitigating the information loss from binarization.
  • The training process alternates between updating full-precision weights and projecting them to ±1 for inference.
  • The approach is applied to MLPs on MNIST and ConvNets on CIFAR-10 and SVHN, demonstrating generalization across architectures and datasets.

Experimental results

Research questions

  • RQ1Can deep neural networks be trained effectively with weights and activations constrained to ±1 without significant accuracy degradation?
  • RQ2How does the performance of BinaryNet compare to full-precision networks on standard benchmarks like MNIST, CIFAR-10, and SVHN?
  • RQ3To what extent can binary inference reduce memory usage and accelerate computation in deep learning systems?
  • RQ4Can a custom GPU kernel for binary matrix multiplication achieve measurable speedups in inference without accuracy loss?
  • RQ5Is the straight-through estimator effective for backpropagation in networks with binary weights and activations?

Key findings

  • BinaryNet achieves nearly state-of-the-art classification accuracy on MNIST, CIFAR-10, and SVHN despite using binary weights and activations.
  • The method reduces memory usage significantly by storing weights and activations as single bits instead of 32-bit floats.
  • Inference is accelerated by replacing most multiplications with XNOR and bit-counting operations, which are highly efficient on modern hardware.
  • A custom binary matrix multiplication GPU kernel enables a 7x speedup on MNIST inference compared to an unoptimized kernel, with no loss in accuracy.
  • The training procedure with a straight-through estimator allows effective backpropagation and convergence on all tested datasets.
  • The approach is generalizable across different network architectures, including MLPs and ConvNets, across multiple benchmark datasets.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.