Table of Contents
Fetching ...

Neural Networks for on-chip Model Predictive Control: a Method to Build Optimized Training Datasets and its application to Type-1 Diabetes

Alberto Castillo, Elliot Pryor, Anas El Fathi, Boris Kovatchev, Marc Breton

TL;DR

The paper tackles the challenge of deploying Model Predictive Control (MPC) on resource-constrained devices by training neural network surrogates. It introduces Optimally-Sampled Datasets (OSDs), a cost-driven, non-duplicative training data framework that adaptively densifies regions where MPC is sensitive, achieving high numerical resolution with scalable generation $O(\log(N_d))$. The approach is validated on the University of Virginia automated insulin delivery MPC, where NN surrogates trained on OSDs show substantially higher accuracy and two networks attain regulatory testing clearance. The work provides a practical, data-centric pathway to certify NN-based embedded controllers and suggests broad applicability to other domains requiring efficient, certified optimization on limited hardware.

Abstract

Training Neural Networks (NNs) to behave as Model Predictive Control (MPC) algorithms is an effective way to implement them in constrained embedded devices. By collecting large amounts of input-output data, where inputs represent system states and outputs are MPC-generated control actions, NNs can be trained to replicate MPC behavior at a fraction of the computational cost. However, although the composition of the training data critically influences the final NN accuracy, methods for systematically optimizing it remain underexplored. In this paper, we introduce the concept of Optimally-Sampled Datasets (OSDs) as ideal training sets and present an efficient algorithm for generating them. An OSD is a parametrized subset of all the available data that (i) preserves existing MPC information up to a certain numerical resolution, (ii) avoids duplicate or near-duplicate states, and (iii) becomes saturated or complete. We demonstrate the effectiveness of OSDs by training NNs to replicate the University of Virginia's MPC algorithm for automated insulin delivery in Type-1 Diabetes, achieving a four-fold improvement in final accuracy. Notably, two OSD-trained NNs received regulatory clearance for clinical testing as the first NN-based control algorithm for direct human insulin dosing. This methodology opens new pathways for implementing advanced optimizations on resource-constrained embedded platforms, potentially revolutionizing how complex algorithms are deployed.

Neural Networks for on-chip Model Predictive Control: a Method to Build Optimized Training Datasets and its application to Type-1 Diabetes

TL;DR

The paper tackles the challenge of deploying Model Predictive Control (MPC) on resource-constrained devices by training neural network surrogates. It introduces Optimally-Sampled Datasets (OSDs), a cost-driven, non-duplicative training data framework that adaptively densifies regions where MPC is sensitive, achieving high numerical resolution with scalable generation . The approach is validated on the University of Virginia automated insulin delivery MPC, where NN surrogates trained on OSDs show substantially higher accuracy and two networks attain regulatory testing clearance. The work provides a practical, data-centric pathway to certify NN-based embedded controllers and suggests broad applicability to other domains requiring efficient, certified optimization on limited hardware.

Abstract

Training Neural Networks (NNs) to behave as Model Predictive Control (MPC) algorithms is an effective way to implement them in constrained embedded devices. By collecting large amounts of input-output data, where inputs represent system states and outputs are MPC-generated control actions, NNs can be trained to replicate MPC behavior at a fraction of the computational cost. However, although the composition of the training data critically influences the final NN accuracy, methods for systematically optimizing it remain underexplored. In this paper, we introduce the concept of Optimally-Sampled Datasets (OSDs) as ideal training sets and present an efficient algorithm for generating them. An OSD is a parametrized subset of all the available data that (i) preserves existing MPC information up to a certain numerical resolution, (ii) avoids duplicate or near-duplicate states, and (iii) becomes saturated or complete. We demonstrate the effectiveness of OSDs by training NNs to replicate the University of Virginia's MPC algorithm for automated insulin delivery in Type-1 Diabetes, achieving a four-fold improvement in final accuracy. Notably, two OSD-trained NNs received regulatory clearance for clinical testing as the first NN-based control algorithm for direct human insulin dosing. This methodology opens new pathways for implementing advanced optimizations on resource-constrained embedded platforms, potentially revolutionizing how complex algorithms are deployed.

Paper Structure

This paper contains 32 sections, 11 equations, 8 figures, 1 table, 1 algorithm.

Figures (8)

  • Figure 1: Simplified block diagram of the University of Virginia Automated Insulin Delivery System garcia2021advanced.
  • Figure 2: Three main NN architectures that have been proposed for MPC learning. The individual operators are: Normalization$:=\frac{x_k-\mu}{\sqrt{\sigma}+\epsilon}$, ReLU layer$:=\max\{0,\,(A_{k}\cdot y_{k}+b_{k})\}$, Affine trans.$:=A_{k}\cdot y_{k}+b_{k}$, and Projection$:=\min_{u_k}||u_k-\tilde{u_k}||^2$, s.t. $C_uu_k\leq d_u$ and $C_cBu_k\leq d_c-C_cAx_k$; where $C_u$, $C_c$, $d_u$ and $d_c$ are defined in chen2018approximating and are designed to guarantee the MPC constraints.
  • Figure 3: Left --- Illustration of an Optimally Sampled Dataset (OSD). The MPC operating space, $\mathbb{M}$, is partitioned in a finite set of discrete volumes. The volumes automatically shrink thanks to the control action penalization term in order to augment sampling and resolution in regions where the MPC becomes more sensitive; i.e. higher $\partial(MPC(x))/\partial x$. The space inside each volume remains empty, while the final dataset $\mathcal{D}$ is conformed by the centroids. Right –-- Fast search algorithm for nearest neighbor retrieval malkov2018efficient. Every centroid is connected to its neighbors. The nearest neighbor search is initiated at a random entry-point, iteratively moving to the next neighbors that makes the cost smaller.
  • Figure 4: The MPC operational space (orange) vs. the one that is extracted in each randomized simulation (greens).
  • Figure 5: Illustration of one of the simulated days where four meal disturbances were given at different instants.
  • ...and 3 more figures