H-Rec 2 : A Novel Mobile-Social System for Automatic Health Recognition and Recommendation

Over the past decades, overweight and obesity has become a global epidemic and the leading threat for death. To prevent the serious risk, an overweight or obese individual must apply a long-term weight-management strategy to control food intake and physical activities, which is however, not easy. Recently, with the advances of information technology, more and more people can use wearable devices and smartphones to obtain physical activity information, while they can also access various health-related information from Internet online social networks (OSNs). Nevertheless, there is a lack of an integrated approach that can combine these two methods in an efficient way. In this paper, we address this issue and propose a novel mobile-social framework for health recognition and recommendation, namely, H-Rec2. The main ideas of H-Rec2 include (1) to recognize the individual’s health status using smartphone as a general platform, and (2) to recommend physical activity and food intake based on personal health information, life science principles, and health-related information obtained from OSNs. To demonstrate the potentials of the H-Rec2 framework, we develop a prototype that consists of four important components: (1) an activity recognition module that senses physical activity using accelerometer, (2) a health status modeling module that applies a novel algorithm to generate personalized health status index, (3) a restaurant information collection module that collects relevant information from OSN, and (4) a restaurant recommendation module that provides personalized and context-aware recommendation. To evaluate the prototype, we conduct both objective and subjective experiments, which confirm the performance and effectiveness of the proposed system.


Introduction
In a modern society, overweight and obesity are quite common and it is well-known that they can increase the risks of many chronic diseases [1].Fundamentally, overweight and obesity are mainly due to the imbalance between calories consumed and calories expended.Particularly, there are two main reasons for overweight and obesity problems: the excessive calorie intake and the lack of physical activity.Since the weight problem cannot be solved overnight, a long-term strategy must be applied to control the weight.According to [2], a series of actions must be conducted everyday in a feedback controllable manner.Typically, an individual needs to (1) monitor not only the basic health information such as weight, but also the daily activities and food intake, (2) estimate his or her health status regularly, and (3) based on the health status, perform necessary physical exercises and control the diet.Unfortunately, many people failed to apply such a strategy continuously and persistently due to many practical issues, such as the cost, complexity and difficulty in data collection and analysis, effectiveness, etc.Therefore, there is a strong need for a systematical approach that can enable both automatic health status recognition and weight management recommendation.
With the advances of information technologies, it is now possible to manage weight continuously with low cost.In resent years, many systems have been designed and developed to provide one or more of the three functions: (1) activity sensing, (2) health status estimation, and (3) weight management recommendation.The activity sensing procedure can monitor an individual's physical activities by sensors on wearable devices and smartphones [3][4][5][6].The health status estimation procedure aims to process the sensed data and then generate the individual's health status, which can be done either on the mobile devices or on servers in the Cloud [7], depending on the computation and wireless transmission costs.The weight management recommendation can be a complicated process that shall take into account many issues, including the individual health status, context (location, time, etc.), and so on.For instance, HyperFit [8] is an Internet-based service that provides personalized recommendations for nutrition and exercise.
Although these existing systems can help to manage weight, none of them can provide an integrated solution that can both recognize an individual's health status and generate personalized and context-aware recommendations for physical activities and food intake.On the other hand, we notice that, many online social networks (OSNs) can provide useful health-related information for individuals, such as recommendations for exercise facilities [9,10] and restaurants [11,12].However, to the best of the authors' knowledge, such useful information has not been fully integrated into any pervasive mobile weight management systems.
To design a better weight manage system, in this paper, we propose a novel mobile-social framework, namely, H-Rec 2 , that aims to integrate continuous health status recognition, and personalized and context-aware weight management recommendations.In particular, the key ideas of H-Rec 2 include: (1) to exploit the sensing capabilities of already ubiquitous smartphone to recognize personal health status, and (2) to leverage health-related information obtained from OSNs to generate personalized and context-aware weight management recommendations.Specifically, the major contributions of our work can be summarized as below: • Firstly, we propose a novel mobile-social framework that can efficiently recognize health status using smartphone and at the same time, generate context-aware personalized weight management recommendations that are based on three types of information: (1) personal health status, (2) life science principles, and (3) health-related information collected from OSNs.• Secondly, we develop a prototype that consists of four important components: (1) an activity recognition module that senses physical activity using accelerometer, (2) a health status modeling module that applies a novel solution to generate personalized health status index in real time, (3) a restaurant information collection module that collects relevant information from OSN, and (4) a health based restaurant recommendation module that provides personalized and context-aware recommendations on demand.• Thirdly, we conduct comprehensive experiments to evaluate the performance and effectiveness of the prototype.The results show that: (1) the proposed machine learning based recognition algorithm can effectively classify different activities in complicated real environments, (2) the health status index model can accurately encode the exercise persistence factor, and (3) the novel health Item-based Collaborative Filtering (ItemCF) algorithm can effectively recommend healthy restaurants that satisfy users' requirements.
In summary, the idea of H-Rec 2 provides a novel way of automatic health recognition and recommendation that can be used for long-term health monitoring and weight management.
The rest of the paper is organized as the follows.In Section 2, we first present the details of the H-Rec 2 framework.Based on the framework, in Section 3, we elaborate on the design of an H-Rec 2 prototype that can recognize a user's physical activities and then provide recommendation for personalized food intake.Next, in Section 4, we present the evaluation of the prototyped system through comprehensive experiments.We describe the related works in Section 5, and finally, we conclude the paper and discuss the promising directions for future work in Section 6.

Background
Obesity is gradually recognized as a main public epidemic health risk factor around the world.Cardiovascular disease, diabetes, hypertension, stroke and metabolic, and some types of cancer syndrome are famous obesity related diseases and all cause morbidity and mortality.Strictly obesity can't be defined as a kind of disease, but it has even more general influences on people's health level than most of other diseases.
Lack of physical activity and excessive calorie intake are the two major subjective causes for obesity and overweight.Physical activity can improve obesity related diseases and mortality [13], while diet is very important determinants of obesity related chronic [14].Physical activity and food intake are both specific and mutually interacting behaviors which promote and maintain good health throughout our entire life.
Inspired by the idea of participatory sensing concept and technology, many researcher groups investigated different kinds of systems for health improvement.Representative examples include UbiFit [15], myHealthAssistant [16] and HyperFit [8].
Benefiting from the ubiquitous sensor-equipped mobile intelligent devices, UbiFit [15] is a mobile, persuasive system that is developed to encourage individuals to self-monitor their physical activity and incorporate regular and varied activity into everyday life.Also by using a single customized accelerometer and a heart rate sensor together with a smartphone as an aggregator, myHealthAssistant [16] system automatically performs daylong activity recognition and heart rate monitoring and adapts to given requirements on activity recognition.HyperFit [8] is an Internet service for personal management of nutrition and exercise.It combines internet, hybrid media and mobile technology with professional nutritional knowledge to give users health counsel, representing summary information and analysis.
Based on numerous case study, two research groups, CENS from UCLA [17] and MetroSense from Dartmouth [18], attempted to abstract more universal system architecture for participatory application system.However, those models are generic for participatory systems, and cannot be directly used for health recognition and recommendation.To the best of our knowledge, there is a lack of a comprehensive framework for personalized health recommendation.

Problems and Challenges
Although researchers have involved in participatory health care area for many years and have designed and developed some systems in real scenario.There are still some problems and challenges.
Firstly, most of current systems rely on extra wearable devices and have not well-exploited the potentialities of already ubiquitous mobile phone.Although external sensors and devices rich the information input, it is more complicated to use and makes system hard to implement and deploy easily.
Secondly, current health care systems only provide low level services for users, such as exercise type recognition and simple statistics counting results etc. Due to the lack of accurate health model, those raw sensor data obtained cannot be fully utilized towards batter health advice.
Furthermore, most of current platforms pay more attention to provide health management services.The limitation of mobile device's resources, such as CPU and energy are not well considered into the participatory system design.On the other hand, to improve the quality of the service, it normally requires real-time sensing streams as input to data mining or machine learning algorithms, which is obviously a big challenge under resource-constrained phone environment.
In addition, due to the lack of user-centric usability evaluation method, how to effectively evaluate the system efficiency from usability perspective is very challenging.
Finally, although there are a lot of health resources on Internet, they are independent from participatory sensing applications.Those information will be very much valuable if the participatory e-Health application can take those contents and context into consideration.Thus, how to achieve content and context awareness in participatory applications is an important issue that need further investigation.

H-Rec 2 : System Design Principles
In this section, we propose a novel mobile-social framework for health recognition and recommendation, namely, H-Rec 2 .In particular, we first present a motivating example, we then elaborate on the key components within the H-Rec 2 framework and provide guidelines towards a good design.Suppose a user, Alice, is going to start a weight control plan for a relative long time period.She is planning to do some exercise every day or at least three times a week, and at the same time, she may want to have some low-calorie food in a decent restaurant nearby every time when she goes out for lunch or dinner.For such a common application scenario, we consider that Alice is taking a smartphone with her and we aim to design a system, including a mobile app and a server-side program, that can monitor her daily health condition and recommend healthy food to her.

Motivating Scenarios
As shown in Fig. 1, to achieve the above goals, a systematic feedback-based approach is needed in the design.Specifically, during the exercise, an activity recognition module shall sense and record her activities accurately by using an accelerometer and other sensors on the smartphone.Once Alice finishes her exercise, a health status modeling module shall estimate Alice's health status based on her body conditions, such as age, weight, etc., as well as the historical records for her activities.When Alice wants to get some recommendations about healthy foods, a health recommendation engine, running in a remote server, shall provide her a list of recommended restaurants, with locations and corresponding meals.
Here we note that, to generate relevant recommendations to Alice, the recommendation engine needs a lot of information.For instance, the engine needs the current location of Alice, which can be obtained from the smartphone.In addition, the engine also needs to utilize the health status history of Alice, which can be obtained from a database that records information sent from the mobile app.Moreover, to obtain useful information about healthy food and restaurants, the engine shall include a restaurant information collection module that can keep retrieving resources from the Internet and mining relevant information about restaurants, such as the location, menu, taste, service, ranking, etc.In this manner, upon receiving the request from Alice's smartphone, the recommendation module can start fusing together the restaurant information, various life science principles such as nutrition of ingredients of food, and the health status and location of Alice.Eventually, a list of nearby restaurants can be sent to Alice, along with recommended meals that are healthy and fit Alice's health conditions.

