AIAPS Model of Adaptive Carbohydrate Uptake in Artificial Pancreas

Friends, the AIAPS project team is developing an artificial pancreas system, or IPV.



An artificial pancreas is a system for the automated delivery of insulin to a person with insulin-dependent diabetes, including glucose monitoring, an insulin pump, and a decision center (such as the AIAPS app).



AIAPS is an application - the control center of the IPG, the purpose of which is: to regulate blood glucose and keep it in the target range. To achieve the goals, the system builds a blood glucose prediction using linear logic and neural networks.



When developing an application, the project team puts special emphasis on the safety of using the system.



The function of AIAPS, which this article is devoted to, is an adaptive (also called dynamic) model of carbohydrate absorption.



Starting point



Let's start with the fact that nine months ago a model of carbohydrate action was introduced into the AIAPS, depending on the decomposition time of different types of carbohydrates, namely:



Type 1 - carbohydrates with a duration of 60 minutes and a peak of 25 minutes

These include Coca-Cola, lollipops, sugar etc.

Type 2 - carbohydrates with a duration of 120 minutes and a peak of 40 minutes

For example, it can be candy or white bread.

Type 3 - carbohydrates with a duration of 180 minutes and a peak of 60 minutes

This is a complex food, for example, buckwheat with meat.

Type 4 - carbohydrates with a duration of 240 minutes and a peak of 70 minutes.

Fatty and protein foods in large quantities.



We tested this model for 6 months, constantly noting duration, but soon ran into the following challenges (besides the fact that introducing duration makes it harder to record carbohydrates).



Firstly, for example, my complex lunch with buckwheat and meat contains more than 100 carbohydrates (any large amount for you), we noticed that in this case it would be incorrect to indicate the duration of carbohydrates for 180 minutes. And after these 180 minutes, the increase in glucose will continue and obviously - carbohydrates are the trigger of this increase.



Secondly, after a meal, after a while, blood glucose begins to drop sharply (although according to the model there is still a sufficient amount of carbohydrates on board), which indicates that carbohydrates have already been absorbed by the body



We also noted that carbohydrate absorption begins at different intervals after a meal, which can lead to a longer period of carbohydrate absorption relative to the model.



Thirdly, we calculated that despite the complexity of carbohydrates, from the moment you start taking carbohydrates, their peak will be about 25-30 minutes. This point does not fit, the complexity is written at the top, and this is just our assumption.



In addition, we saw that some meals contain not one but several peaks, or may have wave decomposition instead of linear decomposition.



All this led to the idea of โ€‹โ€‹revising the previously laid down model, which nevertheless gave good results.



New solution



We decided to do some research and see a real model of carbohydrate degradation.

To do this, we have implemented an adaptive carbohydrate assimilation model or an adaptive carbohydrate model (MAU).



Below you can see an example of the first render of a reflection of an adaptive division.



image

Figure 1: Screenshot of a program showing carbohydrate breakdown



Notice the differences between the standard model (purple, read 1 time per minute) and digested carbs (green, read 1 time every 5 minutes). The model is different and it is a great example of how carbohydrates actually work.



We also concluded that carbohydrates last longer than we imagined.



This will help us to draw such a model of carbohydrates, which is actually available and correctly calculate the coefficients.



How the calculations are done



The first stage is to predict glucose based on the current ratios, insulin and carbohydrates on board, the

second stage is to obtain glucose values.



Next, we calculate the difference between the forecast and real values โ€‹โ€‹and get the UIA delta.



After receiving the UIA delta, we add it:



  1. To carbohydrates
  2. To their absence
  3. To activity.


After the values โ€‹โ€‹are received and the conclusion is made, you can start adjusting glucose according to the data obtained.



The adjustment according to the received data will be carried out in the following variants.



  1. The action of carbohydrates has begun, the supply of insulin assigned to the decomposition of carbohydrates is allowed.
  2. The effect of carbohydrates did not start on time, in which case their effect can be extended by 1.5 hours.
  3. The action started, but not in the expected volume, in which case the residual insulin will be supplied according to the sinking amount of carbohydrates in fact.


What development is aimed at



The adaptive carbohydrate model is an attempt to relieve the user of tedious tasks such as:



  1. accurate calculation of carbohydrates
  2. protein count
  3. counting snacks


And also a way to inject insulin more safely.



Technical details



Installation and use of the artificial pancreas AIAPS is now possible on devices with Android OS (version above 6.0) and will soon be possible on the IOS platform. The virtualization of carbohydrate decomposition is under testing and is installed as a separate program on Windows. The system has been tested by users on Samsung, Xiaomi devices, but we see no obstacles to work on other devices.



We will soon receive the first results from the adaptive carbohydrate assimilation model and add new features to the AIAPS.



Subscribe to our telegram chat and instagram and take part in the development of the application:



t.me/aiaps

instagram.com/diabet_type_1



All Articles