Diabetes Artificial Pancreas looping with NN

Not sure this is the right place for this topic but anyway…

There is a large diabetes community that has been DIY-looping there insulin pumps and cgm’s (continuous glucose meters) for a couple of years now, starting with the OpenAPS (APS=artificial pancreas system), that has now developed to AndroidAPS and loop (ios-app).
Essentially the system works like this: every 5 minute it gets a BG (blood glucose) reading and calculates how much insulin the pump will give based on a calculated predicted BG value, aiming at a target 3h in the future. Sounds easy right?

The problem is that there are a number of parameters that the user has to supply for the loop algorithm to work with. The parameters that has the biggest effects are:

  • Basal: the basal rate of insulin needed to keep the BG steady if no carbs are eaten. Differs every hour of the day and is the most important parameter to get the loop to work!
  • ISF: Insulin sensitivity factor (how many mmol/L the BG will fall, when 1U of insulin is given).
  • IC: Insulin to carb ratio (how many grams of carbs does 1U of insulin take care of).

These parameters also changes over time, if you get sick, are affected by hormones (puberty, having your period), etc.

The APS-systems are usually setup to upload all the data to a database through a self-hosting API called Nightscout, which also serves a frontend for visualization. So every user owns there own data and has full access to the history.

Now to the question:

  • Would it be possible to use this data to create a NN-model that can see changes in the parameters listed above and suggest changes? In the future implement it in the app’s to do the decisions automatically… Even only the basal would be very beneficial!
    • Would the NN model have to be custom for every user, or could this be one single model, tought on lots of peoples data? (wouldn’t be that hard to get hold of since the community is very science/tech friendly) If it need a lot of peoples data, there is a site called Tidepool that is working on a FDA approved version on the openAPS which have collected this kind of data from lots and lots of people and I bet they’d love to get involved with an AI model if they could…
    • Would the model have to learn on the fly as new data comes in?

I am new to the AI-world, have gone through the fast.ai course once, but only played around with CNN’s. Tabular data seemed very promising for this kind of task in my eyes!?


Dear Karl
I am a physician working with ML. This seems doable. But a good part of this could be solved with regression or even heuristics for ranges. Which I am sure is how the current models work. If you’d like to collaborate, drop a line.



1 Like

I’m not sure how the current model is calculating the divergence in sensitivity, but it would be interesting to see if we could come up with something more precise - ML or not :grin: