Physical Activity Recommendation System Based on Deep Learning to Prevent Respiratory Diseases

: The immune system can be compromised when humans inhale excessive cooling. Physical activity helps a person’s immune system, and inﬂuenza seasonally affects immunity and respiratory tract illness when there is no physical activity during the day. Whenever people chill excessively, they become more susceptible to pathogens because they require more energy to maintain a healthy body temperature. There is no doubt that exercise improves the immune system and an individual’s ﬁtness. According to an individual’s health history, lifestyle, and preferences, the physical activity framework also includes exercises to improve the immune system. This study developed a framework for predicting physical activity based on information about health status, preferences, calorie intake, race, and gender. Using information about comorbidities, regions, and exercise/eating habits, the proposed recommendation system recommends exercises based on the user’s preferences. Author Contributions: Conceptualization, U.B., and M.S.; methodology, U.B.; software, G.B.; validation, U.B., N.C., and M.S.; formal analysis, U.B.; investigation, M.S.; resources, G.B.; data curation, U.B.; writing—original draft preparation, G.B.; writing—review and editing, G.B.; visualization, M.S.; supervision, G.B.; project administration, N.C.; funding acquisition, authors manuscript.


Introduction
The prevention of communicable and non-communicable diseases can be achieved by promoting a healthy lifestyle, diet, and physical activity. Heart attacks and kidney failure are more likely to occur when we have high blood pressure, diabetes, or hypertension [1]. It has been shown that moderate exercise reduces morbidity and mortality after viral infection [2,3]. Exercises and meditation are detrimental to the treatment of respiratory viral infections in preclinical studies [4].
A traditional Indian health practice promotes strength and immunity through exercise, meditation, and yoga poses. Stress and depression can be reduced through these exercises as well as improving sleep patterns and boosting immunity [5,6]. Focusing on a particular thought or object combats stress, and exercise-induced adaptations enhance the immune system and mental health [7,8]. The immune system is influenced by physical activity. Increasing fitness can reduce cancer risk, cardiovascular disease risk, type 2 diabetes risk, and obesity risk [9]. Physical activity is recommended by the World Health Organization (WHO) for battling viral infections [10]. Communication technology has made it possible for people to share and motivate physical activity through recommendation systems. A healthy lifestyle and balance can be found on health websites [11,12]. Online communities provide quality healthcare, but their inconsistent advice may negatively impact health, leading to untrustworthiness and the need for filtered accurate information [13][14][15]. In addition, the disclaimer on healthcare solutions does not apply to health recommendations [16][17][18].
The recommendation system based on physical activity promotes individual health and prevents communicable and non-communicable diseases. The effects of high-volume exercise and calorie reduction are attributed to preserving metabolic, cardiovascular, neuromuscular, fiber degeneration, and insulin resistance [19]. The authors of [20], mention that exercise and antipathogenic activity improve the immune system. As a result of user behavior, health recommendation systems provide actionable knowledge [21][22][23][24]. Technology-assisted personalized recommendations enable people to monitor their health and improve it. When exposed to viral infections, regular exercisers will respond better to vaccines and their physical and mental health will be enhanced [25].
In the healthcare sector, intelligent health systems have become a critical component of decision-making. Systems like these ensure access to critical information at the right time, as well as the quality, trustworthiness, authentication, and privacy of the information. Deep learning has also helped healthcare organizations provide personalized care for their patients by analyzing medical histories, symptoms, and tests of patients. Physicians use these health recommendation systems for diagnostic assistance and to provide advice to users of personal health tools [26]. The results of some deep learning-based studies suggest recommendation systems for lesion classification, smart diabetes management, and posture detection.
Physical exercise recommendation systems are arguably under-researched. Consequently, healthcare costs are rising as a result of sedentary lifestyles. Several recent studies [27,28] advocate walking, stair climbing, running, and jumping to prevent chronic viral infections and maintain health after the pandemic. During this study, we developed a recommendation system that included yoga, meditation, and exercises geared toward boosting people's immune systems, as well as preventing viral infections and respiratory diseases. Using a convolutional neural network, a recommendation system is developed based on the user's physical activity levels and immune system. Furthermore, it generates automatic recommendations for patients and healthy individuals to boost their immunity.

