Friendbook: A Semantic Based Friend Recommendation System

Yashaswini S.   
Assistant Professor, Department of Information Science and Engineering, PESIT, Bangalore, India.

Abstract

Existing social networking services recommend friends to the users based on their social graphs, which may not be the most appropriate to reflect a user's preferences on a friend selection in their real life. Friendbook is a novel semanticbased friend recommendation system, which recommends friends to the users based on their lifestyles instead of social graphs. By taking advantage of sensor-rich smartphones, Friendbook discovers life styles of users from user-centric sensor data, measures the similarity of lifestyles between users, and recommends friends to the users if their life styles have high similarity. User's daily life is recorded as life activities, from which his/her life styles are extracted and further get stored in the cloud. Similarity metric is used to measure the similarity of life styles between users, and calculate users' impact in terms of life styles. When entering the friend recommendation system, Friendbook returns a list of people with highest recommendation scores to the query user. Finally, Friendbook integrates a feedback mechanism to further improve the recommendation accuracy. The idea is to implement Friendbook on the Android-based smart phones, and evaluate its performance on both small-scale simulations.

Keywords :

Introduction

A few years ago, people typically made friends with others who live or work close to themselves, such as neighbors or colleagues. We call friends made through this traditional fashion as G-friends, which stands for Geographical location-based friends because they are influenced by the geographical distances between each other.

With the rapid advances in social networks, services such as Facebook, Twitter and Google+ have provided us revolutionary ways of making friends. According to Facebook statistics, an user has an average of 130 friends, perhaps larger than any other time in history. One challenge with existing social networking services is how to recommend a good friend to an user. Most of them rely on pre-existing user relationships to pick friend candidates. These existing friend recommendation systems, however, are significantly different from this work, as we exploit recent sociology findings to recommend friends based on their similar lifestyle instead of social relations.

In our everyday lives, we may have hundreds of activities, which form meaningful sequences that shape our lives. In this paper, we use the word ‘activity’ to specifically refer to the actions taken in the order of seconds, such as “sitting”, “walking”, or “typing”, while we use the phrase lifestyle to refer to higher-level abstractions of daily lives, such as “office work” or “shopping”. For instance, the “shopping” lifestyle mostly consists of the “walking” activity, but may also contain the “standing” or the “sitting” activities.

1. Literature Survey

Litrarature survey is carried out to analyze the flaws in the existing system, which guides to solve the problems which motivated to propose solutions. A variety of research has been done on activity recognition using smart phones. Following section explores different references that discuss about several topics related to activity recognition and lifestyle modelling.

Friend recommendation system is a system which is based on recording the user's daily lifestyle activities using smart phones and creating a life document out of it. Daily activities are recorded with the help of rich smart phone sensors. These life documents are then analyzed and indexing of each lifestyle is done [1].

Inspired by probabilistic model, daily lives (or life documents) can be treated as a mixture of life styles (or topics), and each life style as a mixture of activities (or words). Taking the idea from the field of text mining, daily lives of the users has been modeled as life documents.

Friend recommendation is done by finding the similarity between different user's lifestyles with the help of an unique similarity metric.

A few lifestyle activities that can be monitored in a smart phone are: Walking/running, sitting, typing, shopping, on call, watching movie, listening to music, travelling etc.

These activities will then be matched to user's life styles like sitting can be matched to '-In office' life style and walking can be matched to travelling or shopping. Similarly every activity will be grouped in one or the other lifestyle (like shoppy guy, foody etc.).

These activities will record user's data, perform some operations and based on the matching between users, recommendation will happen. It also describes, like how the recommendation would be done and they are also providing a feedback control in which user can rate or provide some description whether they are satisfied with the recommendations or not.

We have extracted the idea of recording daily life activities of users and modeling them. Each activity is then matched to one or the other lifestyle. Our computation method is different from that of the paper. The paper uses Hadoop as their backend computational platform while we are using a cloud service.

The accelerometer can be used to obtain sensitive information about the user. Using the magnitude of the accelerometer data we found that we could identify general activities performed by the user, and even have the phone learn new activities [2].

The accelerometer in Android phones measures the acceleration of the device on the x (lateral), y (longitudinal), and z (vertical) axes. Accelerometers can be used to detect movement and the rate of change of the speed of movement. As stated above, the use of accelerometers in Android applications does not require the application permission to use it.

Therefore, it is possible for an application to collect an user's accelerometer data without the user's knowledge. With accelerometer data and the use of a server to collect the information, it is a fairly simple task for someone to gain a user's personal information, their location, or to figure out what a user is doing.

