Abstract
Context prediction plays a vital role in an assistive ubiquitous environment. The environmental configuration in a ubiquitous environment is heavily dependent on the context of the events occurring in the environment. Current state of the art approaches utilize the user’s history information for predicting the context of the events. When the user’s history does not provide apposite contextual information for the observed activity/event at time t, the history based state of the art context prediction techniques fails to predict the appropriate future context. To overcome the gap of missing context information in the user’s context history, we propose a Profile based Collaborative Context Prediction (PCCP) approach. PCCP is a predictive association rules based system which utilizes the history of similar users and collaborate among users of the ubiquitous environment. PCCP generates rules at high level of abstraction, human readable and understandable that helps in avoiding the underline details. To evaluate the PCCP, a smart office is considered as an experimental environment. Experiments are carried out on indigenous multi user smart office data set. Our experiments showed significant level of accuracy in both environments. Due to the understandability of output and higher accuracy of PCCP, it can be extended to assist the user in a smart environment.
Introduction
Context prediction has been an important research area in the context aware systems and ubiquitous environment for the last few years. In ubiquitous environment the context aware systems shall use the users’ history information to predict his/her future context. The future context is then utilized to assist the users in ubiquitous environment. A common approach to enable the prediction of future context is to make use of the collected and stored contextual information related to the user’s actions or to the user’s environment. Letś consider an example of a smart office environment; where different types of people enters along with the office bearer. Upon the entrance/exit of the office bearer the proactive system is supposed to take some actions to assist the office bearer. The actions for an office bearer should not be same as those for outsiders (guests) or other staff members. Also, the office bearer may perform different activities based on his/her schedule and other important parameters.
To elaborate the smart office scenario, we consider a real environment example of a professor who delivers lecture in the same room every day. When the professor leaves his office, the context aware system should predict his next action/activity. Before he/she enters the room for the next class, the system should automatically adapt the designated services in the room to be ready for the lecture using a prediction system spanning the whole university. Besides, the context prediction system should also differentiate the activities of each person that enters the specific room. The action of the system depends upon the userś predicted context. However, if the professor leaves the office for the same room in which he delivers his lecture but this time he is attending the workshop or seminar which he has never done before, his current context is unknown to the system. The system will have to predict the context of the professor, however, without prior information about the context, the system may make a wrong prediction. In such scenarios, state of the art context prediction approaches that rely on the context history of a single user fail to forecast the userś future context.
To overcome the problem of missing context information in a single userś context history, we explore the strength of collaborative environment for context prediction. Our proposal is based on the collaboration between the user histories for providing information on the userś context pattern. In case of missing context pattern, we utilize the context histories of other users whom’s profile match the current userś profile. To enrich the context history of the user, we use the Predictive Association Rule Mining (PARM) [10] method that has been applied successfully in the field of traveler context prediction [18]. The association rules mining has also been applied in parallel way for mining the best rules in short amount of time [1]. With respect to the above-mentioned scenario, the future context of the professor attending seminar which is based on unknown context patterns could be predicted using PCCP, if the context is provided by context histories of his colleagues and if these histories show sufficient similarities to the professorś history.

