Strong mixed-integer programming formulations for trained neural networks

Ross Anderson, Joey Huchette, Will Ma, Christian Tjandraatmadja, Juan Pablo Vielma

TL;DR

This paper introduces novel, strong mixed-integer programming (MIP) formulations for neural network components, specifically piecewise linear functions like ReLU. These formulations offer significant improvements in solving verification and decision problems involving trained neural networks, leading to faster computation times and more reliable results compared to existing methods.

What Problem Does This Paper Address?

Deep learning models, particularly neural networks, are increasingly used in critical applications like image classification and autonomous systems. However, verifying their robustness against adversarial attacks or using them to solve complex decision problems is challenging. Traditional methods often rely on heuristics or local search, which don't guarantee optimality. While Mixed-Integer Programming (MIP) offers a framework for provably optimal solutions, existing MIP formulations for neural networks, especially those involving piecewise linear activation functions like ReLU, are often weak. This weakness leads to inefficient solvers and can limit the scalability and reliability of verification and optimization tasks. This paper aims to bridge this gap by developing stronger, more efficient MIP formulations for neural network components.

Methods

The core of this paper lies in developing "strong" MIP formulations. A strong formulation is one whose linear programming (LP) relaxation is a tight approximation of the true feasible region. The authors introduce a general framework for constructing ideal MIP formulations for the maximum of $d$ affine functions over bounded polyhedral domains. This involves:

  • Cayley Embedding: A technique to represent the graph of a function as a polyhedron.
  • Primal and Dual Characterizations: Deriving mathematical descriptions of these polyhedra using both primal (direct) and dual (optimization-based) approaches.
  • Lagrangian Duality: Applying duality to derive efficient separation routines for the inequalities defining the formulations.
  • Simplifications for Special Cases: Developing specific, often more efficient, formulations for common scenarios like ReLU activation functions, box input domains, and product of simplices. This includes deriving explicit, finite sets of inequalities.
  • Hereditarily Sharp Formulations: Developing formulations that maintain their tightness throughout the branch-and-bound process used by MIP solvers.

The paper then applies these general tools to derive specific MIP formulations for ReLU and leaky ReLU neurons, and demonstrates how these can be composed to form formulations for entire neural networks.

Datasets

The paper uses the MNIST digit dataset for training and evaluating their formulations on verification tasks. They train neural networks on this dataset and then use their MIP formulations to verify the robustness of these trained networks.

Key Insights and Ideas

  • The Power of Tight Formulations: The paper strongly emphasizes that the "strength" of an MIP formulation (how tightly its LP relaxation approximates the true feasible region) directly impacts the efficiency and reliability of solving problems involving neural networks.
  • Decomposition is Key: By developing strong formulations for individual neurons (piecewise linear functions), the authors show how to build strong formulations for entire networks, which is crucial for scalability.
  • Bridging Theory and Practice: The paper provides both theoretical characterizations of ideal formulations and practical algorithms for separating violated constraints, making their methods applicable to real-world solvers.
  • Special Cases Matter: Simplifying the general machinery for common cases like ReLU and box domains leads to significant computational gains, highlighting the importance of domain-specific optimizations.
  • Beyond Big-M: The paper demonstrates that traditional "big-M" formulations, while common, are often weak and can be significantly improved upon by their proposed methods.

Key Results

  • Stronger MIP Formulations: The paper presents novel, ideal, and hereditarily sharp MIP formulations for piecewise linear functions, which are strictly stronger than existing approaches.
  • Computational Improvements: Experimental results show substantial speedups (orders of magnitude) in solving verification tasks for image classification networks when using their proposed formulations, especially when combined with efficient separation routines.
  • Efficient Separation: For key cases like ReLU over box domains, they provide separation routines that are efficient, often linear in the input dimension.
  • Ideal Formulations for ReLU: They derive ideal, non-extended MIP formulations for ReLU neurons, which are crucial for practical MIP solvers.

Limitations and Future Work

  • Exponential Number of Constraints: While their formulations are ideal and separable, some of them (particularly for ReLU over box domains) involve an exponential number of inequalities in the input dimension. While efficient separation is provided, the sheer number of constraints can still be a bottleneck for very high-dimensional inputs.
  • Scalability to Very Large Networks: While their methods offer significant improvements, scaling to extremely deep and wide networks remains an ongoing challenge in the field.
  • Future Work: The authors suggest exploring other algorithmic techniques for modeling neural networks, improving formulations for specific network subclasses, and investigating how these techniques can be integrated into the training procedure itself to produce networks with inherent robustness guarantees.

Summary updated

Abstract

We present strong mixed-integer programming (MIP) formulations for high-dimensional piecewise linear functions that correspond to trained neural networks. These formulations can be used for a number of important tasks, such as verifying that an image classification network is robust to adversarial inputs, or solving decision problems where the objective function is a machine learning model. We present a generic framework, which may be of independent interest, that provides a way to construct sharp or ideal formulations for the maximum of d affine functions over arbitrary polyhedral input domains. We apply this result to derive MIP formulations for a number of the most popular nonlinear operations (e.g. ReLU and max pooling) that are strictly stronger than other approaches from the literature. We corroborate this computationally, showing that our formulations are able to offer substantial improvements in solve time on verification tasks for image classification networks.
BibTeX
@inproceedings{anderson2018strong,
  author = {Ross Anderson and Joey Huchette and Will Ma and Christian Tjandraatmadja and Juan Pablo Vielma},
  title = {{Strong mixed-integer programming formulations for trained neural networks}},
  booktitle = {IPCO},
  year = {2018},
  doi = {10.1007/978-3-030-17953-3\_3},
}
Figure