Intelligent Nutrition Diet Recommender System for Diabetic’s Patients

Diabetes is one of the ever-increasing menace crippling millions of people worldwide. It is an independent risk factor for many cardiovascular diseases including medium and small vessels and results in heart attack, stroke, kidney failure, blindness, and lower-limb amputations. According to a World Health Organization (WHO) report estimated 1.6 million deaths were the direct result of diabetes. Nutrition plays a vital role in diabetes management alongside physical activity, drugs, and insulin. Weight management can help to avert or delay at pre-diabetic stages. This research work explains the features of the Nutrition Diet Expert System (NDES), which will preferably be used by the health care professionals (HCPs) for calculating per day calorie requirements of diabetic patients and recommend the best diet plan to control diabetes. The primary objective of this proposed model for diet plan is to help individuals attain healthy body weight and optimum check on diabetes by gaining control over blood pressure and lipid count. The ultimate focus of this research result is prevention of diabetes related complications using nutrition diet expert system. In this paper, proposed recommender system has come in handy in figuring out the diet plan by determining the individual dietary requirements at the level of micro and macro nutrients for expert system using fuzzy logic. The results are very promising indicating testing and assessment of the expert system worked well for the individual diet plan.


Introduction
Management of Diabetes Mellitus requires lifestyle changes and careful meal planning on day to day basis. Adopting a balanced diet plan controls diabetes and in turn reduces the risks of cardiovascular diseases, increasing the prospects of healthy life free of morbidity and delaying mortality. By intelligent meal planning these goals can be achieved. There is a whole plethora of websites and smartphone applications available for users to plan their meals in view of their personal health status [1]. However, many apps and websites focusing singularly on calorie and sugar levels fail to take into account other important factors that have crucial values for an individual's health like personal constraints, socio-economic status, tradition, and culture. Because of sociocultural differences, no single approach fits all. Furthermore, diabetic patients have predefined limitations for food selection that can fulfill requirements [2]. Our proposed system is effective for meal planning and can be tailored individually. It recommends multiple diet choices including different vegetables, grain, fruit, and meat considering the specific medical requirements of the patients. According to WHO about 422 million people have diabetes worldwide [3] and one of the leading causes of death worldwide amounts to 1.6 million each year [4]. Systematic analysis of 195 countries for the global burden of disease estimates that 11 million deaths are associated with poor diet and dietary risk factors are contributing to a range of chronic diseases among people around the world including diabetes and cardiovascular disease. Low amounts of foods containing whole grains, fruit, nuts, and seeds and high levels of trans-fats, sugary drinks, and high levels of red and processed meats are the contributory factors. Considering different requirements and constraints, this study proposes a system to make decisions based on different conditions. This research work mainly focuses on the development of a reliable Nutrition Diet Expert System (NDES) based on nutritional recommendations for diabetes patients that will be useful specifically for HCPs and will enable them to monitor the patients' health in hospitals and at home [5]. Health monitoring systems are one of the major advancements in the information technology (IT) field with the market of wearable devices worldwide producing revenue of around $26 B which is expected to increase to $34 B in 2021 [6].
To achieve these goals, this research applies machine learning logic to design a healthy and nutritious food chart for diabetic patients based on factors including age, gender, height, weight, type and intensity of physical activity. In countries like Pakistan with low literacy rates, public education on diet and a healthy lifestyle is very challenging, especially for people of rural backgrounds and low socioeconomic strata. There is a heightened need for such programs and Fuzzy logic can be a promising tool for HCPs to guide diabetic patients to maintain their healthy profile through compliance with proposed dietary options [7].

Related Works
Selection of food intake affects people with Diabetes Mellitus. Dietary adjustment and insulin can modulate blood sugar levels. This research paper proposes an intelligent system through fuzzy inference that recommends food based on the severity of the disease and on personal lifestyle and contains recommendations including the diet plan mechanism and real-time processing mechanisms. A platform has been developed for experiments to check personal health and performance. The results showed the effort of registered dietician and also show proposed method work effectively [8].
Health management through proper diet planning is a key to successful operation of health systems . There are many online apps available for personal food planning according to sugar levels, type, and degree of severity of diabetes and associated complications. These apps take into account taste preference and cost of food. However, there is room for improvement. We propose and develop a new system that takes decisions based on multiple criteria for food recommendation including natural ingredient selection and cultural differences amongst others [9].
Multi agent web based model is working as a clinical-based nutrition system and work as prototype of virtual clinical system which can examine and recommend multiple kinds of nutrition that are essential for the human body [10]. This paper describes [11] the problem of healthy nutrition based on individual human diet analysis using its infrastructure. The program for a balanced eating method for diet correction was created as a mobile application. For the optimization of person balanced eating, analysis and correction of technological applications for desktop and mobile computers designed for a healthy diet, strategic framework base of information technology systems, and a general system for decision making are prepared [12]. A personalized diet system provides food suggestions to individuals based on the genetic test. A personalized diet is used to avoid nutrigenomics emergencies and is used for food recommendations. However, the main issue of recommending the food is a connection between genetics, personalized food, and data scalability for the applied system. In this paper, a personalized nutrition system is introduced to provide personalized recommendation applications for consumers. Categorization of products can be achieved by deep learning and applied neural networks [13].
An expert and intelligent diagnosis-system is introduced using artificial neural networks that ensure the veracity of the reasoning system. The sample of six crops used in the system for diagnosis and recommendation. MCS_51C language is used to confirm the confidences of symptoms using a computer chip. Moreover, the computer chip and expert system validate the diagnosis error of less than 10%. Experiment results store in knowledge memory for future diagnosis [14].
Health is a very important aspect of a family. As for children, proper diet helps them not only lead a good life but also enables them to grow and perform to their full. So, children require comprehensive help with healthy food and this target is the mainstay of the health of the whole family. Author proposed and designed a system for children of different age stages, which provides the user with a nutrition expert system. Nutrition expert system that provides healthy food plan for children of different age groups according to a certain situation is based solely on children's ages. A web-based application is developed to demonstrate how the functionality of the proposed system can be achieved for children nutrition expert web-based system [15].

