Exercise, Insulin and Automation. The challenges.

There are regularly calls in the #WeAreNotWaiting world to incorporate exercise detection into the algorithms that we use, so that end users can minimise hypo risk and not have to worry about unplanned, mild, exercise. This might cover a half hour walk with the dog, a shopping trip or a similar event.

The cry is typically “we have a load of sensors in watches and on phones, let’s use them”.

And while this is an admirable desire, it typically runs into the one factor that everyone forgets. Sensors don’t make up for the lack of a functioning bodily glucose management system.

But why?

I’ve spoken about this a little before, but let’s split this into three areas.

  • Detection – what we can detect and when;
  • Response – what can we do?
  • Insulin – the key driver of hypoglycaemia.

Detection

Modern smart watches contain multiple sensors. The screenshot below shows you what an Apple Watch Ultra can detect:

Apple watch Ultra healthcare sensors

Key in that list are the heart sensors, plus accelerometer and gyroscope, and of course GPS, which isn’t listed.

Like many other watches, this means that we can detect elevated heart rate, pace and change of pace and location. The software tools of most smart watches can auto detect walking, running and in some cases, swimming.

They’re less effective at detecting “gym” type activities such as weight training, which have similar characteristics in terms of heart rate to both stress and other forms of exercise.

Phones themselves can also detect steps and location.

All of these things are helpful in establishing that forms of exercise are taking place, indeed, with my Garmin, it is rarely incorrect with auto detection of walking and running, so these triggers could be considered to be reliable.

So if we assume that we have effective triggers for exercise, what happens next?

Response

Let’s assume that, as above, we are able to accurately detect walking or running, and that, by looking at rate of steps, speed, rate of change of speed, heart rate and location, we can determine some of the types of aerobic or anaerobic exercise we’re doing, what is our response?

Firstly, using an AID system, we’re likely to set some form of exercise “profile”.

What might this look like?

For me in AAPS, that’s a percentage change that reduces my profile basal rate to 80% of standard and sets a temp target at 8mmol/l, the latter of which I’ve done for exercise since OpenAPS days.

Post exercise, I may then leave the settings in place as I’m likely to be more insulin sensitive post.

So we’ve automatically increased the correction target and decreased our insulin delivery settings, but still, half an hour into the shopping trip, we’ve received an alert that we’re going low. What’s happened? We’ve done all the right things, or rather our algorithm has, and still we’re going low?

Insulin

Most Automated Insulin Delivery (AID) systems work on the “now”. You could say that they live for the moment.  They view the current situation and react to it. In most cases now that ameliorated with an additional layer that understands time based factors and adjusts the parameters that they use to react at this point in time.

However, now comes with a confounding point that interferes with both detection and response.

Insulin. Or more specifically, Insulin On Board (IOB).

Most strategies relating to planned exercise involve reducing IOB ahead of exercise, and keeping it reduced during exercise, which is exactly what I described in the response section.

As humans, we do this by reducing boluses and setting lower temporary basal rates, when we know we’re going to exercise.

When it’s unplanned, we have to deal with IOB.

David Burren’s IOB graph from BionicWookiee.com

As the above graph from the David Burren’s experiments shows, for a long time after dosing insulin it hangs around in the body.

The major difference here from those without diabetes is dose sizes and lifetime of insulin. Within the body of a non-T1, insulin amounts are much smaller, act much faster and handle around for a much shorter period. This means that counter measures are much more easily managed. Amazing how great true homeostatic systems are…

Perhaps more importantly, two to three hours after dosing, between 10 % and 50% of insulin taken my still be on board, and therefore, active.

This matters in our automation. If we’ve bolused 10u for lunch and exercise three hours later, put simply, there could be as much as 3u of insulin active.

If our normal, planned, exercise targets normally result in there only being 1u active, it becomes pretty obvious why we go hypo with that unplanned exercise. And no higher temp target or reduced basal profile will help with that after the exercise has started.

Realistically, counter measures are required, whether that’s carbs or glucagon, we need to stop the drop.

As I hope is fairly obvious from this, acting after exercise starts has limited efficacy. It’s generally better to start well before exercise.

Automation solutions

As we’ve discussed above, while there are strategies for dealing with exercise before, during and afterwards, starting any of them during unplanned exercise, especially aerobic exercise, can make it challenging to get acceptable outcomes.

As a result, simple automation to detect exercise usually doesn’t help with the in-exercise state. This data can definitely be used to adjust post exercise set-up, and reduce basal or increase targets for a period to reduce hypo risk while more insulin sensitive though.

So what’s required from automation for exercise?