System Architecture and Design Guidelines
To generalize the ideas mentioned above, we propose a system architecture as illustrated in Fig. 2. As shown in this figure, there are two main parts in the system: (1) recognition and (2) recommendation.In general, the first part will be implemented on a smartphone, while the second one can be realized on an H-Rec 2 server.
In the recognition part, physical activities of a user will first be acquired by sensors on the smartphone.The sensed data will become the inputs of an activity recognition module that can extract features of physical activities continuously.Next, the features will be classified by a health status modeling module to generate concise health status, which will be forwarded to the recommendation part.
In the recommendation part, three types of information will be used to generate weight management recommendations.The first type of information consists of personal health data, some of which can be updated continuously by the health status modeling module.The second type of information can be generated by exploring results obtained from life science, such as the nutrition of various foods, etc.And finally, the third type of information will be obtained from OSNs by a health-related information collection module, which can collect information about local restaurants, exercise facilities, etc.With these information, a weight management recommendation module is responsible for generating personalized and context-aware recommendations for the user.
To explain more details of the H-Rec 2 framework, we will further discuss the design guidelines for the following main modules.

Activity Recognition
To realize the activity recognition module, a number of challenging issues must be considered.First, since there are many different sensors on a smartphone, this module must determine the set of sensors to be used.Second, the frequency or accuracy of sensing shall be decided.Thirdly, a suitable machine learning algorithm shall be designed to accurately recognize physical activities.
It shall be noted that the design procedure can be complicated because the smartphone has limited energy supply and processing capability, which will obviously constrain the computational ability.For instance, when it comes to the sensing frequency, a higher sensing frequency may improve the accuracy of sensing data.On the other hand, with a higher sensing frequency, the smartphone will certainly spend more processing power and consume more energy, which may lead to negative user experience.

Health Status Modeling
For the health status modeling module, the key issue is how to represent the health status that encodes daily health condition into a relatively long time period.On the one extreme, data generated by the activity recognition module can be directly forwarded to the recommendation part without any modeling.However, such an approach may require to transmit a large volume of data through the wireless transmission, which will increase the cost or burden to the user.Therefore, the health status modeling module shall provide accurate health status over the long term, while consuming reasonably small amount of resources, such as storage capacity, network bandwidth, and energy.

Health-related Information Collection
Although OSNs have been part of our lives for years, how to obtain useful information from OSNs is still an open problem.To design the health-related information collection module, there are many new issues.First, the module shall determine what are the most relevant OSNs from the ocean of Internet OSNs.Secondly, once a targeted OSN is determined, programs shall be design so as to automatically acquire health-related information.Finally, a major challenge is how to process the obtained information and extract useful feature that can be used for weight management recommendation module.

Weight Management Recommendation
For the weight management recommendation module, a number of factors must be determined.First, the module shall decide what are the information and healthy principles to be considered.Next, based on the type of recommendation, particularly, physical activity and food intake, advanced algorithms shall be designed to generate personalized and context aware recommendations.
In summary, H-Rec 2 is a complete system that integrates the individual small data from mobile ends and the big data from online social networks, to provide individual-oriented healthy preference.Most researches focus on either the mobile side or the social side, few has worked on the system that takes information from both sides.To the best of our knowledge, H-Rec 2 is the first complete system platform that attempts to address design issues and research challenges in the field.

Implementation of H-Rec 2
To demonstrate the effectiveness and feasibility of H-Rec 2 , we develop a prototype system that can recognize the physical activities of a smartphone user and recommend healthy restaurants to the user on demand.In this rest of this section, we will elaborate on the background and motivation, the methodology, and the implementation details for each of the four modules in H-Rec 2 .The illustration of the prototype system is shown in Fig. 3.

System Components
As discussed before, we infer use's health information by his physical exercise according to obesity and activity related diseases risk factor.The question is: how we can take use of those personal health information to improve people's health status?
In this work, we attempt to borrow the resources from social network to recommend health food to the user, based on his personal's health information as detected using mobile sensing functions.Since calorie is one of the most important factors that affects food health status, to simplify the issue, we choose to use average calories as the criteria to evaluate the restaurant's recommended dishes.
We developed a mobile-social prototype to demonstrate the proposed idea.The prototype includes two main parts: (1) AR based Health Level Estimator (H-Estimator) that is based on Health Index Model and developed on smartphone, (2) Health Restaurant Recommender (H-Recommender) that is based on Health Recommendation Model and runs in remote web server.The technical details are discussed in [19], and will be reviewed in the following subsections.
At usual time, the system on a user's smartphone runs periodically to collect and record his daily health level information.When he decides to go to a restaurant and wants to select a more healthy one which he had never tried, he can use the application on his smartphone to send a request.Through the GPRS or WiFi network, the system sends the user's real-time health level information estimated by H-Estimator together with the query to remote server.H-Recommender generates the recommendations that fit user's current health level and then responds to the user.Then this user can choose the one he likes the most from candidates that are recommended based his real-time health level.

