How AI could put diabetes on autopilot

Dr Chirath Hettiarachchi

Managing insulin levels is a 24/7 challenge. Dr Chirath Hettiarachchi from the Australian National University (ANU) School of Computing aims to solve this challenge with AI algorithms.

A bowl of cereal for breakfast, a skipped lunch, and a slice of cake to celebrate a co-worker’s birthday: Most of us choose our meals and snacks spontaneously and without giving it too much thought. For people living with type 1 diabetes, such choices could be life threatening. Although modern diabetes technology has come a long way, people with type 1 diabetes still have to calculate carb contents and administer insulin twenty minutes before every meal. Self-monitoring blood glucose, also known as blood sugar, and managing insulin levels is a 24/7 challenge. Dr Chirath Hettiarachchi from the Australian National University (ANU) School of Computing aims to solve this challenge with AI algorithms.

The difficulty in self-monitoring blood glucose and managing insulin in type 1 diabetes

In people with type 1 diabetes, the immune system launches an attack on the insulin-producing cells within the pancreas, resulting in the destruction of these vital cells. Consequently, people with type 1 diabetes are unable to make their own insulin - a hormone produced by the pancreas that helps blood glucose enter our cells so we can use it for energy. Without insulin, blood glucose cannot get into the cells and builds up in the bloodstream. Ketone bodies also rise in blood due to uncontrolled break down of body fat. This can lead to a life-threatening condition known as diabetic ketoacidosis.

“People with type 1 diabetes must administer the insulin from external sources, but knowing the right amount of insulin needed is complex,” explains Hettiarachchi.

“We eat different types of food that have varying effects on glucose. We sleep and exercise. We might experience a hot summer or have a particularly stressful day. All these activities of normal daily living affect the glucose regulation in our body in different ways.”

To maintain their glucose levels in a good range, people with type 1 diabetes have to self-monitor their blood glucose levels throughout the day and night, and deliver insulin by injections or a pump device. Increasingly, they do this by using something called ‘hybrid closed-loop systems’.

How does hybrid closed-loop technology automate insulin delivery in type 1 diabetes?

Hybrid closed-loop technology is an advanced system that supports people with type 1 diabetes in managing their blood glucose levels by automating insulin delivery. The term artificial pancreas system refers to automated insulin delivery technology.

“There's a sensor and a pump attached to the body. The sensor measures the glucose values typically every five minutes, and a piece of computer code, called a control algorithm, to calculate the insulin that we need to give to the body which is executed through the insulin pump,” Hettiarachchi says.

“This forms the ‘closed-loop’ component of the hybrid closed-loop technology, from sensing glucose and calculating insulin need to automatically delivering insulin and looping back to sensing glucose.”

Current automated insulin delivery systems cannot yet handle meals without a human in the loop. User interaction is needed at meal times — this non-automated human-in-the-loop component forms the ‘hybrid’ component of the technology. Approximately twenty minutes in advance, the person needs to predict what food they will eat, estimate the quantity of carbohydrates in it, and enter this estimated value and other information about the meal to the technology, usually by using an app on their phone. According to these manually administered instructions, the insulin pump then delivers an insulin bolus dose.

“Having to proactively think of what you're going to eat, calculate the carbs, and administer the bolus for every meal adds a huge cognitive burden,” Hettiarachchi stresses.

“It’s hard to know the amount of carbs in a bowl of pasta or in a snack, and even when people receive appropriate diabetes education, there is still room for human error, which leads to suboptimal glucose control. Sometimes, someone might also skip a meal or eat more than planned.”

“Human intervention is also required for handling exercise,” he adds.

Hettiarachchi, who recently obtained his PhD for his research project that was supervised by Professor Hanna Suominen, Dr Elena Daskalaki, Professor Christopher Nolan, and Dr Nicolo Malagutti, aims to reduce or, in the best case, eliminate this burden by fully automating this process. Once perfected, this artificial pancreas technology would allow people to enjoy their meal without having to announce it twenty minutes ahead of time. For the past four years at ANU, his studies have taken steps to remove the human component of hybrid closed-loop technology and develop a fully closed-loop automated insulin delivery system by a type of AI algorithm called ‘reinforcement learning.’

What is reinforcement learning?

Reinforcement learning is a type of machine learning algorithm used for decision-making tasks.