We have understood the basic idea as to how the accelerometer sensor works and how to use them in Android smartphones to detect the user's movement.

Motion sensor embedded smartphones have provided a new platform for activity inference. These sensors, initially used for cell phone feature enhancement, are now being used for a variety of applications [3]. Providing cell phone user's information about their own physical activity in an understandable format can enable users to make more informed and healthier lifestyle choices.

A smartphone application which tracks users' physical activities and provide feedback requiring no user input during routine operation. The application reports estimates of the calories burned, broken up by physical activities. Detectable physical activities include walking, running, climbing stairs, descending stairs, driving, cycling and being inactive.

Evaluated a number of classification algorithms from the area of Machine Learning, including Naìˆve Bayes, Decision Tree, K-Nearest Neighbor and Support Vector Machine classifiers. For training and verification of classifiers, we collected a dataset of 510 activity traces using cell phone sensors. A smartphone app is being developed that performs activity recognition that does not require any user intervention.

The Android Developer website is a complete guide for android development. We have taken a lot of help from the website for various APIs that we have used in our project. The website helped us know various use of mobile sensors and how to integrate them with our android code [4] .

Parse is a hosted cloud service which we have used for the backend computation. The website tells about the usage of parse, it's features and guide to write cloud codes [5]. Few errors are corrected by looking up different websites. Android Architecture is explained in a well manner [6].

Mobile application can be tested by using step-by-step process in eclipse [7].

These are the requirements needed:


2. Existing System

The challenge with the existing social networking services is that how to recommend a good friend to an user. Most of them rely on pre-existing user relationships to pick friend candidates. Facebook relies on a social link analysis among those who already share common friends and recommends symmetrical users as potential friends. Unfortunately, this approach may not be the most appropriate based on recent sociology findings.

2.1 Demerits of Existing System

Unfortunately, this approach may not be the most appropriate based on recent the sociology findings.

3. Proposed System

The proposed solution is motivated by the recent advances in smartphones, which have become more and more popular in people's lives. These smartphones (e.g., iPhone or Android-based smartphones) are equipped with a rich set of embedded sensors, such as GPS, accelerometer, microphone, gyroscope, and camera. Thus, a smartphone is no longer simply a communication device, but also a powerful and environmental reality sensing platform from which we can extract rich context and content-aware information. From this perspective, smartphones serve as the ideal platform for sensing daily routines from which people's lifestyles could be discovered. In spite of the powerful sensing capabilities of smartphones, there are still multiple challenges for extracting users' lifestyles and recommending potential friends based on their similarities.

Friendbook is one such first friend recommendation system which exploits the user's lifestyle information discovered from smartphone sensors. Try to relate the sensor data results with user's life styles. We propose a unique similarity metric to characterize the similarity of users in terms of lifestyle and then recommend friends to users based on their lifestyles. The concept is to use Accelerometer to detect user's movements. Inbuilt Android API's such as Location Manager, Service Manager and Sensor Manager are used to record various activities. Google Map API is used along with location manager and GPS to track user's location. Service manager API gives the luxury to bring out call and SMS details of the users.

These activities are continuously stored in the cloud. We have used Parse cloud as our backend database. Parse is a hosted service that provides back-end services to enduser applications. Parse supports a number of different platforms including iOS, Android and Windows, and web applications. SDKs are available for a number of these platforms. Parse provides a lot of features like Data Persistence, Push Notifications, Social Integration, Analytics, Cloud Code Execution, Web Hosting and Crash Reporting.

4. Methodology

4.1 Registration Module

This module allows new user to create their account. User has to enter his mobile number as his id. This is done to make sure that every user has an unique id.

4.2 Login Module

This module is used to log in to the application. Once successful registration is done, the user has to give his registered id and password as input.

4.3 Activity Recognition

This module is to identify user activities using mobile phone sensors. We have considered four day-to-day activities.

4.3.1 SMS Tracker Module

This module is used to track the number of text messages sent and received over a period of time. This is done using Service Manager API.

4.3.2 Call log Tracker Module

This module is used to fetch the number of calls that a user has placed or received over a period of time. This is done using Android API Service Manager.

4.3.3 Location Detection Module

This module is to detect the current location of the user and match it with the preference that he has given. This module takes use of Location Manager API and Google Map API.

4.3.4 Movement Detection Module

This module is to detect if a person is walking or is Idle at the time he has set his preference. This takes use of the Accelerometer sensor that comes in a built-in mobile phone and a Sensor Manager API.

4.4 Threshold Calculator Module

