Next Article in Journal
Optimal Performance of Photovoltaic-Powered Water Pumping System
Next Article in Special Issue
A Fuzzy-Based Fast Feature Selection Using Divide and Conquer Technique in Huge Dimension Dataset
Previous Article in Journal
On the Fractional-Order Complex Cosine Map: Fractal Analysis, Julia Set Control and Synchronization
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:

Performance Comparison between Type-1 and Type-2 Fuzzy Logic Control Applied to Insulin Pump Injection in Real Time for Patients with Diabetes

Autonomous University of Baja California, Tijuana 21500, Mexico
Tijuana Institute of Technology, Tijuana 22414, Mexico
Author to whom correspondence should be addressed.
Mathematics 2023, 11(3), 730;
Submission received: 13 January 2023 / Revised: 28 January 2023 / Accepted: 28 January 2023 / Published: 1 February 2023


Nowadays, type 1 diabetes is unfortunately one of the most common diseases, and people tend to develop it due to external factors or by hereditary factors. If is not treated, this disease can generate serious consequences to people’s health, such as heart disease, neuropathy, pregnancy complications, eye damage, etc. Stress can also affect the condition of patients with diabetes, and our motivation in this work is to help manage the health of people with type 1 diabetes. The contribution of this paper is in presenting the implementation of type-1 and type-2 fuzzy controllers to control the insulin dose to be applied in people with type 1 diabetes in real time and in stressful situations. First, a diagram for the insulin control is presented; second, type-1 and type-2 fuzzy controllers are designed and tested on the insulin pump in real time over a 24 h period covering one day; then, a comparative analysis of the performance of these two controllers using a statistical test is presented with the aim of maintaining a stable health condition of people through an optimal insulin supply. In the model for the insulin control, perturbations (noise/stress levels) were added to find if our proposed fuzzy controller has good insulin control in situations that could generate disturbances in the patient, and the results found were significant; in most of the tests carried out, the type-2 controller proved to be more stable and efficient; more information can be found in the discussion section.

1. Introduction

At present, technology has evolved a great deal, and several applications have been made using intelligent techniques, for example, in the optimization of processes and reduction of times applied in industry and also in some process to improve the quality of life for people. For example, mechatronic devices can be a physical part of people, for example, an arm or leg; smaller devices can measure heart rate and notify an emergency contact if the person’s health is in danger or even call automatically to the ambulance, and there are also continuous pressure monitoring devices that provide more control over a person’s health, especially older people. Many processes that were previously manual today have been automated for better monitoring and control for people, such as the artificial pancreas, which is an automated process of a human organ that helps regulate a specific function to improve people’s quality of life. We know that the most important thing for human beings today is health because without it, we have nothing. One can enjoy money, comforts, friends, and trips, but if one does not have health, one cannot enjoy any of these things. There are many factors and different diseases that attack human life, and some of them can be controlled with medication, while some of them cannot. Hereditary diseases or diseases caused by an external factor also have a great impact on people’s living conditions and state of mind. One of the most common diseases is diabetes, and there are different variants of this disease [1].
In this research, the focus is specifically for type 1 diabetes. It was mentioned that technology is used for various benefits, including people’s health, and on this occasion, for the control of diabetes, there is an insulin pump. These devices are used to avoid injections and make it easier to administer insulin doses. A good controller is needed to have a good control of the daily insulin dose in real time for patients, and this is where this research focuses: on developing type-1 and type-2 fuzzy systems for controlling the insulin dose in real time.
It is important to mention that in the literature, there are few works related to our proposal, and the most relevant are mentioned below. In [2], the authors of this work developed an embedded system using an FPGA microcontroller for insulin injection; however they did not integrate intelligent techniques into their work. Furthermore, in [3], a case study of insulin injection pumps was presented to analyze the behavior of users of different ages and stages of diabetes in a controlled space. In [4], a comparison was performed of two hybrid closed-loop systems in adolescents and young adults with type 1 diabetes (FLAIR). Here, a multicenter, randomized, crossover trial is presented, and the authors of this paper carry out a comparative study between different countries with the aim of testing whether the new automatic methods are more efficient than traditional manual methods.
This paper is organized as follows: Section 2 presents the basic concepts to better understand the application. The description of the problem and the methodology are presented in Section 3. Results of type-1 and type-2 fuzzy systems and their comparison are presented in Section 4, and finally, in Section 5, the conclusions are presented.

2. Background and Basic Concepts

Some basic concepts such as type 1 diabetes, type-1 and type-2 fuzzy systems, artificial pancreas, intelligent control, and continuous insulin pump are explained in this section to understand better the application and the contribution.

2.1. Type 1 Diabetes