Layered architecture of the proposed system.
The rest of the paper is organized as follows: In Section 2 existing state of the art techniques for context prediction are discussed. Sections 3 and 4 describe the proposed architecture and discusses the case study of smart office for the profile based collaborative context prediction using predictive rules mining. In Section 5 experimentation and results are discussed. Section 6 conclude the paper.
Michael C. Mozer directed a project on future context prediction [12], In which the automatic home control actions have been performed using occupantś activities for predicting the context using neural network approach. This was one of the early projects in context prediction. Diana J. Cook also conducted a project on smart home called MavHome [3]. In this project the Active LeZi approach [6], a sequence-matching algorithm and the Episode Discovery algorithm [7] have been utilized to forecast the interaction between devices and inhabitants. In [2] the authors suggested a method to predict a userś next location by using/interpreting his/her GPS data. The authors proposed an approach to cluster the GPS data; then by using the Markov model they predicted the userś next location. The authors in [14] introduced a context time series prediction algorithm that is based on local alignment techniques. This approach is based on an algorithm inspired by computational biology. The authors had carried out two different experiments; one on wind energy prediction and the other on user location prediction. For the first experiment the wind data set has been used while for the second experiment the authors used userś mobile phone data to track his location.
Structured Context Prediction algorithm is presented in [11]. The authors presented the approach to overcome the trade-off for context prediction methods needing to be generic while being efficient by using additional knowledge about the application domain given by the developer at the time of design. The used evaluation approach focuses on the availability prediction of two services. The mentioned approaches use only the context history of the user whose future context should be predicted and do not explicitly make use of the relations existing among the context histories of other similar users. The authors in [17] present an idea of collaborative context prediction in which they consider the histories of all the users in the environment. This approach is very slow in finding the future context. Activity recognition of the patients using Smartphone has been presented in [8]. In this paper the authors track the patient motion to recognize his/her activities. In [16] the authors have presented a survey of the indoor and outdoor location prediction techniques. However, this survey considers only location based context prediction which is obviously a sub part of the context prediction paradigm.
State of the art context prediction approaches with few exceptions like [17] uses context histories of single user for context prediction. However the collaborative approach presented in [17] is a simple attempt to use the histories of multiple users in the environment.
The novelty of our approach is twofold; (a) the collaboration among the user for context sharing, and (b) the selective collaboration among the similar kinds of users, which to the best of our knowledge, has not been reported in the literature. The advantage of the profile based collaboration is that it is simple to implement, secure and more efficient due to additional information. In the next section, we describe our proposed approach in detail.
Profile based collaborative context prediction
This work proposes a profile based collaborative context prediction approach which improve the accuracy of userś context prediction in a collaborative ubiquitous environment. The layered architecture of the proposed context prediction approach is shown in Fig. 1. The architecture consists of 4 layers i.e. sensor, pre-processing, context processing, and application layer.

Flow diagram of the context processing layer.
The sensor layer consists of two type sensors i.e. physical/hardware sensors and virtual/software sensors. The physical/hardware sensors are represented as
A very important layer of the system is data pre-processing layer. Key role of this layer is to clean the data for the context processing layer. As shown in Fig. 1, this layer comprised of context aggregation, handling missing values, handling duplicate values, normalize data and most importantly anonymize data. Averaging is used for handling missing, duplicate values and outliers, which is a simple approach, however, this approach served the purpose for this study. A more sophisticated approach may be used as per the requirement of the situation. The critical part of pre-processing is layer is to anonymize the data to cope with the privacy concerns. Since this study is focused on the profile based collaboration of context data, therefore, fully anonymization did not serve the purpose of the study. For this study, we use temporary IDs and profiles for collaboration purpose which leaves the data as partially anonymized. Privacy preservation is discussed in Section 4.5.
The central processing layer of the system is context processing layer. At this layer, all the key components are involved in processing the collected data. The pre-processed data is stored in the context database which is handled at the context processing layer. The rules generator generates the rules from the data stored in the context database using the First order inductive learning (FOIL). The rules are stored in the context knowledge base which is used for context recognition and prediction. The performance evaluator of the system continuously evaluate the performance of the system and modify the rules set accordingly. The context collaborator is an important component of this layer. The collaborator only invokes when a context pattern miss occur at the context recognizer/predictor component. The recognizer and predictor components work sequentially, while the collaborator components needs as explicit invocation from the other components. The collaborator component decides the collaboration among the different profiles and uses the collaboration rules set.
This layer is the consumer layer of the processing carried out at the lower layers. The application layer carry out all the interaction with the users, handle the environment level details and proactively adapt the environment according to the user’s context and the system’s recommendation.

Combinations of overlapped activities.
The core of the proposed approach is context processing layer, therefore, a detail description of the functionality of the layer is discussed in this section. Figure 2 shows that the context prediction system uses the association rules to predict the future context for the observed pattern. The brief overview of the flow is given as: The context prediction system checks the pattern in the userś history, if the pattern is present, the appropriate action is recommended and adopted by the system; however, if the system does not find the pattern in the history of the current user, the system checks the user category/type. When the system finds other users of the same category/type, it checks their histories for the presented pattern. Upon the positive results from the other histories, the system performs the appropriate action, updates the history of the current user and updates the classification rules for that class. We incorporate the collaborative filtering concept used in recommendation system as discussed in [4]. The primary focus of collaborative filtering is the prediction of a user’s interest by utilizing the information from many users’ histories. However, we generalize this concept to predict the behavior of an entity (human or object) by utilizing the behavior patterns of many other but similar entities. We explore the similarity between situations and infer the relationship and dependencies. Each situation is a combination of actions. For example, let us consider that activity
This data creates possible relations between
Feature model
A smart office, where multiple persons are involved, is considered as an evaluation scenario for this work. Therefore the problem is considered as multiple users’ action recognition problem in a smart environment. When it comes to multiple users, feature modeling becomes complex and important. The data is divided into three sets;
set of users P of the collaborative ubiquitous environment set of possible context patterns CP set of predictable contexts C
The problem is formulated with the sequential association rules as:
User ID
User Name
User Category (Profile based category)
Current Time
Current Location
Current Movement Direction
Temperature
Humidity
Wind Speed
Illumination
The personal data is retrieved from the database using the user’s id. The geographical data is collected using GPS receivers, while the environmental data is taken from the environmental sensors. The feature attributes in the pattern set are combinations of persons, pattern set, and actions. This will imply to predict the future context of a person
Figure 3 shows overlapped activities by multiple persons in a given same time slot. For example activity
We use association rules mining to extract minimum number of rules for predicting the user’s context in a time series. Firstly we generate rule using inductive logic and then apply a predictive rules mining algorithm to enhance the efficiency of rules generated through inductive logic. The best rule set is then applied to find the user’s context. The following section describes our proposed model for activity recognition and context prediction in more details.