Background and Motivation
Activity recognition using sensors (e.g, accelerometer, gyroscope, GPS) on smartphone has been an active research area in recent years [4][5][6].In general, the phone-based activity recognition task is carried out in three phases: (1) raw data collection, (2) feature extraction, and (3) classification.
In the first phase, the smartphone obtains a serial of sensor readings within a small time window.For example, in [4], the readings of accelerometer on Android phones are collected at 20Hz in ten-second windows.In the feature extraction phase, the smartphone can transform the raw time-series sensor data into a set of representative features that describe the characteristics of activity.Once the features are obtained, the smartphone can apply classification algorithm to infer the activities.
In previous studies, various feature extraction and classification approaches have been investigated for different activities.In [20], the authors analyzed several feature extraction methods and they observed that, to classify dynamic activities, frequency-based features extraction can be more accurate than the wavelet-based features extraction.For activity classification, many existing machine learning schemes have been applied, such as Decision Tree, K-Nearest Neighbor (KNN), and Support Vector Machine, etc.In practice, these algorithms have to be trained beforehand, using a set of data samples representing the specific activities that need to be recognized.

Methodology
Among many embodied sensors on a typical smartphone, accelerometer and gyroscope are the most relevant sensors to activity recognition.For simplicity, in our prototype we choose to use only the accelerator sensor, the same as most other work.Moreover, since the activity recognition is only a part of the health recognition framework, we adopt a common approach, similar to many existing work, to realize the training process and real-time activity recognition on smartphone.
Specifically, each reading generated by the accelerometer used on smartphone has three values corresponding to the three axes/dimensions.In the first step, onSensorChanged(), provided by Android, is called to obtain three floating-point values.With such three values, many features can be obtained, such as the mean, energy, and entropy of acceleration, which have been shown to result in accurate recognition of certain postures and activities [21].To simplify the computation and save the energy on smartphone, in this study, we borrow the idea from [22] to achieve the activity recognition.First, the Average Resultant Acceleration for each sample is calculated.That is, for each sensor reading, we compute the magnitude: Next, as in [21], the fast Fourier transform (FFT) is applied for the feature on a data set that contains sixty-four consecutive magnitudes: ( f 0 , ..., f 63 ) = FFT(m 0 , .., m 63 ).Furthermore, a feature vector is constructed by organizing the Fourier transform results, the maximum value of the magnitude block (max(m 0 , .., m 63 )), and the user supplied label (i.e. the physical significance, such as walking).Finally, we will train the activity classifier using such a series of labeled feature vectors, to generate the classifier.
For classification, there are many standard machine learning algorithms that can be used here to identify the activities.Nevertheless, there are still many open challenges on how to find a feasible algorithm that satisfies specific activity recognition requirements.This is because the classification depends on the application scenarios and many other scientific or engineering issues, such as computational complexity, energy consumption, etc.Thus, in this work, we will discuss how to choose and train the classification algorithms in details in Section 4.1.

Implementation
We implement the activity recognition module using the following working threads on the smartphone.Fig. 4 shows the sensing interface to users.
• SensorManager.By using the SensorManager class provided by the standard Android SDK, this thread achieves the acceleration sensor device management, including the sensor devices monitoring, frequency setting, data sensing collection and storage, and so on.• DataFeatureExtractor.According to the requirements of machine learning algorithms, the raw sensor data need to be pre-precessed.The main task of this thread is to extract the sensor data feature and organize processed data into feature vectors.• DataClassifier.This thread includes two parts of system functions.On the one hand, it uses machine learning algorithms to classify the feature vector as physical activities.On the other hand, it takes the classified physical activity information to mine personal health status.

