Implementation of Inference Engine in Adaptive Neuro Fuzzy Inference System to Predict and Control the Sugar Level in Diabetic Patient

- Fuzzy logic in medical diagnosis is a promising technique usually involves careful examination of a patient to check the presence and strength of some features relevant to a suspected disease in order to take a decision whether the patient suffers from that disease or not. The present work introduces implementation of a simple and effective methodology to develop fuzzy Inference systems for diabetic’s diagnosis to estimate the risk factor value of a human being with respect to ranges of sugar level such as Fasting, After meal, before meal and function value of Total Energy Expenditure. The main goal of the paper is to develop data mining techniques to support decision making and to control the controllable risk factors and also overcome the other parts of organs highly affected by diabetes and which in turn reduces the risk of the patients. By applying the powerful technique of ANFIS based on Sugeno method. The research methodology diagram of the proposed research is classified into two levels. In first level, the research can be analyse the BMR, TEE and diet taken in time bases of fluctuation in different time (Fasting, before meal, after meal, bed time), then analyse the scoring sugar level of patient risk 6). In second level, to fixing an insulin range for reducing the risk of patient health based on the score of sugar level in first level. The result shows, how a fuzzy logic controller is used to control the controllable risk factors to regularize the blood sugar level and also how a patient can control the contributing factors of inactivity of dosage of insulin, to find the life time postponement of other organs affected by diabetes, to protect the patient from risk of blood sugar level.

The main goal of the paper is to develop data mining techniques to support decision making and to control the controllable risk factors and also overcome the other parts of organs highly affected by diabetes and which in turn reduces the risk of the patients. By applying the powerful technique of ANFIS based on Sugeno method, where the evaluation of knowledge domain is uncertain, vague and ambiguous for analyzing the risk factor of human health condition.
The developed control strategy is not only simple, but also reliable and may be easy to implement in real time applications using some interfacing like fasting, after meal, before meal, bed time value of diet taken, Basal Metabolic Rate (BMR) can be estimate based on the collection of height, weight, age and gender and Total Energy Expenditure (TEE) can be measured by product of BMR and activity factor of the patients. [1] The constructed fuzzy inference system was used to train, test and check the data to monitor the patient according to the risk level, for immediate action to overcome the problem of high and low measure of Diet taken and TEE function in different range and to increase the life time of the patient from the risk. This approach is contributed to medical decision-making and the development of computer-assisted diagnosis in medical domain and identifies the major risk of the patient in earlier. [2][3][4] II. SYSTEM MODEL USING ANFIS System Model Diagram of the proposed research is classified into two levels as in Fig.1.  In second level, to fixing an insulin range for reducing the risk of patient health based on the score of sugar level in first level.

III. DATA FOR RESEARCH
The data taken for the researches from the entire people who are either suffering or safe by diabetic. Information collected from the patient's status of the test report based on the attribute given in the Table -1.

A. Architecture of Adaptive Neuro Fuzzy Interface System (ANFIS) -Sugeno Method -First Level
Fuzzy logic is one of the successful applications of fuzzy set in which the variables are linguistic rather than the numeric variables. Linguistic variables, defined as variables whose values are sentences in a natural language (such as large or small), may be represented by the fuzzy sets. Fuzzy set is an extension of a 'crisp' set where an element can only belong to a set (full membership) or not belong at all (no membership). Fuzzy sets allow partial membership, which means that an element may partially belong to more than one set. [5][6]  A fuzzy set A of a universe of discourse X is represented by a collection of ordered pairs of generic element and its membership function μ : X N [ 0 1], which associates a number μA(x) : X N [ 0 1], to each element x of X. A fuzzy logic controller is based on a set of control rules called as the fuzzy rules among the linguistic variables. These rules are expressed in the form of conditional statements. [7] The rule base block is connected to the neural network block. Back propagation algorithm is used to train the neural network to select the proper set of rule base. For developing the control signal, the training is a very important step in the selection of the proper rule base. Once the proper rules are selected and fired, the control signal required to obtain the optimal outputs is generated. The output of the NN unit is given as input to the de-fuzzification unit and the linguistic variables are converted back into the numeric form of data in the crisp form, the controller design of ANFIS as shown in Fig  In the fuzzification process, i.e., in the first stage, the crisp variables, the speed error and the change in error are converted into fuzzy variables or the linguistics variables. The fuzzification maps the five input variables to linguistic labels of the fuzzy sets. [8][9][10] The fuzzy coordinated controller uses the linguistic labels. Each fuzzy label has an associated membership function. The membership function of triangular type is used in our work. The inputs are fuzzified using the fuzzy sets and are given as input to ANFIS controller. The ANFIS architecture is shown below Fig. 3.
A Two Rule Sugeno ANFIS has rules of the form: For the training of the network, there is a forward pass and a backward pass. The forward pass propagates the input vector through the network layer by layer. In the backward pass, the error is sent back through the network in a similar manner to back propagation.

1) Layer 1:
Collect the Current status of the patient regarding Diet taken, Age, Weight, Gender, Activity by set of facts and represented using domain knowledge. Diet taken is taken as X parameter range is divided into four values such as Fasting as X , Before meal as Y, After meal as Z and Bed Time as W. Finally BMR rate was represent as U.

2) Layer 2:
Each node calculates the firing strength of each rule using the min or prod operator. In general, any other fuzzy AND operation can be used.Every node in this layer is fixed. This is where the t-norm is used to sum 'OR' the membership grades are represented by the membership functions.

