Skip to main content
QUICK REVIEW

[论文解读] PySCIPOpt-ML: Embedding Trained Machine Learning Models into Mixed-Integer Programs

Mark Turner, Antonia Chmiela|arXiv (Cornell University)|Dec 13, 2023
Formal Methods in Verification被引用 4
一句话总结

PySCIPOpt-ML 是一个开源的 Python 包,可自动将训练好的机器学习模型(如神经网络、树集成模型和线性模型)转化为混合整数规划(MIP)模型,以集成到优化工作流中。它通过 SCIP 实现了 ML 预测器与 MIP 的无缝嵌入,重点关注数值稳定性和对多种框架的支持,并引入了 SurrogateLIB,一个包含嵌入 ML 约束的半真实 MIP 实例库。

ABSTRACT

A standard tool for modelling real-world optimisation problems is mixed-integer programming (MIP). However, for many of these problems, information about the relationships between variables is either incomplete or highly complex, making it difficult or even impossible to model the problem directly. To overcome these hurdles, machine learning (ML) predictors are often used to represent these relationships and are then embedded in the MIP as surrogate models. Due to the large amount of available ML frameworks and the complexity of many ML predictors, formulating such predictors into MIPs is a highly non-trivial task. In this paper, we introduce PySCIPOpt-ML, an open-source tool for the automatic formulation and embedding of trained ML predictors into MIPs. By directly interfacing with a broad range of commonly used ML frameworks and an open-source MIP solver, PySCIPOpt-ML provides a way to easily integrate ML constraints into optimisation problems. Alongside PySCIPOpt-ML, we introduce, SurrogateLIB, a library of MIP instances with embedded ML constraints, and present computational results over SurrogateLIB, providing intuition on the scale of ML predictors that can be practically embedded. The project is available at https://github.com/Opt-Mucca/PySCIPOpt-ML.

研究动机与目标

  • 解决在现实世界优化问题中,由于变量依赖关系不完整或非线性,传统 MIP 建模方法不可行的问题,尤其是在存在复杂或未知关系的情况下。
  • 提供一个统一的、自动化的工具,将来自主流框架的训练好的 ML 模型转换为等价的 MIP 约束,同时保持数值稳定性和解的鲁棒性。
  • 支持广泛的 ML 模型(包括神经网络、梯度提升树和线性模型)通过与 SCIP 求解器直接集成,用于 MIP 模型中。
  • 创建一个可复现、可扩展的 MIP 实例库,其中嵌入了 ML 约束,以支持机器学习增强优化领域的基准测试与研究。

提出的方法

  • 该包直接与 Scikit-Learn、XGBoost、LightGBM 和 PyTorch 接口,提取训练好的模型,并使用分段线性逼近和大 M 约束,自动生成等价的 MIP 建模形式。
  • 对于神经网络,采用基于 ReLU 激活函数的混合整数规划建模方法,利用析取约束来建模非线性,同时确保数值稳定性。
  • 对于树形模型(如随机森林和梯度提升树),采用类似分支定界法的建模方式,将每条决策路径表示为一组二值变量和逻辑约束。
  • 该建模方法支持回归和分类任务,通过紧密且对求解器友好的约束,将输出变量与 MIP 决策变量关联。
  • 它与开源的 SCIP MIP 求解器集成,可高效求解包含 ML 代理约束的 MIP 问题。
  • SurrogateLIB 库通过使用真实世界数据对基础优化问题(如汽车设计)进行参数化生成,从而创建出同质但多样、复杂度各异的实例。
Figure 1: How trained ML predictors can be automatically formulated as MIPs and embedded in an optimisation problem using our Python package PySCIPOpt-ML.
Figure 1: How trained ML predictors can be automatically formulated as MIPs and embedded in an optimisation problem using our Python package PySCIPOpt-ML.

实验结果

研究问题

  • RQ1如何自动且稳健地将来自多种框架的训练好的机器学习模型嵌入到混合整数规划中?
  • RQ2在将 ML 预测器集成到优化模型时,哪些 MIP 建模策略能确保数值稳定性和高效求解?
  • RQ3是否可以构建一个统一的软件工具,支持在单一 MIP 框架中集成广泛的 ML 模型(包括深度神经网络、树集成模型和线性模型)?
  • RQ4如何系统性地生成具有嵌入 ML 约束的、现实且半合成的 MIP 实例,以支持基准测试与研究?
  • RQ5在存在复杂或未知关系的真实应用场景中,ML 代理模型的集成在多大程度上提升了 MIP 的建模能力?

主要发现

  • PySCIPOpt-ML 可成功支持多种 ML 模型的自动 MIP 建模,包括使用 ReLU、Sigmoid 和 Tanh 激活函数的神经网络,以及来自 XGBoost、LightGBM 和 Scikit-Learn 的树形模型。
  • 该工具通过 SCIP 实现了 ML 预测器与 MIP 的端到端集成,其建模方式旨在提升数值稳定性,避免求解器收敛问题。
  • SurrogateLIB 库提供了 100 多个具有嵌入 ML 约束的半真实 MIP 实例,这些实例基于历史汽车销售数据,从一个真实世界的汽车设计问题中生成。
  • 基于 ReLU 的神经网络建模通过一种混合整数表示方法实现,利用析取约束来建模每个神经元的分段线性行为。
  • 该包支持回归和分类任务,通过紧密的基于约束的映射,将输出变量与 MIP 决策变量关联。
  • 该工具为开源,可在 https://github.com/Opt-Mucca/PySCIPOpt-ML 获取,SurrogateLIB 可通过 https://zenodo.org/records/10357875 访问。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。