DOI: 10.30865/mib.v7i1.5543
Healthy Menu Recommendation for Malnutrition Patients Based on Ontology
Igga Febrian Virgiani, Z.K.A. Baizal *, Ramanti Dharayani School of Computing, Informatics, Telkom University, Bandung, Indonesia
Email: 1[email protected], 2,*[email protected], 3[email protected] Correspondence Author Email: [email protected]
Abstract−A healthy diet is one of the keys to creating a healthy lifestyle, but at this time the selection of a healthy and nutritious meal menu in the society is difficult to do because of the limited nutritional information contained in a food. A healthy diet can help a person to get balanced nutrition, good nutritional intake can increase the body's immunity, and make a normal or healthy body weight so that it can increase work productivity and prevention of chronic diseases. To overcome this problem, we propose the use of ontology and Semantic Web Rule Language (SWRL) to build a healthy menu recommendation system in the form of a chatbot to make it easier for users to determine the daily meal menu. These recommendations are personalized by considering the user's needs. Ontology is used to represent the required knowledge and the reasoning process uses SWRL.
From the results of system testing, the recommendations get the accuracy of the F-Score value of 0.951 Keywords: Healthy Menu; Malnutrition; Chatbot; Ontology; Semantic Web Rule Language.
1. INTRODUCTION
Malnutrition refers to the condition of a person who is deficient or excess in nutrients, an imbalance of essential nutrients or impaired nutrient utilisation. Malnutrition can be in the form of nutritional deficiencies, overweight, obesity, and the emergence of non-communicable diseases related to unhealthy diets [1]. Diet is an important thing that can affect the state of nutrition, because the quantity and quality of food and beverages consumed will have an impact on the level of a person's nutritional intake [2]. Eating the right food according to nutritional needs will make the body's need for nutrients be fulfilled. However, each person has different needs depending on personal factors such as age, gender, height, weight, and allergies [3]. Lack of knowledge about healthy food and the search for correct and relevant nutritional information takes a long time in the midst of a fast-paced lifestyle and a busy schedule of daily activities, making people prefer food that is fast and easy to obtain without considering the nutritional content in it.
Currently, there are many studies on recommender systems with health domains especially for non- communicable diseases such as diabetes, hypertension, and malnutrition. This research continues to be developed to assist medical personnel and patients in making more efficient and accurate health-related decisions [4].
Recommender systems in the health domain offer user personalization to improve understanding of the user's health condition [5]. Semantic-based filtering based on domain knowledge is usually defined using ontologies. In this case, the use of ontologies can facilitate communication between humans and machines, in the system development stage [6]. Ontology is a knowledge representation model that can be used as a database in the system as well as for reasoning. Ontology has been widely utilized in the development of recommender systems. Baizal et al [7] utilized ontology in the development of a multi-domain conversational recommender system (CRS) framework. Ontology can also be utilized in query refinement in a CRS based on navigation by proposing [8].
Query refinement in CRS can be expressed in natural language-based chatbot interaction by utilizing ontology [9]. Recommender systems in the healthcare area have also been developed. Somaye Norouzi, et al. developed a mobile-based application for diabetic patients [10], the recommender system is made using a combination of artificial intelligence and knowledge-based. Recommendations are made based on the patient's condition and favourite foods. Research [11] using ontology and demographic recommendation models in the development of recommender systems can reduce data sparsity and also affect recommendation results. Research [12] uses ontology and SWRL methods and implements them in mobile applications and has been tested by experts to produce health recommendations and medical services for diabetic patients based on user profile information.
Previously there have been health chatbots such as Tunuibot and DrMeawbots [13] but chatbots for fulfilling the nutrition of underweight patients are still lacking. In this study, we propose the use of ontology and SWRL to recommend healthy food menus to create a chatbot that can provide daily menu recommendations to users. In addition, not only does it provide a daily menu based on a person's nutritional needs, this chatbot provides recommendations based on user preferences. The user is intended for people who have underweight and normal BMI categories, the user must be 18 years old and above and consider the user’s allergies.
2. RESEARCH METHODOLOGY
2.1 Body Mass Index (BMI)
Body Mass Index is a body fat number based on the calculation of body weight adjusted for height. How to calculate BMI can be seen in formula 1.
BMI = Weight (kg)
Height (m2) (1)
BMI is a standard for classifying a person's nutritional status as underweight, normal weight, overweight, and obesity. BMI is usually intended for adults because children are considered to be in a period of growth, so that BMI is not accurate in children. BMI calculation according to formula 1 can be performed with an age restriction, which is above 18 years [14]. With BMI as an indicator of body weight, it can be known whether a person's weight is normal or not. There are supporting factors in BMI calculations such as age, gender, and muscle mass. Table 1 shows the BMI categories based on WHO and Asia Pacific, there are differences in values because they are adjusted to the characteristics of people in Asian countries and other countries.
Table 1. BMI Category based on WHO global and Asia Pacific Category WHO (BMI) Asia-Pacific (BMI)
Underweight ≤ 18.5 ≤ 18.5
Normal 18.5 - 24.9 18.5 - 22.9 Overweight 25 - 29,9 23 - 24,9
Obese ≥ 30 ≥ 25
2.2 Basal Metabolic Rate (BMR)
BMR stands for Basal Metabolic Rate, which is the minimum number of calories your body needs to perform basic functions such as breathing, circulation, and digestion. BMR is influenced by factors such as age, sex, weight, and muscle mass, and it can be used to estimate the number of calories you need to consume in order to maintain your current weight. BMR can be calculated using the Harris Benedict formula, BMR calculations for men and women are different [15] and can be seen in formula (2) and formula (3).
BMR(male)= (13.7 × Weight(kg)) + (5.0 × Height(cm)) –(6.8 × Age) + 66 (2) BMR(female)= (9.6 × Weight(kg)) + (1.8 × Height(cm)) – (4.7 × Age) + 665 (3) 2.3 Ontology Web Language (OWL)
OWL (Web Ontology Language) is a language used to create ontologies for the worldwide web. It is a formal language for describing domain concepts and relationships, and it is used to represent and share knowledge in a machine-readable format [16]. Based on RDF or Resource Description Framework, OWL is designed for use on the web, allowing ontologies to be easily shared and integrated across a variety of system and application [16].
OWL is consisting into three sublanguages, OWL Lite, OWL DL and OWL Full [17]. OWL Lite is the most basic and is used for simple class hierarchies, while OWL DL and OWL Full provide more advanced features such as properties and rule-based reasoning. It is widely used in areas such as Artificial Intelligence, Semantic Web and Knowledge Representation
2.4 Semantic Web Rule Language (SWRL)
SWRL (Semantic Web Rule Language) is a language for expressing rules that contain both ontological and non- ontological information in the Semantic Web. It allows to express complex relationships between concepts and relationships in an ontology and external data sources. SWRL combines the OWL Web Ontology Language with a rule language [18], allowing to express rules such as "If a person has BMI is smaller than 18.5, then they are underweight". SWRL allows for greater expressivity than OWL alone, making it possible to express more complex constraints and inferences. It also enables the integration of external data sources into the ontology, such as data from databases or other web services. SWRL rules can be executed by reasoner, which can infer new knowledge from the rules and the information in the ontology [19].
2.5 Chatbot
A chatbot is a computer program and designed to be able to interact with humans through text or voice messages.
Chatbots are equipped with artificial intelligence [20]. The artificial intelligence used for the creation of this conversation-based system uses machine learning to understand the context and intent of the question before formulating the output to the user which allows when running the chatbot the user does not feel that he is having a conversation with the machine [21].
Figure 1. Simple workings of a chatbot
DOI: 10.30865/mib.v7i1.5543
Chatbots include Natural Language Processing (NLP) programmes, so chatbots understand human natural language and can be used to provide responses to users and perform analysis of user requests [22].
3. RESULT AND DISCUSSION
3.1 The Dataset
The dataset is obtained from TKPI (Indonesian Food Composition Table) in 2017, the data contains food names, calories, protein, fat, etc. as in Table 2. The dataset containing nutritional information is used as a knowledge base in the construction of ontology.
Table 2. A partial view of the TKPI dataset
Food Nutritional Composition / 100 g
Calorie (cal) Protein (g) Fat (g) DV (g) ….. Fiber (g) Sodium (mg)
Rice 180 3.0 0.3 39.8 ….. 0.2 1
Sardine 109 19.9 1.8 3.4 ….. 0.0 266
Apple 58 0.3 0.4 14.9 ….. 2.6 2
Soy milk 41 3.5 2.5 5.0 ….. 0.2 128
An example of food data that has been entered into the individuals ontology can be seen in Figure 2.
Figure 2. Sample dataset 3.2 System Design
As shown in Figure 3, the system flow is divided into several processes. First, information is collected that will be used in system development such as the nutritional content of food, physical activity, allergies, daily nutritional needs, etc. Second, knowledge is created based on the data that has been owned by creating SWRL ontology and rules. Third, knowledge validation is carried out by a nutritionist/nutritionist to find out that the ontology design is appropriate. Fourth, making menu recommendations based on user information and preferences. Furthermore, the existing menu recommendations will be validated by a nutritionist, then after getting validation from a nutritionist, a performance evaluation is carried out to determine the accuracy produced by the system.
Figure 3. System Flowchart
Figure 4. Chatbot System Architecture
Figure 4 explains how to show the system architecture of the chatbot. The system receives input in the form of user information. The system receives the input request and forwards it to the handler. The input is converted into a knowledge query and matched with chatbot inference. The system sends a response in the form of recommendation results and is forwarded to the chatbot so that users get a reply from the system in the form of menu recommendations.
Figure 5. User interaction with chatbot
For more details, Figure 5 explains the user interaction with the chatbot. When the user enters the command to start, the system responds by giving a greeting "Hello, I can help you recommend some menus for today's meal", then the chatbot starts asking about user preferences such as gender, physical activity, food allergies, age, weight, height. Then the system checks whether the input provided by the user is in the form of numbers for height and weight. After that the system provides menu recommendations, if the user is not satisfied with the recommendations given then the system provides new menu recommendations. The system will display 3 menu recommendations each at each meal time, and users are asked to choose the menu they want. In the final stage, a menu recommendation is displayed based on the user's choice. Figure 6 is an example of interaction on the telegram chatbot.
Figure 6. User interaction on telegram chatbot
DOI: 10.30865/mib.v7i1.5543 3.3 Ontology design
Ontology design in Figure 5 consists of four main classes BMI Level, Person, Menu, and Type. The BMI Level class is a classification of users based on BMI values, this value is obtained from calculating the user's height and weight, users are classified into two categories, underweight and normal. Person class stores user characteristic information. The Menu class stores information related to individual foods, each individual food is classified into subclasses based on the type of food. The Type class stores information regarding the type of allergies considered such as seafood, peanuts, egg, chicken, etc., the type class is used in food selection for users who have allergies.
Figure 7. Ontology Class Design
In addition to the ontology class, there are properties that complement the information from the ontology class. Table 3 and table 4 are property data and property objects used in the ontology in this system. Each property has its own function such as the menu class has a serving size property to determine how much food needs to be eaten in grams or household measurements.
Table 3. Data properties used in the Ontology Properties Name Domain Range
Calorie Person decimal
BMI Person decimal
Age Person integer
Gender Person String
Weight Person decimal
Height Person decimal
Allergy Person String
Activity Person String
Fat Menu decimal
Protein Menu decimal
Carbo Menu decimal
Serving size Menu integer
Food Cal Menu decimal
Table 4. Object Properties used in the Ontology Properties Name Domain Range
hasBMI Person BMI Level
hasMenu Person Menu
LevelNutrient Menu Owl: Thing
isNotContains Menu Type
Contains Menu Type
3.4 Rule of SWRL
The use of SWRL rules serves to get recommendation conclusions based on existing ontologies. There are several rules that are made in order to get food recommendations that match user preferences, such as rules on daily calories, BMI classification, menu classification, and recommendations..
a. BMI classification
BMI value classification uses formula rules. The rules are obtained from the calculation of the user's weight and height as in formula (1). The BMI value is stored in the hasBMI property object for each person. In this research, the BMI category is limited to two categories Underweight and normal weight.
person(?p), hasweight(?p, ?w),hasheight(?p, ?h), multiply(?wh, ?w, 10000), multiply(?hm, ?h, ?h), divide(?bmi, ?wh, ?hm) -> hasBMI(?p, ?bmi)
person(?p), hasBMI(?p, ?bmi), greaterThan(18.5, ?bmi) -> underweight(?p) person(?p),hasBMI(?p, ?bmi), greaterThanOrEqual(?bmi, 18.5),
greaterThanOrEqual(22.9, ?bmi) -> normal(?p) b. Menu classification
Each individual menu has a LevelNutrient property object, the LevelNutrient classification is based on the percentage of Daily Value, if the Daily Value is less than or equal to 5% then it is categorised as low, and if the percentage of Daily Value is more than or equal to 20% then it is categorised as high.
Menu(?f),hasNutrientCarbo(?f, ?n),divide(?h, ?n, 275),
multiply(?DV, ?h, 100), greaterThanOrEqual(?DV, 20) -> LevelNutrient(?f, HighCarbo) Menu(?f) , hasNutrientFat(?f, ?n), divide(?h, ?n, 78),
multiply(?DV, ?h, 100), greaterThanOrEqual(5, ?DV) -> LevelNutrient(?f, LowFats) c. Daily Calories
The user's daily calories are obtained with the help of rules, the following is an example of a rule to calculate the daily calories of users with female gender.
person(?p), hasweight(?p, ?w), hasheight(?p, ?h), hasAge(?p, ?a), hasGender(?p, "Wanita"), multiply(?k, ?w, 13.75), multiply(?l, ?h, 5), multiply(?m, ?a, 6.75), add(?h1, ?k, 66.47), add(?h2, ?h1, ?l), subtract(?bmr, ?h2, ?m) -> hasBMR(?p, ?bmr), hasActivity(?p, "Light"), multiply(?c, ?bmr, 1.375) -> hasCalorieNeed(?p, ?c)
d. Recommendation
The recommendation is based on the user's calorie needs, the percentage of daily calories is 25% at breakfast, 25%
at lunch, 20% at dinner, and the remaining 30% is obtained from snacks. There are 3 snacks, morning snack, afternoon snack, and night snack, to get recommendations from each meal menu, each recommended menu item is saved to each property as in the rule. For example, if a user has normal weight and is allergic to seafood, the IsNotContains property is used to select food menus that contain seafood.
Person(?p),normal(?p), hasAlergi(?p, "seafood") , SnackCal(?p, ?c), IsNotContains(?f, Seafood), IsNotContains(?f1, Seafood),
hasNutrientCal(?f, ?sc), hasNutrientCal(?f1, ?sc1), add(?tc, ?sc, ?sc1), roundHalfToEven(?s, ?tc), divide(?pcf, ?c, 3), multiply(?pcf1, ?pcf, 0.005), subtract(?bba, ?pcf, ?pcf1), roundHalfToEven(?pf1, ?bba) ,
add(?ba, ?pcf1, ?pcf), roundHalfToEven(?pf, ?ba), greaterThanOrEqual(?s, ?pf1), greaterThanOrEqual(?pf, ?s) -> hasSnackB(?p, ?f), hasSnackB(?f, ?f1)
3.5 Test Scenario
System testing is carried out using data samples from a number of users, the results of existing menu recommendations are evaluated by nutritionists. From the evaluation results, precision, recall, and F-Score are calculated. Precision is the ratio of positive correct predictions to the overall positive prediction results, while Recall is the ratio of positive correct predictions compared to the overall correct data. Precision and Recall calculations are performed using formulas (4) and (5).
Precision = TP
TP + FP (4)
Recall = TP
TP + FN (5)
TP is True Positive, FP is False Positive, and FN is False Negative. The precision and recall values are used in the F-Score calculation. The F-Score calculation is done as in formula (6).
F − Score = 2 ×Precision × Recall
Precision + Recall (6)
True Positive is the total result of food recommendations that match nutritionist recommendations, while False Positive is the total result of food recommendations recommended by the system but not recommended by nutritionists, and False Negative is the result of food recommendations that are not recommended by the system and nutritionists.
3.6 Validation result
Testing is done by validating the results of food recommendations by nutritionists. We used a questionnaire with google form media and managed to collect as many as 20 respondents, there were 10 men and 10 women and 11 of them with underweight BMI category and 9 people with normal BMI category. Table 5 displays user data from the questionnaire results.
Table 5. User Data for Evaluation
Age Sex Height (cm) Weight (kg) BMI Category Allergy
18 Male 179 48 Underweight None
DOI: 10.30865/mib.v7i1.5543
Age Sex Height (cm) Weight (kg) BMI Category Allergy
19 Male 164 47 Underweight None
20 Male 162 40 Underweight None
20 Female 159 42 Underweight None
21 Female 167 66 Normal Seafood
21 Male 166 60 Normal None
21 Male 177 63 Normal None
21 Male 162 56 Normal None
21 Female 158 50 Normal Seafood
21 Female 158 43 Underweight None
21 Female 154 43 Underweight None
21 Female 163 45 Underweight None
22 Female 165 53 Normal None
22 Male 168 66 Normal None
22 Male 180 49 Underweight Seafood
22 Male 175 50 Underweight None
24 Male 174 68 Normal Peanuts
24 Female 151 37 Underweight None
26 Female 150 36 Underweight None
From the 20 user data tested, there are 3 menu choices at each meal time. The test produced 120 food samples and obtained 11 menus not recommended by nutritionists.
3.7 Evaluation Result
The validation results are used to calculate the system performance in formula (4), (5), and (6).
Prec = 109
109 + 11 = 0,90833 Rec = 109
109 + 0= 1
F − Score = 2 ×0,90833 × 1
0,90833 + 1 = 0,95196
4. CONCLUSION
This research develops CRS based on ontology and SWRL, from the tests that have been carried out chatbot successfully provides menu recommendations according to user preferences. After validating the recommendation results, the system has an accuracy value of precision 0.90833, recall 1 and F-Score 0.95196. From the results obtained, it can be concluded that the chatbot for malnutrition sufferers, especially underweight and users with normal BMI, was successfully proposed.
REFERENCES
[1] World Health Organization,”Malnutrition : Overview”.[Online]
https://www.who.int/health-topics/malnutrition#tab=tab_1/ [Accessed 7th April 2022].
[2] PERMENKES, R. (2014). Peraturan Menteri Kesehatan RI No. 41 Tahun 2014 tentang Pedoman Gizi Seimbang. [Online]
Available at: https://peraturan.bpk.go.id/Home/Details/119080/permenkes-no-41-tahun-2014 [Accessed 7th April 2022].
[3] Luo, Y. (Ed.). (2020). Cooperative Design, Visualization, and Engineering: 17th International Conference, CDVE 2020, Bangkok, Thailand, October 25–28, 2020, Proceedings (Vol. 12341). Springer Nature.
[4] Tran, T. N. T., Felfernig, A., Trattner, C., & Holzinger, A. (2021). Recommender systems in the healthcare domain: state- of-the-art and research issues. Journal of Intelligent Information Systems, 57(1), 171-201.
[5] Pincay, J., Terán, L., & Portmann, E. (2019, April). Health recommender systems: a state-of-the-art review. In 2019 Sixth International Conference on eDemocracy & eGovernment (ICEDEG) (pp. 47-55). IEEE.
[6] H. Al-Zubaide and A. A. Issa, "OntBot: Ontology based chatbot," International Symposium on Innovations in Information and Communications Technology, Amman, Jordan, 2011, pp. 7-12, doi: 10.1109/ISIICT.2011.6149594.
[7] Baizal, Z. A., Widyantoro, D. H., & Maulidevi, N. U. (2016, October). Design of knowledge for conversational recommender system based on product functional requirements. In 2016 international conference on data and software engineering (ICoDSE) (pp. 1-6). IEEE.
[8] Baizal, Z. A., Widyantoro, D. H., & Maulidevi, N. U. (2016, October). Query refinement in recommender system based on product functional requirements. In 2016 International Conference on Advanced Computer Science and Information Systems (ICACSIS) (pp. 309-314). IEEE.
[9] Solechah, N., Baizal, Z. K. A., & Ikhsan, N. (2022, July). Sellybot: Conversational Recommender System Based on Functional Requirements. In 2022 International Conference on Data Science and Its Applications (ICoDSA) (pp. 315- 319). IEEE.
[10] Norouzi, S., Ghalibaf, A. K., Sistani, S., Banazadeh, V., Keykhaei, F., Zareishargh, P., ... & Etminani, K. (2018). A mobile application for managing diabetic patients’ nutrition: A food recommender system. Archives of Iranian medicine, 21(10), 466.
[11] lian, J. Li, and V. Pandey, “A Personalized Recommendation System to Support Diabetes SelfManagement for American Indians,” IEEE Access, vol. 6, pp. 73041–73051, 2018, doi: 10.1109/ACCESS.2018.2882138.
[12] Jie, M., HuiMing, Y., & Yizhuo, C. (2020, July). Research on Ordering Recommendation System of Traditional Chinese Medical Health Preserving Ontology Model based on Context-aware Environment. In 2020 International Conference on Computer Vision, Image and Deep Learning (CVIDL) (pp. 629-632). IEEE.
[13] Thongyoo, P., Anantapanya, P., Jamsri, P., & Chotipant, S. (2020, October). A Personalized Food Recommendation Chatbot System for Diabetes Patients. In International Conference on Cooperative Design, Visualization and Engineering (pp. 19-28). Springer, Cham.
[14] Kemenkes, R. I. (2012). Pedoman Praktis Memantau Status Gizi Orang Dewasa. [Online]
Avalaible at: http://gizi. depkes. go. id. [Accessed 11th April 2022].
[15] J. A. Harris and F. G. Benedict, “A Biometric Study of Human Basal Metabolism,” Proc. Natl. Acad. Sci., vol. 4, no. 12, pp. 370–373, 1918, doi: 10.1073/pnas.4.12.370.
[16] McGuinness, D. L., & Van Harmelen, F. (2004). OWL web ontology language overview. W3C recommendation, 10(10), 2004.
[17] Dean, M., Schreiber, A. T., Bechofer, S., van Harmelen, F. A. H., Hendler, J., Horrocks, I., ... & Stein, L. A. (2004). OWL web ontology language reference.
[18] Horrocks, I., Patel-Schneider, P. F., Boley, H., Tabet, S., Grosof, B., & Dean, M. (2004). SWRL: A semantic web rule language combining OWL and RuleML. W3C Member submission, 21(79), 1-31.
[19] Mehla, S., & Jain, S. (2019). Rule languages for the semantic web. In Emerging Technologies in Data Mining and Information Security (pp. 825-834). Springer, Singapore.
[20] Kohli, B., Choudhury, T., Sharma, S., & Kumar, P. (2018, August). A platform for human-chatbot interaction using python. In 2018 Second International Conference on Green Computing and Internet of Things (ICGCIoT) (pp. 439-444).
IEEE.
[21] Rule-Based Chatbots vs. AI Chatbots: Key Differences'. [online]
https://www.hubtype.com/blog/rule-based-chatbots-vs-ai-chatbots [Accessed 11th April 2022].
[22] A. Nazir, M. Y. Khan, T. Ahmed, S. I. Jami, and S. Wasi, “A novel approach for ontology-driven information retrieving chatbot for fashion brands,” Int. J. Adv. Comput. Sci. Appl., vol. 10, no. 9, pp. 546–552, 2019, doi:
10.14569/ijacsa.2019.0100972.