An Integer Programming Approach to Deep Neural Networks with Binary Activation Functions

Bubacarr Bah, Jannis KurtzarXiv 2020

Abstract

We study deep neural networks with binary activation functions (BDNN), where the activation function has only two states. We show that the BDNN can be reformulated as a mixed-integer linear program (MILP) which can be solved to global optimality by classical integer programming solvers. Additionally, a heuristic solution algorithm is presented, and we study the model under data uncertainty using a two-stage robust optimization approach. We implemented our methods on random and real datasets and show that the heuristic version of the BDNN outperforms classical deep neural networks on the Breast Cancer Wisconsin dataset while performing worse on random data.

Introduction

Standard deep learning relies on backpropagation and gradient descent, which require activation functions (like ReLU or Sigmoid) to be differentiable. However, biological neurons behave more like binary switches. "Binary" networks—where activations are strictly 0 or 1—offer significant advantages in hardware efficiency, memory storage, and interpretability.

Because binary functions are discontinuous and non-differentiable, they are typically "un-trainable" by standard gradient-based methods. This paper proposes a shift in perspective: treating neural network training as a combinatorial optimization problem rather than a continuous one.

Methodology

The authors propose a mathematical reformulation of the training process through several key components:

  1. MIP Formulation: A BDNN can be represented as a Mixed-Integer Program (MIP). By using "Big-M" constraints, the discrete step functions are linearized, allowing solvers like Gurobi to find globally optimal weights for a given training set.
  2. Learnable Thresholds: Unlike standard networks with fixed thresholds, this model treats the activation threshold ($\lambda$) as a learnable parameter for every neuron.
  3. Local Search Heuristic: To address the NP-hard nature of global optimization, the authors introduced a "Mountain-Climbing" heuristic. This algorithm alternates between fixing activations to optimize weights and fixing weights to optimize activations.
  4. Two-Stage Robust Optimization: To defend against adversarial attacks, the authors formulated a robust version of the model that seeks weights minimizing the worst-case loss across defined uncertainty sets.

Experimental Results

The approach was evaluated on synthetic random data and the Breast Cancer Wisconsin (BCW) medical dataset.

Accuracy and runtime comparison on random data across different hidden layer sizes ($d_1$) and training sample sizes ($m$).

Key Findings

  • Performance on Real Data: On the BCW dataset, the BDNN heuristic achieved an accuracy of 95.0%, significantly outperforming a standard ReLU-based Deep Neural Network (DNN), which scored 91.4%. In some shuffles, the heuristic reached a peak accuracy of 97.1%.
  • Performance on Random Data: On unstructured random datasets, the standard DNN maintained superior performance. The BDNN models showed higher sensitivity to the specific training data distribution.
  • The Heuristic Advantage: Interestingly, the local search heuristic often outperformed the "exact" global MIP solution on test data, suggesting a beneficial regularizing effect that prevents overfitting.

Discussion and Limitations

While BDNNs are ideal for low-power edge devices due to their binary nature, scalability remains the primary bottleneck. As shown in the experimental results, the runtime for BDNNs is significantly higher than standard DNNs, and the number of integer variables scales linearly with the number of training samples and neurons.

Furthermore, the Two-Stage Robust Optimization model proved computationally intensive; the algorithm failed to terminate within 24 hours even for small networks. Future work will focus on developing more efficient decomposition methods or specialized solvers to make this discrete approach viable for larger, more complex tasks.

Summary updated

BibTeX
@misc{bah2020integer,
  author = {Bubacarr Bah and Jannis Kurtz},
  title = {{An Integer Programming Approach to Deep Neural Networks with Binary Activation Functions}},
  year = {2020},
  eprint = {2007.03326},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2007.03326},
}
Figure