1. Introduction
Diabetes is a chronic disease in which the pancreas cannot produce sufficient insulin, affecting millions of people worldwide. Effective insulin therapy is crucial for maintaining balanced blood sugar levels in patients with diabetes. Incorrect insulin dosage adjustment can lead to serious complications and increase the risk of hyperglycemia or hypoglycemia in patients with diabetes. Therefore, an accurate and timely adjustment of daily insulin doses is of utmost importance. Type 1 diabetes is a disease that occurs due to the autoimmune destruction of beta cells in the pancreas, resulting in the cessation of insulin production. Although it is most commonly diagnosed during childhood or adolescence, it can also develop in adulthood and beyond the age of 80.
Insulin dose adjustment is a fundamental component of basal insulin therapy for patients with type 1 and type 2 diabetes. Lifelong insulin therapy is essential for the management of type 1 and type 2 diabetes and is typically administered through either a basal–bolus regimen (consisting of basal insulin once or twice daily and bolus insulin before each meal) or continuous subcutaneous insulin infusion (CSII) [
1].
Currently, the process of insulin dose adjustment is largely based on patients’ personal experiences, physician recommendations, and manual tracking forms. However, these methods are time-consuming, prone to errors, and do not adequately account for individual variations. Consequently, there is a growing need for digital solutions to make the insulin dose adjustment process more systematic and automated. It is vital that the insulin dose adjustment algorithm is recognized and reliably adopted by healthcare professionals as a clinically accepted algorithm in the medical field. Various studies have explored different titration algorithms to evaluate their effects on patients and determine the optimal insulin dosing strategy.
In [
2], a study was conducted to investigate how insulin titration can be carried out based on patients’ blood glucose measurements, the challenges faced by patients when initiating insulin therapy, how these challenges can be addressed, and which methods are most effective throughout the treatment process. Consequently, they presented an insulin management protocol. The study concluded that patient-led titration was faster and more effective, although it required regular education and monitoring. Furthermore, mobile applications and digital tools facilitated the titration process.
Similarly, the impact of continuous glucose monitoring (CGM) on glycemic control parameters, including HbA1c levels, hypoglycemia frequency, and glycemic variability, was investigated in a study conducted by [
3]. This study revealed that the use of CGM significantly improved glycemic control by lowering HbA1c levels, reducing the duration of hypoglycemia, and minimizing blood glucose fluctuations in patients with type 1 diabetes.
A study [
4] focused on the development of insulin dose adjustment algorithms based on the principle that various insulin types exerted their peak effects at specific times of the day. Based on the glucose measurement data, specific rules were defined to guide dose modifications, which were implemented within a computerized system known as Insulin Insights. The system proved to be effective, reducing HbA1c levels from 11.0% to 7.2% in a cohort of 111 patients, while enabling the automatic generation of insulin dose recommendations within 15 s.
In a separate study [
5] conducted to enable glycemic control without requiring clinic visits and to facilitate more frequent insulin dose adjustments, the effectiveness of a remote glucose monitoring system combined with computerized insulin dose adjustment algorithms was evaluated. In this system, glucometers connected to patients’ smartphones automatically transmit blood glucose readings to a HIPAA-compliant secure server. The data were analyzed using computer algorithms to generate insulin dose adjustment reports, which were reviewed and either approved or modified by healthcare staff. Patients were then contacted by telephone with new instructions, eliminating the need for in-person clinic visits. At the end of the six-month follow-up period, HbA1c levels showed a 7.6% reduction. Although the total insulin dose was increased by 24%, no cases of severe hypoglycemia or emergency department visits were reported. Moreover, by removing the need for physical appointments, the system saved a total of 456 h and created time slots for 268 patient visits.
In another study [
6], a novel, automated, self-adjusting subcutaneous insulin algorithm was evaluated in comparison with traditional methods for its impact on glycemic control and physician satisfaction in hospitalized patients with diabetes mellitus. The findings demonstrated a significant reduction in both hypoglycemia and hyperglycemia rates, while also alleviating physician workload and achieving high levels of user satisfaction. Physicians regard this system as an effective and practical tool for enhancing patient safety and facilitating clinical practice.
A recent study [
7] focused on various insulin titration algorithms and provided detailed insights into their rationale for use. The study highlighted that in the most commonly applied dose adjustment strategies, insulin doses are typically adjusted based on fasting plasma glucose (FPG) levels, particularly by considering the average FPG values from the previous two–three days. It was noted that dose increments were generally made in small steps; for example, while some simplified protocols employ 2-unit increases, in other cases, smaller or larger steps are used depending on blood glucose levels. The frequency of dose adjustment varied among studies, with titration algorithms implemented on a daily basis, once weekly, or every three days. Among these, the most widely adopted titration programs involve fixed dose increases every two–three days. Furthermore, this study indicated that simple titration algorithms could be as effective as physician-managed regimens, often achieving comparable or even better glycemic control, and were generally associated with lower rates of hypoglycemia than physician-managed regimens.
Similarly, a study [
8] explored the approaches aimed at establishing simpler and more practical insulin regimens for individuals with type 2 diabetes. In this context, recommendations were provided regarding the selection of the most appropriate meal for the first pre-meal injection in basal-plus regimens, considering each individual’s needs and capabilities. This study also compared different insulin titration algorithms and emphasized the importance of personal motivation and autonomy in achieving optimal glycemic control. Furthermore, this study underscored that insulin dose adjustment algorithms should be as straightforward as possible. Ideally, under appropriate conditions, a basal-plus regimen should be initiated using a simple, patient-managed algorithm. This approach is expected to enhance the acceptance and effectiveness of insulin intensification strategies in real-world settings.
In [
9], a dynamic algorithm was developed to determine basal insulin requirements in patients with type 1 diabetes using CGM and insulin pump data with linear regression. This approach enables automatic adjustments to insulin sensitivity factors and glycemic targets, thereby improving treatment safety and flexibility. In [
10], two sensor-based methods were proposed to optimize insulin dosing by integrating CGM and activity tracker data. These methods adjust real-time insulin sensitivity and bolus doses based on physical activity, thereby enhancing postprandial glycemic control.
In [
11], an AI-based algorithm was designed to classify post-meal blood glucose status using CGM, carbohydrate intake, and bolus insulin data. This machine learning approach showed potential for improving insulin dosing strategies in type 1 diabetes management.
Finally, in [
12], the Diabetes Mellitus Diagnosis, Treatment, and Follow-up Guideline published by the Turkish Society of Endocrinology and Metabolism (TEMD) provides comprehensive and evidence-based recommendations for the management of diabetes and its complications. This guideline aims to offer up-to-date, practical, and scientifically grounded protocols for healthcare professionals involved in diabetes care, including endocrinologists, family physicians, nurses, and dietitians. Key recommendations include the importance of individualized insulin therapy tailored to patient-specific characteristics, the adoption of basal–bolus or continuous subcutaneous insulin infusion regimens for optimal glycemic control in type 1 diabetes, and the necessity of structured education to reduce the risks of acute and chronic complications. Furthermore, the guidelines emphasize that insulin dose adjustments should be based on a combination of factors, such as the self-monitoring of blood glucose (SMBG), continuous glucose monitoring (CGM) data, HbA1c levels, and insulin sensitivity factors, to achieve effective and safe diabetes management.
In line with these recommendations, this study presents a mobile implementation of a rule-based insulin dose adjustment approach derived from the TEMD guideline [
9], which is currently applied at the Diabetes Clinic of Kocaeli University Hospital using manual forms of administration. By digitizing this guideline-based method, the developed system enables patients to systematically adjust their insulin doses based on blood glucose measurements recorded at predefined times over the past three days. This approach not only aligns with the evidence-based practices outlined in the national guidelines but also provides a flexible and automated solution that can be seamlessly integrated into digital health platforms, enhancing patient safety, treatment efficacy, and clinical workflow efficiency.
2. Methodology
2.1. Data Collection and Input Variables
In this study, a rule-based algorithm that is based on clinically applied metrics as given in
Table 1 is developed and implemented as a mobile application to optimize insulin dose adjustments in patients with diabetes. The system provides recommendations to increase or decrease insulin doses based on blood glucose levels measured at specific times over the past three days.
2.2. Data Sources
Blood glucose measurements: Patients perform glucose measurements at specific times throughout the day:
Fasting blood glucose: 08:00, 14:00, 18:00
Postprandial blood glucose: 10:00, 11:30
Nighttime measurement: 03:00
Insulin dose data: The insulin dose administered at each measurement is recorded.
Timestamps: Measurements are tracked over the past three days.
2.3. Rule-Based Algorithm
The developed algorithm analyzes patients’ blood glucose levels at specified time intervals and provides recommendations for increasing or decreasing insulin doses.
Threshold Values and Rules: The algorithm determines insulin doses using different blood glucose threshold values based on the measurement time.
Patient data from the last three days are collected and stored for analysis.
Blood glucose levels measured at specific time intervals are analyzed and compared with predefined threshold values. Based on this comparison,
If the measured blood glucose level is greater than or equal to the threshold value, the insulin dose is increased by 2 units.
If the measured blood glucose level is less than or equal to the threshold value, the insulin dose is decreased by two units.
Finally, the system notifies the patient regarding the type of insulin that needs to be adjusted for each time period.
2.4. Algorithm Flowchart
This flowchart illustrates how the system decides to increase, decrease, or maintain the current insulin dose. The system analyzes the patient’s blood glucose measurements from the past three days at specified time intervals and recommends appropriate dose adjustments based on the threshold values.
According to the flowchart presented in
Figure 1, the user’s blood glucose levels were measured at specific time intervals based on the fasting and postprandial states. If all of the last three measured blood glucose values are below the clinically determined threshold levels, the system generates recommendations to reduce the insulin dose. Conversely, if the blood glucose values are above the threshold levels, the system generates recommendations to increase the insulin dose. However, if any of the three most recent blood glucose measurements fall within the normal threshold range, no recommendation is provided by the system. The insulin dose recommendation system for blood glucose measurements taken at other times of the day operates similarly.
2.5. The AIDCARE Mobile Application and Its Integrated Modules
The AIDCARE application is developed for the monitoring and self-management of diabetes patients as shown in
Figure 2.
The risk module is designed to calculate the patient’s estimated average blood glucose value (HbA1C) based on their historical data and to predict potential changes in blood glucose levels in the short term (1–2 days), medium-term (1–2 weeks), and long-term (1–2 months). Additionally, this module can predict the likelihood of hypoglycemia or hyperglycemia in the short term and alert the patient to take the necessary precautions in case of potential risk situations.
The measurement module aims to enable patients with diabetes to record and monitor their health data systematically and securely. Through this module, users can manually enter various health parameters such as blood glucose measurements (along with fasting/postprandial information), weight, height, blood pressure (systolic/diastolic), insulin type, and insulin dosage. The measurement records are automatically timestamped, and the system performs validation checks on the entered data, providing warning messages to the user when necessary. Measurement data can be collected either manually or automatically through integration with measurement devices (e.g., via Bluetooth technology). Moreover, the application supports voice-to-text technology, allowing users to add measurement data using voice commands. All measurement data were stored locally on the device and securely transmitted to the server in real time. The data were securely stored in the database and associated with the user’s unique identifier (ID).
The recommendation module was developed to support diabetic patients in managing their health by providing personalized suggestions. These recommendations aim to help individuals maintain their health parameters within normal ranges, based on the identification of abnormalities detected from measurement results, and with the approval of healthcare professionals. The insulin dose recommendation mechanism is based on the algorithm illustrated in
Figure 1, which was designed specifically for this purpose. Insulin dose suggestions were automatically generated by utilizing user data obtained from the measurement module. In addition to insulin dose recommendations, other health-related suggestions will be provided within this module by leveraging the data collected from the various modules integrated into the application.
The exercise module was developed to support individuals with diabetes in planning and monitoring their physical activities in a structured and controlled manner. Through this module, users can create personalized exercise programs tailored to their needs and health conditions. These programs may include parameters such as the type of exercise (e.g., strength training and aerobic exercises), duration, and, if applicable, the number of repetitions. Scheduled exercises are accompanied by reminders at designated times (e.g., a notification stating “Your exercise time is approaching”). Additionally, users are prompted to input their real-time blood glucose levels prior to engaging in physical activity to ensure safety. A feedback-based verification system was integrated to facilitate exercise tracking and encourage users to complete their sessions. This verification can be achieved either by manually marking the exercise as completed or by uploading a video recorded during the activity. This module aims to monitor the exercise habits of individuals with diabetes and evaluate their physiological and psychological states following physical activity.
The diet management module was designed to assist individuals with diabetes in monitoring and regulating their dietary habits in a comprehensive and personalized manner. Within this module, users can record the amounts of carbohydrates, proteins, fats, and calories consumed in each meal, enabling precise nutritional tracking. Additionally, the module includes an image-based food recognition feature that analyzes a photo of the meal to estimate its nutritional value (carbohydrates, proteins, fats, and calories). This functionality is particularly critical in individuals with type 1 diabetes. The module calculates the required bolus insulin dose based on the estimated carbohydrate content. Furthermore, considering the user’s height and weight, the module estimates the total daily caloric requirement, distributes it across meals, and indicates the ideal caloric intake for each meal. This comprehensive approach aims to improve glycemic control and promote balanced dietary habits in individuals with diabetes.
The reminders module was developed to support individuals with diabetes in maintaining regular and controlled management of their daily health routines, including medication adherence, exercise planning, and educational engagement. Within the scope of this module, the timing of prescribed medication intake is recorded in the system, and users receive timely notifications reminding them to take their medications. Similarly, users are notified of scheduled exercise sessions at predetermined times to promote consistent physical activity. Additionally, the module aims to support patients in following their educational journey by sending notifications related to the educational content available within the application. These notifications are dynamically generated based on the duration of inactivity in the user’s engagement with the educational content and are designed to motivate users to complete the learning process. This module is intended to enhance treatment adherence, ensure uninterrupted daily health management, and support the completion of diabetes-related educational programs.
The education module was developed to enhance the awareness of individuals with diabetes regarding their condition. The module includes scientifically based educational content approved by physicians and nurses and presented in an interactive format using H5P technology. Users’ progress, achievement levels, and engagement with educational materials are monitored through XAPI technology. A personalized recommendation system supported by artificial intelligence analyzes user health data to suggest tailored educational content. Users can create their own personalized learning paths and track their progress via a dedicated profile page. Additionally, participation in educational activities is incentivized through a point-based system; with motivational features such as “streaks” and a leaderboard to encourage continued engagement. The module also included a chatbot designed to assist users throughout the educational process. All data are securely stored and can be shared with healthcare professionals when necessary. Overall, the module aimed to increase the knowledge level of individuals with diabetes and enhance the effectiveness of their learning experience.
2.6. Integration of the Developed Algorithm into the Mobile Application
The developed algorithm was integrated into mobile applications to serve as a personalized assistant for diabetic patients through the AIDCARE mobile application, utilizing its measurement and recommendation modules.
Blood glucose values, for which the user can select either a fasting or postprandial status, are added to the system through voice input or manual entry and stored in a local SQLite database. Each entry was recorded with a corresponding timestamp, enabling a comparison with the previous values. This comparison process analyzes the measurements within the same time frame and generates outputs accordingly. A dedicated rule-based algorithm, triggered upon each blood glucose entry, performs this evaluation and sends the resulting output to the recommendation module for further processing.
Patients can enter this information and value through the measurement module in the AIDCARE mobile application. After selecting their fasting status in this module, they can input their blood glucose value by manually clicking the input field (by hand) or pressing the microphone icon to use the voice input.
Based on the measurement times in
Table 1, the data entries in the mobile application were divided into the following time intervals:
Morning
- ○
Fasting: lower limit = 80 mg/dL, upper limit = 110 mg/dL
- ○
Postprandial: lower limit = 80 mg/dL, upper limit = 140 mg/dL
Noon
- ○
Fasting: lower limit = 80 mg/dL, upper limit = 110 mg/dL
- ○
Postprandial: lower limit = 80 mg/dL, upper limit = 140 mg/dL
Evening
- ○
Fasting: lower limit = 80 mg/dL, upper limit = 110 mg/dL
- ○
Postprandial: lower limit = 80 mg/dL, upper limit = 140 mg/dL
Night
- ○
3 AM measurement: lower limit = 80 mg/dL, upper limit = 110 mg/dL
Patients can select the appropriate fasting status and enter their blood glucose values as shown in
Figure 3a within the specified time intervals. The selected fasting status must match the fasting status defined in the algorithm for the corresponding period. If the patient attempts to enter a blood glucose value without selecting a meal status, they are prompted with a pop-up, as shown in
Figure 3b, to ensure that the appropriate meal status is selected.
If the patient enters the values completely, starting from the third day (including today and the previous two days), the recommendation module is activated to check whether the values for each time interval are above or below the threshold values. If the values for a specific time interval exceed the threshold on the previous two days and the value for the same interval on the third day also exceeds the threshold, an insulin dose increase recommendation is generated for that time interval.
If a recommendation has already been generated for the specified time interval on the third day (based on today’s entry), no new recommendation is created, and the other data points are reviewed. This check was applied to prevent the generation of duplicate recommendations for the previous time intervals.
In the recommendation module, if no recommendations are available, a message is displayed to the patient indicating that no recommendations were generated for that day, as illustrated in
Figure 4a. However, when the user clicks the “Get Insulin Dose Recommendation” button, the algorithm generates and displays the recommendations as a list if any have been created, as shown in
Figure 4b. Because the recommendations were generated using a rule-based algorithm, they must be approved by a specialist doctor or healthcare professional.
To support this process, it is planned to send the generated recommendations to relevant healthcare personnel via SMS or similar messaging services.
Once the healthcare professional reviews and approves the insulin dose recommendation, the patient can follow the suggestion accordingly. This section is still under development, and once completed, the insulin treatment process between the patient and healthcare professional will become faster and more reliable.
The pseudocode for the process of measuring blood glucose, storing the measured value into the AIDCARE system, and generating a recommendation is shown in
Appendix A.
According to the pseudocode presented in
Appendix A, the user enters the blood glucose value into the measurement module. Once the value was successfully recorded, the system analyzed the blood glucose data from the same time interval over the previous two days. If the newly entered value, along with those from the past two days, falls above or below the predefined threshold, the system proceeds to the final step to generate an insulin dose recommendation. Patients may enter multiple blood glucose readings within the same time interval. If each of these entries exceeds the threshold, the algorithm may attempt to generate a new insulin dose recommendation. To prevent redundancy, the system checks the recommendation table to determine whether a recommendation already exists for a specific time interval.
If no recommendation is found for a given time slot, the system generates an insulin dose recommendation. This recommendation is then displayed in the insulin dose recommendations section of the recommendation’s module, indicating the time range and providing guidance on how to adjust insulin dosage. However, if a recommendation for that time interval already exists, the system will refrain from generating a new one. This mechanism prevents duplication and ensures that multiple abnormal measurements within the same time frame do not lead to repeated recommendations.
3. Results
Clinical practices followed at the Diabetes Clinic of Kocaeli University Hospital have shown that considering the most recent three days of blood glucose data for insulin dose adjustments is crucial for accurately assessing a patient’s glycemic control and making appropriate treatment modifications. Given that daily blood glucose levels are influenced by factors such as stress, physical activity, diet, and illness, relying on a single day’s data for insulin adjustment may lead to errors caused by temporary fluctuations. Therefore, analyzing blood glucose data for at least three days enables a more accurate evaluation of a patient’s overall glycemic control and supports a more stable application of insulin doses [
7].
Based on these findings, a rule-based insulin dose adjustment mechanism was developed using the last three days of blood glucose data and integrated into the mobile application. The system provides insulin dose recommendations to minimize the risks of hypo- and hyperglycemia according to predefined clinical threshold values. In the analyses conducted based on fasting, postprandial, and nighttime measurements, automatic dose adjustment recommendations were generated when blood glucose levels fell outside the specified normal ranges. This approach personalizes insulin therapy and contributes to the safe and effective management of the treatment process.
This study emphasized the importance of considering blood glucose levels based on fasting, postprandial, and nighttime measurements for insulin dose adjustments. In line with clinical guidelines, normal ranges and threshold values were defined for each type of measurement, and these reference values form the basis for insulin dose adjustments.
4. Conclusions
In this study, a rule-based algorithm was developed to automate insulin dosing for patients with diabetes, providing real-time dosage adjustment recommendations based on blood glucose measurements taken at specific time intervals on previous days. This algorithm, grounded in clinical tables and rule-based logic, aims to facilitate easier monitoring of blood glucose and insulin dosage values by offering understandable, traceable, and clinically consistent outputs compared with traditional manual methods. With the integration of the algorithm into a mobile application, the goal is to enable patients to easily track their blood glucose levels and receive personalized insulin dose recommendations, thereby improving the self-management of insulin therapy. Furthermore, the algorithm is designed to support remote monitoring by healthcare professionals, potentially reducing the number of clinical appointments and allowing the examination of more patients who require face-to-face care during the day.
A survey conducted with diabetic patients at Kocaeli University Hospital regarding the developed rule-based insulin dose adjustment algorithm and its monitoring via a mobile application revealed that 46.2% of the participants were dissatisfied with traditional insulin dose adjustment methods and nearly 40% reported improvement in their HbA1c levels by employing dynamic insulin dosage adjustment. However, all participants expressed a positive attitude toward managing insulin dosage through a mobile application. These findings indicate that managing insulin dosing via the proposed AIDCARE mobile application may meet a critical need among patients with diabetes when compared with traditional approaches.
In the subsequent phase of the study, the effectiveness of the insulin dosage recommendations provided by the application in the interaction between patients and healthcare professionals will be evaluated. Pilot tests will be conducted with a control group of selected patients to identify the strengths, limitations, and potential areas for improvement in the application and algorithm. Based on the findings obtained, the application will be updated to make it more functional and user-friendly.