Type 1 diabetes disease is considered the second most chronic disease and most frequently presents in childhood [5]. When we talk about type 1 diabetes, we are referring to a condition where the pancreas does not produce insulin, and this means that there is an excess of glucose that remains in the blood [6], for which it is important to take into account the desired glucose levels [7]. If these problems persist, and no attention is paid, it can generate several serious problems, for example, in the heart [8], eyes, kidneys, etc. In these times of the COVID-19 pandemic, some patients who had certain diseases [9] including diabetes showed greater complications when infected and were more vulnerable [10,11].
Constant, real-time monitoring is essential to make medical decisions; if a real-time monitor is added for each patient, with personalized insulin supply control for each person, better results can be obtained. Today, there are various technologies that have been added to treat and control type 1 diabetes. Ordinarily, intramuscular insulin supply was common, which is one of the best known approaches, but there are also glucose monitoring devices. Glucose monitoring allows people to know if their glycemic goals are being met. Previously, the glucose level was measured in the urine using a copper reagent, but today, there are portable devices that can measure it based on a drop of blood or by using a continuous monitoring device. In the search for alternatives for patients with diabetes, a predictive suspension pumps with low glucose level (PLGS) can be found; these devices that use this technology interrupt the administration of insulin when it is detected so that the glucose value of the sensor reaches or decreases to the glucose limit within a period of time [12].
There are several kinds of devices that are coming into the market with the objective of facilitating glucose control for people with diabetes [13]. Moreover, it is important to mention that different technological tools, computing techniques, and mathematical models are used to research and develop new advances for people with type 1 diabetes. For example, in [14], mathematical models are presented to help to understand and predict the dynamics within the glucose regulation system, and this part is very important because based on these models’ possible behaviors, methods can be developed and contribute to the health of people and to other work, where they also use techniques to predict glucose concentration using image processing and machine learning [15]. There is also what today is called an artificial pancreas, which is glucose-sensitive automated insulin administration and works using computer techniques such as PID control, i.e., combining glucose control with insulin administration; in short, it is a system that provides automatic control of blood glucose levels and assists in the administration of insulin. Several studies have been carried out, and it has been seen that insulin pumps help to improve the quality of people’s lives [16] since they provide better control in daily social activities as well as the use of the different interfaces developed as in [17], which presents two ways to implement an MPC (model predictive control) for a smartphone-based artificial pancreas system. There are also investigations where the authors [18] performed a system based on derivatives of fractional order with the objective of regulating the supply for an insulin pump with the objective of regulating diabetes. Therefore, though we can continue giving different examples, it is easy to see that researchers want to reach the same goal, which is to obtain support for people with type 1 diabetes.

Diabetes and Stress

There are many myths that say that a scare can cause diabetes, but there is no established foundation; however, for people who have this tendency, increased stress can accelerate the beginning of this disease, and a person who is constantly subjected to stress can develop health problems. Stress is characterized by violent nervous tension that is maintained in addition to being accompanied by a significant degree of anxiety, and it can be said that there are different types of stress such as psychological, social, economic, physiological, and psychosocial [19,20]. When a person is under stress levels, they can have symptoms such as headache, chest and back and neck pain, cold sweats, insomnia, etc., in some systems such as the metabolic, cardiovascular, and gastrointestinal systems, among others. Only in Latin America is work stress a psychosocial factor, and it is considered an epidemic of modern working life. When some people are under stress, they are susceptible to consuming an excess of calories, which can cause weight gain and variations in their glucose levels, which is especially concerning in people with diabetes. In addition, the emotional stress generated by living with a person with diabetes can negatively affect treatment adherence, quality of life, and disease control [21].
Stress can cause an increase in blood glucose levels. The increase in stress at chronic levels will depend on the vulnerability of each person, their ability to protect and respond to the body, and their self-esteem as well as the social support they have [22]. Each of these factors is very important because each can result in a stress with high levels, which it can generate a significant change in glucose, and if the control is not the adequate at that time, it could generate significant changes in people’s health. Different levels of stress have different effects on each person. For example, some hardly eat, while others eat an excessive amount, and some turn to junk food or try to over-exercise when they feel stressed to try to release it. However, there is also oxidative stress, which is a process that our body generates before various situations that have to do with the food that is ingested, solar radiation, pollution, and even excessive exercise. Oxidative stress plays a very important role in the development of diabetes complications due to excessive oxidative activity [23]. Just as there is stress that affects people with diabetes, there are also techniques that can be used to manage stress and maintain metabolic control, such as paying attention to one’s breathing, social support, and progressive relaxation, among others [24].

2.2. Fuzzy Logic and Applications

