Proceedings

eNNcode: Optimization-Based Analysis of Neural Networks

Download BibTeX Cite

Proceedings of the Thirty-Fifth International Joint Conference on Artificial Intelligence. Demo Track. Pages 8358-8362.

https://doi.org/10.24963/ijcai.2026/956

Abstract

The increasing use of neural networks (NNs) in high-stakes decision-making requires rigorous analysis to ensure safety, fairness, and explainability.

Formal verification tools for neural networks typically focus on determining the satisfiability of properties such as safety or fairness.

However, many fairness and explainability tasks go beyond satisfiability and instead rely on arbitrary optimization objectives.

To address such problems, neural networks are often encoded as mixed-integer linear optimization (MILO) problems with linear objectives.

In practice, these encodings are usually implemented in an ad-hoc manner, limiting comparability across works, reducing transparency, and increasing implementation effort.

We address this gap by introducing eNNcode, a user-friendly PyPI library that converts any piecewise-linear neural network in Open Neural Network Exchange (ONNX) format into a MILO instance.

The library supports arbitrary constraints on input and output nodes, as well as user-defined optimization objectives.

Our experiments show that eNNcode achieves performance comparable to existing libraries, despite its simplicity and ease of use.

Overall, eNNcode facilitates reproducible and standardized optimization-based analysis of neural networks.

  1. [Benussi et al., 2022] Elias Benussi, Andrea Patanè, Matthew Wicker, Luca Laurenti, and Marta Kwiatkowska. Individual fairness guarantees for neural networks. In Luc De Raedt, editor, Proceedings of the Thirty-First International Joint Conference on Artificial Intelligence, IJCAI 2022, Vienna, Austria, 23-29 July 2022, pages 651-658. IJCAI
  2. [Bynum et al., 2021] Michael L. Bynum, Gabriel A. Hacke- beil, William E. Hart, Carl D. Laird, Bethany L. Nichol- son, John D. Siirola, Jean-Paul Watson, and David L. Woodruff. Pyomo-optimization modeling in python, vol- ume 67, chapter 1, 6 & 9. Springer Science & Business Media, third edition, 2021.
  3. [Ceccon et al., 2022] Francesco Ceccon, Jordan Jalving, Joshua Haddad, Alexander Thebelt, Calvin Tsay, Carl D. Laird, and Ruth Misener. OMLT: optimization & machine learning toolkit. J. Mach. Learn. Res., 23:349:1-349:8, 2022.
  4. [Cecrle et al., 2024] Jordan Cecrle, Jordan Jalving, Radwa Haddad, Alexander Thebelt, Calvin Tsay, Carl D. Laird, and Ruth Misener. OMLT documentation: Exam- ples and notebooks. https://omlt.readthedocs.io/en/latest/ notebooks.html, 2024. Accessed: 2026-04-02. Link
  5. [Cortez et al., 2009] Paulo Cortez, António Cerdeira, Fer- nando Almeida, Telmo Matos, and José Reis. Wine Qual- ity Dataset. UCI Machine Learning Repository, 2009. https://archive.ics.uci.edu/dataset/186/wine+quality. Link
  6. [de Moura and Bjørner, 2008] Leonardo Mendonc ¸a de Moura and Nikolaj S. Bjørner. Z3: an efficient SMT solver. In C. R. Ramakrishnan and Jakob Rehof, editors, Tools and Algorithms for the Construction and Analysis of Systems, 14th International Conference, TACAS 2008, Held as Part of the Joint European Confer- ences on Theory and Practice of Software, ETAPS 2008, Budapest, Hungary, March 29-April 6, 2008. Proceedings, volume 4963 of Lecture Notes in Computer Science, pages 337-340. Springer, 2008.
  7. [Demarchi et al., 2023] Stefano Demarchi, Dario Guidotti, Luca Pulina, and Armando Tacchella. Supporting stan- dardization of neural networks verification with VNNLIB and coconet. In Nina Narodytska, Guy Amir, Guy Katz, and Omri Isac, editors, Proceedings of the 6th Workshop on Formal Methods for ML-Enabled Autonomous Systems, FoMLAS@CAV 2023, Paris, France, July 17-18, 2023, Kalpa Publications in Computing, pages 47-58.
  8. [Deng, 2012] Li Deng. The MNIST Database of Handwrit- ten Digit Images for Machine Learning Research [Best of the Web]. IEEE Signal Processing Magazine, 29(6):141- 142, 2012.
  9. [Dong et al., 2025] Zihang Dong, Cheng Hu, Zeyuan Xu, Goran Strbac, and Dawei Qiu. Machine learning-based economic model predictive control for energy hubs with variable energy efficiencies. Energy, 334:137574, 2025.
  10. [ElAraby et al., 2023] Mostafa ElAraby, Guy Wolf, and Margarida Carvalho. OAMIP: Optimizing ANN Architec- tures Using Mixed-Integer Programming, page 219-237. Springer Nature Switzerland, 2023.
  11. [Girard-Satabin et al., 2022] Julien Girard-Satabin, Michele Alberti, Franc ¸ois Bobot, Zakaria Chihani, and Augustin Lemesle. CAISAR: A platform for Characterizing Ar- tificial Intelligence Safety and Robustness. In AISafety, CEUR-Workshop Proceedings, Vienne, Austria, July 2022.
  12. [Grimstad and Andersson, 2019] Bjarne Grimstad and Hen- rik Andersson. ReLU networks as surrogate models in mixed-integer linear programs. Computers & Chemical Engineering, 131:106580, December 2019.
  13. [Gurobi Optimization, LLC, 2024a] Gurobi Optimization, LLC. Gurobi machine learning documentation: Supported regression models. https://gurobi-machinelearning. readthedocs.io/en/stable/user/supported.html, 2024. Accessed: 2026-02-03. Link
  14. [Gurobi Optimization, LLC, 2024b] Gurobi Optimiza- tion, LLC. Gurobi Machine Learning: Mathemat- ical Optimization with Machine Learning Models. https://github.com/Gurobi/gurobi-machinelearning, 2024. Python package version 1.4.1. Link
  15. [Jiang et al., 2023a] Junqi Jiang, Jianglin Lan, Francesco Le- ofante, Antonio Rago, and Francesca Toni. Provably Ro- bust and Plausible Counterfactual Explanations for Neural Networks via Robust Optimisation. In Berrin Yanikoglu and Wray L. Buntine, editors, Asian Conference on Ma- chine Learning, ACML 2023, 11-14 November 2023, Is- tanbul, Turkey, Proceedings of Machine Learning Re- search, pages 582-597. PMLR, 2023.
  16. [Jiang et al., 2023b] Junqi Jiang, Francesco Leofante, Anto- nio Rago, and Francesca Toni. Formalising the robust- ness of counterfactual explanations for neural networks. In Thirty-Seventh AAAI Conference on Artificial Intelligence, AAAI 2023, pages 14901-14909. AAAI Press, 2023.
  17. [Jiang et al., 2024] Junqi Jiang, Francesco Leofante, Anto- nio Rago, and Francesca Toni. Interval abstractions for robust counterfactual explanations. Artif. Intell., 336:104218, 2024.
  18. [Krizhevsky et al., 2012] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton. ImageNet Classification with Deep Convolutional Neural Networks. In Peter L. Bartlett, Fernando C. N. Pereira, Christopher J. C. Burges, Léon Bottou, and Kilian Q. Weinberger, editors, Advances in Neural Information Processing Systems 25: 26th Annual Conference on Neural Information Processing Systems 2012. Proceedings of a meeting held December 3-6, 2012, Lake Tahoe, Nevada, United States, pages 1106-1114, 2012.
  19. [Lorenz et al., 2025] Tobias Lorenz, Marta Kwiatkowska, and Mario Fritz. MIBP-Cert: Certified Training against Data Perturbations with Mixed-Integer Bilinear Programs.
  20. In D. Belgrave, C. Zhang, H. Lin, R. Pascanu, P. Ko- niusz, M. Ghassemi, and N. Chen, editors, Advances in Neural Information Processing Systems, volume 38, pages 98193-98216.
  21. Curran Associates, Inc., 2025.
  22. [Lueg et al., 2021] Laurens Lueg, Bjarne Grimstad, Alexan- der Mitsos, and Artur M. Schweidtmann. reluMIP: Open Source Tool for MILP Optimization of ReLU Neural Net- works, 2021. Version 1.0.0.
  23. [Marzari et al., 2024] Luca Marzari, Francesco Leofante, Ferdinando Cicalese, and Alessandro Farinelli. Rigorous Probabilistic Guarantees for Robust Counterfactual Expla- nations. In ECAI 2024 -27th European Conference on Ar- tificial Intelligence, 19-24 October 2024, volume 392 of Frontiers in Artificial Intelligence and Applications, pages 1059-1066. IOS Press, 2024.
  24. [McGregor, 2021] Sean McGregor. Preventing repeated real world AI failures by cataloging incidents: The AI incident database. In Thirty-Fifth AAAI Conference on Artificial Intelligence, AAAI 2021, Thirty-Third Conference on In- novative Applications of Artificial Intelligence, IAAI 2021, The Eleventh Symposium on Educational Advances in Ar- tificial Intelligence, EAAI 2021, Virtual Event, February 2-9, 2021, pages 15458-15463. AAAI Press, 2021.
  25. [Microsoft and ONNX Runtime Contributors, 2024] Microsoft and ONNX Runtime Contributors. Onnx runtime documentation. https://onnxruntime.ai/docs/, 2024. Accessed: 2026-01-05. Link
  26. [Ovalle et al., 2025] Daniel Ovalle, Lorenz Biegler, Ignacio Grossmann, Carl Laird, and Mateo Dulce Rubio. Con- formal Mixed-Integer Constraint Learning with Feasibility Guarantees. In D. Belgrave, C. Zhang, H. Lin, R. Pascanu, P. Koniusz, M. Ghassemi, and N. Chen, editors, Advances in Neural Information Processing Systems, volume 38, pages 80387-80423.
  27. Curran Associates, Inc., 2025.
  28. [Papalexopoulos et al., 2022] Theodore P. Papalexopoulos, Christian Tjandraatmadja, Ross Anderson, Juan Pablo Vielma, and David Belanger. Constrained Discrete Black- Box Optimization using Mixed-Integer Programming. In
  29. Kamalika Chaudhuri, Stefanie Jegelka, Le Song, Csaba Szepesvári, Gang Niu, and Sivan Sabato, editors, Interna- tional Conference on Machine Learning, ICML 2022, 17- 23 July 2022, Baltimore, Maryland, USA, Proceedings of Machine Learning Research, pages 17295-17322. PMLR, 2022.
  30. [Redmon et al., 2016] Joseph Redmon, Santosh Kumar Div- vala, Ross B. Girshick, and Ali Farhadi. You Only Look Once: Unified, Real-Time Object Detection. In 2016 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2016, Las Vegas, NV, USA, June 27-30, 2016, pages 779-788. IEEE Computer Society, 2016.
  31. [Shriver et al., 2021] David Shriver, Sebastian G. Elbaum, and Matthew B. Dwyer. DNNV: A framework for deep neural network verification. In Alexandra Silva and K. Rustan M. Leino, editors, Computer Aided Verification -33rd International Conference, CAV 2021, Virtual Event, July 20-23, 2021, Proceedings, Part I, Lecture Notes in Computer Science, pages 137-150. Springer, 2021.
  32. [Simonyan and Zisserman, 2015] Karen Simonyan and An- drew Zisserman. Very deep convolutional networks for large-scale image recognition. In Yoshua Bengio and Yann LeCun, editors, 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015.
  33. [Stinchfield et al., 2025] Georgia Stinchfield, Natali Khalife, Bashar L. Ammari, Joshua C. Morgan, Miguel Zamarripa, and Carl D. Laird. Mixed-Integer Linear Programming Formulation with Embedded Machine Learning Surro- gates for the Design of Chemical Process Families. Indus- trial & Engineering Chemistry Research, 64(16):8299- 8311, 2025.
  34. [Szegedy et al., 2014] Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian J. Goodfellow, and Rob Fergus. Intriguing properties of neural networks. In Yoshua Bengio and Yann LeCun, editors, 2nd International Conference on Learning Repre- sentations, ICLR 2014, Banff, AB, Canada, April 14-16, 2014, Conference Track Proceedings, 2014.
  35. [The ONNX Community, 2026] The ONNX Community. Open neural network exchange (onnx) operators, 2026. Accessed: 2026-02-10.
  36. [Tjeng et al., 2019] Vincent Tjeng, Kai Yuanqing Xiao, and Russ Tedrake. Evaluating Robustness of Neural Net- works with Mixed Integer Programming. In 7th Inter- national Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenRe- view.net, 2019.
  37. [Wachter et al., 2017] Sandra Wachter, Brent D. Mittelstadt, and Chris Russell. Counterfactual explanations with- out opening the black box: Automated decisions and the GDPR. Harvard Journal of Law & Technology, 31(2):841-887, 2017.
  38. [Wu et al., 2020] Ga Wu, Buser Say, and Scott Sanner. Scal- able Planning with Deep Neural Network Learned Transi- tion Models. J. Artif. Intell. Res., 68:571-606, 2020.
  39. [Wu et al., 2024] Haoze Wu, Omri Isac, Aleksandar Zeljic, Teruhiro Tagomori, Matthew L. Daggitt, Wen Kokke, Idan Refaeli, Guy Amir, Kyle Julian, Shahaf Bassan, Pei Huang, Ori Lahav, Min Wu, Min Zhang, Ekate- rina Komendantskaya, Guy Katz, and Clark W. Barrett. Marabou 2.0: A versatile formal analyzer of neural net- works. In Arie Gurfinkel and Vijay Ganesh, editors, Com- puter Aided Verification -36th International Conference, CAV 2024, Montreal, QC, Canada, July 24-27, 2024, Pro- ceedings, Part II, Lecture Notes in Computer Science, pages 249-264. Springer, 2024.
  40. [Yeh, 1998] I-Cheng Yeh. Concrete Compressive Strength Dataset. UCI Machine Learning Repository, 1998. https://archive.ics.uci.edu/dataset/165/concrete+ compressive+strength. Link

References were extracted automatically from the PDF and may contain errors.

Welcome Future Conferences AI Journal Division IJCAI Proceedings About IJCAI IJCAI Awards