Efficient and Robust Mixed-Integer Optimization Methods for Training Binarized Deep Neural Networks

Jannis Kurtz, Bubacarr BaharXiv 2021

Abstract

Binarized Deep Neural Networks (BDNNs) offer significant advantages for resource-constrained devices by reducing memory consumption and computational overhead. However, their discontinuous and non-differentiable activation functions pose a significant challenge for traditional gradient-based training methods. This paper presents a mathematically rigorous framework for training BDNNs with binary activations and continuous or integer weights using Mixed-Integer Linear Programming (MILP). We introduce a local search heuristic for finding locally optimal networks and an iterative data-splitting heuristic based on k-means clustering to enhance scalability. Furthermore, we propose a novel robust optimization model that enforces stability against data uncertainty during training. Our results on various benchmarks demonstrate that these methods can compete with or outperform classical Deep Neural Networks (DNNs) in small-scale architectures, confirming the viability of discrete optimization for efficient deep learning.

Introduction

The proliferation of deep learning on edge devices has created a demand for models that are both computationally efficient and memory-lean. Binarized Deep Neural Networks (BDNNs), which restrict activations to discrete values (e.g., $\{-1, 1\}$ or $\{0, 1\}$), are ideal for these applications. Despite their benefits, training BDNNs is notoriously difficult because their activation functions lack the gradients required for backpropagation. Most existing approaches rely on "straight-through estimators" to approximate gradients, which lacks mathematical guarantees.

This research shifts the paradigm from gradient descent to discrete optimization. By reformulating the training process as a Mixed-Integer Programming (MIP) problem, we can achieve global optimality for small architectures, incorporate provable robustness, and utilize integer weights to further optimize hardware performance.

Methodology

1. Mixed-Integer Programming (MIP) Reformulation

We demonstrate that a BDNN can be modeled as a Mixed-Integer Linear Program (MILP). To handle the non-linear products of binary activations and weights, we employ McCormick linearization. This transformation allows the training task to be solved using high-performance solvers like Gurobi, providing a path to global optimality that gradient-based methods cannot guarantee.

2. Local Search Heuristic

To mitigate the computational complexity inherent in full MIP models, we implement a "Mountain-Climbing" local search method. This algorithm alternates between two phases:

  • Weight Optimization: Fixing the activation patterns and optimizing the weights.
  • Activation Optimization: Fixing the weights and optimizing the activations. This iterative approach allows the model to converge on locally optimal solutions much faster than a global solver.

3. Iterative Data-Splitting (DS)

Scalability is a primary hurdle for MIP-based training, as the number of integer variables typically scales with the size of the training dataset. We introduce an Iterative Data-Splitting heuristic to address this. By using k-means clustering, we group data points that are likely to share the same activation patterns based on their geometric proximity in the input space. By forcing all points within a cluster to follow the same activation path, we significantly reduce the number of integer variables, enabling the training of models on much larger datasets.

4. Robust Optimization

We present the first BDNN model that incorporates robustness directly into the training phase. By defining an "uncertainty set" around the input data, the MIP formulation ensures that small perturbations do not flip the binary activations of the first layer. Because binary stability in the initial layer often propagates through the network, this approach provides a computationally efficient way to build models resistant to adversarial noise.

Experimental Evaluation

Datasets

We evaluated our methods using several benchmarks from the UCI repository, including:

  • Breast Cancer Wisconsin (BCW): Diagnostic classification.
  • Default Credit Card (DCC): A large-scale dataset (30,000 instances) to test the Data-Splitting heuristic.
  • Iris and Digit Dataset (DD): Multi-class classification tasks.
  • Boston Housing (BH): Regression analysis.

Key Results

  • Accuracy: On the BCW dataset, the BDNN local search heuristic achieved an accuracy of 97.1%, notably outperforming a standard ReLU-based DNN which achieved 91.4%.
  • Scalability: The Iterative Data-Splitting method successfully scaled the MIP framework to the DCC dataset (30,000 points), a feat previously considered impossible for standard MIP training.
  • Robustness: The robust BDNN (RO-BDNN) challenged the typical trade-off between accuracy and robustness. In several tests, the robust model maintained higher accuracy under attack than standard DNNs without a significant drop in clean-data performance.
  • Weight Stability: Interestingly, BDNNs using integer weights ($\{-1, 0, 1\}$) often demonstrated higher stability and better performance than those using continuous weights within the MIP framework.

Discussion and Limitations

While the MIP approach offers rigorous guarantees and high accuracy for small architectures, it faces challenges with depth. As network depth increases, the accuracy of BDNNs tends to decline relative to classical DNNs. This suggests that the current strength of BDNNs lies in "shallow but wide" architectures optimized for specific low-power tasks.

Furthermore, computational time remains a factor. Even with heuristics, training via MIP is significantly slower than Stochastic Gradient Descent (SGD). For high-dimensional data like the Digit Dataset, the computational overhead currently limits the BDNN's ability to match the performance of large-scale classical models.

Conclusion

This work demonstrates that Mixed-Integer Programming provides a viable and robust alternative to gradient-based training for binarized networks. By leveraging geometric insights for data-splitting and incorporating robustness into the optimization objective, we can produce models that are uniquely suited for deployment on restricted hardware. Future research will focus on refining the data-splitting process and exploring sparsity constraints to further improve the efficiency of these discrete optimization models.

Summary updated

BibTeX
@misc{kurtz2021efficient,
  author = {Jannis Kurtz and Bubacarr Bah},
  title = {{Efficient and Robust Mixed-Integer Optimization Methods for Training Binarized Deep Neural Networks}},
  year = {2021},
  eprint = {2110.11382},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2110.11382},
}
Figure