Background and Motivation
In life science, many researchers have paid attention to cardiovascular disease risks associated with obesity and physical exercise, and they demonstrated that people in different obesity and active levels (i.e., the amount of physical activity) may have different probability to suffer with possible cardiovascular disease and metabolic syndrome [14,[23][24][25][26]. Considering all factors, the concept of persistence is one of the most important features of physical exercise that would influence on body health.
The influence of persistence can be interpreted in two ways: (1) one-time physical exercise for a relative long duration (e.g., several hours) can benefit our bodies for a few days; (2) a body lacks of exercise for a long time cannot recover immediately to be healthy by only the one-time physical exercise.Besides, the impact of physical exercise can last for a period of time and will decay over time.For instance, for the recommended amount of exercise for adults given in [24], the impact cycle is about one week.
According to above discussion, the health status modeling module shall realize the impact of persistence when transforming the physical activity to body health level.

Methodology
To effectively infer the health status from the activity, we propose a health index model that takes persistence of physical activity into account when it realizes the transformation of physical activity to body health status.The major idea is illustrated in Fig. 5. Let d be the longest valid time (in days) during which a physical exercise can affect body health.Let d i be the ith day before today and t(d i ) be the total amount of exercise on day i.Also let α be a factor that represents the decay of physical exercise's influence on body health, and r be the recommended amount of exercise threshold for one day, which can be built from knowledge developed in life science.With these definitions, we use Eq. ( 1) to estimate user u's current health level h u (c):

Positive Negative
The parameter α can be a simple constant number or a function (e.g., α = f ((t(d i ) − r), d)).By using α, we can integrate different factors inferred from life science to enhance the estimation about the impact of exercise on body health.If t(d i ) is larger than the threshold, it will have a positive Here we note that, h u (c) is built based on the physical activities.If we want to integrate some other body indicators, such as Body Mass Index (BMI), gender and so on, we can use those indicators as a weight to the variables in the equation.
In short, we consider that our model is simple and does not restrict the specific life science model in the context.Since we abstract activity health index independent with health level inference, it can be easily extended if the basic life science model changed.

Implementation
In our implementation, we calculate h u based on the results shown in [24].Specifically, we refer to Table 2 and Table 3 in [24], for (1) "Adjusted odds ratio of cardiovascular risk factors by activity and BMI" and ( 2) "Odds ratio for metabolic syndrome according to physical activity and BMI", respectively.By comparing the user's current activity index h u (c) with the recommended amount of exercise, we can rate his or her current active level.Combining it with the user's BMI and gender, we can evaluate the disease risk level.
According to expert knowledge in life science, we set d, t and α, which are important and relevant parameters, as follows: let d be 7 days, let t be half-hour moderate exercise.We evaluate different values for α to see how the estimated health level changes by different influence factor.The results are shown in Section 4.

Background and Motivation
In many OSNs, there are a lot of health-related resources, which can be very much valuable if the e-Health applications can take those contents and context into consideration.However, they are normally independent from each other, and they are rarely used in the mobile e-Health system.
With regards to the healthy food collection, there are several challenges in collecting useful information from the OSNs.First of all, due to the variety of meals, diversity of recipes, ambiguity of meal's and food's names, it is very difficult to construct a unique dataset directly from the original data crawled from public web.Also, many restaurants do not open their recommended dishes, and some do not have users' comments.Though some automated methods have been proposed for Internet receipt data collection [27], they need knowledge from natural language processing, large resource database of dishes and food, and high quality retrieval methods; and hence, it is very complicated to implement in practice.

Methodology
To obtain useful health-related information, we need several steps.First, we shall crawl a bigger dataset from different sources from the Internet.Second, we need to clean up the data to ensure the consistency and semantic uniqueness.Third, those data have to be reformed to the one that can be used as input to the health recommendation algorithm.
Clearly, the collection process shall be done offline because it may take several hours, even days, to gather raw data from the Internet.Moreover, how to clean up the data is also an active research area, which requires a lot of efforts.Once the initial database is constructed, according to the new arrivals of the contents, such as the user comments and the opening of new restaurants, the system shall automatically update the database.

Implementation
In this work, we have crawled about 10000 raw commercial restaurant records available in Internet (particularly from dianping.com[12]) to build an initial dataset, including the restaurants' basic information, users' grade information and comments.We then cleaned up the dataset to make sure that each data item contains all required information.Finally, according to the average calorie of the ingredients of each dish, we labeled about 2000 restaurants' health level and built the health food database for all to be recommended restaurants.

Background and Motivation
In order to make an effective feedback control scheme on the weight management, upon receiving the user's query, the system should be able to automatically recommend health food or exercise facilities to the user.
Among the recent advances in recommendation techniques, Collaborative Filtering (CF) is one of the most successful approaches [28][29][30] that is widely used in many recommender systems in e-commerce and information filtering applications.In a typical CF scenario, there are m users and n items, where each user can express his/her opinions about the item by a rating score.So we can use a m × n matrix R to represent such user-item relationship, where each entry r x,y in R is the preference rating score of the xth user on the yth item.Obviously, for those items that have not been rated by that user, the corresponding value will be 0. The basic idea behind CF algorithm is to mine patterns within the ratings in order to forecast each user's preference for unrated items [29].
In this work, we tailor the idea from Item-based CF (ItemCF) [30] to design health food recommendation algorithm.A typical ItemCF algorithm recommends an item to a target user by taking into consideration the user's preferences, and comments and rankings on items of other users that share similar preferences.For instance, with regards to the health food/restaurant recommendation, the ItemCF algorithm can recommend a smartphone user to visit a set of restaurants that are suggested by people who have similar health preferences of other user.

Methodology
Typically, there are two steps in Item-based CF algorithm: item similarity computation and prediction computation.Similarity computation is to determine the similarity between two items, and prediction is to select the most similar items to the target user [30].The illustration of the algorithm process is presented in Fig. 6.The proximity for similarity can be measured using either the correlation, such as Pearson correlation, or the cosine measure.For the sake of simplicity, we take use of cosine-based technique to calculate the item similarity in this work.That is, for the given m × n rating matrix R, the similarity between the items i and j is defined as the cosine of the angle between these two m dimensional vectors.For instance, for the representing vectors of item i and j: (r i1 , r i2 , ..., r im ), (r j1 , r j2 , ..., r jm ), the cosine similarity is: Once the most similar items are calculated, the next step is to predict the linkings to the target user.In general, there are two prediction methods: weighted sum and regression [30].Here, we adopt the idea of weighted sum approach and try to integrate the health model into the calculation.For user u, the prediction on item i is computed in equation 3.
Here, sim(i) denotes the set that includes all similar items to i, r u,j refers to user's rating on item j, and f (h j , h u ) represents the match between the item's health level and the user's health level that is defined as below: Here, β is set to be a constant factor that represents how much to the extent that the health match level impacts the similarity calculation.It can be a simple number or inferred from a more complicated life science model.Note here, with respect to the well-defined health indexing model, the more closer of the value to 1, the better match of the restaurant item to the target user.
In summary, the proposed method implies that the better the item's health level matches the user's expectation, the higher similarity it obtains.In other words, item i is more likely to be recommended to this user who likes item i because it can better match his/her health level.

Implementation
In our prototype, the recommendation engine is designed using the proposed technique, as discussed before.In order to integrate the health indictor with other information, the health recommendation subsystem is built on a server with data resources from three different dimensions: personal data repository, life-science database, and restaurant information generated by the health-related information collection module.
• Personal database: As discussed before, sensing data and activity-based health status information are collected and mined on personal smartphone.This part of information should also be stored at the server side for permanent usage.According to the individual's health query, the recommendation subsystem can check the history health records in the personal data repository to provide customized recommendation services.• Life-science database.In this system, we use calorie, a de facto criteria as the health indicator for food intake.Since there is no standard database for calories for each recipe, we manually build such a database for restaurants according to the life science resources.• OSN database Although there exist some restaurant recommendation applications on the Internet, such as Yelp [11] in USA, and DianPing [12] in China, most of them publish users comments or an average ranking score for a restaurant by the interests of taste, price, location, and services etc., and few focuses on health criteria.In this work, we take health as the major factor into the recommendation generating procedure.Specifically, we will utilize restaurant information generated by the health-related information collection module.We observe that the accuracy in real environment is slightly lower than ideal evaluation scenarios (i.e., without normal phone usage), e.g., about 10% lower than the results in [21], [4].The main reason of the difference is that in the real scenarios, activities are intervened with phone's normal usage, such as making phone call, sending message, listening to music, websites surfacing and so on, thus there are many noise to the raw activity data.Comparing Table 1 with Table 2, we observe that a general classifier (i.e., J48) is not as accurate as a specific one (e.g., RF).Also, the same classifier may show different results for different subjects, as shown in Table 2.
In summary, we can see from the results, in daily life, the body activity is much more difficult to be recognized than in the ideal conditions.But the result with highest score is about 73% (RF), which is acceptable in a complicated real environment.

Evaluation of Health Status Modeling
In order to evaluate the effectiveness of the health status modeling module, we conduct a test for a real user to recored the activity.In the test, the subject had been traveling in Beijing as a tourist for 7 days from Apr 23rd to Apr 29th, 2014.He visited most of Beijing's interests and spent about seven hours everyday in tour and used the phone to record all his activities.We compared the record curves with different decay factors α in the health model and the activity record curve without health model.The results are shown in Fig. 7 and Fig. 8.
During the journey, since there are a lot of exercises everyday, the subject's body was kept in tired state, which should be indicated as health status in the health model.That is, although in last two days, the amount of exercise reduced, the persistence of activity in previous days still had impact and the body was still in health state.These results are confirmed:-with different decay factors in our model, the last two days' health indicator are still high in the figures.While without the health model, the results only reflect the health level for everyday independently, but ignores the persistent impact of exercise in previous days, thus the health indicator sharply decreased to a very low level.In summary, our proposed health model can effectively take the impact of activity persistence into account and thus reflect health level more accurately and objectively.

Evaluation of the Recommendation Algorithm
Considering that our experiments will not last long enough to reflect a slow health improvement for one user, we set β to 5 to amplify the influence of the recommended restaurant's health level on similarity calculation.Thus, experimenters can reflect visible differences in each recommendation results.We conduct experiments to compare three different kinds of recommendation algorithms.
• Random Recommendation: recommend restaurants for users randomly.
• ItemCF Recommendation: recommend restaurants for users based on their interest history.
• Health ItemCF Recommendation: recommend restaurants for users based on their interest history and health level.
The application scenario is as follows.At usual time, the system on a user's smartphone runs periodically to collect and record his daily health status.When he decides to go to a restaurant and wants to select a more healthy one which he had never tried, he can use the application on his smartphone to send a request.Through the GPRS or WiFi network, the system sends the user's real-time health level information together with the query to remote server.Upon the receipt of the query and the personal health information, the recommender generates the recommendations that fit user's current health level and then responds to the user.Then this user can choose the one he likes the most from candidate list.
Ten subjects participated in the test.All of them were asked to use the recommendation application for seven days and test each recommendation algorithm once a day.The application runs as a background thread to collect their health information in normal situation everyday.Subjects needed to rate for about 10 restaurants recommended by each algorithm.The recommended restaurants are from the dataset at OSN DB, and each recommendation item includes a restaurant's all real information, such as location, price, recommended dishes, expense, service and so on.Subject will provide a rating score choosing from 1 to 5 point for each recommended restaurant in the list.A higher score means that the subject prefers to choosing the food in this restaurant.
The average and standard deviation of the resulting ratings are presented in Fig. 9.We observe that ItemCF recommendation performs significantly better than random recommendation, and health ItemCF recommendation is better than ItemCF recommendation.These results indicate that the proposed activity-based health restaurant recommendation strategy matches user's health level well with item's health level, and thus outperforms the other two methods.

Subjective Evaluation
In order to understand user's experience and intention to health diet, we also design a survey to evaluate the performance with regards to usability.The survey is presented in Table 3 and   is inspired by [36].In the survey, Q1 and Q2 are set to record subjects' experiences.Q3 and Q4 try to understand how much they care about their health and the intention to change their dietary habits.Q5, Q6 and Q7 try to know if H-Rec 2 can satisfy users' requirements for health recommendation, and whether it is a potential good choice.The survey is used for ten subjects after the experiments.The results are also presented in the same Table .All questions are set to be answered on a 5-point scale, from strongly disagree" for 1 point to "strongly agree" for 5 point.
The results demonstrate that: 1) most users prefer more health recommendations; 2) it is not easy to find healthy food and users hope that one application based on mobile phone can make up the shortfall; 3) as a demonstration system, H-Rec 2 is a good platform to service users' health requirements.