Nowadays, systems that make use of fuzzy logic can be visualized in a more common way and can be seen in everyday life, such as in household appliances, industrial processes, medical measurement instruments, etc. Since fuzzy logic was proposed, we have witnessed that its applications have increased to this day. It was originally proposed in 1965 by Professor Zadeh, who presented the theory of fuzzy sets to deal with imprecision and uncertainty. A fuzzy set is defined as a class of objects that have degrees of membership, and these present the degree of truth with which a certain element belongs to a fuzzy set [25,26,27]. Different examples are presented to explain the fuzzy set concept, and many times, the word “fuzzy” itself is misunderstood in its meaning. A simple example is explained using the height of people: when it is said that a person is tall, for some, being tall refers to measuring more than 1.90 m, but for others, being tall refers to measuring more than 1.70 m. Each person has their perspective, so ranges can be managed; that is, membership functions such that, for example, height can be represented with more datasets (see Figure 1).
In Figure 1, it can be seen that there are three linguistic values, namely short, medium, and tall, that can be used to classify people based on their height; for example, a person who is 1.68 m tall could be considered to be of average height, and a person who is 1.70 m could be in the range of consideration as a tall person but could also be considered as medium. This is just one example of how a fuzzy system would be considered, but it is also important to mention that one of the first commercial applications of fuzzy logic was in the control of cement kilns and later in navigation systems for automobiles [28]. One of the areas where fuzzy logic is implemented in a very competitive way is in the control area, making different types of controllers to improve the performance of applications and obtain a better result in the implementation.
Type-1 fuzzy systems are the most used, but other types of systems have also been found more recently, such as generalized systems and type-2 fuzzy systems, because the values used in the development of type-1 membership are considered to be accurate [29]. However, if the level of information is not adequate to establish the membership functions, then it would not work to establish the membership functions with this precision, but if it is regarding fuzzy systems that can be further generalized due to their interval values, these intervals could become fuzzy [30]. Therefore, each interval of the membership function would become an ordinary fuzzy set, and this is what is called an interval type-2 fuzzy set [31], which can be visualized in Figure 2.
Mathematical definition of membership function type-1 is obtained by in Equation (1):
A = {(x, µA(x)) | x Є X}
Let us consider fuzzy set A, A = {(x, µA(x)) | x Є X}, where µA(x) is called the membership function for the fuzzy set A. X is referred to as the universe. The membership function associates each element x Є X with a value in the interval [0, 1].
Mathematical definition of membership function type-2:
A type-2 fuzzy set to be named can be represented as follows [32] in Equation (2):
A ˜ = { ( ( x , u ) , μ A ˜ ( x , u ) ) | x   X ,   u   J x   [ 0 , 1 ] }
A type-2 fuzzy set (also called a generalized type-2 fuzzy set) denoted A ˜ , also called membership function of A ˜ , is about the product cartesian X × [0, 1] in [0, 1], where X is the universe for the primary variable of A ˜ , x . the membership function of A ˜ is represented as μ A ˜ ( x , u ) or μ A ˜ , and it is called membership function type-2 (Equation (2)).
Fuzzy systems have had applications in several areas, and one of them is medicine; for example, in [33], the authors mention that there are different patients, and each one has different behavior patterns and coordination, especially in patients with diabetic cardiomyopathy. Since they have Parkinson’s, they used a fuzzy system for the prediction of falls and the estimation of diabetic cardiomyopathy disorders, and as inputs, they took the height, gyroscope, age and weight of the patients. The outputs were the RMS error, estimation, and identification. The test was performed with 20 patients, and good results were obtained. The solution was fast and in real-time conditions. The fuzzy systems used were type-1, and in this example, we can also see fuzzy systems that are applied to patients to control their hypertension during anesthesia [34] as well as to diagnose certain types of diseases through these fuzzy systems and detection of cardiac arrhythmias [35,36].
In [37], studies developed from 2007 to 2018 are presented, including the current state of the use of fuzzy systems in the field of medicine for the diagnosis of diseases, and it is demonstrated that fuzzy logic has been used with satisfactory results. In the area of medicine, different methodologies are used to diagnose the disease by analyzing the history, symptoms, and clinical data of people. The study presents the benefits of using fuzzy logic for this area, which is an important detail to mention. These systems could be available to people, and some important issues could be identified before going directly to the doctor or even helping through medicine to diagnose diseases. Some areas within medicine where fuzzy systems have been applied are in the heart, breast cancer, cholera, brain tumor, asthma, liver, viral diseases, etc. [38,39,40]. Many applications begin with developing studies with type-1 fuzzy systems but when, for example, the images or databases have a high level of noise or uncertainty, the outcome can be unsure. In these cases, type-2 fuzzy systems could work better and obtain better performance and model better the uncertainty.
Some studies in medicine also use fuzzy type-2 systems. For example, in [41], the authors present a proposal to design a robust and optimal controller for the supply of medicine for the automatic control of blood pressure, as all human systems also have uncertainty problems, such as variations in certain parameters, disturbances, or external noises. That is why for each patient with different characteristics, an adequate supply of medicine is needed for good control. On many occasions, PID controllers have been used, even in controllers for health at a commercial level, but in some cases, with the management of uncertainty, a more robust control would be needed that adapts to the characteristics of each individual since all the physiological variables that a person may have are of an uncertain nature and can negatively affect their health, which is why in these cases tests are carried out with type-1 fuzzy systems and then type-2 [42] to better model the uncertainty. In the area of diabetes, research papers have also emerged, and everything possible is done to contribute to scientific knowledge and provide work ideas so that in the future, these ideas are taken to improve applications. In [43], the authors present a fuzzy system to classify the glycemic index for patients with type 2 diabetes into four types: great decrease, decreases followed by stabilizing, stabilizing, and then increasing. In this research, some authors such as in [44,45] also performed a fuzzy system for glucose control in diabetic patients. Many intelligent techniques are applied in several health areas to improve the quality of people’s lives [46,47,48,49,50].

3. Problem Description