Prescience

Or in the absence of that, prediction.

This is where we talk about machine learning models and the internet of things.

At the most basic level, learning that you generally go shopping every Saturday morning based on location history and walking history, a time based model could use these factors to reduce basal ahead of time and modify IC ratio for breakfast bolus on a Saturday. If it’s wrong, then you may end up slightly higher than you’d like, but if it’s generally correct, you’d find that you didn’t go low when you did that shopping trip.

This kind of learning could be applied to any kind of exercise that was done on a fairly routine basis.

But what of other sensors? Could there be cues in your behaviour when you go shopping and when you don’t? How about when you take the dog out?

Could your in house location or the conversations that you are having with individuals be used to trigger, or un-trigger, routine changes that a model has learned?

One of the key aspects of open source algorithms is the high use of “if this then that” approach to create heuristic models. Something like this can be used alongside machine learning to stop a behaviour, and then incorporated into the learning.

As users of existing machine learning based systems will attest, though, getting this right isn’t always easy.

The question for users becomes “How much tolerance do you have for variation in your average glucose level?”. That will help to guide what approach works for you.

And if we can’t effectively do prescience…

Counteraction

Instead of trying to predict exercise, the alternative is to counteract the effects of IOB.

Here you are moving directly into the realms of dual hormone devices, attempting to increase glucose levels or stabilise them when activity is detected.

The mechanisms for automation in this realm are all focused on glucagon delivery and microbolusing, which, while effective, have the effect of depleting muscle and liver glycogen stores, which is likely to result in even greater sensitivity after exercise. But as an automated system, awareness of this is down to the sensors, and can be ameliorated.

This is an area that’s had plenty of research, but little fruition so far. The reasons for that are probably multiple, but Inreda in the Netherlands have been producing an effective dual hormone solution for a while.

Inreda Dual Hormone system

This suggests that it isn’t impossible, just challenging.

What are our takeaways?

Automation of unannounced exercise is much more difficult than it seems. The culprit for this is the thing that keeps those with T1D alive. Insulin.

Whilst solutions right now aren’t widely available, we will get there, probably through a combination of machine learning and multi-hormones, but it will require some work.

In the meantime, while we can limit post exercise susceptibility to hypos by identifying when exercise takes place, reducing in-exercise drops is much harder if we don’t know it’s about to happen.

Overall then, if it’s a quick trip to the shops or an unexpected dog walk, it may be a good time for a carb top up.

Until your AID can help you out.

5 Comments

  1. I’ve found a large variance between what happens with anerobic and aerobic exercise. With a 5K anaerobic run, I go high pretty quickly. If I let my AID microbolus, I end up low within 40-60 mins of stopping. If my run is longer say 10K, I tend to have the hypo later on in the run (about 8K) and don’t have the anaerobic high. If I try to reduce insulin to much prior to a 10K, I feel really grotty from the lack of insulin which effects my run times and enjoyment. It’s taking a lot of effort to get this right, which has caused aggro with some of my fellow runners. Sometimes I feel like I’m battling with my AID here. Is OpenAPS any better at this than the Loop algorithm?

    • Thanks for the feedback. I’d agree that aerobic and anaerobic are quite different. I can’t speak about it from a running perspective though, as most of my anaerobic work has been done either on a bike or with weights.

      I found that oref1 does handle this stuff quite well, but I’ve not used loop to compare.

  2. Prof Fournier in WA suggested quick 2 minutes of intense in the spot running will cause liver to do its thing – When going low. I used to do this at the end of spin class if I thought I needed some rise to drive home safely. My spin participation was definitely aerobic.

  3. This assumes all exercise is equal when it is not. I can illustrate this with my experience of cycling
    – a pootle along a flat tow path whilst chatting to my mates, would have little impact to my BG.
    – a fast ride through country roads (or a Spin class), would cause my BG to plummet.
    – a slog up a steep hill against the wind on a wet and rainy day, would cause my BG to rocket.

    I am sure GPS and heart rate gains could probably detect no need for basal change with the first scenario. But the latter two may be harder to distinguish unless the GPS was tracking height gain and weather.

    • Thanks Helen. This doesn’t assume all exercise is equal. We were discussing unplanned, spontaneous “mild exercise”, such as a shopping trip or dog walk, which neither a spin class nor a climb up a steep hill is likely to be.

      For many people, that causes lows, and the point here was that sensors alone can’t drive action that has much impact on those.

      There is far more to full exercise detection and that involves many more hormones, plus sensors that don’t yet exist.

Leave a Reply

Your email address will not be published.


*