Algorithm to generate initial rules set
The PCCP is based on the well known machine learning algorithm called First Order Inductive Logic (FOIL). FOIL, proposed by Ross Quinlan in 1993 [13], is a greedy algorithm that learns rules which differentiate between the positive and negative examples. FOIL algorithm shown in Algorithm 1 continues removing the positive examples which are covered by the current best rule until all the positive examples are removed. As our problem is a multi-class problem (multiple feature are to be predicted), therefore we apply FOIL on each class: during each run the examples of that class are considered as positive examples and those of other classes are considered negative examples. After the FOIL finishes execution for all the classes the rules are merged to form a uniform rules set.
Foil Gain is calculated for each instance before adding it to the current rule. Let suppose we have a rule R and there are |X| positive examples and |Y| negative examples satisfying the R’s body. After adding the instance x to R, there are |X*| positive and |Y*| negative examples satisfying the new Rule, R*’s body. The Foil gain of x is defined as;
Predictive rule mining
Predictive Rule Mining (PRM) is an extension to the FOIL for higher accuracy and efficiency. The FOIL generates very small number of rules due to which it does not achieve higher accuracy. The PRM algorithm listed as 2, assign weight to each rule in the rules set R. PRM decreases the weight at a certain ratio of rule after an instance is successfully covered by the rule. The PRM has greater number of rules as compared to FOIL and each positive instance has more covering rules.
The FOIL consumes most of the time on evaluating each instance during the calculation of highest gain. We used the technique similar to [5]. We need the information stored in an array called SInfo for gain calculated using Eq. (2).
SInfo stores the following information corresponding to rule r.
X and Y: The number of positive and negative instances that satisfy R’s body X(x) and Y(y): For all possible instances of x, satisfying body of rule r.
The gain will be calculated for each instance using the information in SInfo corresponding to the current rule. The gain calculation is independent of the size of data set.
Rules based prediction
Rules evaluation
The accuracy of rules needs to be evaluated before applying on prediction. As we have a total of 9 parameters for our problem therefore our rule will look like

Algorithm to generate predictive rules set
The procedure of using the rule for prediction is as follow:
Select all the rules whose bodies are satisfied by the instances.
Select the best k rules for each class from the rule set of step 1.
Calculate the accuracy for each rule using Eq. (2).
Compare the accuracy for each class and choose the class with highest accuracy as the predicted class.
When the system does not find the pattern in the history of current user, it checks the user category/type. When the system finds other users of the same category/type, it checks their histories for the presented pattern. Upon the positive results from the other histories, the system performs the appropriate action. The following terminologies are referred very often in this paper
all information that relates to a particular entity, e.g., information about the type of a person/user, location, time, duration, participants, etc. The profile can be updated and can evolve over time. the category of an entity is a set of other similar entities that share some basic characteristics, e.g., similar actions and histories of the same type or similar people with same interests.
Privacy preservation
Privacy preservation in collaborative environment got the attention of the research community decades ago. Numerous studies are dedicated to devise techniques for privacy preservation [9], which resulted in various techniques and approaches. Data anonymization is one such approach to preserve the privacy in transactional data [15,19]. Context collaboration is an appealing approach for achieving a higher accuracy in a multi-user environment. The additional information from the histories of other users, the performance of context prediction can be enhanced at a great level, however, the risk of sharing personal information is too high in such situations.

