Ontology-Based Physical Exercise Recommender System for Underweight Using Ontology and Semantic Web Rule Language

− Inactive lifestyles and unhealthy diets are often the result of people's busy lives. because of these bad habits, many people are underweight. diet and lack of physical activity are factors that cause underweight. Due to lack of information, people prefer to live lazily and not exercise. To solve this problem, we propose a physical exercise recommendation system that is explicitly designed for Indonesian people who are struggling with underweight. Despite the existence of various research studies advocating for physical activities tailored to individual preferences, there is currently no recommendation system available within a chatbot framework that includes a comprehensive session to be completed, along with specific sets and repetitions for each activity. This research proposes the utilization of ontology and Semantic Rule Web Language (SWRL) to represent and process the knowledge presented, enabling the development of rules for generating physical activity recommendations based on user preferences. By integrating the user profile, ontology, and the rules created, our system recommends physical exercise based on gender, weight, height, activity level, difficulty of movements, and the type of muscle to be trained. From the sample user data obtained, 408 physical exercises menu are recommended. The performance of the system is quite good, together with the validation results from personal trainers, obtained a precision value of 0.8, recall of 1, and f-score of 0.888. Concluding that the system we designed can provide physical activity recommendations in accordance with user preferences.


INTRODUCTION
Being underweight refers to having a body weight that is less than what is considered healthy for an individual's height, age, and gender.It is essentially the opposite of being overweight or obese.While many people struggle with being overweight, being underweight can also pose significant health challenges and concerns.Being underweight increases mortality and reduces life expectancy [1].Physical activity is an essential requirement for the human body that can increase physical fitness while also having a favorable impact on mental health.This aids in the treatment of many ailments and the reduction of stress levels [2].It is important to know the body's BMI category and ensure that BMI is within the normal category.Body Mass Index (BMI) is a calculation index that indicates a person's weight.Underweight is defined based on Body Mass Index, for adults (age ≥ 19 years) BMI is calculated using body weight (kg) / height (m 2 ).Based on the WHO classification underweight is defined by (BMI < 18.5), normal (18.5 ≤ BMI < 24.9), overweight (25.0 ≤ BMI < 29.9), obesity (30.0 ≤ BMI < 35.0) and severe obesity (BMI ≥ 35.0) [3].
The clinical definition of underweight in children and adolescents refers to having a low body mass index (BMI) for their age.This condition profoundly affects the health, well-being, and overall growth and development of young individuals, with potential consequences that can extend throughout their lifetime [4].Physical activity in general is a movement of the body's muscles and their supporting systems that require energy to do so.Physical activity contributes to maintaining optimal health conditions, both physical and mental [5].The importance of information about the right physical activity for underweight people to get the ideal weight.For example, MadMuscles [6] and Freeletics [7] are two applications that offer users training plans based on their preferences.These help users tailor their workouts to reach their fitness goals.Recommendation systems in the workout domain play an important role in helping users to find the right type of workout that is useful for their user needs.In knowledge-based recommendation systems for workout resources, ontologies are used to represent knowledge about users and their workout types [8].In this study, we develop a recommendation system for workout menu based on ontology and Semantic Rule Web Language (SWRL).Semantic Rule Web Language is generally an OWL-based language for presenting generated rules.SWRL combines OWL knowledge base and inference rules to perform reasoning on the basis of OWL ontology [9].Ontology-based approaches, such as [10]- [12], have been implemented to generate recommendations using domain knowledge and rules.Ontology plays an important role in knowledge representation [13], such as tourism recommendation [14], camera recommendation based on product functional requirements [15], and laptop recommendation based on product functional requirements [16].
In previous research, Shadi et al. [17].Presented a personalized recommendation system to help people with diabetes for American Indian.The recommendations are based on the biocultural ontology of the AI (American Indians) community.Recommendations along with diabetes guidelines are converted into rule-basic logic that is integrated with the ontology as the knowledge of the recommender system.Basnayke et al [18] developed a software application that employs an ontology-based approach to diminish physical exertion among individuals who are obese or overweight.The application takes into account anthropometric measurements, exercise inclinations, age, dietary habits, and medical background.To retrieve recommendations, researcher used Simple Protocol and Resource Description Framework Query Language (SPARQL) queries.Answering competency questions and expert testimonials ensures accuracy and correctness.
Sambola et al. [19] uses ontologies and semantic rules to create recommended menus that consider multiple measurements, height, weight, and BMI.According to [19], the system was able to select the diet that best matched each user's preferences, listing components and nutritional value dishes that met the prescribed dietary limits.
Meanwhile.Patricia et al. [20] Have conducted research with the title physical activity recommendation system during covid-19.In this study, researcher suggests at least 150 minutes of moderate-intensity physical exercise each week or 75 minutes of intense activity, and preferably 2-3 session of physical activity carried out by children, adults or the elderly.
In addition, Kadri et al [21].announced a recommendation system for human physical activity using smartphones.In this study, the researchers used a decision tree algorithm and its BiLSTM (bidirectional long-term memory) algorithm to train and classify physical activity and compared the results of machine learning and deep learning algorithms.
In this paper, we propose the creation of an underweight workout menu recommendation system based on ontology and SWRL.This system aims to help underweight people to gain weight.This recommendation system includes repetitions and sets for each recommended workout movement.This system is implemented in the form of a chatbot on the Telegram platform which will facilitate interaction between the user and the system to get workout recommendations that match the user's preferences.

RESEARCH METHODOLOGY 2.1 System Design
The flow of system design in our research will be explained based on Figure 1.The first stage that will be carried out is data collection.The data we use contains user biographic data (name, age, gender, weight and height) and physical exercise data.After conducting data collection process, the next stage will be the creation of the knowledge that will be used in this research.The knowledge we create is based on an ontology consisting of OWL (Ontology Web Language) and SWRL language rules.The results of knowledge creation will be validated by Personal Trainer.Validated knowledge will be used as knowledge in our recommendation system to recommend physical exercise according to user preferences.

Figure 1. Flowchart System
The flow of the physical exercise recommender system is depicted in Figure 2. User will interact with the recommendation system through a chatbot with a telegram platform.The system will start with the user entering user information data such as name, gender, height, weight, activity level, difficulty preference, and muscle group preference and then the result will be sent to the handler.User input will be matched with the ontology and the recommendation will be issued through the chatbot.

Knowledge Creation
In this ontology, we develop workout plan knowledge that contains user properties and preferences to provide recommendations regarding appropriate physical exercise information.In making this knowledge there are many factors needed, namely BMI, activity level, difficulty preference based on user preference, and muscle group preference based on user preference.we use BMI as a measure of overall fat used in clinical and public health settings [22].The BMI metric formula ( 1) is used to measure body fat by measuring height (m 2 ) and weight (kg) through a standardized protocol [23].

BMI =
Weight (in kilograms) Height 2 (in meters) (1) Currently there are 2 commonly used BMI classifications, namely the WHO and Asia-Pacific classifications [23].Table 1 is the standard BMI classification that we use based on the WHO classification.Based on the findings of the 2008 Advisory Committee [24], individuals who lead sedentary lifestyles can enhance their well-being by increasing their level of physical activity, even if they do not meet the recommended target ranges specified in Table 2. Recent evidence suggests that reducing physical inactivity at any age can yield substantial health advantages, regardless of whether individuals meet at the suggested target range.

Daily Activity Inactive
No moderate-or vigorous-intensity physical activity beyond basic movement Active 150 -300 minutes a week of moderate-intensity physical activity Very Active More than 300 minutes a week of moderate-intensity physical activity In Figure 3 shows some of the major concepts and relationships for the ontology design of physical exercises for underweight.as shown in the figure it contains Person, BMI_Level, Exercise_Plan and Physical_Exercise.Person class represents the user's properties, user properties and preferences such as constraints on what should be considered for the user.The subclasses of the Person class are activity level that contains user activity level, difficulty preference that contains user preference of the recommended exercise difficulties and muscle group preference that contains the muscle group user desired to ask for recommendation.The BMI_Level class is a user categorization based on calculated values derived from user height and weight input, which are then categorised into BMI Level subclasses, underweight.Physical_Exercise class used to store physical exerciserelated information such as exercise name and duration (minutes, sets, and repetitions).

Figure 3. Ontology Design
We utilize Protégé to create an ontology.Figure 4 shows the ontology that contains 4 main classes: Difficulty Level, Equipment Person, and Workout Plan.Each class in an ontology we create is equipped with object properties to establish semantic relationships between instances each class, as shown in Figure 5. Data properties are also defined on Figure 6 that provide extra information about the class.

Creating SWRL Rules
Body Mass Index of user determined based on the calculation on their gender, weight, and height.It starts by identifying an individual person, it is further established that the person has a particular weight and height value.Next the rule employs the multiply function to convert height and weight to grams and squared height.Lastly the rule (2) conduces by associating the person with their calculated BMI value.(?), ℎ(?, Male), ℎℎ(?, ?), ℎℎ(?, ?ℎ),  (? ℎ, ?, 10000), (?ℎ, ?ℎ, ?ℎ), (?, ?ℎ, ?ℎ) → (?, ?) (2) In taking physical exercises menu, the BMI level classification of a person is calculated using rule (1) and will be determined based on rule (3) where a person with a BMI level of less than 18.5 will be classified as underweight.
(? ), (? ,Male), (?, ?), (?, .) → (? ) Exercise recommendations are formulated by employing recommendation rules that utilize casual logic.For instance, these rules take into account user preferences in order to propose appropriate workout sessions.Rule (4) assigns a workout plan to a person who is categorized as inactive, prefers beginner difficulty, and has a preference for upper body workouts.It matches the person characteristics with the appropriate workout plan and establishes the association between the person and the workout plan using the WorkoutPlan relation.The specific workout plan assigned to the person in this rule named "InactiveBeginnerUpperBodyWorkoutPlan".Lastly this rule used to automate the process of recommending workout plans based on individual preferences and characteristics.(?), ℎ(? , inactive), ℎ(? , beginner), (? , ), (? ) (4) → ℎ(? , ?),  Each recommendation in the physical exercise menu has different characteristics according to the user's input preferences.The recommendations are divided into four sessions, namely Warmup session for warm-up exercises, Core session for core exercises, Muscle group session, where in this session exercises are recommended for the body muscles desired by the user (UPPER BODY, LOWER BODY and FULL BODY) and finally the Cooling down session for cooling down exercises.

Knowledge Validation
The knowledge design's outcomes are then validated by a personal trainer who is an expert in the field of physical activity.The knowledge will be validated by discussing and presenting it to a personal trainer.The knowledge validation process ensures that the knowledge provided is appropriate to the user's preferences and needs through expert discussions and knowledge presentations.

Test Result
The system is tested with the help of personal trainers who are experts in the field of physical activity to validate the findings of the physical exercises menu suggestions and advisors to evaluate the attributes as a determinant of the accuracy of the results of the system.To conduct the test, user samples were collected using Google Form Media and divided into age groups ranging from 15 to 30 years.A total of 30 user data containing name, gender, weight, height, activity level, difficulty preference, and muscle group preference were tested.Based on user data, the chatbot will process the data to provide recommendations for physical exercises in the form of warmup session, core session, muscle group preference session, and cooling down session that will be recommended randomly and provided in the form of a table along with user information during the validation process by personal trainers.
The validation results of the 510 menus recommended by the system show that there are 408 menus validated by personal trainers that the recommended physical activities are suitable for underweight users, and 102 menus of validated physical activities are not suitable because there are still physical activities that are prohibited for underweight user.The validation outcomes are utilized to compute system performance, (5) with a precision value of 0.8, ( 6) with a recall value of 1, and ( 7) with an F-score value of 0.888.

Application Implementation
This approach suggests an exercise routine for those who are underweight.As a result, the user must answer the questions required for the system to offer the suitable exercise selection.Figure 7 depicts a question regarding the user's personal information, such as age, weight, and height.Figure 8 contains a question about the user's activity level, difficulty preference, and muscle group preference.The system uses all of these questions to determine which exercises to recommend to the user.Then Figure 9 explain the results of the recommended workout plan for today which is divided into 4 sessions, namely warm up session which is an exercise menu that must be done before doing the next exercise menu, core session which contains a core exercise menu, muscle group session based on Figure 7 the user selects lower body as the muscle group preferences and finally cooling down session which is a movement that must be done after doing the previous three sessions.

Discussion
During our investigation, we constructed an ontology by employing a diverse range of tools and methodologies, with the use of protege.We incorporated swrl rules into Python through the protege swrl tab.We utilized Python to create a chatbot recommendation system that is connected to the Telegram platform.To assess the chatbot's effectiveness, representation of knowledge, capacity for reasoning, and user-friendliness, we enlisted the expertise of a physical activities domain expert (personal trainer) who tested the system with predetermined queries.The feedback obtained from the expert validation process proved to be valuable in refining the ontology knowledge, rules, and chatbot implementations, thereby confirming their effectiveness.By integrating these approaches with expert evaluation, we successfully created a strong and validated knowledge recommendations.

CONCLUSION
From the tests conducted using sample user data obtained from a Google Form questionnaire, there are 30 user data.The system has successfully recommended a training plan with four training sessions for one day.Each user will be recommended 12 warmup movements, 3 core movements, 3 movements according to the muscle group selected by the user, and 1 cooling down exercise for one day.The results, validated by personal trainers, are that 408 out of 510 menus are accepted for recommendation and 102 menus are not suitable for recommendation.Thus, the precision and recall values are 0.8 and 1.These precision and recall values are quite good, so we conclude that our proposed system can provide workout plan recommendations based on user preferences and can be used as a tool to assist users in increasing weight using muscle mass according to user preferences.One limitation of this study is the restricted quantity of user profiles considered.It is worth mentioning that the chatbot in question is specifically designed to provide a selection of physical exercise options exclusively for individuals who are underweight.

Figure 2 .
Figure 2. Overview of Physical Exercise Recommender System

Figure 4 .
Figure 4.The Classes in Ontology