Inference System

Predictive model

The approach we choosed for the predictive model is fuzzy logic. There are mainly two reasons for that:

If the diabetic wrote down an history of glycaemia tests, insulin injections and circumstances, a supervised learning permits to initialize the fuzzy rules. If not, generic rules based on physicians experience are established.

Fuzzy inference systems (FIS)

The predictive system is divided into two Takagy-Sugeno FIS: before meal and after meal. Indeed, the "nature of the meal" and "physical exercise" inputs are not significant simultaneously. Reducing the number of inputs in the premises generates less rules and so facilitates the interpretability.

FIS before meal FIS after meal
FIS used in the predictions

Glycaemia measurement

Among all entries, the value of the current glycaemia is the more accurate entry. A device takes a drop of blood in order to test it. Should the device be a sensor or a lancet, it is designed to have a small error rate.

Predictions about the nature of the meal and the exercise

Both inputs are the ones that can be the less accurate beacause they are based on the user's a prori estimations. The latter may misjudge. Indeed, valuate precisely the glucid strenght of a meal requires dietetics skills and all diabetics do not. This requires not only the knowledge of the glucid value of each distinct food, but also the ability to appreciate the consequences of foodstuffs associations. For example, glucids contained in a potato won't be assimilated in the same way whether it is eaten with bred or not.
On the other hand, even if the user is experienced, some unexpecteds may happen and thwart one's plans. For example, we can imagine somebody's intents to practise an outdoor sport discouraged by a sudden rainfall.

Action of the insulin injections

The graphs shown in the "insulin treatment" section have a pretty rough internal approximation. Indeed, a more subtle modelisation would be unprofitable, having regard to dubiousness due to uncertain other inputs (nature of the meal and intended exercise). Moreover, the effects of the insulin injections vary depending on organisms.
Individually, the curve of the hypoglycemic power of a type of insulin is approximated by an affine function described like this:

Modélisation d'un injection

The parameters involved in the modelisation of this graph initially have default values but are adjustable as described in the user manual (french only).

We just saw the way an individual insulin injection is modelised. But the hypoglycemic power of the active insulin in the organism at a given moment is the result of several insulin injections, maybe of different types. Indeed, as we have seen in the insulin treatment section, both regular and lente insulin are used together. To express the resultant hypoglicemic power at a given moment, the additive character of the hypoglycemic power of regular and lente insulin. Moreover, the effects of an injection of insulin may last after the next injection of the same type of insulin. The figure below represents the overlap of insulin actions during a day when a diabetic would make an injection of lente insulin in the morning and in the evenning and an injection of regular insulin before each meal as well.

Cumul des injections d'insuline
Additive character of the hypoglycemic power of several insulin injections

Fuzzy partitions of the input and conclusion variables

The fuzzy subsets that constitute the partitions of inputs and conclusion are shown below.
The measurement of the current glycaemia is, as we said, an accurate input, we divided this entry into four fuzzy subsets. A normal fasten glycaemia is about 1g/l, and a little bit more after the meal.

Glycémie
Fuzzy partition of the "Glycaemia" variable

The "nature of the meal" and "exercise" are inaccurate, they are divided into two fuzzy subsets.
There is no unit for these inputs so the user indicates his estimation thanks to a graphic bar. Their internal values range from 0 up to 1. 0 represents a minimal suggar value or an absence of exercise and 1 a maximum value.

Nature of the meal Physical exercise
Fuzzy partition of the "Nature of the meal" variable Fuzzy partition of the "Physical exercise" variable

We reprensent the resultant hypoglycemic power of the different active injections of insulin by a variable which name is insulin power. It is divided into two fuzzy subsets. See the calculation details for a given injection.

Insulin power
Fuzzy partition of the "Insulin power" variable

At last, the "glycaemia varaition" has been divided into nine subsets. It will enable a fine choice when setting a qualitative conclusion for each rule.

Glycaemia variations
Fuzzy partition of the conclusion "Glycaemia variations"

Fuzzy rules