Abstract
Background:
Delivering insulin in type 1 diabetes is a challenging, and potentially risky, activity; hence the importance of including safety measures as part of any insulin dosing or recommender system. This work presents and clinically evaluates a modular safety system that is part of an intelligent insulin dose recommender platform developed within the EU-funded PEPPER project.
Methods:
The proposed safety system is composed of four modules which use a novel glucose forecasting algorithm. These modules are predictive glucose alerts and alarms; a predictive low-glucose basal insulin suspension module; an advanced rescue carbohydrate recommender for resolving hypoglycemia; and a personalized safety constraint applied to insulin recommendations. The technical feasibility of the proposed safety system was evaluated in a pilot study including eight adult subjects with type 1 diabetes on multiple daily injections over a duration of six weeks. Glycemic control and safety system functioning were compared between the two-weeks run-in period and the end point at eight weeks. A standard insulin bolus calculator was employed to recommend insulin doses.
Results:
Overall, glycemic control improved over the evaluated period. In particular, percentage time in the hypoglycemia range (<3.0 mmol/l) significantly decreased from 0.82% (0.05-4.79) at run-in to 0.33% (0.00-0.93) at endpoint (P = .02). This was associated with a significant increase in percentage time in target range (3.9-10.0 mmol/l) from 52.8% (38.3-61.5) to 61.3% (47.5-71.7) (P = .03). There was also a reduction in number of carbohydrate recommendations.
Conclusion:
A safety system for an insulin dose recommender has been proven to be a viable solution to reduce the number of adverse events associated to glucose control in type 1 diabetes.
Type 1 diabetes (T1D) is a long-term condition characterized by a loss of insulin secretion by the pancreatic β cells. 1 Currently, people with T1D measure capillary blood glucose several times daily and administer exogenous insulin via multiple daily injections (MDI) or continuous subcutaneous insulin infusion (CSII). Continuous glucose monitoring (CGM) technology 2 has opened the door to more advanced technologies to control glucose levels, such as sensor-augmented insulin pumps with low-glucose insulin suspend, 3 the artificial pancreas, 4 and decision support systems for insulin dosing. 5 However, although these advanced delivery systems have been associated with improvements in glycemic control, they are not able to wholly eliminate hypo- and hyperglycemia and introduce the additional risk of malfunctioning of one of their components.6,7 Therefore, there is a clear need to include a safety system to minimize such adverse events.
Current real-time CGM systems incorporate glucose alarms, and more recently predictive glucose alerts, that notify the user of hypo- and hyperglycemia events. 8 In addition, existing sensor-augmented pumps incorporate a predictive low-glucose insulin suspension system (Medtronic MiniMed 640G with SmartGuard (Northridge, CA, USA); Tandem t:slim X2 pump with Basal-IQ (San Diego, CA, USA)) to reduce nocturnal hypoglycemia. 3 Various automated strategies have been proposed to recommend carbohydrate doses to avoid or revert hypoglycemia.9,10 Finally, different methods have been proposed to minimize the risk of adverse events due to CGM and pump failures. 11
In this work, we present a modular safety system developed within the framework of the EU-funded PEPPER (Patient Empowerment through Predictive PERsonalised decision support) project. 12 PEPPER is a personalized decision support system for T1D self-management, which includes an insulin bolus recommender based on the artificial intelligence technique of case-based reasoning13,14 and a safety system.
PEPPER offers a dual architecture to cater for both MDI or CSII treatment, the latter via the Cellnovo patch-pump (Cellnovo Ltd, UK; Figure 1). In both cases, the user wears real-time CGM (Dexcom G5, San Diego, CA, USA) which communicates to the hand-held device via xDrip+. 15 An activity monitor (MiBand 1s, Xiaomi, China) is included to determine physical activity. Additional data such as food intake, alcohol consumption, stress, hormonal cycles are input through the user interface (Figure 2) of the hand-held unit (smartphone or Cellnovo handset). The hand-held unit remotely communicates to a secure web server where all collected data is uploaded and stored. Finally, a web-based user interface enables the clinical team to monitor the functioning of the system (PEPPER clinical platform). Although the presented safety system has been developed to integrate within the PEPPER platform, it can easily be adapted to other insulin dosing systems (eg, artificial pancreas).

Left) PEPPER system MDI and CSII architectures and Right) PEPPER system components.