System Evaluation
In order to evaluate the effect of work load of the sensing and recommendation system, we add a thread to monitor CPU performance for the recommendation system and a thread to control sensor data collect.The resource consumption of these two threads takes only a small proportion.So we take them into account together with the overall resource consumption statistics result.The evaluation results are illustrated in Fig. 10.
We set five experiments, each having the work rate range from 90% to 10%, and the 100% work rate is set as the benchmark.The work rate which is a decimal between 0 to 1 means the ratio of sensor data processing related threads' work time and sleep time.The higher value means that the system is running with higher work load.
As showed in Fig. 10(a), the CPU utilization percentage of the system reduced from 65% to 45% as the work rate changes from high to low values.Fig. 10(b) shows the details for each thread's CPU utilization in one experimental seting.Because of the multi-thread mode, the results shown in Fig. 10(a) declines more smoothly than in Fig. 10(b).When the amount of data to be processed is small, most of CPU computational resources are for the maintenance of the idle status.
We also compared the CPU utilization between the entire system and sensor data processing related threads.In Fig. 10(c) we observe that the entire system's CPU utilization reduces as the same proportion of sensor data processing related threads' reduces.The results prove that real-time sensor data processing is the major component of the participatory system.

Related Work
In this section, we first discuss some interesting related mobile sensing applications, and then present mobile-sensing based health system works.As a very important issue, researches on real-time sensing and related resource optimization problems in such participatory sensing environment are also summarized.