Data Collection
A total of 658 individuals filled out the forms in the years 2020-2021, providing us with information on their health and preferences. A questionnaire and a test report were used to gather information about patient symptoms. As well as hospital records, X-rays, scans, and prescriptions from doctors, clinical data sources include individual user preferences. Moreover, medical information and individual preferences were collected using textual data. A total of 658 cases of respiratory diseases including 17 newborns, 83 infants, 115 children, 86 adolescents, and 40 pregnant women. Based on the adopted dataset, Table 1 presents the extracted features.

Study Flow
The flow of the current study is shown in Figure 1. A physical recommendation system based on content filtering was developed and exercises are suggested depending on health profiles filtered by these techniques (refer to Figure 2). User-defined filtering selects exercise lists based on their age, comorbidities, and health status. Two evaluations of the proposed recommendation system concerning experts and individuals were performed at the end of this study. For the expert evaluation, we asked yoga, gym trainers, and medical experts about the sustainability of the system's recommendations. A questionnaire was used to assess the acceptance level of the proposed recommendation system for similar physical activity cases.

Study Flow
The flow of the current study is shown in Figure 1. A physical recommendation system based on content filtering was developed and exercises are suggested depending on health profiles filtered by these techniques (refer to Figure 2). User-defined filtering selects exercise lists based on their age, comorbidities, and health status. Two evaluations of the proposed recommendation system concerning experts and individuals were performed at the end of this study. For the expert evaluation, we asked yoga, gym trainers, and medical experts about the sustainability of the system's recommendations. A questionnaire was used to assess the acceptance level of the proposed recommendation system for similar physical activity cases.

Feature Representation
The yoga recommendation model was developed during this phase. To extract the features that will help the recommendation model from the dataset, we proposed a feature extraction algorithm. Both Algorithms 1 and 2 are proposed to conduct feature extraction and conduct exercise clustering. Based on the filtering criteria, a list of recommended yoga asanas and/or exercises are generated. Upon accepting a recommended plan, the list is stored; otherwise, alternative recommendations are provided based on yoga and/or exercise preferences. The user's preferences and previous health status should be taken into consideration when generating recommendations.

Feature Representation
The yoga recommendation model was developed during this phase. To extract the features that will help the recommendation model from the dataset, we proposed a feature extraction algorithm. Both Algorithms 1 and 2 are proposed to conduct feature extraction and conduct exercise clustering. Based on the filtering criteria, a list of recommended yoga asanas and/or exercises are generated. Upon accepting a recommended plan, the list is stored; otherwise, alternative recommendations are provided based on yoga and/or exercise preferences. The user's preferences and previous health status should be taken into consideration when generating recommendations. Calculate the fitness score using the metabolic rate, body mass index, and daily calorie requirements using the formula: is the probability of the individual that the yoga and the exercise belong to the selected feature, ( | ) is the probability of the individual preferred yoga and/or exercise x, and ( | ) is the individual selecting the random features; c.
Estimate the similarity and exercise preference scores from matrix factorization methods; d.
Integrate both the similarity and exercise preference scores as input layers for the stacked RBM model. For each user, : Compute the individual yoga and/or exercise similarity score as well as the exercise preference score calculated as: where individual I x is constructed using a binary vector I x = (I x1 , I x2 , I x3 , . . . . . . I xn ) where I xm = 1 in the case of the yoga asana preferred by the user I x ; other wise I x = 0; b.
Calculate the fitness score using the metabolic rate, body mass index, and daily calorie requirements using the formula: is the probability of the individual i that the yoga and the exercise belong to the selected feature, p(i|x) is the probability of the individual i preferred yoga and/or exercise x, and p( i|q) is the individual selecting the random features; c.
Estimate the similarity and exercise preference scores from matrix factorization methods; d.
Integrate both the similarity and exercise preference scores as input layers for the stacked RBM model.