The Threshold calculator module is used to calculate the minimum threshold for each activity that is set by the user.

4.5 Preference Module

The Preference module is to set the user's preference as to what time he likes to walk and what are the location he prefers to visit. Preference given by him are saved in the cloud db.

4.6 Friend Recommender Module

The Friend recommendation module gives the list of potential friend list by calculating the similarity between different user's lifestyles. User also gets the option to add him/her as his friend.

4.7 Friend List Module

This module shows the list of friends that a particular user has. After the user adds another user, he/she has, his/her friend’s name added to this list.

4.8 Feedback Module

The feedback module is to take feedback from the user for the recommendation results.

5. Results and Discussion

The following snapshots define the results or outputs that we will get after step-by-step execution of all the modules of the system.

Figure 1 shows the first page of the application where the existing user can log in to his/her account and new users can create a new account.

Figure 1. User Login Page

Figure 2 shows the registration activity for a new user registration. User has to enter his/her 10 digit mobile number as user id.

Figure 2. Registration Activity

Figure 3 shows the main activity which contains different options for setting user preferences. It also contains the friend recommendation option and an option to see user's Friend list.

Figure 3. Options to Set User Preferences

Figure 4 shows the preference activity where user can set set his location preferences and Accelerometer threshold for detecting movement.

Figure 4. Preference Activity to Set Location and Threshold

Figure 5 shows the Location preference activity where user can give his location preferences. Multiple Locations can be given.

Figure 5. Location Preference Activity

Figure 6 shows activity for setting the accelerometer threshold in F/sec. i.e., the accelerometer will detect the movement based on this threshold.

Figure 6. Activity to Set Accelerometer Threshold

Figure 7 shows the activity to set the alarm time as to what time the accelerometer will be turned on.

Figure 7. Activity to Set Alarm

Figure 8 shows the result of friend recommendation. User's potential friends are suggested based on their lifestyle similarity. User can add him/her as a friend.

Figure 8. Result of Friend Recommendation

6. Robotium Framework

Robotium is an Android test automation framework that has full support for native and hybrid applications. Robotium makes it easy to write powerful and robust automatic black-box UI tests for Android applications. With the support of Robotium, test case developers can write function, system and user acceptance test scenarios, spanning multiple Android activities [8].

6.1 Features


6.2 Snapshot of Application Testing

The Login and registration module of friendbook is tested using the robotium framework inorder to check the behaviour of the activity as shown in Figure 9

Figure 9. Testing of Login and Registration Activity using Robotium

The overall application was tested for an apk file of the generated friendbook app as shown in Figure 10.

Figure 10. Overall Testing of Application

The result of the overall application testing module is formulated interms of table along with the description of each test conducted and with test script for each activity. The test are conducted to check its effectiveness the form is validated and user ia authenticated for login and registration module [9].

The validation of wrong inputs fails for some cases eventhough the acquired accuracy when the application testing is done for overall application is around 88%. Thus robotium serves as a good platform for testing the mobile apps effectively as shown in Table 1.

Table 1. Result Table for Robotium

Conclusion

The design and implementation of Friendbook, a semantic-based friend recommendation system for social networks is completely different from the friend recommendation mechanisms relying on social graphs unlike in existing social networking services.

Friendbook extracted lifestyles from user-centric data collected from sensors on the smartphone and recommended potential friends to users if they share similar lifestyles. User's day-to-day activities were recorded and then similarity between different users were calculated.

Friendbook is an Android-based application for smartphones, which is evaluated to check its performance on small scale experiments. Figure 9. Testing of Login and Registration Activity using Robotium The results showed that the recommendations accurately reflect the preferences of users in choosing friends.

References

[1]. Zhibo Wang, Jilong Liao, Qing Cao Hairong Qi, Senior and Zhi Wang, (2014). “Friendbook: A Semantic-based friend recommendation System for Social Networks”, IEEE Transactions on Mobile Computing, Vol. 13, No. 19.
[2]. Sauvik Das, Latoya Green, Beatrice Perez and Michael Murphy, (2010). “Detecting user activity using the Accelerometer on Android Smart phones”.
[3]. Anjum and Ilyas (2013). “Activity recognition using smartphone sensors”, Consumer Communications and Networking Conference(CCNC), IEEE, pp. 914-919.
[4 ]. www.developer.android.com
[5]. www.parse.com
[6]. www.tutorialspoint.com
[7]. http://code.google.com/p/robotium/
[8]. http://www.3pillarglobal.com/insights/mobile- testingautomatedtesting- for-android-with-robotium
[9]. http://www.methodsandtools.com/tools/robotium. php