Mobile Sensing Applications
Because of the wide applied range of participatory systems, their design methods are very flexible.Also they often involve in multiple disciplines of knowledge and technology.But universal system structural frame and unified design specification are still a open question .
Based on CENS [37]'s work, although participatory sensing systems vary, their basic workflow is very similar.They divides a typical participatory system into 3 core parts, Collaboration, Capture, Transfer, Storage, Access, Analysis, Feedback and Visualization.Each part works respective and is carried out by appropriate technical implementations [17] [38].MetroSense [39] proposed three core parts of the participatory system design structure: Sense, Learn, Inform share and persuasion in [18].Sense refers to use cell phone sensors to collect and pre-process raw data.Learn refers to mine useful information from sensor data through machine learning.Feedback , contains a number of participatory systems critical components.Inform emphasizes informing participatory information to users, Share emphasizes participatory information sharing between the groups and the general public, Persuasion stresses the importance of participatory information visualization.

Mobile-Sensing Based Health System
Obesity is gradually recognized as a main public epidemic health risk factor around the world.Physical activity and food intake are both specific and mutually interacting behaviors which promote and maintain good health throughout the our entire life.Inspired by the idea of Mobile-Sensing, many researcher groups put forward different kinds of system to improve the situation.
UbiFit is a mobile, persuasive system that is developed to encourage individuals to self-monitor their physical activity and incorporate regular and varied activity into everyday life.Benefiting from the ubiquitous sensor-equipped mobile intelligent devices, the system uses on-body sensing, activity inference, and a novel personal mobile display to encourage physical activity.The system relies on the Mobile Sensing Platform(MSP) [40] to automatically infers and communicates information about several kinds of physical activities to a mobile phone application.The application includes detailed information about the individuals physical activities and an editable activity journal.Finally the application provides the goal attainment to motivate behavior for daily physical activity for users.
By using embedded wearable sensors combining with a smartphone as an aggregator, myHealthAssistant system automatically recognizes and logs both daily activities as well as specific gym exercises.It performs daylong activity recognition and heart rate monitoring and adapts to given requirements on activity recognition.A set of a single customized accelerometer, a smartphone, and a heart rate sensor together form the BSN-based preventive health care system.The classifiers on the phone mine the data which is collected by customized 3D inertial sensors embedded in fitness accessories with built-in pre-processing of the initial 100Hz.The application in the phone finally provides information including current heart rate, calorie expenditure, repetition count, exercise, and workout details.
HyperFit is an Internet service for personal management of nutrition and exercise.It combine internet, hybrid media and mobile technology with professional nutritional knowledge.The system gets quick and easy food and exercise diary data input by wearable devices, product browsing and search, favorite lists, barcode scanning etc. Basing on the official nutrition recommendations by the National Nutrition Council of Finland it gives users health counsel, representing summary information and analysis.The information services include nutrition recommendations, energy and nutrients, weight management, food additives and exercise.
At the same time current work still have many unsolved problems and limitations.At first, most of current systems rely on extra wearable devices and have never well-exploited the potentialities of already ubiquitous mobile phone.Secondly, current health care systems can only provide low level services for users.Especially the activity and dietary based health care applications can only give information about exercise type recognition and monitor, amount of exercise statistics and suggestion, nutrition input recording and diet adjusting and so on.Finally, most of current works pay more attention to provide novel kinds of health services.The limitation of mobile device's resources and efficiency of the whole system and algorithm model are not fully considered during system design and implementation.

