Skip to main content
Anuraag Mishra

Mathematical Optimization

DNN-MILP: neural networks as mixed-integer programs

Rewriting a trained ReLU network as a mixed-integer program so a solver can reason about it exactly. The groundwork for my thesis and paper.

Role
Implementation, thesis groundwork
Context
2024 · FAU master's thesis
PythonMixed-integer programmingReLU networksJupyter

The idea

A ReLU unit is either off (output 0) or on (output equals its input). That on/off choice can be written as a binary variable with a few linear constraints. Do that for every unit and the whole network becomes a mixed-integer linear program. A solver can then search over the network’s input and prove when it has found the best one.

This repo is my implementation of that formulation from Fischetti & Jo (2018), done as the first step of my master’s thesis.

What it does

  • Builds the MILP from a trained network, layer by layer.
  • Runs feature visualization: find the input that maximizes a chosen output, with the solver reporting a proven optimum.

Where it went

The thesis and research version continued privately at FAU’s optimization lab. A small ReLU network trained to predict edges, rewritten this way and placed inside a CT reconstruction model, became the paper in Machine Learning: Science and Technology (2025). See the research page.

Code: github.com/mishraanuraagx/DNN_MILP (work in progress)