Submit manuscript...
eISSN: 2574-8092

International Robotics & Automation Journal

Research Article Volume 9 Issue 2

Artificial pancreas control using optimized fuzzy logic based genetic algorithm

Ahmed J Abougarair,1 Mosab JA Abujarir,2 Hana Tarek Tilamon3

1Electrical and Electronics Engineering, University of Tripoli, Libya
2The Higher Institute of Medical Professions, Algarabolli, Libya
3Electrical and Electronics Engineering, University of Tripoli, Libya

Correspondence: Ahmed J Abougarair, Electrical & Electronic Engineering, University of Tripoli, Tripoli Libya, Tel +218916094184

Received: June 24, 2023 | Published: July 17, 2023

Citation: Abougarair AJ, Abujarir MJA, Tilamon HT. Artificial pancreas control using optimized fuzzy logic based genetic algorithm. Int Rob Auto J. 2023;9(2):89-97 DOI: 10.15406/iratj.2023.09.00270

Download PDF

Abstract

The aim of this paper is to develop an artificial pancreas that can automate the process of monitoring blood glucose levels and administering insulin to diabetic patients. The device incorporates a fuzzy controller that is optimized through a genetic algorithm and designed using MATLAB. The system comprises three key components: a continuous glucose monitoring (CGM) system, an insulin pump, and the fuzzy controller. The CGM measures blood glucose levels in real-time, and the insulin pump administers insulin doses to maintain blood glucose levels within a specific range. The fuzzy controller adjusts the insulin delivery rate based on the patient's blood glucose levels and their target range. To enhance the system's performance, a genetic algorithm is used to fine-tune the parameters of the fuzzy controller, seeking the optimal set of parameters that minimize the difference between the patient's blood glucose levels and the desired target range. The system is implemented in MATLAB, and simulation results indicate its effectiveness in maintaining blood glucose levels within the desired target range, reducing the risk of hypoglycemia and hyperglycemia. In summary, the proposed artificial pancreas system provides an effective automated solution for monitoring blood glucose levels and administering insulin to diabetic patients, with the fuzzy controller and genetic algorithm optimization enhancing the system's performance.

Keywords: diabetes, insulin, glucose, fuzzy logic, genetic algorithm

Abbreviations

CGM, continuous glucose monitoring; FLCs, Fuzzy logic controllers; FLC, fuzzy logic controller

Introduction

The development of an automated closed-loop insulin delivery system, also known as an artificial pancreas, has been a major focus of diabetes research in recent years. The goal of an artificial pancreas is to provide a fully automated system that can mimic the activity of a normal pancreas and maintain physiological blood glucose levels for insulin-dependent diabetic patients. The system typically consists of three main components: a continuous glucose monitoring (CGM) sensor, an insulin pump, and a control algorithm that regulates the pump based on the CGM readings. The CGM sensor continuously measures the glucose levels in the patient's interstitial fluid and sends the readings to the control algorithm. The control algorithm then calculates the amount of insulin needed to maintain normoglycemia based on the current glucose levels and other factors such as the patient's weight and insulin sensitivity. The insulin pump then delivers the correct amount of insulin to the patient subcutaneously. The development of an artificial pancreas has the potential to dramatically improve the quality of life for insulin-dependent diabetic patients by reducing the need for frequent finger-stick blood glucose measurements and subcutaneous insulin injections. It could also reduce the risk of hypoglycemic and hyperglycemic events, which can have serious health consequences for diabetic patients. Several clinical trials have been conducted to evaluate the safety and effectiveness of artificial pancreas systems, with promising results. For example, a study published in The Lancet in 2019 evaluated a closed-loop insulin delivery system in 235 adults with type 2 diabetes and found that the system was effective in improving glucose control and reducing the risk of hypoglycemia compared to a standard insulin delivery system. While there is still work to be done before artificial pancreas systems can be widely adopted, the development of these systems represents a significant step forward in diabetes management and has the potential to revolutionize the treatment of insulin-dependent diabetic patients. Diabetes is a health condition characterized by high levels of glucose in the blood, caused by either insufficient production of insulin or the body's inability to use it effectively. The disease can be caused by the immune system's destruction of beta cells in the pancreas that produce insulin, leading to a deficiency of the hormone, or by abnormalities that result in insulin resistance.1,2 People with diabetes are at a heightened risk of developing long-term complications that can negatively impact their eyes, kidneys, nerves, heart, blood vessels, and limbs.3 The primary challenge in the treatment of diabetes is to maintain normal blood glucose levels, which necessitates a balance of insulin delivery and glucose monitoring. Conventional insulin therapy involves regular subcutaneous insulin injections, but it has drawbacks such as imprecise insulin dosage adjustments and the risk of hypoglycemia. To address these shortcomings, researchers have been developing artificial pancreas systems that can deliver insulin automatically in response to glucose fluctuations.4,5 Fuzzy logic controllers (FLCs) have been proposed as a viable solution to regulate blood glucose levels in artificial pancreas systems. FLCs excel in modeling complex and nonlinear systems such as the glucose-insulin system since they can handle uncertain and imprecise data. Fuzzy logic is a type of mathematical logic that allows for reasoning with uncertain or imprecise information. In contrast to classical (Boolean) logic, which relies on binary true/false values, fuzzy logic allows for variables to take on values between 0 and 1, representing degrees of truth or membership in a set. For example, instead of categorizing glucose levels as "high" or "low," fuzzy logic can represent glucose levels as "moderately high" or "slightly low," which can better capture the complexity of physiological systems. In the context of closed-loop insulin dosing, a fuzzy logic controller uses a set of rules to determine the appropriate insulin infusion rate based on input variables such as glucose levels and insulin doses. The rules are typically based on expert knowledge or clinical guidelines, and the controller can learn and adapt to individual patient responses over time. One advantage of fuzzy logic controllers is their ability to handle uncertainty and variability in physiological systems. For example, they can account for individual differences in insulin sensitivity or the effects of stress or illness on glucose levels. Additionally, fuzzy logic controllers can be personalized to individual patients by adjusting the rules or parameters of the controller to match the patient's specific needs and preferences. There have been several studies evaluating the use of fuzzy logic controllers for closed-loop insulin dosing, with generally positive results. For example, a study published in Diabetes Technology & Therapeutics in 2017 evaluated a fuzzy logic controller in 20 patients with type 1 diabetes and found that it was effective in maintaining glucose levels within a target range. Another study published in the Journal of Diabetes Science and Technology in 2020 compared a fuzzy logic controller to a model-based controller and found that both controllers were effective in maintaining glucose levels, but the fuzzy logic controller had a lower risk of hypoglycemia. While fuzzy logic controllers show promise for closed-loop insulin dosing, further research is needed to fully evaluate their effectiveness and safety in a clinical setting. Additionally, the development of more advanced artificial intelligence and machine learning techniques may offer even more sophisticated approaches to closed-loop insulin dosing in the future. Genetic algorithms (GAs) have also been employed to optimize the FLC parameters, leading to improved performance.6 The proposed artificial pancreas system includes a continuous glucose monitoring system (CGM) for glucose level measurement, an insulin pump for insulin delivery, and a fuzzy controller-based genetic algorithm for insulin dosage calculation based on glucose levels. This system has the potential to automate insulin administration, leading to better management of blood glucose levels and a reduced risk of complications associated with diabetes.7,8

 Artificial pancreas system

Diabetes mellitus is a chronic disease that can be managed with medication and lifestyle changes. Keeping glucose levels under control is essential for preventing or limiting complications. Insulin is a powerful treatment for type 1 diabetes, as it helps to regulate and maintain normal blood glucose levels. The hormone insulin, which is produced by the pancreas, helps the body use sugars from food for energy or store glucose for later use. Insulin helps to prevent both high blood glucose levels (hyperglycemia) and low blood glucose levels (hypoglycemia). When blood glucose levels increase after a meal, beta cells in the pancreas release insulin into the bloodstream, which allows glucose to enter the body's cells to be used for energy. If the body has more sugar than it needs, insulin helps to store the excess sugar in the liver and release it as needed, such as between meals or during physical activity. If the body does not produce enough insulin or the body's cells are resistant to its effects, it can lead to hyperglycemia, which can cause long-term complications. The pancreas plays a critical role in managing blood glucose levels by releasing insulin and glucagon hormones. The pancreas is located in the abdominal region as shown on Figure 1, and it contributes to the digestion process in the small intestine. The pancreas is also an endocrine organ that releases insulin and glucagon hormones. The pancreas is made up of two types of tissue: dark-staining cells involved in digestion and lighter-staining cell-groups called the Islet of Langerhans. The Islet of Langerhans is a pancreatic area that contains five types of cells that release hormones into the bloodstream, such as the alpha-cell type that releases glucagon hormone and the beta-cell type that releases insulin hormone.

Figure 1 The glucose-insulin regulatory system.5

The artificial insulin infusion system is commonly referred to as the Artificial Pancreas. The components of an artificial pancreas system typically include a continuous glucose monitoring (CGM) device, an insulin pump, and a control algorithm that regulates insulin delivery based on CGM data. The Figure 2, provides an overview of the various elements that make up an artificial pancreas system. The CGM device constantly measures glucose levels in the blood and transmits this information to the control algorithm. The control algorithm processes the CGM data and determines the optimal insulin dose based on a pre-defined set of rules. The insulin pump then delivers the required amount of insulin to the patient. This process is repeated continuously in real-time to maintain glucose levels within a target range. A sensor for monitoring glucose levels takes a sample of the patient's blood glucose every five minutes. A controller then generates a calculated insulin dose to regulate the blood glucose levels to a normal range of 80 to 100 milligrams per deciliter. Finally, an insulin pump is used to administer the calculated insulin doses to the patient's body.9,10

Figure 2 AP system components.

Methodology

The approach taken in this graduate paper involves multiple stages. Initially, the Simulink model of the artificial pancreas system will be introduced. Following that, a fuzzy logic controller will be designed and implemented to regulate the artificial pancreas. The controller will undergo optimization by adjusting its rules to improve its performance. Furthermore, the controller's rules will be customized and updated to meet the specific needs of the artificial pancreas system. Ultimately, the performance of the developed controllers will be assessed under various conditions to determine their ability to regulate the artificial pancreas system effectively.10

Fuzzy logic control system

A fuzzy logic controller (FLC) is a control system that utilizes fuzzy logic to process and reason with imprecise or uncertain data. FLCs are especially beneficial in scenarios where the system being regulated is overly complicated or not well-understood to be modeled using conventional control methods.11,12 The FLC system is composed of four key elements: fuzzification, rule base, inference engine, and defuzzification as shown in Figure 3.

Figure 3 Fuzzy logic architecture.

  1. Fuzzification

The fuzzification component of an FLC transforms precise input values, such as sensor readings, into fuzzy values through the assignment of membership values to each input. This procedure involves linking the input to a group of linguistic variables, such as "low," "medium," and "high," which signify the level of membership in a particular set.

  1. Rule Base

The rule base of an FLC comprises a collection of IF-THEN statements that embody the decision-making logic of the controller. Each rule has two parts: the antecedent (IF part) and the consequent (THEN part), and is defined in relation to the fuzzy variables and their membership functions.

  1. Inference Engine

The inference engine of an FLC is accountable for merging the rules in the rule base to generate a precise output value. This process entails employing fuzzy logic operators such as AND, OR, and NOT to the fuzzy sets in the antecedents of the rules to obtain a degree of truth for each rule.

  1. Defuzzification

During the defuzzification process in an FLC, the fuzzy output values produced by the inference engine are converted into a precise output value. This is accomplished by determining the center of gravity of the fuzzy output values, which represents the most likely output value.

FLCs utilize fuzzy logic to simulate the human decision-making process and are highly effective in systems where conventional control techniques may not be sufficient due to the system's complexity or the challenge of establishing precise mathematical models.

Genetic Algorithm

Genetic algorithms are computational methods utilized in computer science and operations research to address optimization problems utilizing the principles of natural selection. Genetic algorithms aim to generate optimal solutions via operations such as mutation, cross-over, and selection. The goal is to start with a large population or search space and gradually reduce it until only the best solutions remain, similar to the concept of survival of the fittest.9,13 Genetic algorithms are sometimes considered more robust than artificial intelligence (AI) systems. This is because, unlike traditional AI systems, genetic algorithms can adapt to changing inputs and handle noisy or imprecise input data. Additionally, genetic algorithms are better equipped to handle complex problems.14 The process of genetic algorithm begins with a large population of potential solutions and gradually reduces it using heuristics until only the best solutions remain. A typical GA cycle is shown in Figure 4.

Figure 4 The genetic algorithm cycle block diagram.

The phases of a genetic algorithm include:

  1. Initial Population: The process of a genetic algorithm starts with a population of individuals, each of which represents a potential solution to the problem being addressed. Each individual is associated with certain parameters, called genes, which are combined to form a chromosome. The set of genes for a particular individual is represented using a string of characters, and these sets of strings form the chromosome, as illustrated in Figure 5.
  1. Fitness Function: The fitness function is a critical component of a genetic algorithm as it determines how fit an individual within the population is. Each individual is assigned a fitness score based on this function, with higher scores indicating greater fitness. The fitness function evaluates how well an individual's genes align with the desired objective, and the results of this evaluation determine the individual's fitness score. The higher an individual's fitness score, the more likely it is to be selected for reproduction in the next generation to produce offspring with similar or improved fitness scores. This process of selection and reproduction is repeated over multiple generations, with the aim of producing a population with increasingly better fitness scores. 
  2. Selection: The selection process in a genetic algorithm involves choosing individuals from the current generation to breed the next generation, based on their fitness. The more fit an individual is, the more likely it is to be selected as a parent. During the selection process, two individuals are chosen to serve as parents to produce the next generation of solutions.
  1. Crossover: Crossover, also known as recombination, is a process in a genetic algorithm where the genetic information from two parents (a father and a mother) is combined to create new offspring. This process is illustrated in Figure 6, where we can see that some of the genes from each parent "cross-over" to produce a new set of genes in the offspring.
  1. Mutation:Mutation is another genetic operation that can occur in a genetic algorithm. In this process, the arrangement of genes in a chromosome is altered to produce a new chromosome. This occurs with a very low probability. Evolutionists often use mutation to explain how species can evolve into new species over time, but this is not based on any scientific law.
  1. Termination: The algorithm repeats until certain termination conditions are met, such as a maximum number of generations or when the fitness score of the population reaches a satisfactory level. When the termination conditions are met, not much change occurs in the population, and the algorithm stops.

Figure 5 Genes, chromosomes and population.

Figure 6 Crossover.

Optimization FLC using GA to control AP

The steps involved in optimizing a fuzzy logic controller using a genetic algorithm14,15

  • Define the design variables: Determine the parameters of the fuzzy logic controller that will be optimized using the genetic algorithm.
  • Define the fitness function: Create a function that evaluates the performance of the fuzzy logic controller, such as mean squared error.
  • Initialize the population: Generate a random set of solutions, with each solution representing a set of values for the design variables.
  • Evaluate the fitness of the population: Use the fitness function to evaluate each solution in the population.
  • Selection: Choose the solutions with the highest fitness to be parents of the next generation.
  • Crossover: Combine the design variables of two parents to create a new solution, repeating this step for all parent pairs.
  • Mutation: Introduce random changes in some of the design variables of the new solutions.
  • Repeat steps 4 to 7 for a certain number of generations or until convergence is achieved.
  • Select the best solution: The optimized fuzzy logic controller is the solution with the highest fitness.

Test the optimized controller: Evaluate the performance of the optimized controller on a validation dataset.

By repeating steps 4 to 7 for multiple generations, the genetic algorithm tries to find the optimal values for the design variables that maximize the fitness function. The end result is an optimized fuzzy logic controller that performs better than the original controller.

Based on the given statement, it appears that the FLC (Fuzzy Logic Controller) is created using a chromosome that represents all the parameters of the membership functions (MFs). The behavior of this FLC is then tested through a simulation process, and the results of the simulation are used to calculate a fitness function value. This mapping from the proposed solution to the fitness function result allows the use of optimization methods. It is expected that this same mapping can be applied to suboptimal solutions in order to obtain the desired FLC. In other words, by evaluating the fitness function for different parameter combinations, the optimization method can identify the combination that results in the best performance of the FLC. Overall, this process involves creating an FLC with a set of parameters represented by a chromosome, testing the FLC using a simulation, evaluating its performance through a fitness function, and using optimization methods to find the best combination of parameters. The flow chart of the genetic algorithm depicted in Figure 7 as follows.

Figure 7 The flow chart of the used genetic algorithm

Control system design

Overall, the Simulink model presented in Figure 8 provides a comprehensive platform for testing and evaluating the performance of the fuzzy logic controller in controlling blood glucose levels in diabetic patients. By incorporating real-world scenarios such as meals and glucose monitoring, the Simulink model can simulate different conditions and provide valuable insights into the effectiveness of the controller in managing blood glucose levels. After creating the Simulink model for controlling blood glucose levels, the next step was to model a diabetic patient.12,13 This involved designing a glucose monitoring system that could measure the blood glucose level and transmit the data to the controller.16 To control blood glucose levels, a fuzzy logic controller was designed separately from the Simulink model. The fuzzy logic controller was chosen due to its ability to handle imprecise or uncertain information, which is common in diabetes management. The fuzzy logic controller was later added to the Simulink model using a built-in block that loaded the fuzzy system from the MATLAB workspace. To simulate real-world scenarios, a meal subsystem was included in the Simulink model. The meal subsystem takes into account different variables such as the time of day and the amount of carbohydrate intake. The meal subsystem allows the Simulink model to simulate the effect of meals on blood glucose levels, which is an important factor in diabetes management.17,18