As previously mentioned, type 1 diabetes is a disease that can have serious health complications if it is not treated properly. Research has been carried out in relation to this disease, and controllers have even been designed for the delivery of the necessary insulin. However, there are many different types of extra problems unique to each individual, such as different situations involving stress or some other external problem that can influence their glucose levels. In this situation, a common controller will not be able to completely regulate what we call uncertainty or noise, which can represent the different levels of stress experienced by people or the external factors that influence each one of them, affecting their glucose levels in real time. The human, as mentioned above, can experience a great deal of uncertainty, which in this case will be called noise, which will be added to the system as an extra signal. The real-time controller will model the noise, and in the event of glucose disturbances, the insulin pump can supply the optimal dose needed to maintain control of the diabetes with the aim of improving people’s quality of life.
The human body generates signals before any behavior, and in this case, the noise is represented by the signal established by the following equation:
y = l b + ( u b l b ) .   r a n d ( s p f , 1 )
The working model can be seen in Figure 3.
The development model contemplates a module named noise, which is represented by a module that generates a signal that can be small or very high so that the system models the adequate supply of insulin in different levels of uncertainty that the patient may have. Three types of error were considered: root mean square error (RMSE), mean square error (MSE), and mean absolute error (MAE) (see Equations (4)–(6)).
R M S E = 1 N i = 1 N ( r e a l   v a l u e i e s t i m a t e d   v a l u e i ) 2
M S E = 1 N i = 1 N ( r e a l   v a l u e i e s t i m a t e d   v a l u e i ) 2
M A E = 1 N i = 1 N | r e a l   v a l u e i e s t i m a t e d   v a l u e i |
where N is the number of errors, and before using the fuzzy systems, the performance was simulated using PID control; then, the type-1 and type-2 fuzzy systems were designed to compared results and to achieve the control of the insulin in each person. The fuzzy system has one input and one output.

4. Simulation Results

As the first execution, PID was performed, and then, different types of fuzzy systems were design to test the model using three or five membership functions. By changing the rules, 15 different fuzzy inference systems (fis) were developed, and results for the PID controller and the 15 fuzzy systems are presented in Table 1.
When the type-1 fuzzy system was developed with different membership functions and rules, the error decreased until 11.871 with the fis 13. The parameters of the best fuzzy system used to achieve the control of the insulin pump injection are presented in Figure 4, and rules are illustrated in Table 2. In this case, the linguistic values for the variables used in the set rules are VL, very low; L, low; M, medium; H, high; and VH, very high. The number of rules is the combination of the input and output membership functions. It is important to mention to the reader that the fis number of 13 was the one that obtained the best result for the 15 tests carried out.
The parameters of the membership functions are presented in Table 3.
After obtaining results with the type-1 fuzzy systems, the type-2 fuzzy system tests were performed, and results are shown in Table 4. The best type-2 fuzzy system is presented in Figure 5, and parameters of each membership functions are presented in Table 5.
After obtaining results using type-1 and type-2 fuzzy systems with three different types of error, a statistical test was performed as presented in Table 6, Table 7 and Table 8.
As can be sees in Table 4, Table 5 and Table 6, there is statistical evidence to say that there is a significant difference in the results presented although we used different types to calculate the error with regard to type-2 (more than 95% confidence). Basically, type-2 fuzzy systems generated a significant increase in the controller, enabling better control for the insulin dose in response to disturbances.
The statistical test was a critical point to test the insulin control supply in real time using fuzzy systems when the type-1 fuzzy system the minimum error was 11.87, as mentioned above. Taking into account that people’s health is very important, system with greater robustness, such as the fuzzy type-2 system, was developed, which in many cases can give better results because it has better response in uncertainty. When we performed the tests with the ype-2 fuzzy system, the behavior of the control improved, and we can verify it with the result of the statistical tests that were carried out previously.

5. Conclusions

Health is one of the most valuable things that human beings have because if they are not healthy, in addition to affecting their personal health, it can have a negative impact on the people around them. The importance of having an optimal control of disease is paramount; in this case, a person with type 1 diabetes can stop worrying about their optimal dose supplied by the insulin pump in case they have a stressful situation or some external or even internal factor that could affect their glucose levels, which would improve the emotional condition of the patient and family members. Fuzzy systems, thanks to their versatility, are adaptable to several characteristics and situations that the patient may present. In this case, it was verified that type-2 fuzzy systems for insulin supply pump control work better than type-1 fuzzy systems and the PID since the patient is exposed to situations where noise levels could occur at low levels or at high levels of uncertainty, and the fuzzy model type-2 helps in these cases. In the last section of the paper, a statistical Student’s t-test was performed to prove the efficiency of the type-1 and type-2 fuzzy systems, and results showed that a type-2 fuzzy system can model the uncertainty in a better way to obtain the best control of insulin using pump injection in real time. The statistical comparison was a very important part of the results, as it demonstrates a significant difference in real-time insulin control. These results show with more than 95% confidence that using type-2 fuzzy systems to control insulin supply works better, and people can have an optimal insulin supply in real time, with no need to manually check. The statistical test was required to be able to numerically visualize the operation of type-1 and type-2 fuzzy systems and verify which is the best for this type of case study.