The accuracy graph of PCCP for the single user’s environment.
In this study, we preserved the privacy at two levels i.e. data sharing and data anonymization. Since this study deals with the smart office scenario, the data is restricted at an office/building scale. The data can only be shared among the users of a closed environment which causes minor privacy concerns. Besides, office activities are rarely personal as well as less vulnerable to external attacks. Also, the data is divided into 4 groups based on the class of users, and the data is shared only among the same class of users. Therefore, the chance of misuse of data is reduced. Furthermore, the users information is encoded at the pre-processing layer, which anonymize the data and store anonymous data in the context database. This additional level of encoding ensures a great level of privacy preservation.
In this section, we present our experimental results. We use real world data collected in a university department. Context data of four types of users’ (academic staff, admin staff, students and support staff) is considered. We showed that the data from other users of the same profile can be used in case a user does not have sufficient information in his/her history. Furthermore, we explore how the prediction accuracy for missing patterns affects the prediction time. We also compare our results with other collaborative context prediction techniques which do not use the profile information of the user.

Accuracy of prediction by PCCP in collaborative environment.

Comparison of prediction accuracy between with and without collaboration of context prediction.
The data set contains location and direction data which is recorded using built in sensors of Android Smartphones. The movements of
For evaluation of our technique, all computations were performed on AMD Athlon (tm) 64-bit X2 Dual Core 6000+ 3.10 GHz processor with 4 GB Physical Memory. However, the program was built using 32-bit compiler, which means full computational power is not utilized.
In order to test the system more extensively, we form four training data sets for every testing data set which are used to construct the rules for the context prediction model. The first training data set contains the information of the context histories of one type of users. The test data is generated from the same type of users. In the second training set the context information of the two types of user are used for testing the system. For the third test we extend the context information to three types of users. For the whole testing set the information of all the users were utilized for training. These data sets were formed in order to test the dependability of the types of users on each other. Every time, new context data is added, the rules and prediction model are updated. This information is used to forecast the context of the users which are the part of the test data set.
Results
In this section, we present the results obtained from the PCCP on indigenous test data sets. Figure 4 shows the prediction results of the proposed system without collaboration with other users. The graph shows that increase in the number of instances results in the increases in accuracy of prediction, however, due to the limited amount of data, the accuracy cannot be increased after a certain level. The maximum accuracy of
Figure 4 shows the accuracy graph of our technique collaborating with the other users without profile information as [17]. In [17] the authors used another technique called HOSVD for collaborative context prediction. However our technique of collaboration is different than that technique in many ways. We divide the users into different categories and collaborate within the category. Besides, we use different technique to predict the context. Figure 5 shows the results of collaboration in our technique. The maximum accuracy achieved in the collaborative environment for PCCP reach to
The accuracy of the PCCP in collaborative environment is higher than without collaborating environment. This is because of the availability of information in the histories of other users. Figure 6 shows the comparison of collaborative versus non collaborative approach, which clearly depicts the better results in case of collaboration.
In Table 1, we have presented the results of the PCCP technique both with collaboration and without collaboration.
Comparison of with and without collaboration of the context prediction results
Comparison of with and without collaboration of the context prediction results

Time based comparison of CCP and PCCP.
The results show that the future context can be predicted even when the context information is missing. The collaboration among other users can enhance the prediction accuracy.
In this paper, a Profile based Collaborative Context Prediction (PCCP) approach is proposed for context prediction in a multi user smart environment. The approach is focused in finding solution to the problem of missing or unknown context pattern in a multi-user environment. The context information of the other users is utilized to predict the context of missing or unknown pattern. Real world data is used for evaluation of the proposed technique which shows that the PCCP can predict the context for unknown pattern in a reasonable time with a good accuracy rate. The PCCP is compared with the CCP and the results showed that our technique can produce better results in less amount of time than CCP (see Fig. 7). We intend to add the privacy preservation of the other users along with other techniques like fuzzy logic to enhance the prediction level of the PCCP. The fuzzy can improve the results in a case where the perfect match does not find in the histories of all the users.
Footnotes
Acknowledgements
This work was partly supported by Institute for Information & communications Technology Promotion (IITP) grant funded by the Korea government (MSIP) (No. 10043907, Development of high performance IoT device and Open Platform with Intelligent Software). Also, this research was supported by the MSIP (Ministry of Science, ICT and Future Planning), Korea, under the ITRC (Information Technology Research Center) support program (IITP-2015-H8501-15-1017) supervised by the IITP (Institute for Information & communications Technology Promotion). Corresponding author; DoHyeun Kim (E-mail:
