Movie Recommendation Service Based on Preference Correlation Coefficient of Audience in Smart Environment

— Recommendation system has been more and more popular recent years. It can help people make decisions quickly, and is used in many popular applications include movies, music, news, books, research articles, search queries, social tags, and products in general. Smart homes also get enormous attention in the last decade, due to important applications like health, energy, and security. Different techniques and approaches have been devised by the researchers to make the smart home more efficient and effective. In this paper, we proposed the movie recommendation service based on preference correlation coefficient of the audience in a smart environment, which will lead to the entertainment convenient in a smart environment. Based on our experiment results, we consider the use of the Pearson Correlation Coefficient in the recommendation service is feasible and practical.


I. INTRODUCTION
The science and technology develop rapidly; everything begins to become intelligent, providing all kinds of convenience for human life. Many researchers are working on building a smart environment [1] - [3]. To build a smart city, it can use the Blockchain Technology to join the Smart Energy Grid, exchange information and buy/sell energy between the involved nodes (energy providers and private citizens), use the Blockchain granting ledger [4]. The smart home can automatically perceive the changes in family situation, respond to the corresponding responses dynamically, and automatically help residents realize a more comfortable life [5]. The smart home overview includes family (information) equipment, equipped with computer furniture, home network, home gateway, and family service. Household appliances and furniture are linked together through various home networking protocols and home communication media to form a home network. The home gateway can help residents collaborate in the interactive operation of these appliances and furniture. Then, it can create a suitable atmosphere for family members according to their location, circumstances, and preferences. Finally, family residents can comfortably enjoy family services through the autonomic operation of the home gateway without any staffing. Applying context-aware computing in smart homes is useful and practical, it can achieve a vivid interaction between residents and smart home [6] [7]. For a smart home, there could be an IoT-based monitoring system using a tri-level context making model for context-aware services [8], there could have device-level protections augmented with network-level security solutions to monitor network activity and detect suspicious behavior [9]. Moreover, to incorporate strong security in deploying IoT for the smart home system, the system could run on conventional WIFI network implemented based on the AllJoyn framework, using an asymmetric Elliptic Curve Cryptography to perform the authentications during system operation [10]. Then in order to enrich the diversity of the smart home, it is necessary to add some pleasant service.
In this paper, we present the movie recommendation service based on preference correlation coefficient of the audience in a smart environment, which can make the smart environment more interesting. The remaining content of this paper is as follows. Section II describes some material and methods, include the design of the service. Section III shows the results of experimental tests and discussion. Section IV is the conclusion.

II. MATERIAL AND METHODS
Many people like to watch movies now, and sometimes they are too tired to go to the cinema. Then watching movies at home is a good choice, but it is difficult to find movies they like, at this time, smart home with movie recommendation service is necessary. Some researchers have built a recommender system model that combines content-based filtering with collaborative filtering, harnessing the information of both ratings and reviews [11], [12]. And for a movie recommendation service, it is able to use folksonomy to enrich the knowledge base with descriptions and categorizations of movie titles, and user interests and opinions and use tags harvested through the Internet Movie Database, and movie rating data gathered by Netflix to provide a basis for prediction of users' rating for a previously unseen movie [13]. It is also able to implement a hybrid approach based on content-based and collaborative filtering in MoRe (a movie recommendation system) [14]. Alternatively, using a probabilistic model based on collaborative filtering and topic modeling which allows users to capture the interest distribution of users and the content distribution for movies [15].
After some comparison and experiment, we decide to develop the movie recommendation service based on the Pearson Correlation Coefficient. Fig. 1 shows the conceptual diagram of the service. When users finish watching a movie, they can give movie score from 0 to 5; all data will be saved in the database. The system can find the other users who have seen the same movies and the scores they gave to the movies. Using the Pearson Correlation Coefficient, find the user which have the most similar interest (the most significant correlation coefficient). Moreover, finally, the recommendation service will recommend the client movies in the user's database which the client has not seen. (1) Correlation addresses the fundamental question of whether two variables are related or independent. Correlations can range from −1 to +1, where −1 means a perfect negative correlation (as one variable goes up the other goes down), 0 means no correlation (the variables are independent with no pattern of relationship), and +1 means a perfect (error-free) positive correlation between two variables (both go up and down at the same time) [16].
Covariance is used to measure how much two random variables change together (equation 2).
(2) Standard deviation is used to quantify the change in asset of data or the dispersion of the measured value. Low standard deviations indicate that the data points tend to be close to the average of the set (expected value), while the high standard deviations indicate the value of the data points distributed over a wider range. The standard deviation of a random variable is the square root of the variance (equation 3).
(3) There are some advantages to the Correlation Coefficient [17]. Covariance can take on practically any number while a correlation is limited: -1 to +1. Because of its numerical limitations, correlation is more useful for determining how strong the relationship is between the two variables. Correlation does not have units. Covariance always has units. Correlation is not affected by changes in the center (i.e., mean) or scale of the variables. Fig. 2 shows the flowchart of calculating the Pearson Correlation Coefficient of variable set x and y, n is the number of variables in each set. We should calculate the average value of each set firstly; then calculate the deviation of each value from the average value, and then use a formula to calculate the covariance and standard deviation; finally, use a formula to calculate the correlation coefficient. There are 5 (4W1H) knowledge concepts, such as Who, What, Where, When and How, can openly and conveniently establish a meaningful environment for the family interaction between the smart home and the residents [18]. That is to say, any environment at home can be made up of five concepts. For example, the concept of a resident identity, the concept of preserving the location of the resident, when the concept keeps the situation happening, what concept stores what events should happen, and how the concept describes how to do it in this case. Therefore, as mentioned above, the main benefit of ontology is to help the system make informed decisions after contextual interpretation and reasoning. This decision can guide context-aware systems to provide adaptive services according to various environments and situations. Fig. 3 Context model Fig. 3 shows the context model of this system. The smart home is divided into many portions; we called them smart spaces. The smart spaces are equipped with video and audio devices for multimedia services. We design the architecture to provide efficient infrastructure support for building context-aware services in pervasive computing environments. The basic role of the user pool as shown in the figure is to select contents and watch on the preferred devices. The user must be registered in the system to get smart, personalized services, therefore the user login with the id and password and make the content query which consists of content name, content type, year of release, or category. When the user generates the query for the content to watch/listen, it is forwarded to the local app server. The local app server sends the requested information along with the recommended contents based on the use history, and the client selects the required contents and device. The client watches the selected contents on the preferred device. The system senses the user location and provides the content based on his activities and location. The local app server is the most important part of our system. When the user generates the query for the content to watch/listen, it is forwarded to the local app server. The local app server sends the required information to the client, and then the client selects the required contents and device. Besides, the local app server keeps a history (content watched, time of day, the day of the week, and device used) of the user's activities regarding the multimedia services in the home. Utilizing the history information of the user, the system builds a recommender system which recommends the contents to the user along with the preferred devices. The user preferences for devices are taken into account for prioritizing the device in a multi-devices location.
Furthermore, local app server also works as a bridge between the user and global content server, which means that the queries for content to global content server will be made by local app server, not by the user, thus the global content server will not be directly accessible to the user and hence will lead to a secure environment. Contextual information plays a vital role in providing smart, personalized services. The local app server collects the contextual information about the user's location from the motion sensors installed in the smart home, the time of day and day of the week. This information is considered a context pattern for the provision of smart services. The content DB provides the content's context at the local app server, the user history maintained at the local app server, and the device's context is taken from the device gateway which keeps updates about all the devices in its range.
Besides, the existence of a user or his activity is also considered as contextual information for smooth services. Once the context data is collected, the local app server decides the service be providing to the user. The location sensors always keep track of the user's location, when the user changes the location, the system identifies the user's activity. If the activity is identified as a long-time activity, the local app server through the device gateway pauses the content play on the device and take according to action. The Global content server has a straightforward role in the system. The global content server is supposed to have all the contents that are required to the user of the system. The local app server has access to this server. The global contents server handles the user requests based on the contents name. The global content server searches the requested content in the database. When the contents find it sends the basic information of the contents to the local app server. The device gateway works as a middleware between the devices and the local app server. The device gateway keeps track of the devices usage and their status. When the local app server requests the device gateway to start or stop a device, the gateway first checks the status of the device and send a response to the local app server.  Fig. 4 shows the architecture of the proposed Smart Multimedia Service system. The system consists of modules and their relationship. The smart home is divided into many portions called smart spaces. The smart space consists of many devices to display a movie or provide other services. The user activity and location will be sensed by the system and will recommend action based on the user's history and behavior. We consider the user's location and time as abstract contextual information to know about the user activity. Once we find the user activity, it is easy to decide about the service provisioning. The 4 W's, i.e. What (activity), When (time of the activity), Where (what is the location of the activity and user), Who (who performed the activity) are used as the detail contextual information in our proposed system. Fig. 5 shows the sequence diagram of a movie recommendation service. When user request recommendation from the Recommendation Form, the form will request my movie list from the database, database return my movie list; then the form requests other users' scores from database and database return other users' scores to the form. After receiving the data, the form will calculate correlation, find the user who has the biggest correlation coefficient and request the user's other movie list from the database, the database will return the list, and the form will request the recommendation movie list to the user.  Fig. 6 shows the sequence diagram of this system. The user establishes a connection with local app server by logging in to his account with user ID, if the user is registered, then local app server grant access to the user. The user sends a query for contents (movie) to the local app server, the local app server read the status of devices. Local app updates the context of the device in the context database and searches for the contents in the local database, the local app server inferences the user's context from a user 's history database. Based on context filtering, the local app server recommends contents and devices to the user. The filtering mechanism consists of the adaptive rules-based system which updates the rules set based on the user preferences and usage of the system. The user selects the device and contents, the local app receives the contents name (movie name/id) and selected device, the local app server checks the selected contents in the local database, if the contents are available locally, then its send to the selected device otherwise the contents are downloaded from the global contents server (assume all contents are available). The local app server updates the context of the contents, i.e. language of the movie, subtitles, total duration, current status (playing on a specific device). The user starts watching a movie on the selected device. The local app server will update the devices context and contents context. When the user changes his location and exit from his current smart space, the system pauses the movie. If the user enters to another smart space in the same smart home, the system updates the status, stop the movie on the current device and start the movie with the same context on the other device in his new location. The contents are shared between the two devices with the request context. Table 1 shows the implementation environment of this system. We developed the system based on windows operating system, we used Visual Studio as a development tool, and we created a database in MySQL 5.6. In the simulation experiment, there are six simulation data set for five other users and "me," the data set include the movies that users have seen and the movie's score that users have given. Table 2 shows the movies and scores which other users and "me" have all seen. The Movie Recommendation Service will calculate the correlation coefficient of each user and "me," find the user which have the most similar interests with "me" (the biggest correlation coefficient), then recommend other movies of this user to "me."  Fig. 7 shows the implementation result of the emulator, which receives users' instruction directly and send a request to the Service Provider. Click the "Turn on" button to entry the main client page.  Fig. 8 shows the result after clicking the "Turn on" button. Then click the "Get Recommendation" button, some movies' name will show, click one of them like "Titanic" and then click the "start" button, clients can watch the movie, this process shows in Fig. 9. The client is also able to click the "Other Recommendation" button to get more movie recommendation. Fig. 10 shows the recommendation form after click the "Other Recommendation" button; the first table shows the history movie list of the client and the scores client gave to the movies. There are three buttons, click the first button "Read Data," the second table will show the other users cores to the client watched movies.

III. RESULT AND DISCUSSION
The second table is shown in Fig. 11. Click the second button "Correlation," the text box will show the correlation result between five other users and me and will find the user which have the most significant correlation coefficient.
The correlation result is shown in Fig. 12. Click the last button "Recommend," the third table will show the recommendation movies, which are the biggest correlation coefficient user's movie list expect the movie I have seen. Fig. 13 shows the final results; the third table shows other recommendation movies.

IV. CONCLUSIONS
In this paper, we propose a movie recommendation service based on the preference correlation coefficient of audiences in a smart environment; home residents can enjoy entertainment more convenient and direct. The system can use the context-aware concept to make possible multimedia services for family residents according to the inference result of the context collected by the home.