Author Contributions

Conceptualization, L.C. and C.C.; methodology, L.C.; software, C.C.; validation, L.C., C.C. and O.C.; formal analysis, O.C.; investigation, C.C. and L.C.; writing—review and editing, L.C., O.C. and C.C. All authors have read and agreed to the published version of the manuscript.


This research received no external funding.

Data Availability Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest.


  1. Association, A.D. Classification and Diagnosis of Diabetes: Standards of Medical Care in Diabetes—2020. Diabetes Care 2019, 43 (Suppl. 1), S14–S31. [Google Scholar] [CrossRef] [PubMed]
  2. Ali, W.G.; Nagib, G. Embedded Control Design for Insulin Pump. In Advanced Manufacturing Systems, ICMSE 2011; Advanced Materials Research; Trans Tech Publications Ltd.: Stafa-Zurich, Switzerland, 2011; Volume 201, pp. 2399–2404. [Google Scholar] [CrossRef]
  3. Karges, B.; Schwandt, A.; Heidtmann, B.; Kordonouri, O.; Binder, E.; Schierloh, U.; Boettcher, C.; Kapellen, T.; Rosenbauer, J.; Holl, R.W. Association of Insulin Pump Therapy vs. Insulin Injection Therapy With Severe Hypoglycemia, Ketoacidosis, and Glycemic Control Among Children, Adolescents, and Young Adults With Type 1 Diabetes. JAMA 2017, 318, 1358–1366. [Google Scholar] [CrossRef]
  4. Bergenstal, R.M.; Nimri, R.; Beck, R.W.; Criego, A.; Laffel, L.; Schatz, D.; Battelino, T.; Danne, T.; Weinzimer, S.A.; Sibayan, J.; et al. A Comparison of Two Hybrid Closed-Loop Systems in Adolescents and Young Adults with Type 1 Diabetes (FLAIR): A Multicentre, Randomised, Crossover Trial. Lancet 2021, 397, 208–219. [Google Scholar] [CrossRef]
  5. Álvarez Casaño, M.; del Mar Alonso Montejo, M.; Leiva Gea, I.; Jiménez Hinojosa, J.M.; Santos Mata, M.Á.; Macías, F.; del Mar Romero Pérez, M.; de Toro, M.; Martínez, G.; Munguira, P.; et al. Estudio de Calidad de Vida y Adherencia Al Tratamiento En Pacientes de 2 a 16 Años Con Diabetes Mellitus Tipo 1 En Andalucía. An. Pediatría 2021, 94, 75–81. [Google Scholar] [CrossRef] [PubMed]
  6. DeMarsilis, A.; Mantzoros, C.S. The Continuum of Insulin Development Viewed in the Context of a Collaborative Process toward Leveraging Science to Save Lives: Following the Trail of Publications and Patents One Century after Insulin’s First Use in Humans. Metabolism 2022, 135, 155251. [Google Scholar] [CrossRef] [PubMed]
  7. Díez Gutiérrez, B. Curso Básico Sobre Diabetes. Tema 1. Clasificación, Diagnóstico y Complicaciones. Farm. Prof. 2016, 30, 36–43. [Google Scholar] [CrossRef]
  8. Saldarriaga-Giraldo, C.; Navas, V.; Morales, C. De La Diabetes a La Insuficiencia Cardiaca ¿Existe La Miocardiopatía Diabética? Rev. Colomb. Cardiol. 2020, 27, 12–16. [Google Scholar] [CrossRef]
  9. Tittel, S.R.; Rosenbauer, J.; Kamrath, C.; Ziegler, J.; Reschke, F.; Hammersen, J.; Mönkemöller, K.; Pappa, A.; Kapellen, T.; Holl, R.W. Did the COVID-19 Lockdown Affect the Incidence of Pediatric Type 1 Diabetes in Germany? Diabetes Care 2020, 43, e172–e173. [Google Scholar] [CrossRef]
  10. Alonso, N.; Batule, S. COVID-19 y Diabetes Mellitus. Importancia Del Control Glucémico. Clínica E Investig. En Arterioscler. 2021, 33, 148–150. [Google Scholar] [CrossRef]
  11. Hernández Herrero, M.; Terradas Mercader, P.; Latorre Martinez, E.; Feliu Rovira, A.; Rodríguez Zaragoza, N.; Parada Ricart, E. Nuevos Diagnósticos de Diabetes Mellitus Tipo 1 En Niños Durante La Pandemia COVID-19. Estudio Multicéntrico Regional En España. Endocrinol. Diabetes Y Nutr. 2022, 69, 709–714. [Google Scholar] [CrossRef]
  12. Dovc, K.; Battelino, T. Evolution of Diabetes Technology. Endocrinol. Metab. Clin. North Am. 2020, 49, 1–18. [Google Scholar] [CrossRef]
  13. Barrio Castellanos, R. Avances En El Tratamiento de La Diabetes Tipo 1 Pediátrica. An. Pediatría 2021, 94, 65–67. [Google Scholar] [CrossRef] [PubMed]
  14. Huard, B.; Kirkham, G. Mathematical Modelling of Glucose Dynamics. Curr. Opin. Endocr. Metab. Res. 2022, 25, 100379. [Google Scholar] [CrossRef]
  15. Poddar, A.; Rangwani, N.; Palekar, S.; Kalambe, J. Glucose Monitoring System Using Machine Learning. Mater. Today Proc. 2022, 73, 100–107. [Google Scholar] [CrossRef]
  16. Haynes, E.; Ley, M.; Talbot, P.; Dunbar, M.; Cummings, E. Insulin Pump Therapy Improves Quality of Life of Young Patients With Type 1 Diabetes Enrolled in a Government-Funded Insulin Pump Program: A Qualitative Study. Can. J. Diabetes 2021, 45, 395–402. [Google Scholar] [CrossRef] [PubMed]
  17. Chandrasekhar, A.; Padhi, R. Optimization Techniques for Online MPC in Android Smartphones for Artificial Pancreas: A Comparison Study. IFAC-PapersOnLine 2022, 55, 561–566. [Google Scholar] [CrossRef]
  18. Farman, M.; Saleem, M.U.; Ahmad, A.; Imtiaz, S.; Tabassum, M.F.; Akram, S.; Ahmad, M.O. A Control of Glucose Level in Insulin Therapies for the Development of Artificial Pancreas by Atangana Baleanu Derivative. Alexandria Eng. J. 2020, 59, 2639–2648. [Google Scholar] [CrossRef]
  19. Aguilar, M.E.B. El Estrés y Su Influencia En La Calidad de Vida. Multimed 2017, 21, 971–982. [Google Scholar]
  20. Alberto, R.S.C. Procesos Complejos Del Estrés: Dinámica No-Lineal; Universidad Nacional de Colombia: Bogotá, Colombia, 2012. [Google Scholar]
  21. Beléndez Vázquez, M.; Lorente Armendáriz, I.; Maderuelo Labrador, M. Estrés Emocional y Calidad de Vida En Personas Con Diabetes y Sus Familiares. Gac. Sanit. 2015, 29, 300–303. [Google Scholar] [CrossRef]
  22. Juárez Jiménez, M.V. Influencia Del Estrés En La Diabetes Mellitus. NPunto 2020, 3, 91–124. [Google Scholar]
  23. Storino, M.A.; Contreras, M.A.; Rojano, J.; Serrano, R.; Nouel, A. Complicaciones de La Diabetes y Su Asociación Con El Estrés Oxidativo: Un Viaje Hacia El Daño Endotelial. Rev. Colomb. Cardiol. 2014, 21, 392–398. [Google Scholar] [CrossRef] [Green Version]
  24. Montes Delgado, R.; Oropeza Tena, R.; Pedroza Cabrera, F.J.; Verdugo Lucero, J.C.; Enríquez Bielma, J.F. Manejo Del Estrés Para El Control Metabólico de Personas Con Diabetes Mellitus Tipo 2. En-Claves Del Pensam. 2013, 7, 67–87. [Google Scholar]
  25. Simić, D.; Kovačević, I.; Svirčević, V.; Simić, S. 50 Years of Fuzzy Set Theory and Models for Supplier Assessment and Selection: A Literature Review. J. Appl. Log. 2017, 24, 85–96. [Google Scholar] [CrossRef]
  26. Lotfi, A.; Zadeh, R.A.A. Fuzzy Logic Theory and Applications: Part I and Part I; World Scientific Publishing: Singapore, 2018. [Google Scholar] [CrossRef]
  27. Höhle, U. On the Mathematical Foundations of Fuzzy Set Theory. Fuzzy Sets Syst. 2022, 444, 1–9. [Google Scholar] [CrossRef]
  28. Voskoglou, M. Fuzzy Sets, Fuzzy Logic and Their Applications; MDPI-Multidisciplinary Digital Publishing Institute: Basel, Switzerland, 2020. [Google Scholar] [CrossRef]
  29. Mendel, J.M. Uncertain Rule-Based Fuzzy Systems Introduction and New Directions, 2nd ed.; Springer: Cham, Switzerland, 2017. [Google Scholar] [CrossRef]
  30. Timothy, J.R. Fuzzy Logic with Engineering Applications, 3rd ed.; Wiley: New York, NY, USA, 2010. [Google Scholar]
  31. Castillo, O.; Aguilar, L.T. Background on Type-1 and Type-2 Fuzzy Logic BT—Type-2 Fuzzy Logic in Control of Nonsmooth Systems: Theoretical Concepts and Applications; Castillo, O., Aguilar, L.T., Eds.; Springer International Publishing: Cham, Switzerland, 2019; pp. 5–19. [Google Scholar] [CrossRef]
  32. Najariyan, M.; Mazandarani, M.; John, R. Type-2 Fuzzy Linear Systems. Granul. Comput. 2017, 2, 175–186. [Google Scholar] [CrossRef]
  33. Sharma, N.; Sampath Dakshina Murthy, A.; Karthikeyan, T.; Usha Kumari, C.; Omkar Lakshmi Jagan, B. Gait Diagnosis Using Fuzzy Logic with Wearable Tech for Prolonged Disorders of Diabetic Cardiomyopathy. Mater. Today Proc. 2020, online. [Google Scholar] [CrossRef]
  34. Oshita, S.; Nakakimura, K.; Sakabe, T. Hypertension Control during Anesthesia. Fuzzy Logic Regulation of Nicardipine Infusion. IEEE Eng. Med. Biol. Mag. 1994, 13, 667–670. [Google Scholar] [CrossRef]
  35. Kora, P.; Meenakshi, K.; Swaraja, K.; Rajani, A.; Kafiul Islam, M. Detection of Cardiac Arrhythmia Using Fuzzy Logic. Inform. Med. Unlocked 2019, 17, 100257. [Google Scholar] [CrossRef]
  36. Iancu, I. Heart Disease Diagnosis Based on Mediative Fuzzy Logic. Artif. Intell. Med. 2018, 89, 51–60. [Google Scholar] [CrossRef]
  37. Thukral, S.; Rana, V. Versatility of Fuzzy Logic in Chronic Diseases: A Review. Med. Hypotheses 2019, 122, 150–156. [Google Scholar] [CrossRef]
  38. Kumar, A.; Raj, R. Design of a Fractional Order Two Layer Fuzzy Logic Controller for Drug Delivery to Regulate Blood Pressure. Biomed. Signal Process. Control 2022, 78, 104024. [Google Scholar] [CrossRef]
  39. Thakkar, H.; Shah, V.; Yagnik, H.; Shah, M. Comparative Anatomization of Data Mining and Fuzzy Logic Techniques Used in Diabetes Prognosis. Clin. eHealth 2021, 4, 12–23. [Google Scholar] [CrossRef]
  40. Arji, G.; Ahmadi, H.; Nilashi, M.; Rashid, T.A.; Ahmed, O.H.; Aljojo, N.; Zainol, A. Fuzzy Logic Approach for Infectious Disease Diagnosis: A Methodical Evaluation, Literature and Classification. Biocybern. Biomed. Eng. 2019, 39, 937–955. [Google Scholar] [CrossRef]
  41. Sharma, R.; Deepak, K.K.; Gaur, P.; Joshi, D. An Optimal Interval Type-2 Fuzzy Logic Control Based Closed-Loop Drug Administration to Regulate the Mean Arterial Blood Pressure. Comput. Methods Programs Biomed. 2020, 185, 105167. [Google Scholar] [CrossRef] [PubMed]
  42. Doctor, F.; Syue, C.-H.; Liu, Y.-X.; Shieh, J.-S.; Iqbal, R. Type-2 Fuzzy Sets Applied to Multivariable Self-Organizing Fuzzy Logic Controllers for Regulating Anesthesia. Appl. Soft Comput. 2016, 38, 872–889. [Google Scholar] [CrossRef]
  43. Bressan, G.M.; Azevedo, B.F.; de Souza, R.M. A Fuzzy Approach for Diabetes Mellitus Type 2 Classification. Brazilian Arch. Biol. Technol. 2020, 63. [Google Scholar] [CrossRef]
  44. Zhu, K.Y.; Liu, W.D.; Xiao, Y. Application of Fuzzy Logic Control for Regulation of Glucose Level of Diabetic Patient BT-Machine Learning in Healthcare Informatics; Dua, S., Acharya, U.R., Dua, P., Eds.; Springer: Berlin/Heidelberg, Germany, 2014; pp. 47–64. [Google Scholar] [CrossRef]
  45. Asadi, S.; Nekoukar, V. Adaptive Fuzzy Integral Sliding Mode Control of Blood Glucose Level in Patients with Type 1 Diabetes: In Silico Studies. Math. Biosci. 2018, 305, 122–132. [Google Scholar] [CrossRef] [PubMed]
  46. Sharma, A.; Nilam; Singh, H.P. Computer-Controlled Diabetes Disease Diagnosis Technique Based on Fuzzy Inference Structure for Insulin-Dependent Patients. Appl. Intell. 2023, 53, 1945–1958. [Google Scholar] [CrossRef]
  47. Sohrabi, M.; Zandieh, M.; Shokouhifar, M. Sustainable Inventory Management in Blood Banks Considering Health Equity Using a Combined Metaheuristic-Based Robust Fuzzy Stochastic Programming. Socioecon. Plann. Sci. 2022, 101462. [Google Scholar] [CrossRef]
  48. Ghorbani, A.; Davoodi, F.; Zamanifar, K. Using Type-2 Fuzzy Ontology to Improve Semantic Interoperability for Healthcare and Diagnosis of Depression. Artif. Intell. Med. 2023, 135, 102452. [Google Scholar] [CrossRef]
  49. Xiao, G.; Xiao, Y.; Ni, A.; Zhang, C.; Zong, F. Exploring influence mechanism of bikesharing on the use of public transportation—A case of Shanghai. Transp. Lett. 2022, 1–9. [Google Scholar] [CrossRef]
  50. Chen, X.; Wu, S.; Shi, C.; Huang, Y.; Yang, Y.; Ke, R.; Zhao, J. Sensing data supported traffic flow prediction via denoising schemes and ANN: A comparison. IEEE Sens. J. 2020, 20, 14317–14328. [Google Scholar] [CrossRef]