Algorithm 2. Proposed Clustering Algorithm
Data: Feature Extracted data Outcome: Clusters of individuals a. Initialize the individuals as u 1 , u 2 , · · · , u n . Initialize the yoga poses and/or exercises as y 1 , y 2 , · · · , y n . Initialize the centroid as k. b.
For each user, u i : a. Measure the centroid k; b.
Calculate the immediate user with similar user preferences u j ; c.
Repeat until the last user u n . c.
The centroid can be given as d.
For each cluster C: a. Calculate the new centroid by: Assigned to cluster C i in the previous step; c.
Repeat until the last user u n is assigned to the cluster C n .
e. Repeat until all the cluster assignments C i change.

Prediction and Recommendations
Exercise is predicted using an individual's health history and preferences. Figure 3 shows a set of exercises that are stacked with a Restricted Boltzmann Machine (RBM) model. Using similar features, the health profiles and preferences of the individuals were compared. Calculate the immediate user with similar user preferences ; c.
Repeat until the last user . c.
The centroid can be given as = ∑ ( ) → , where q = 1, 2…n. Assigned to cluster in the previous step; c.
Repeat until the last user is assigned to the cluster . e.
Repeat until all the cluster assignments change.

Prediction and Recommendations
Exercise is predicted using an individual's health history and preferences. Figure 3 shows a set of exercises that are stacked with a Restricted Boltzmann Machine (RBM) model. Using similar features, the health profiles and preferences of the individuals were compared. here V x is the visible input, and H y is the hidden unit, b 1, b 2 are the bias weights of the V x and H y , and w xy is the weights from V x to H y .
A normal health condition or one that is deteriorating is determined by the input parameters. A parameter's current state determines the recommendation algorithm, and here V x is the visible input, and H y is the hidden unit, b 1, b 2 are the bias weights of the V x and H y , and w xy is the weights from V x to H y . A normal health condition or one that is deteriorating is determined by the input parameters. A parameter's current state determines the recommendation algorithm, and there are different classes of parameter values in the proposed technique. The health profiles of individual users are taken into consideration, as well as comparing two users who have had similar health conditions in the past. Algorithm 3 provided instructions on how to recommend exercises further.

Algorithm 3. Proposed Recommendation Algorithm
Data: Categorized data Outcome: Recommended lists of yoga asanas and/or exercises a.
Conduct user categorization based on filtered features, and group them with the same features. b.
Calculate the exercise list for active individuals by considering their health status and preferences with the formula: ; where f p are the most important features, n p and P p are the measurements for the next and past activities, t u is the altered activity, m( t u ) is the instance count, ϑ(t u ) is the selected features of the activity t u , d(u * , p) is the feature direction change, the value range is −1,0,1, i(t u ) is the magnitude of the specified feature and S(d(t u )) is the duration.

Results
The frequency of symptoms observed in observed cases is listed in Table 2. The most common respiratory infection symptoms were cough, fever, and dyspnea (78.6%), followed by vomiting (85.4%), cough, sore throat, and diarrhea (65.4%). Furthermore, 67.6% of patients had cardiovascular disease, and 54.8% had diabetes.

System Performance Evaluation
Datasets were divided into 75% training and 25% testing, and different invisible nodes were used in the proposed model. Table 3 presents the performance of the proposed yoga recommendation system with different hidden layers. The recommendation system identified three hidden layers with low bias. We evaluated the proposed model's performance using performance metrics. The proposed model outperforms existing ones in terms of accuracy, precision, sensitivity, and specificity, which can be observed in Table 4.

System Validation
Test cases for the yoga recommendation system based on the stacked RBM algorithm are shown in Table 5. Meditating for 30 min while doing yoga poses is recommended for middle-aged people with no comorbidities. The proposed model monitors comorbidities like diabetes and blood pressure and recommends yoga, exercise, and diet plans based on the individual's age and gender. In addition, it includes his or her most recent health report. Additionally, it offers a choice of specific poses or exercises and diet items depending on the user's preferences.