“Generally, machine learning algorithms are widely adopted in healthcare applications such as looking at retinal images and determining whether the image should be classified as ‘diabetic retinopathy’ or ‘healthy’,” Hettiarachchi explains.

However, when it comes to glucose regulation in type 1 diabetes, the classic regression and classification algorithms are not sufficient in dealing with the complexity of real-life circumstances. This is a complex 24/7 decision-making challenge that needs to be formulated and solved over-and -over again in order to keep the artificial pancreas system updated.

To administer insulin and regulate blood glucose levels properly, an algorithm must be able to make appropriate decisions and react to changing circumstances at least every five minutes. When the computer does something right, it receives a ‘reward’, and over time, it will figure out the best way to get rewards by making the right decisions in different situations. This is reinforcement learning.

 Dr Chirath Hettiarachchi from the Australian National University (ANU) School of Computing

“Having to proactively think of what you're going to eat, calculate the carbs, and administer the bolus for every meal adds a huge cognitive burden,” Dr Hettiarachchi explains.

For the past four years, Hettiarachchi has conducted reinforcement learning research in a virtual simulation environment that contains large amounts of data from a computer-created cohort of people with type 1 diabetes. Through simulation, he has developed a safe AI-based insulin delivery algorithm, surpassing key milestones like autonomous operation without meal announcements and achieving a fully closed-loop system.

Subsequently, the algorithm will undergo real-world assessment, starting with a clinical trial involving human participants while addressing ethical considerations and associated risks. Advanced stages of development will necessitate testing the algorithm on individuals with type 1 diabetes in meticulously managed clinical trials, addressing ethical issues and risks.

Bringing computer science and health experience together

Chirath Hettiarachchi is part of the Big Data Program of Our Health in Our Hands (OHIOH), a transdisciplinary research initiative of ANU.

“At OHIOH, I’m able to collaborate with clinicians and people with lived health experience who have expertise that needs to be considered when developing this type of technology,” he says.

 “With our glucose control scenario, for example, consulting clinicians and people with type 1 diabetes who understand real-world characteristics and constraints, eases the path for computer scientists to achieve the level of innovation necessary to substantially improve technologies.”

“This could be achieving 100% accurate blood glucose control with low cognitive burden on the person with type 1 diabetes.”

“I was able to talk with some of the top clinicians in Australia who are working in the field. In particular, my supervisors and I got to work very closely with Professor David O’Neal, Dr Barbora Paldus, and Dr Dale Morrison from the University of Melbourne.”

“Initially I thought they would only be focused on the management of diabetes, but they were really keen to understand why did the algorithm take a given decision and how can we improve it further to perform well in more and more complicated situations.”

“Getting their feedback was incredibly valuable and meant a huge advantage for me.”

“I also had the opportunity to talk directly to people with type 1 diabetes and learn more about the practical problems with managing diabetes. I found it motivating and encouraging to solve a challenge that these people are facing every day. As computer scientists, we don’t always get the chance to see how our work can improve the quality of people’s lives.”

Based on this experience, to bring computer scientists, clinicians, and people with lived experience together, Hettiarachchi has developed the online demonstration tool CAPSML, allowing visitors to learn about glucose regulation and try out the AI-based systems he has developed for glucose control.

About Our Health in Our Hands (OHIOH)

OHIOH involves clinicians and researchers from various fields, including chemistry, computing, engineering, medicine, physics, and psychology. Importantly, the team works with people with lived experience who inform research every step of the way, from choosing research topics to designing studies, and testing new devices and programs.

Do you or someone you know have lived experience with Parkinson’s disease, Multiple Sclerosis (MS), or type 1 diabetes? If you would like to get involved in the research, contact

If you liked this story please follow us on Google News or subscribe to our FacebookInstagram or Twitter accounts.

Related news

A mother breastfeeding her baby

22 Nov 2023

We won’t get real equality until we price breastmilk, and treat breastfeeding as work

Breastfeeding is not just a personal choice; it's unpaid work that contributes to the economy. To achieve true equality, we must recognise breastmilk as a valuable commodity, support breastfeeding at work, and integrate it into economic measures.

16 Nov 2023

Can you spot the AI impostors? We found AI faces can look more real than actual humans

Does ChatGPT ever give you the eerie sense you’re interacting with another human being? Artificial intelligence (AI) has reached an astounding level of realism, to the point that some tools can even fool people into thinking they are interacting with another human.