Package: reluMIP
reluMIPEmbed ReLU neural networks into mixed-integer programs.AboutWith this package, you can generate mixed-integer linear programming (MIP) models of trained artificial neural networks (ANNs) using the rectified liner unit (ReLU) activation function. At the moment, onlyTensorFlowsequential models are supported. Interfaces to either thePyomoorGurobimodelling environments are offered.ReLU ANNs can be used to approximate complex functions from data. In order to embed these functions into optimization problems, strong formulations of the network are needed. This package employs progressive bound tightening procedures to produce MIP encodings for ReLU networks. This allows the user to embed complex and nonlinear functions into mixed-integer programs. Note that the training of ReLU ANNs is not part of this package and has to be done by the user beforehand. A number of illustrative examples are provided to showcase the functionality of this package. For more detailed information, see the slide show in thedocs/folder of thereluMIPGit repository.InstallationThis package is part of PyPI. It can be installed throughpip:pipinstallreluMIPAfter installing, you can use the examples provided in theexamples/folder to become familiar with the package.Alternatively, you can clone the github repository:gitclonehttps://github.com/ChemEngAI/ReLU_ANN_MILP.gitYou can install all requirements from the project root folder by calling:pipinstall-rrequirements.txtYou can add the root folder of the repository to yourPYTHON_PATH, so that the package can be accessed from anywhere.Note that in order to use the package, a compatible solver has to be installed. This can beGurobi(with a valid license) or any MIP solver compatible withPyomo(we recommendglpk). In our experience, the best performance is obtained when using theGurobiinterface.Example usagesTwojupyternotebooks describing the use of the package are supplied in theexamples/folder of theGit repository. There, an MIP formulation of a ReLU ANN - trained on a nonliner, nonconvex function - is used to find the global minimum of the network response surface. If you installed the package throughpip, you can simply download the example files that you are interested in.Related work on NLP formulations of ANNsIn this tool, ReLU ANNs are formulated as MILPs. Notably, ANNs can also be formulated as nonlinear problems (NLPs) and solved through deterministic gloabl optimization (Schweidtmann and Mitsos (2019)). Please visit theMeLOn toolboxfor more information.How to cite this workPlease citeour Zenodo DOIif you use this code:@software{reluMIP.2021,
  title={reluMIP: Open Source Tool for MILP Optimization of ReLU Neural Networks},
  author={Lueg, Laurens and Grimstad, Bjarne and Mitsos, Alexander and Schweidtmann, Artur M.},
  year={2021},
  doi={https://doi.org/10.5281/zenodo.5601907},
  url = {https://github.com/ChemEngAI/ReLU_ANN_MILP},
  version = {1.0.0}
}ReferencesGrimstad, B., Andersson, H. (2019).ReLU networks as surrogate models in mixed-integer linear programs.Computers & Chemical Engineering(Volume 131, 106580).Schweidtmann, A. M., & Mitsos, A. (2019).Deterministic global optimization with artificial neural networks embedded.Journal of Optimization Theory and Applications(Volume 180(3), 925-948).