Real-time Sensing
For smartphone based sensing system, whether it is used for activity recognition or for other purposes, continuous real-time sensor data collecting and processing is the core part.Although the sensor data collecting and processing frequency will vary for different types of application, mobile based sensing systems have similar work flow.Especially such uninterrupted data collecting and processing consume a lot of phone resources and even affect the normal use of the phone.
Symphoney [41] focuses on system components associated with real-time data processing, especially solves the multiple applications concurrently executing.As proposed in the paper Symphoney, which is a sensing flow execution engine, can be used to build a common structure and coordinate the deployment on the same phone of different systems.Due to SymPhoney different applications can dynamically adjust their workload by monitoring CPU usage and maximize the overall effectiveness.
There are also researcher works, such as [42], [43], consider how a reasonable continuous running mechanism can be brought to reduce resource consumption in real-time data processing.Such works independently investigate specific sensor systems to try to balance resources consumption and system functions by managing, controlling and optimizing the system data collecting and processing.
In mobile based sensing system, the core data processing can be deployed on the phone independently as well as on the mobile cloud.[44] and [45] make their contributions about deployment of sensor data processing in the cloud and present related optimized design models.Especially XStream in [45] can support for signal processing on the server side.

Resource Consumption Optimization
Matador [46] and SociableSense [47] are two mobile sensing systems which focus on resource consumption optimization during system design.Matador is a mobile crowd-sensing system which exploits user context to optimally deliver tasks to users, while preserving mobile device resources.It maximizes conditions for user participation by presenting the only tasks relevant to the user, while minimizing the consumption of mobile device resources, specifically the battery.SociableSense , a mobile phone based platform that captures user behavior in office environments.It provides an adaptive sampling mechanism and models to decide whether to perform computation of tasks, such as the execution of classification and inference algorithms, locally or remotely, while considering three dimensions: energy, latency, and data traffic.
[48] presents a novel and universial design framework for an Energy Efficient Mobile Sensing System (EEMSS).It uses hierarchical sensor management strategy to recognize user states and to detect state transitions.EEMSS's core component is a sensor management scheme for mobile devices that operates sensors hierarchically, by selectively turning on the minimum set of sensors for monitoring and triggers new set of sensors if necessary for state transition detection.Energy consumption can be reduced by shutting down unnecessary sensors at any particular time.
[49] develops an efficient processing pipeline for continuous 3D accelerometer and gyroscope sensors based gesture recognition.The front-end of the pipeline is comprised of low computation stages responsible for spotting potential gestures, while filtering out most of the "non gestural" sensor data.These stages can be offloaded to a low power processor close to the sensors for further optimization.The backend of the pipeline is responsible for recognizing gestures and is more computationally intensive, but will be invoked for only a fraction of the time.This enables considerable savings of energy and processing consumption by allowing the main CPU to be in idle state longer while still processing sensor data in low power unit.

Conclusions and Future Work
To prevent the serious risks due to overweight and obesity, it is necessary to design a comprehensive weight management system that can help individuals to recognize and control their food intake and physical activity.To address this challenging issue, in this paper, we have systematically investigated the design a weight management system.Specifically, we proposed a novel mobile-social framework, namely, H-Rec 2 , that can leverage both mobile sensing and relevant resources in online social networks (OSNs) to achieve better health recognition and recommendations.To demonstrate the potentials of the H-Rec 2 framework, we have developed a prototype system that consists of four important components: (1) an activity recognition module that senses physical activity using accelerometer, (2) a health status modeling module that applies a novel algorithm to generate personalized health status index, (3) a restaurant information collection module that collects relevant information from OSN, and (4) a restaurant recommendation module that provides personalized and context-aware recommendation.To evaluate the prototype, we have conducted extensive experiments, which demonstrate the performance and effectiveness of the prototype.
We believe that the study in this paper is just the first step towards new generations of weight management systems.In the near future, we plan to further improve our system in several dimensions.First, we will investigate the energy consumption issue in smartphone, which is an important factor that can attract more users.Second, to improve user experience, we will study how to mitigate the conflicts of resource demand between the H-Rec 2 and other smartphone usage.Finally, we will enhance the health recommendation model to take into account more factors, such as the context information, etc.

Figure 1 .
Figure 1.The Mobile Sensing and Social Application Scenario.

Figure 2 .
Figure 2. The System Architecture of H-Rec 2 (DB stands for database.).

Figure 8 .
Figure 8. Health level record of one subject (BMI is 18) a tourist.α which is 1, 2 or 3 respectively represents different activity decay factors.

Preprints (www.preprints.org) | NOT PEER-REVIEWED | Posted: 10 March 2017 doi:10.20944/preprints201703.0058.v1 influence
on body health during d days and vice versa.In this model, d, t and α are variables that can be set according to different health indicators.

Table 3 .
Questionnaire of user intention and experience.