Figure 8 AP Model.17

In this paper, a fuzzy inference system (FIS) tree controller is proposed to manage the blood glucose levels of a diabetic patient. The controller is based on a Mamdani-type fuzzy architecture, which is a popular type of fuzzy inference system that uses fuzzy rules to map input variables to output variables. The FIS tree controller has three inputs, which are the blood glucose level (mg/dL), the rate of change of blood glucose level (mg/dL/min), and the acceleration rate of blood glucose level (mg/dL/min/min). These inputs are used to determine the optimal insulin infusion dosage required to maintain the blood glucose level at a normal level. The FIS tree controller is designed as a hierarchical structure, with each level representing a different aspect of the control strategy.19 The first level of the controller uses a set of fuzzy rules to determine the overall insulin dosage required based on the current blood glucose level. The second level of the controller uses a set of fuzzy rules to adjust the insulin dosage based on the rate of change of the blood glucose level. The third level of the controller uses a set of fuzzy rules to further adjust the insulin dosage based on the acceleration rate of the blood glucose level.20,21

Create FIS1

FIS1 in Figure 9 is a fuzzy inference system that uses specific membership functions (MFs) for its inputs and outputs. The inputs are the blood glucose level (BG_Level) and the rate of change in blood glucose (BG_Rate), while the output is the precalculated insulin dosage (Precalculated_Dose).22

The BG_Level input utilizes three uniformly distributed triangular MFs, which are labeled as L (low level), M (medium level), and H (high level). These MFs represent different levels of blood glucose, with L being the lowest, M being the moderate level, and H being the highest.

The BG_Rate input employs three triangular MFs, which are labeled as N (negative rate), Z (zero rate), and P (positive rate). These MFs represent different rates of change in blood glucose, with N indicating a negative rate of change, Z indicating no change, and P indicating a positive rate of change.9,23

The Precalculated_Dose output utilizes five MFs, which are labeled as L (low dosage), M (medium dosage), H (high dosage), VL (very low dosage), and VH (very high dosage). These MFs are specifically designed to provide appropriate dosage recommendations based on the input variables. For example, if the BG_Level is high and the BG_Rate is positive, the output would suggest a higher dosage (H or VH) to bring down the blood glucose level.24

Figure 9 System FIS1.17

Create FIS2

The second fuzzy inference system as shown in Figure 10 is designed to generate the final insulin dosage by incorporating both the precalculated dose from the first layer and the effect of the blood glucose acceleration rate. fis2 also uses uniformly distributed triangular membership functions (MFs) for its inputs and outputs.

Figure 10 System FIS2.17

The input Precalculated_Dose utilizes three triangular MFs to represent the precalculated dosage, similar to the first layer of the FIS. The input BG Acceleration considers the rate at which the blood glucose level is changing and also utilizes three triangular MFs to represent negative, zero, and positive rates of acceleration. The output Final_Dose employs five triangular MFs, similar to the first layer, to represent different levels of insulin dosage. These MFs are designed to ensure effective dosage recommendations based on the combined inputs. To determine the appropriate insulin dosage, fis2 uses a set of nine fuzzy rules that take into account the precalculated dose and the blood glucose acceleration rate. The rules are designed based on the expert knowledge of diabetes specialists and are optimized using the genetic algorithm.25‒28

Afterwards, the inputs and outputs ranges are updated by writing code in the MATLAB workspace to be :

FIIS1 :

BG_Level=[70 125] BG_Rate =[-1 1]

Precalculated_Dose = [0 2]

FIIS2: Precalculated_Dose = [0 2]    BG_Accel= [-0.009 0.009]   and Insulin_Dose=[0 maxDose]

Simulation results

