Combinatorial Attacks on Binarized Neural Networks

Elias B. Khalil, Amrita Gupta, Bistra Dilkina

Introduction

Binarized Neural Networks (BNNs) offer extreme computational efficiency, making them highly attractive for deployment on resource-constrained devices. However, evaluating their security is notoriously difficult. Because their non-differentiable nature breaks standard gradient-based attack methods, BNNs often appear artificially robust.

This paper introduces IProp (Integer Propagation), a novel combinatorial attack that treats adversarial generation as a sequence of small integer programming problems. By embracing the discrete nature of BNNs, IProp significantly outperforms traditional gradient-based attacks—especially at small perturbation budgets—providing a much more accurate measure of true BNN robustness.

The Challenge with BNNs

Adversarial attacks are tiny, intentional perturbations to an input designed to cause a model to misclassify. To build robust models, researchers first need "strong" attacks to test them.

Most state-of-the-art attacks, such as Projected Gradient Descent (PGD), rely on calculating gradients to find the optimal direction to perturb an image. However, BNNs use the sign function for activations and restrict weights to $\{-1, +1\}$. Because the derivative of the sign function is zero almost everywhere, gradients provide no useful information.

True discrete BNN outputs (left) versus continuous surrogate approximations (right).

While researchers often use differentiable "surrogates" to bypass this issue, these continuous approximations are frequently inaccurate representations of the true, step-like BNN landscape. The authors argue that to accurately assess vulnerability, we need attacks that directly navigate the discrete, combinatorial structure of these networks.

Methodology: From Exact MILP to IProp

The authors propose two main approaches to tackle this combinatorial challenge:

1. Exact MILP Formulation

Initially, they model the entire BNN attack as a Mixed Integer Linear Program (MILP). This approach is mathematically guaranteed to find the "best" possible attack (global optimality). However, because MILP is NP-Hard, this method suffers from exponential complexity and only scales to very small networks before becoming computationally intractable.

2. IProp (Integer Propagation)

To solve the scaling issue, the authors introduce IProp. Instead of solving one giant optimization problem, IProp breaks the task into a sequence of much smaller, layer-by-layer subproblems:

  • It starts at the output layer and determines an "ideal" target activation vector for the last hidden layer.
  • It then solves a small MILP to find activations in the previous layer that would induce that target.
  • This "target propagation" continues backward until it reaches the input pixels.

Key Innovation: To prevent the algorithm from being too "greedy" or ambitious, IProp uses a step size ($S$). It only tries to flip a small subset of neurons at a time, functioning similarly to how a learning rate controls progress in gradient descent.

Key Insights and Results

The methods were evaluated on standard computer vision benchmarks (MNIST and Fashion-MNIST) using BNN architectures with varying depths (2 to 5 layers) and widths (100 to 500 neurons).

  • Gradients are Misleading: The authors demonstrate that the "surrogate" gradients used by standard attacks like PGD often point in directions that don't actually help flip the BNN's prediction. Combinatorial search is much more "honest" to the network's true behavior.
  • Decomposition Enables Scaling: By treating the attack as a layer-wise satisfaction problem, IProp can leverage powerful MILP solvers (like Gurobi) on small, manageable chunks of the network. While the full MILP solver timed out on networks larger than two layers, IProp successfully attacked 5-layer networks with hundreds of neurons per layer.
Prediction flip rates across different perturbation budgets (epsilon) and network architectures.
  • Superiority at Small Perturbations: IProp is most effective when the allowed perturbation ($\epsilon$) is very small. This is exactly where BNNs previously appeared "robust" simply because gradient-based attacks were too blind to find the narrow paths to failure. On MNIST, IProp consistently achieved higher "flip rates" (successful attacks) than PGD across almost all network architectures.
  • Efficiency and Quality: IProp typically finds a better adversarial example in a few seconds than PGD finds even after many restarts. Furthermore, the raw optimization objective (maximizing the target class score versus the predicted class score) was significantly higher quality in IProp's solutions.

Limitations and Future Work

While much faster than a full MILP, IProp is still more computationally expensive than a single pass of PGD and requires access to a high-performance MILP solver. Additionally, the current work focuses on fully connected (dense) layers; extending IProp to handle Convolutional Neural Networks (CNNs) is a necessary next step for modern vision tasks. Ultimately, the authors suggest that IProp could be integrated into the training loop to create truly robust BNNs, provided the speed can be further optimized.

Summary updated

BibTeX
@inproceedings{khalil2019combinatorial,
  author = {Elias B. Khalil and Amrita Gupta and Bistra Dilkina},
  title = {{Combinatorial Attacks on Binarized Neural Networks}},
  booktitle = {International Conference on Learning Representations},
  year = {2019},
}
Figure