Fuzzy Logic and Membership Function
It is a huge challenge to suggest someone a food plan list according to the body mass index (BMI) and daily required calories because the calculated relation and link between these variables values is very complex and there is no proper mathematical equation that provides the exact required output for this recommender system.
By keeping the focus of the problem statement, there is a need to design the intelligent recommender system to build up one or more fuzzy membership functions. For example, a person can be of 20 to 22 years that can be considered an adult or non-adult can have a membership function in a fuzzy logic system based on 0.6 degrees because the value of membership function lies between 0 and 1 for all points to manage multiple curves. So, while at the time of 0.6 degrees a person may have another membership degree for another age group. According to these requirements, there are 2 different fuzzy membership functions (MF).

Trapezoidal MF Triangular MF
In the function of fuzzification, age of the patient is divided into membership functions and these are 2 member functions as shown in Tab. 1 of age group detail.
Similarly, patient BMI is divided into four different groups: underweight, overweight, normal, and obese. Tab. 2 shows the detail of BMI Interpretation groups.

Proposed Model Designing
The proposed system will recommend diet of different individuals through the fuzzification phase. Later high and low costs will be added in the form of input to manage the final output of the system. The first part of the proposed system is fuzzification that will recommend a nutrient diet in increasing as well in decrement way. Age and body index will act as a fuzzy input variable and it will decide which nutrients of the diet need to be taken more or which need to be taken less. A sample of 20 nutrients that have a connection with the heath of a person, include fiber, zinc, iron, calcium, vitamin A-C, fat, protein, and carbohydrates for health indication. The final step of fuzzification are used to recommend proper food based on cost and nutrition requirements. The income of the person living in the rural area is associated with nutritional deficiency and both are taken as input in the fuzzification process [16,17].

Body Mass Index and Analysis for Recommendation of Nutrients
BMI is a measurement of an individual's body fat based on height and weight. It is depicted in Fig. 1. Since our system is for diabetes patients, hence the process will start with finding the BMI of the patient and then look for the type of diabetes the patient has as it is of 2 types-type 1 or type 2. After finding BMI, we calculate the required calories per day. Our system already has some groups based on the physical characteristics -normal, underweight, and overweight. We measure the patient's weight as per a preset standard which dictates that we take 60-70 normal, above 70 overweight, and below 60 is underweight [18]. Group formation is carried out depending upon body weights and how much proteins and carbohydrates are required by a patient of a specific group. Our system has five food variations, comprising vegetables, fruits, dairy, meat, and fiber. Our system will recommend the diet with different variations according to the type of diabetes and calorie requirement, which is cost and divided into Low and high scale, based on all food diet variations as shown in Fig. 1. The BMI formula is:   For example, if a user is sedentary or age is 21-25 and he is a male, he should take 2,400 calories. If he is moderate will take 2,800 and if he is very active will take 3,000. Likewise, if the person is a female and sedentary or age is 21-25 she should take 2,000 calories, if she is moderate type physically she will take 2,200 calories and if she is very active will take 2,400 calories. Tab. 3 shows nutritional requirements destined according to age and gender-wise.
Similarly, suggestions for carbohydrate, protein, or fat are depicted in Tab. 4. This delineates how many dietary requirements of micronutrient as well macronutrients are prescribed for different age groups and type of gender is mentioned in the table below in which macronutrients have been categorized in three different types like carbohydrates proteins and fats.
A regular BMI is relatively proportional to an average basal metabolic rate (BMR), which we just managed previously. So, the diabetic nutrition suggested normal BMI must be deemed average relative to the calorie intake in the above procedure. The combination of Age and BMI variation are in above average, average, and below-average are estimated calories and micronutrients in above Tab. 5. The Since the value of membership, a function is divided into three categories as normal, underweight, and overweight so following calculation of FM that have the maximum degree of membership value will be considered as X1.  Fig. 2 explains fuzzy logic system architecture in which rule base contains the set of rules that provided the expert system according to the IF-THEN conditions. Rule base basically defines the decision-making logic of the system. Fuzzification is used to convert system input i.e., crisp number into fuzzy logic sets. The inference engine evaluates and explains the matching degree values of the set according to the current fuzzy input with respect to each rule base.
Defuzzification converts input fuzzy sets into a crisp value by obtaining inference engine methods. These methods are available in the specific expert system to reduce the error. Fig. 3 explains the input and output of the fuzzy system.

Knowledge Base Input and Output Fuzzy System
Five input variables and one output variable including gender, diabetes type, age group, activity factor, BMI, and calories food plan respectively used for simulations. Fuzzy variable diabetes has three fuzzy terms, namely, Type-1, Type-2 and Prediabetes. Details of input variables are shown in Tab. 6.

Member Function
Membership functions in fuzzy logic can be identified as Boolean logical operators, which involve predicates expressing in parametric form the existence or nonexistence of the conditional. Fuzzy logic uses a predicate notation to encode the meaning of fuzzy logic formulas, which are firstly like standard Boolean logic. But then operators are also defined as the fuzzy logic operators, which imply some predicates. In particular, membership functions represent the exact values that are expected in a particular case and are often used to perform mathematical operations on such a data set. Membership functions for the proposed system are given in Tab. 7.

Rule-Based
Fuzzy rule-based systems are so flexible and extensible, it gives decision power with input and output shapes and fuzzy logic types. Fuzzy rules represent the different forms of knowledge in expert systems according to multiple conditions. ND-MIFS expert system Input/Output variables play the main role in the fuzzy system. The excellent performance of an expert system depends upon these I/O rules that are shown in Fig. 4.    Age-Group = AG l AG ag ð Þ l AG;Children ag ð Þ ¼  (Continued )

Defuzzification
Defuzzification is the instrument and formation of producing a computable or quantitative result in crisp logic, given fuzzy logic sets and interrelated membership degrees. It is also called a decision-making algorithm that selects the best crisp input and output value based on a fuzzy set. Figs. 5-7 shows the De-Fuzzifier graphical representation of NDES-MFIS expert system. In Fig. 4 the rule surface shows different colors, the bluish color shows the age factor and BMI interpretation values of the patient. The greenish color represents all types of diabetic patients.
The yellowish color represents the calorie requirement per day for diabetic patients on the basis of age and BMI interpretation in Fig. 5.
In Fig. 6, the bluish color shows the age factor of the patient. The greenish color represents all types of diabetic patients. The yellowish color represents the calories requirement per day for diabetic patients on the basis of age group and gender.

Input
Membership Function Sample MF Screenshot   In Fig. 7, the bluish color shows the age factor of the patient. The greenish color represents the gender type. The yellowish color represents the calories requirement per day for the diabetic patients on the basis of types of gender type and age group.

Diet Plan Recommendation
Our system has sorted and categorized five major groups including Vegetables, Dairy, Grains, Proteins, and Fruits. The nutrients are selected based on daily allowances including micronutrients and essential dietary elements using fuzzification.  Local market food items are categorized according to the local market surveys. Low price food items are the ones, which have amount per price ratio higher than high price food collections. Largely accessibility of foods has been considered in categorizing price of local food item.

Experimental Results
For simulation results, a tool MATLAB R2017 is used. MATLAB is a high-performance language for technical computing. It allows programming in a high-level way while providing a small footprint, efficient execution, and long-term memory use. MATLAB is used for numerical calculations, image processing, data visualization, and scientific computing.     11 shows the rules that If (Gender is Male) and (Age is Group_4) and (Diabetes is Type-2) and (Activity is Active) and (BMI is Normal) then (Caloris-Foodplan is Plan5).

Nutrition Diet Expert System
For nutrition diet expert system, height and weight of the diabetic patient and BMI calculations is compulsory. After calculating the BMI of the patient, resultant passed the parameter values of the patient like gender, type of diabetes, age, BMI, Activity factor in the nutrition diet expert system in Tab. 8.
In Fig. 12 shows the Nutation Diet Expert System in which patient information entry like First Name, Last Name, TagID, Diabetes Type, Age, and Calorie, after submitting the information of the patient.  Fig. 13 shows the NDES in which patient's Diabetes Type, Age, and Calories, after validating the information in Fig. 12 show the recommendation of the diet plan chart for the diabetic patient and also can see the categories of the diet plan in five major groups' vegetables, dairy, grains, proteins, and fruits.

Conclusion
This paper proposed an expert agent system for diabetes patients and that also recommends a diet plan according to the individual energy requirements. The required information related to domain knowledge is kept in an expert system database and the personal food recommendations. The result of experiments shows that our expert agent system is pretty competent at recommending food plans for individual patients according to their health condition and complication degree of diabetes. The fuzzy enhanced set introduced to create accurate results and correct predicted diet plans. Besides, in an enhanced version of the expert system, adaptive learning skills imparted in proposed system to improve the working and functionality of our expert agent system.