The plot consists of two subplots. Figure 11 displays the blood glucose level (mg/dl) of a diabetic patient. Figure 12 shows the amount of carbohydrate intake (g) at different times (min) of the day. In this example, the day is divided into three meals: breakfast with 25 g of carbohydrates, lunch with 30 g of carbohydrates, and dinner with 25 g of carbohydrates. The meal timings are at 60, 300, and 720 minutes, respectively, corresponding to the first, fifth, and twelfth hour of the day. The plot shows the blood glucose level over time in an open-loop scenario, where no corrective insulin dosages are injected into the patient. The blood glucose level significantly increases after each meal and reaches very high values. This demonstrates the need for a controller to maintain the glucose level by regulating the insulin doses. Overall, the plot highlights the importance of a closed-loop control system for managing blood glucose levels in diabetic patients. Without proper control, blood glucose levels can fluctuate greatly and lead to serious health complications.

Figure 11 AP response in open loop.

Figure 12 Carbohydrate intake (g).

The main objective of the controller is to generate corrective insulin doses for different scenarios in diabetic patients as shown in Figure 13. The three primary scenarios that the controller addresses are hyperglycemia, hypoglycemia, and normal blood glucose conditions. In the case of hyperglycemia, where the blood sugar level is high (typically above the target range), the controller responds by providing a high insulin dose in bolus mode. The recommended insulin dose ranges from 125 to 200 mg/dL and is dependent on various factors such as the patient's fasting and meal conditions. In contrast, when the blood glucose level is low (generally below the target range of 50-70 mg/dL), the controller ceases insulin administration to prevent further lowering of blood glucose levels. This is referred to as hypoglycemia. In the normal condition, where the blood glucose level is within the target range (generally 80 to 100 mg/dL), the controller maintains a low insulin dosage in basal mode to sustain optimal blood glucose levels. By generating corrective insulin doses for these different scenarios, the controller helps to regulate blood glucose levels in diabetic patients and prevent health complications associated with unstable blood glucose levels.

Figure 13 AP response after tunning rules.

There are various methods to assess the performance of a fuzzy system, and one of them involves examining the control surface. The control surface is a graphical representation of the relationship between the inputs and outputs of the system, where the z-axis corresponds to the insulin dosage, the x-axis corresponds to blood glucose levels, and the y-axis corresponds to blood glucose rate. Upon analyzing the control surface, one particular area of concern is when the blood glucose level is approximately 80 mg/dl, which is considered normal, and the blood glucose rate is negative. In this scenario, the current fuzzy system administers a high dose of insulin, which is unexpected and undesirable. Figure 14 illustrates that when the blood glucose level was 80 mg/dl and the blood glucose rate was -0.5, the insulin dose was 1.9 units, which is excessively high and unacceptable.

Figure 14 control surface of FIS 1 and Fis2 with tunning rules.

The simulation results illustrate that some of the control actions in the fuzzy system are not direct or straightforward. Specifically:

When there is a negative rate of change in blood glucose, the fis1 system does not always increase the insulin dosage proportionally as the blood glucose level increases.

When the blood glucose level is high, and the rate of change is also high and positive, fis1 sets the insulin dosage to medium instead of very high, which may not be optimal.

In cases where the blood glucose acceleration rate is negative, the fis2 system does not always increase the insulin dosage linearly with an increase in the precalculated insulin dosage.

For scenarios with a low precalculated insulin dosage and a negative blood glucose acceleration rate, fis2 sets the insulin dosage to very high, which is not desirable.

When the precalculated insulin dosage is high, and the blood glucose acceleration rate is zero, fis2 sets the insulin dosage to very low instead of medium, which is unexpected.

Figure 15 illustrates the outcome of optimization using the update rules, which enhance the controller's effectiveness and minimize the cost function. The controller with updated rules reduces the blood glucose levels compared to the tuned FIS tree controller. The fuzzy logic controller demonstrated its ability to inject insulin doses that correct the measured blood glucose levels of the patient, ultimately regulating it to a normal range. Moreover, to test the system's resilience, one can simulate various scenarios by adjusting the meal subsystem. For example, by increasing the carbohydrate intake by almost double (50, 60, 50) g, we can assess whether the fuzzy logic controller can still effectively regulate insulin and maintain the patient's blood glucose level within the normal range. Simulation results with day consists three meals: 50 g carbohydrate breakfast, 60 g carbo‑hydrate lunch, and 50 g carbohydrate dinner. The meal timings are 60, 300, and 720 minutes consecutively, corresponding to the first, the fifth and the twelfth hour of the day respectively (same in previous example)

Figure 15 AP response with update rules.

Figure 16 explain, the controller with updated rules reduces the blood glucose levels compared to the tuned FIS tree controller, this means that insulin doses have been calculated more accurately, resulting in a reduction in glucose levels.

Figure 16 Insulin rate and observed glucose after Tunning rules.

If the blood glucose level is high and the blood glucose rate is negative, it suggests that the glucose level is returning to a normal range, and therefore, a very high insulin dosage may not be necessary. Instead, a low insulin dosage would be more appropriate. By making this adjustment, the fuzzy system will better align with expected outcomes, and the overall performance of the system will improve. It is important to note that any modifications to the system should be thoroughly tested and validated to ensure that they do not introduce any unintended consequences or negative impacts on the system's performance.

After modifying the control rules, the control surface of the fuzzy system displays the expected behavior. By comparing Control Surface 1 before and after the rule update, as shown in Figure 17 and Figure 18 respectively, we can see that there is a significant improvement in the system's performance. Before the rule update, when the blood glucose level was 82mg/dl, which is considered within the normal range, the controller administered a high insulin dosage, which was not an expected outcome. However, after updating the rules, as observed in Figure 18, when the blood glucose level was 82mg/dl, the controller injected a very low dosage, which is an expected and desirable outcome. This improvement in the system's performance demonstrates the importance of regularly reviewing and updating the control rules in fuzzy systems to ensure that they align with expected outcomes and optimize the system's performance.

Figure 17 Comparison between the control surface of FIS1 with tuning rules and with update rules.

Figure 18 Comparison between the control surface of FIS2 with tuning rules and with update rules.

Conclusion

The use of fuzzy logic controllers (FLC) in closed-loop insulin delivery systems presents a promising alternative to traditional model-based controllers. FLCs allow clinicians to easily specify the level of glucose control based on the patient's clinical needs, and the flexibility and adaptability of the FLC allow for the refinement and updating of control rules to improve the accuracy of insulin dosing decisions. The Simulink model of the AP artificial system will serve as the basis for the design and application of the FLC. The rules of the FLC will be optimized by tuning them to enhance the system's performance. The optimization process will use a genetic algorithm to explore the parameter space and find an optimal set of control parameters, improving the system's ability to regulate blood glucose within the target range. It is important to note that further testing and validation are necessary to ensure the reliability and effectiveness of the AP system in real-world clinical settings. Incorporating other factors that may affect blood glucose levels, such as physical activity, stress, and medication, can provide a more comprehensive assessment of the system's performance. Additionally, regulatory and safety considerations must be taken into account for the implementation of the AP system in clinical practice.

Finally, the use of FLCs in closed-loop insulin delivery systems presents a promising approach for regulating blood glucose levels in diabetic patients. The ability to refine and update control rules and optimize the system's performance through a genetic algorithm provides greater flexibility and adaptability, improving the accuracy of insulin dosing decisions.

Acknowledgments

None.

Conflicts of interest

Authors declare that there is no conflict of interest.