3) Layer 3:
The nodes calculate the ratios of the rule's firing strength to the sum of all the rules firing strength. The result is a normalized firing strength. It contains fixed nodes which calculate the ratio of the firing strengths of the rules: When the IF (condition) part of the rule matches a fact, the rule is fired and its THEN (action) part is executed. The condition is check diet taken is mf1, Total Energy Expenditure (Calorie) represents mf2, and insulin level is representing as mf3. The inference engine uses a system of rules to make decisions through the fuzzy logical operator and generates a single truth value that determines the outcome of the rules.

4) Layer 4:
The nodes in this layer are adaptive and perform the consequent of the rules: Finally risk factor was analyzed by Diet taken , Basal metabolic Rate (BMR) and analysis by Total energy Expenditure (Calorie burn) functions. Using AND and OR operator to input the value mf value to the rule, the rule was analyse in to the engine and single truth value to be determine for the patient risk stage.

5) Layer 5:
There is a single node here that computes the overall output: Defuzzification is the process of converting the final output of a fuzzy system to a crisp value (T. A. Runkler, 1997). Finally the process of defuzzification converts the conclusion of the mechanism into the actual inputs for the process. The health risk are determines the level of severity of depression risk given the input variables.

A. Simulation Result Based on Sugeno Method in ANFIS
In order to start the simulations, the 343 fuzzy rule set has to be invoked first from the command window in the Matlab. The fuzzy file where the rules are written with the incorporation of the control strategy is opened in the Matlab command window.
In this Sugeno FIS triangular membership function is used for input variables of different case of rules in insulin range and sugar level can be feed to the MATLAB as in input parameter. The shape for triangular membership function plot for each category for Diet taken is shown in Fig.4. Triangular-shaped built-in membership function is defined for the variable Y 0 . The weight is calculated by the Equation-1. The decision field refers to the presence of diabetes analysis. In the proposed system the output variable as refer in Fig. 5 and Fig. 6 which is divided into the following fuzzy sets low, normal, medium, High and Very High when the patient health condition can be analyzed after giving the insulin range who affected by diabetes sugar level.
Fuzzy controller considers the input and output variables, to decide the membership function (mfs). These variables transform the numerical values of the input of the fuzzy controller to fuzzy quantities. The number of these membership functions specifies the quality of the control which can be achieved using the fuzzy controller.

B. Adaptive Neuro fuzzy interface system
The inference engine compares each rule stored in the knowledge base with facts contained in the database. When the IF (condition) part of the rule matches a fact, the rule is fired and its THEN (action) part is executed. The condition is check sugar level is mf1, Insulin given range value represents mf2. The inference engine uses a system of rules to make decisions through the fuzzy logical operator and generates a single truth value that determines the outcome of the rules. The risk factor of sugar level was analyzed by Diet taken and Total Energy Expenditure which is represented as Y 1 denoted as 0 or 1. Y 2 represents the insulin ranges where the health problem suffer from the diabetes the suggestion of dosage range can be fitted into fuzzy controller based on membership function. Finally the health risk was observed by the relationship between those attributes in the determination of depression risk levels.

C. Defuzzification Process
In defuzzification method the area of each consequent set is multiplied by the domain values passing through its centre. The sum of these products is then divided by the sum of the area values of all the sets yields the normalised defuzzification values which can be mapped to yield the control force which is worked in FIS Editor.

V. RESULT AND DISCUSSION
The fuzzy logic controller uses the centroid method to calculate the geometric center of the full area under the scaled membership functions. The research methodology diagram of the proposed research, is classified into two levels. In first level, the research can be analyse the BMR, TEE and diet taken in time bases of fluctuation in different time (Fasting, before meal, after meal, bed time), then analyse the scoring sugar level of patient risk 6). In second level, to fixing an insulin range for reducing the risk of patient health based on the score of sugar level in first level. This method gives better performance in terms of continuity, computer complexity and counting. Finally the surface of patient's diabetes level can be representing in surface viewer. This method for Computing a "Centroid Approximation" by fitting the fuzzy output area into a "Triangular" shapes in defuzzifation layer.
The central contribution of this research work is designed by Sugeno method in ANFIS to identify the high risk of diabetes patients and given the insulin range in level 2 methodologies to avoid the sudden death by controlling the controllable risk factors. The validation to be determines the low, normal, medium, high and very high patients to decide about the type of treatment. The result shows, how a fuzzy logic controller is used to control the controllable risk factors to regularize the blood sugar level and also how a patient can control the contributing factors of inactivity of dosage of insulin, to find the life time postponement of other organs affected by diabetes, to protect the patient from risk of blood sugar level.

VI. CONCLUSION
The constructed fuzzy inference system was used to train, test and check the data to monitor the patient according to the risk level, for immediate action to overcome the problem of high and low measure of Diet taken and TEE function in different range and to increase the life time of the patient from the risk. This approach is contributed to medical decision-making and the development of computer-assisted diagnosis in medical domain and identifies the major risk of the patient in earlier.
Fuzzy controllers make the tracking error sufficiently small enough to achieve significantly improves the performance without changing the controller algorithm and increasing the cost or complexity of the system. For Future work, it can be extended and evaluated the work in areas like system extended to analysis the risk factor value of different organs affected by Diabetes, In industries field , these architectures also applied in modelling, nonlinear system and control engineering, Can extended to analysis the risk factors simultaneously for more than one disease, such as cancer, cardiac attack.