System Evaluation
The Likert scale was used to measure the responses of medical and yoga experts regarding the exercises and yoga recommendations. The system's recommendations for physical activity were agreed upon or disagreed upon by medical and yoga experts. According to their specialties, they were asked to rate the solutions. To evaluate the questionnaire, we used SPSS software. The system evaluation rating is higher than the Likert five-point average (avg = 3.0), indicating that respondents agree with the physical activity recommendation. To recommend suitable physical activities, gym staff, yoga trainers, and medical professionals will be consulted. According to Table 6, the expert team applied the evaluation framework to the real recommendation. Table 6. Experts and corresponding physical activity recommendations.

Exercises
Asanas Recommendations The expert team's descriptive analysis is presented in Table 7. The standard deviation is less than one, indicating the data is close to the mean. The mean values are above 3.0, and the evaluation rating is higher than the Likert five-point average (avg = 3.0), so the selected similar case might at least be able to be adapted to solve the new problems. We then asked the respondents if they agreed or disagreed with the recommendations. According to Table 8, the results of the respondent's evaluation were tabulated. For each recommendation, the expert evaluation indicates a value of over 4.0, which indicates that the respondent agreed with the recommendation.

Discussions
Muscles are used to consume energy during physical activity. Through the spread of communicable and non-communicable diseases, physical inactivity increases risk factors, including mortality. Smartphones and wearable devices track step counts, but there is a subtle difference between them. There was a discrepancy of 20% between the monitored step count and the wearable devices.
The performance of various leisure activities during leisure time is improved by recommendation systems for outdoor activities [30]. As a result of individual healthcare awareness, various functionalities have been integrated into the healthcare system [31,32]. Analyzes fitness data and workouts to determine their effectiveness. A mobile application generates recommendations for physical activity but lacks an indication of personal details, location, and intensity [33].
Using accelerometer data, Profit's framework recommends physical activity based on users' past activities, preferences, and health status [34]. The program analyzes the user's daily routine and heart rate to determine the amount of physical activity he or she should perform [35]. It lacks full personalization and is more engaging than My Behaviors, a mobile app that tracks user activity and suggests food and physical activity [36].
When recommending activity and exercise models, the recommendation system considers the activity profile, demographics, and contextual data [37]. Using sociodemographic data and a person's behavior, the framework generated recommendations [38]. Daily routines are To determine the optimal marathon finishing time at various distances, the K nearest neighbor extreme gradient boosting method is used [39].
Exercise is the same for people of all ages, regardless of their health conditions. There are several confounding variables considered in the proposed recommendation system, including age and health conditions. The proposed system allows fitness assistants to provide continuous recommendations, and daily fitness program recommendations can be made at any time. The proposed model is more accurate due to the use of more comprehensive personal data, comorbidities, individual habits, and location.
It is critical to consider an individual's age, gender, height, and weight when making a recommendation for physical activity. The participants in the conversation will need to manually label vigorous exercises in the future. Regarding calorie burning, which varies from person to person, we will consider confounding variables that negatively affect reliability.

Conclusions
In this paper, we discuss physical activity frameworks that prevent and avoid respiratory viral infections. Three algorithms were presented for recommending physical activity. By analyzing the features collected during data collection, the yoga feature extraction algorithm extracts features. In the proposed yoga clustering algorithm, individuals are grouped according to their health status and preferences. Physical activity frameworks can benefit both healthy individuals and those who have recovered from respiratory viral infections. We compare the proposed results with those of random forests, K-nearest neighbors, support vector machines, and decision trees. Based on the results, the proposed model outperformed all existing machine learning algorithms.
The main highlights of this study are: All the data were extracted including gender, age, height, weight, comorbidities, respiratory infections, exercise habits, nationality, food, and habits; A similarity and exercise score were calculated for each dataset; Integrated similarity scores and exercise scores to cluster similar users; The proposed recommendation model should be developed based on the following factors: gender, age, height, weight, comorbidities, respiratory infections, exercise habits, nationality, food, and habits; If the user accepts the recommendation plan, store the list. Otherwise, provide an alternate recommendation plan.