References

  1. American Diabetes Association. Diagnosis and classification of diabetes mellitus. Diabetes care. 2014;37(1):S62–S67.
  2.  Abougarair A, Abdulhamid O, Adel E, et al. Intelligent control design for linear model of active suspension system. 30th International Conference on Microelectronics (IEEE): Tunisia; 2018.
  3. Clark M. Understanding ediabetes. John Wiley & Sons. 1 edition; 2004.
  4.  Abougarair JA. Model reference adaptive control and fuzzy optimal controller for mobile robot. Journal of Multidisciplinary Engineering Science and Technology. 2019;6(1):9722‒9728.
  5. Paul AG. A new approach to diabetic control: Fuzzy logic and insulin pump technology. Med Eng Phys. 2007;29(7):824–827.
  6. Elwefati S, Bakush M, Abougarair JA. Control of epidemic disease based optimization technique. 2021 IEEE 1st International Maghreb Meeting of the Conference on Sciences and Techniques of Automatic Control and Computer Engineering (MI-STA2021). 2021;25‒27.
  7. Gnan H, Oun A, Elwarshfani S. Implementation of a brain-computer interface for robotic arm control. 2021 IEEE 1st International Maghreb Meeting of the Conference on Sciences and Techniques of Automatic Control and Computer Engineering (MI-STA2021). 2021;25‒27.
  8. Soylu S, Danisman k, Sacu IE, et al. Closed-loop control of blood glucose  level in type1 diabetics :A simulation Study. 2013 8th International Conference on Electrical and Electronics Engineering (ELECO); 2013.
  9. Guariguata L, Whiting D, Weil C, et al. The International diabetes federation diabetes atlas methodology for estimating global and national prevalence of diabetes in adults. Diabetes Res Clin Pract. 2011;94(3):322–32.
  10. Abougarair JA, Ali S Elmolihi. Robust control and optimized parallel control double loop design for mobile robot. IAES International Journal of Robotics and Automation (IJRA). 2020;9(3):160‒170.
  11. Abogarair JA. Neural networks identification and control of mobile robot using adaptive neuro fuzzy inference system. ICEMIS'20: Proceedings of the 6th International Conference on Engineering & MIS; 2020.
  12. Saheri W, Shashoa NA, Abogarair JA. Recursive least squares algorithm for MISO CARAMA systems utilizing data filtering. 2021 IEEE 1st International Maghreb Meeting of the Conference on Sciences and Techniques of Automatic Control and Computer Engineering (MI-STA2021). 2021;25‒27.
  13. Saeedi P, Petersohn I, Salpea P, et al. Global and regional diabetes prevalence estimates for 2019 and projections for 2030 and 2045: results from the International Diabetes Federation Diabetes Atlas, 9th edition. Diabetes Res Clin Pract. 2019;157:107843.
  14. Richard M, Wang Y, Dassau E, et al. Proposed clinical application for tuning fuzzy logic controller of artificial pancreas utilizing a personalization factor. J Diabetes Sci Technol. 2010;4(4):913–922.
  15. Paul G. A new approach to diabetic control: Fuzzy logic and insulin pump technology. Med Eng Phys. 2007;29(7):824–827. 
  16. Roman H, Canonico V, Chassin LJ, et al. Nonlinear model predictive control of glucose concentration in Subjects with Type 1 Diabetes. Physiol Meas. 2004;25(4):905–920.
  17. Mathworks. Fuzzy Logic Toolbox and Global Optimization.
  18. Wilinska ME, Chassin LJ, Schaller HC, et al. Insulin kinetics in Type-1 diabetes: continuous and bolus delivery of rapid acting insulin. IEEE Trans Biomed Eng. 2005;52(1):3–12. 
  19. Abougarair A, Elmezughi M, Almaktoof A. Supervisory control and simulation of boiler drum water level. 2023 IEEE International Conference on Advanced Systems and Emergent Technologies (IC_ASET’2023); 2023.
  20. Emhemmed A, Salih O. Simulation analysis and control of wireless power transfer for implantable medical devices. IEEE 21st International Conference on Sciences and Techniques of Automatic Control and Computer Engineering (STA). 2022;19‒21.
  21. Abougarair AJ, Aldian AN, Mohamed KS, et al. Performance of anti-lock braking systems based on adaptive and intelligent control methodologies. Indonesian Journal of Electrical Engineering and Informatics. 2022;10(3).
  22. Abougarair AJ. Position and orientation control of a mobile robot using intelligent algorithms based hybrid control strategies. Journal of Engineering Research. 2022;34:67‒86.
  23. Arif MA, Antonio M, Sadek E, et al. Sliding mode control design for magnetic levitation system. Journal of Robotics and Control. 2022;3(6).
  24. Abougarair AJ, Mohamed KI, Mohamed MA, et al. Adaptive neural networks based robust output feedback controllers for nonlinear systems. International Journal of Robotics and Control Systems. 2022;2(1):37‒56.
  25. Wilinska ME, Chassin LJ, Schaller HC, et al. Insulin kinetics in Type-1 diabetes: Continuous and bolus delivery of rapid acting Insulin. IEEE Trans Biomed Eng. 2005;52(1):3–12.
  26. Abougarair AJ. Real time classification for robotic arm control based electromyographic Signal. 2022 IEEE 2st International Maghreb Meeting of the Conference on Sciences and Techniques of Automatic Control and Computer Engineering (MI-STA2022). 2022;23‒25.
  27. Abougarair AJ. Adaptive neural networks based optimal control for stabilizing nonlinear system. 2023 IEEE 3rd International Maghreb Meeting of the Conference on Sciences and Techniques of Automatic Control and Computer Engineering (MI-STA2023). 2023;21‒23.
  28. Buzkhar I. Modeling and control of a two‑wheeled robot machine with a handling mechanism. 2023 IEEE 3rd International Maghreb Meeting of the Conference on Sciences and Techniques of Automatic Control and Computer Engineering (MI-STA2023). 2023;21‒23.
Creative Commons Attribution License

©2023 Abougarair, et al. This is an open access article distributed under the terms of the, which permits unrestricted use, distribution, and build upon your work non-commercially.