PEPPER graphical user interface corresponding to the smartphone version. Blue square displays an estimate of the active insulin bolus; yellow circle shows an estimate of the remaining carbohydrates on-board; pink circle displays the blood glucose level coming from the CGM. The upper graph shows the CGM measurements in dotted (pink line) and the 30-minute forecasted glucose values (dotted green line); the remaining graphs display the injected insulin boluses, the ingested carbohydrates, and the step counts, respectively. The “Get bolus advice” button triggers an insulin dose recommendation that is displayed to the user.
Methods
The PEPPER safety system comprises of four modules: the first module consists of predictive glucose threshold crossing alerts and standard glucose threshold crossing alarms. The second module is designed for insulin pump users and automatically suspends basal insulin delivery when predicted glucose levels are low. A third module recommends an individualized carbohydrate to harmlessly return glucose to safe levels. Finally, the fourth module, referred to as Dynamic Bolus Insulin Constraint, restricts the amount of insulin that can be safely recommended to the user (Figure 3). Details of these four modules are given in the following sections.

Block diagram of the safety system with the four modules, and corresponding inputs and outputs.
Module 1: Glucose Alerts and Alarms Module
The glucose alerts and alarms module consists of two predictive alerts using a 30-minute glucose forecasting algorithm (Appendix A) to notify the user before reaching predefined high and low glucose thresholds. In addition, standard glucose alarms notify the user when thresholds measured by the CGM are exceeded. The user is able to choose the thresholds for when alerts are triggered, while the alarm thresholds are hard-coded and cannot be modified (3.9 mmol/l for hypoglycemia and 16.6 mmol/l for hyperglycemia).
To prevent alarm fatigue, once an alert, or alarm, has been snoozed by the user, another alert, or alarm, cannot be triggered until a predefined time interval of 30 minutes has elapsed. In addition, alerts can be muted, but alarms cannot for safety reasons. Finally, if the user does not address a hypoglycemia alarm before a predefined time interval of 30 minutes, an SMS message containing the type of alarm (ie, hypoglycemia or hyperglycemia) and the time it was triggered, is sent to a designated caregiver. The system keeps sending messages every 30 minutes until the alarm is snoozed on the handheld unit. Figure 4 shows a real example of functioning of the predictive glucose alerts and alarms module.

Clinical scenario showing the functioning of the PEPPER safety system. Dotted blue line corresponds to the CGM measurements and the dotted red line to the forecasted glucose values. Horizontal dashed lines are the glucose thresholds for the predictive alerts (4.4 mmol/l) and for the alarms (3.9 mmol/l). Dark blue bars and red bars are the meals and insulin boluses, respectively. Solid magenta line represents the percentage of basal delivery as a result of the low-glucose insulin suspend module. Cyan bars and black bar correspond to the alerts and alarms respectively. Green bars represent the carbohydrate recommendations.
Module 2: Predictive Low-Glucose Basal Insulin Suspend Module
The predictive low glucose basal insulin suspension (PLGBI) module aims at minimizing the incidence and severity of hypoglycemia by suspending, or partially suspending, basal insulin delivery when predicted glucose levels are low. Basal insulin delivery is reduced by 50% (partial suspension) if the 30-minute forecasted glucose value (Appendix A) falls below a predefined threshold (Threshold 1). Insulin delivery is fully suspended when glucose falls below a second predefined threshold (Threshold 2), which is lower than Threshold 1. Due to a technical limitation, full suspension of the pump is not possible and is set at a rate of 0.01 U/h, which is negligible for most people with T1D. This was done because it was the only way to make the pump resume without manual intervention. While suspended, insulin is resumed to 50% when forecasted glucose is above Threshold 2 and is fully resumed when forecasted above Threshold 1. A total suspension time limit of 90 minutes prevents excessive insulin deficiency and rebound hyperglycemia. After this time limit, insulin is resumed to 50% for up to 30 minutes. Basal insulin delivery can be resumed at any time by the user. For this clinical trial, Threshold 1 was set to 4.5 mmol/l and Threshold 2 to 3.9 mmol/l. Figure 4 shows the functioning of the PLGBI module over a real clinical scenario. Note that low-glucose suspend was not applied since the displayed data corresponds to an MDI participant.
Module 3: Adaptive Carbohydrate Recommender
If neither glucose alerts/alarms module nor the predictive PLGBI module are enough to prevent hypoglycemia, the adaptive carbohydrate recommender module recommends a rescue dose of oral carbohydrates with the aim of reverting hypoglycemia and minimizing rebound hyperglycemia. In particular, if the CGM glucose measurement falls below a predefined hypoglycemic threshold (2.8 mmol/l), the carbohydrate recommendation (
where
where
The CSF is initialized with the guidelines provided by Walsh et al 17 based on body weight. If such initialization is not accurate, CSF is updated using a run-to-run (R2R) control algorithm 18 that adapts such parameter to effectively minimize both hypoglycemia and rebound hyperglycemia. The R2R control law is defined as follows
where Thhypo and Thhyper are predefined hypoglycemia and hyperglycemia thresholds, Gmin and Gmax are the minimum and maximum glucose values within the time window that spams from 20 minutes to one hour after the rescue dose intake. Finally, K1 and K2 are tuning gains which are subject specific and correlated to CSF. In this work, Thhypo = 4.4 mmol/l, Thhyper = 8.3 mmol/l, K1 = 0.05 and K2 = 0.01 were employed. Figure 4 shows on a real scenario the recommendation of a carbohydrate dose.
Module 4: Dynamic Bolus Insulin Constraint
The Dynamic Bolus Insulin Constraint (DBIC) module aims to eliminate potentially dangerous insulin boluses being recommended to the user, which could induce severe hypo- or hyperglycemia. DBIC represents an additional safety layer to the ones already set in place by the CBR-based insulin recommender.13,14
DBIC is based on an insulin bolus calculator, 19 which is expressed by
where CHO (gram) is the amount of estimated carbohydrate, G (mmol/l) is the blood glucose measurement, GT (mmol/l) is the blood glucose target, ICR (g/U) and ISF (mmol/l/U) are two patient-specific parameters namely the carbohydrate-to-insulin ratio and the insulin sensitivity factor, and IOB (U) is the insulin on board, which can be calculated using a linear decay expressed as
where Bp the previously administered insulin bolus, Tint is the elapsed time since the last administered insulin bolus and Tact is the insulin action time, which is subject dependent.
The inherent uncertainty of the bolus calculator parameters and inputs are bounded by means of numerical intervals
To summarize, the interval-based standard formula above is used to calculate the bound constraints, whilst the CBR-based insulin recommender is used to calculate the bolus in real time. It is important to remark that, in this work, the CBR-based insulin recommender was not active during the feasibility trials and insulin bolus recommendations were based on a standard bolus calculator, which corresponds to the midpoint of the bound constraints.
Clinical Evaluation
To analyze the PEPPER system, the design of the study is completed over three phases. Phase 1 assesses the safety and feasibility of the PEPPER safety system (without the CBR-based insulin recommender). Phase 2 evaluates the overall PEPPER system (integrated with the CBR-based insulin recommender). Phase 3 is a randomized open-label cross-over trial comparing the complete PEPPER system to a standard bolus calculator.
In this work, preliminary data from participants on MDI is presented only. Hence, Module 3 (PLGBI) is not evaluated since it is exclusive to pump users. In addition, as the PEPPER Insulin Recommender is not being evaluated, Module 4 (Dynamic Bolus Insulin Constraint) is not properly evaluated and, instead, is used as standard meal-insulin bolus calculator.
Study Design and Participants
Phase 1 is a nonrandomized, open-label study. Ethics approval was obtained from the relevant Ethics Committees at each of the sites. Adult participants with T1D for >1 year and on MDI treatment for >6 months. All participants had to have completed a structured education program and be competent at carbohydrate counting.
Exclusion criteria included an episode of diabetic ketoacidosis (DKA) or severe hypoglycemia requiring third-party assistance (within the last 6 months), use of regular paracetamol, pregnancy, breastfeeding, active malignancy or endocrinopathy, abnormal renal function or liver cirrhosis, or macrovascular complications in the past year. All participants gave informed written consent.
Procedures
At study enrolment, participants gave a full medical history and underwent a physical examination. Random venous bloods, including HbA1c, were taken. A urine sample was taken to measure albumin/creatinine ratio. The Gold Score questionnaire was completed, which is a subjected rating given by the participant on a scale from 1 (always) to 7 (never) in response to the question “Do you know when your hypos are commencing?”
Participants meeting the inclusion criteria were provided the PEPPER system. For Phase 1, the PEPPER CBR-based insulin recommender was disabled and a standard bolus calculator was used. Participants were instructed to use the equipment according to its license.
The study comprised four visits over 8 weeks. There was a two-week initial run-in period using the PEPPER system with the safety system disabled but with xDrip+ glucose alarms activated. A second visit was schedule at the end of Week 2, and the PEPPER safety system was activated on the handset. A third visit was scheduled at the end of Week 4 and a final visit at the end of the study.
At each visit, CGM data were reviewed by the researcher with the participant and changes were made to the basal insulin/ISF/ICR as required. Verbal feedback from participants was obtained regarding any technical issues encountered. Technical issues identified in the assessment were dealt with system redevelopment. At visit 4, the PEPPER system was switched off and returned.
Outcomes
The primary outcome was percentage (%) time in hypoglycemia (<3.9 mmol/l) from baseline to endpoint. Secondary outcomes included low and high glucose alarms, carbohydrate recommendations, low glucose suspend (CSII users only), technical faults of the PEPPER system. Secondary outcomes regarding glycemic control include: percentage time in target (3.9-10 mmol/l), percentage time in hyperglycemia (>10 mmol/l), and lower thresholds of hypoglycemia (<3.3 mmol/l and 3.0 mmol/l).
Statistical Analysis
All glycemic outcomes from baseline (weeks 1 and 2) were compared with endpoint (weeks 7 and 8). Nonnormally distributed data were analyzed with the Wilcoxon matched-pairs signed-rank test. For data analyzed on a fortnightly basis, an analysis of variance (ANOVA) was used. All outcomes are reported as median (interquartile range [IQR]), unless stated otherwise. P values < .05 were considered statistically significant.
The glycemia and safety system data for each participant were stored on the PEPPER Server Application (PSA), which were exported as a test file and run on MATLAB script to calculate the primary and secondary outcomes for each week of the study. A formal power calculation was not performed for Phase 1 pilot studies assessing feasibility and safety of new technology.
Results
Eight participants were recruited at two sites, namely Imperial College Healthcare NHS Trust, London, UK (n = 4) and Hospital Universitari de Girona Dr Josep Trueta, Spain (n = 4). Participants (3 men and 5 female) had a median (IQR) age of 37.5 (31.8-53.5) years, duration of diabetes 22.5 (18.0-26.5) years, BMI 23.8 (23.2-27.5), and HbA1c 63.0 (57.4-66.1) mmol/mol (Table 1). All participants had good awareness of hypoglycemia with a gold score of 2.0 (1.75-2.25).
Median Percentage Time (and IQR) Spent Within Various Glucose Ranges at Baseline (Weeks 1 and 2) and Endpoint (Weeks 7 and 8).
Reduction of percentage time in hypoglycemia <3.0 mmol/l was observed in all 6 individuals. For percentage time in hypoglycemia <3.3 mmol/l, reduction was observed in 5 out of 6 individuals.
Six participants completed the 8-week Phase 1 study. The reasons for the two participants not included in the final analysis were due to one drop out for personal commitments and one participant having handset issues.
Glycemic Outcomes
A comparison of glucose outcomes was derived from the run-in CGM data (baseline weeks 1 and 2) and compared with endpoint (weeks 7 and 8). Median percentage time <3.0 mmol/l fell from 0.8% during run-in (weeks 1 and 2) to 0.3% at endpoint (weeks 7 and 8; P = .02; Table 1; Figure 5). For the primary outcome comparison (percentage time <3.9 mmol/l) and percentage time <3.3 mmol/l, no significant difference was observed between the two groups.

Box plot graphs showing the change in glycemic outcomes on a fortnightly basis over the eight-week study. (a) Change in percentage time in hypoglycemia (<3.0 mmol/l), (b) change in percentage time in target (3.9-10.0 mmol/l), (c) change in percentage time in hyperglycemia (>10 mmol/l). *ANOVA P < .05.
Percentage time in target (3.9-10 mmol/l) significantly increased with use of the PEPPER safety system compared to standard system (P < .05). No significant difference for time in hyperglycemia (>10 mmol/l) was observed.
No adverse incidents of DKA or severe hypoglycemia requiring third-party assistance occurred during the eight weeks. One participant was admitted to hospital due to hyperglycemia precipitated by a mild lower respiratory tract infection.
Safety System Outcomes
The total incidence of PEPPER safety system outcomes (ie, glucose alerts, alarms, and carbohydrate recommendations) between run-in and endpoint are shown in Table 2. It is important to remark that during the run-in period, the safety system was disabled but still running in the background, hence the glucose alerts, alarms, and carbohydrate recommendations were blinded to the user. Nevertheless, the user had the xDrip+ glucose alarms activated with the same thresholds as with the PEPPER safety system. This makes the comparison of glucose alerts and carbohydrate recommendations not completely fair because the user was not able to react to these events during the run-in period. However, we consider that these results are still informative of the improvement on glycemic control.
Safety System Outcomes Comparing Run-in and Endpoint. Data Expressed as Median (IQR).
The total incidence of glucose alerts significantly reduced by approximately one-third at endpoint compared to run-in (P < .05; Table 2), but no difference was observed when categorized into type of alert (ie, hypoglycemia/hyperglycemia). Note that the observed difference in the incidence of glucose alerts might be due to the users changing the glucose alerts thresholds during the trial. Incidence of glucose alarms did not change.
All carbohydrate recommendations were considered, regardless of whether the user acted upon the advice recommended by the PEPPER system. The median total number of carbohydrate recommendations reduced to zero by endpoint, which correlates with the reduction in hypoglycemia <3.0 mmol/l observed.
Data loss was observed for periods of time between the CGM device and handset. Approximately 49.6% of missed signals were observed in the initial run-in period and was reduced to 19.1% by endpoint.
Discussion
This feasibility study has demonstrated proof of concept, safety, and feasibility of the PEPPER safety system in MDI participants with T1D. The results suggest that a 6-week intervention with the PEPPER safety system and CGM has benefit in improving glycemic control by reducing percentage time in clinically significant hypoglycemia (<3.0 mmol/l) and increasing percentage time in target (3.9-10 mmol/l).
Our study is limited by small numbers and a short follow-up period, but the population and study design are comparable with previous reports for a feasibility study. In addition, the feasibility study is not designed to show superiority. The results are encouraging and the overall system has been shown to be safe for use. However, without a control group, it is difficult to determine how much of the improvement was due to the safety system and how much to the prolonged CGM use.
The baseline data were derived from weeks 1 and 2 (with standard safety system), and compared to endpoint (with PEPPER system). Although no significance was observed in the primary endpoint, the International Hypoglycaemia Study Group 21 recommend that <3.0 mmol/l is a low enough but safe value to report “clinically relevant” hypoglycemia in clinical trials. People with T1D who are unaware of their hypoglycemia at <3.0 mmol/l have a fourfold increased risk of severe hypoglycemia. 22 This study was designed before this recommendation was published and had originally defined the level of hypoglycemia at <3.9 mmol/l.
The reduction in total number of alerts decreased as the study progressed, correlating with the improved glycemic control with continued use of the PEPPER safety system.
One limitation in this analysis includes the alert threshold being altered by participants due to “alarm fatigue.” A suggestion from several users was to include a vibration feature, which is to be incorporated into the system. It is also difficult to establish whether the handset had been switched off by the participants, and therefore if the alarm/alert had been acted upon.
Signal loss between the CGM sensor and the PEPPER handset was a consistent issue amongst most participants. Participants found that the handset and CGM could only connect within a 5-metre range. Data loss was addressed during the course of the study and is currently a main focus for improvement within the system.
During the course of the study, changes to insulin regime were made by clinicians to ensure participant safety. However, no significant changes to basal insulin dosing was found between run-in and endpoint to account for the significant reduction in hypoglycemia.
All participants using the PEPPER system expressed a wish to continue using the system in to Phase 2 of the study. However, participants did experience and reported alarm fatigue on a regular basis. For this reason, alterations have made been made to new feature releases, which include a vibration feature (instead of sound) and to downgrade hyperglycemia alarms to alerts.
As only MDI participants were assessed in this feasibility study, the other module components (ie. the Dynamic Insulin Constraint and Low-glucose suspend modules) could not be tested. Further work with pump participants and in the form of a powered, randomized cross-over trial is planned to assess whether the complete PEPPER system, integrated with the case-based reasoning component, is superior to standard safety system and bolus calculator.
Conclusion
In conclusion, the PEPPER safety system is acceptable, safe and maintains improved glycemic control in a small pilot population within an out-of-clinic environment. Despite being a short study, significant reduction in percentage time in hypoglycemia with increase in time in target was observed. These results are promising for the day-to-day use of PEPPER for self-management of T1D.
Footnotes
Appendix A
Abbreviations
CBR, case-based reasoning; CGM, continuous glucose monitoring; CHO, carbohydrates; CSF, carbohydrate sensitivity factor; CSII, continuous subcutaneous insulin infusion; DBIC, Dynamic Bolus Insulin Constraint; DKA, diabetic ketoacidosis; G, glucose; ICR, carbohydrate-to-insulin ratio; IOB, insulin on board; IQR, interquartile range; ISF, insulin sensitivity factor; MDI, multiple daily injections; PLGBI, predictive low glucose basal insulin suspension; Ra, rate of glucose appearance; R2R, run-to-run; T1D, type 1 diabetes.
Declaration of Conflicting Interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This project has received funding from the European Union’s Horizon 2020 research and innovation program under grant agreement 689810. Infrastructure support for participants at Imperial College London was provided by the NIHR Imperial Biomedical Research Centre and the NIHR Imperial Clinical Research Facility. The views expressed are those of the author(s) and not necessarily those of the NHS, the NIHR or the Department of Health and Social Care.