Figure 1. Fuzzy set representation.
Figure 1. Fuzzy set representation.
Mathematics 11 00730 g001
Figure 2. The membership function representation: (a) Type-1 fuzzy membership function; (b) type-2 fuzzy membership function.
Figure 2. The membership function representation: (a) Type-1 fuzzy membership function; (b) type-2 fuzzy membership function.
Mathematics 11 00730 g002
Figure 3. Diagram for the insulin control.
Figure 3. Diagram for the insulin control.
Mathematics 11 00730 g003
Figure 4. Best type-1 fuzzy system to control the insulin pump injection.
Figure 4. Best type-1 fuzzy system to control the insulin pump injection.
Mathematics 11 00730 g004
Figure 5. Best type-2 fuzzy system to control the insulin pump injection.
Figure 5. Best type-2 fuzzy system to control the insulin pump injection.
Mathematics 11 00730 g005
Table 1. Results for the PID and type-1 fuzzy control for optimal supply of insulin.
Table 1. Results for the PID and type-1 fuzzy control for optimal supply of insulin.
ControllerRMSE ErrorMAE ErrorMSE Error
Fuzzy controller
RMSE errorMAE errorMSE error
fis 128.81027.560830.003
fis 220.34715.710413.990
fis 326.97321.559727.514
fis 419.14914.562366.694
fis 518.27113.746333.821
fis 617.64013.150311.176
fis 719.31814.750373.199
fis 819.74515.144389.882
fis 916.78315.180281.679
fis 1011.8838.950141.201
fis 1111.8748.879140.979
fis 1211.9128.960141.892
fis 1311.8718.908140.911
fis 1411.9558.975142.929
fis 1515.65511.375245.088
Table 2. Rules used in the type-1 fuzzy system.
Table 2. Rules used in the type-1 fuzzy system.
Table 3. Parameters of the type-1 membership functions.
Table 3. Parameters of the type-1 membership functions.
Function Type
InputVLGaussian3.382 1.01 × 10−15
LGaussian3.85 14.45
MTriangular24.56 30.58 35.1
HGaussian3.542 42.97
VHGaussian5.586 64.81
OutputLGaussian0.5763 0.9286
MTriangular2.726 3.276 3.926
HGaussian0.5174 5.761
Table 4. Results for the type-2 fuzzy control for optimal supply of insulin.
Table 4. Results for the type-2 fuzzy control for optimal supply of insulin.
Fuzzy Controller
RMSE ErrorMAE ErrorMSE Error
Table 5. Parameters of the type-2 membership functions.
Table 5. Parameters of the type-2 membership functions.
Function Type
InputVLGaussian7.43 −10.1 7.114 −4.21
LGaussian7.43 14.8 6.649 20.7
MTriangular14.6 31.2 35.1 24.7 36.2 39.722
HGaussian5.6 38.529 4.99 44.429
VHGaussian7.43 64.887 7.43 70.787
OutputLGaussian0.862 −0.542 0.759 0.731
MTriangular1.791 3.258 3.841 2.621 3.931 4.941
HGaussian1.408 7.29 1.02 8.03
Table 6. Results for Student’s t-test using RMSE error in type-1 and type-2 fuzzy controllers.
Table 6. Results for Student’s t-test using RMSE error in type-1 and type-2 fuzzy controllers.
ControllerNMeanDeviation Std.Mean of Std.
T value = 7.58; p-value = 0.000; DF = 28
Table 7. Results for Student’s t-test using MAE error in type-1 and type-2 fuzzy controllers.
Table 7. Results for Student’s t-test using MAE error in type-1 and type-2 fuzzy controllers.
ControllerNMeanDeviation Std.Mean of Std.
T value = 2.57; p-value = 0.016; DF = 28
Table 8. Results for Student’s t-test using MSE error in type-1 and type-2 fuzzy controllers.
Table 8. Results for Student’s t-test using MSE error in type-1 and type-2 fuzzy controllers.
ControllerNMeanDeviation std.Mean of Std.
T value = 5.31; p-value = 0.000; DF = 28
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Cervantes, L.; Caraveo, C.; Castillo, O. Performance Comparison between Type-1 and Type-2 Fuzzy Logic Control Applied to Insulin Pump Injection in Real Time for Patients with Diabetes. Mathematics 2023, 11, 730.

AMA Style

Cervantes L, Caraveo C, Castillo O. Performance Comparison between Type-1 and Type-2 Fuzzy Logic Control Applied to Insulin Pump Injection in Real Time for Patients with Diabetes. Mathematics. 2023; 11(3):730.

Chicago/Turabian Style

Cervantes, Leticia, Camilo Caraveo, and Oscar Castillo. 2023. "Performance Comparison between Type-1 and Type-2 Fuzzy Logic Control Applied to Insulin Pump Injection in Real Time for Patients with Diabetes" Mathematics 11, no. 3: 730.

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop