Context Classifier for Service Robots

. In this paper a context classifier for service robots is presented. Inde-pendently of the application, service robots need to have the notion of their context in order to behave appropriately. A context classification architecture that can be integrated in service robots reliability calculation is proposed. Sensorial information is used as input. This information is then fused (using Fuzzy Sets) in order to create a knowledge base that is used as an input to the classifier. The classification technique used is Bayes Networks, as the object of classification is partially observable, stochastic and has a sequential activity. Although the re-sults presented refer to indoor/outdoor classification, the architecture is scalable in order to be used in much wider and detailed context classification. A community of service robots, contributing with their own contextual experience to dynamically improve the classification architecture, can use cloud-based technologies.


Introduction
Aside from our language and the common understanding of the world and its operation, what contributes to a much more efficient exchange of knowledge between human beings, is the notion of context [1]. Humans are able to add and take into account situational information (context) in a conversation to better understand the subject, retain more information in a more efficient way and to respond appropriately to it, in other words, to increase the conversational bandwidth as said in [1]. When interacting with machines or between machines, that awareness can be lost and so can the information richness [2].
As the matter of environment (as a subset of context) regards the physical world, there is also uncertainty associated with its sensing. That uncertainty can be caused, for example, by inaccuracy or incompleteness of sensed information [3]. There is a need for models that manage and take into account that uncertainty [4]. Fuzzy logic is used to set transitions of an element between membership and non-membership in linguistic terms and it involves ambiguity [5]. It can be used to describe subjective contexts and perform a multi-sensor fusion between those contexts.
Bayesian networks consist in nodes (that represent events) and arcs (representing relationships/conditional dependencies). Nodes not connected represent variables that are conditionally independent. Bayesian networks are used to process data sets and to deduce high level information [4], assigning the most likely class to a given observation, described by a set of attributes. According to [6] this technique is best suitable for a factored state representation in which a state consists of a vector of attributes.

Relationship to Cloud-based Solutions
The presented architecture was developed using Robotic Operating System (ROS) [7] on top of the Servrobot platform (servrobot.holos.pt). ROS allows for the exchange of information between software modules within the system using a messaging protocol. These software modules need not to be in the same machine or system and may send messages across the Internet. As the architecture is a software module itself it can receive and send information to other modules or robots. In this sense this architecture is scalable to receive inputs from several service robots. This is a typical application scenario for Cloud-based technologies use thus it can be used by a community of service robots contributing with their own contextual experience to dynamically improve the classification architecture and it's performance. Robotearth is an example of cloud-based technologies use in robotics [8].

State of the Art
Context has been used in the robotic field in many applications using several context models and or techniques [9]. A detailed review was made focusing on the application of context in the field. The most relevant results are presented in Table 1. Table 1. Overview of context models in robotic systems their application purpose

Application Purpose
Context Model/Reasoning Technique

Problem Approach
As it was stated before there are several applications for context analysis in the robotics field but context can be integrated in other applications as well. It is believed that the reliability field hasn't explored context in complete way. Context can and should be integrated in the reliability field allowing reliability calculation optimization.
A classification hierarchy is proposed, in which the context is first classified as indoor environment or outdoor environment and then there will be another computational model created to sub-classify in more detail the type of environment present.

Fig. 1. Reliability context integration architecture
In Fig.1 the reliability context architecture is presented. It will first receive the sensor inputs and process its signals in order to reduce any noise and outlier values as well as to perform any necessary sensor fusion. In the knowledge base the information from sensors and sensor fusion are stored. A context classifier is created that will provide contextual information to the reliability calculation. Those classifications will be also stored in a context history module. This history can be re-fed to the classification module to improve performance. From that history the last state will be considered for the current classification.
It is believed that the environmental conditions will influence a great deal the reliability calculation and estimation. The key elements present in the surroundings may be crucial for optimizing reliability assessment, for example if a mobile robot is working under a very dusty outdoor environment it may be more prone to have mechanical failures thus reducing its reliability.

Fuzzy Logic Membership Functions.
Fuzzy logic was implemented to transform a sensed numeric value into a linguistic term (a qualitative semantic), therefore fuzzification was used to aggregate the sensor inputs. This will increase the flexibility and modularity of the overall algorithm over the slight changes in the sensor values (also decreasing its complexity and load).
The fuzzification was applied to temperature, humidity and light intensity. For each of them tests were conducted during various times of the day and weather conditions to achieve the necessary linguistic terms and membership functions. In this work the functions were chosen with no specific form, but there are many forms that can be assigned (triangular, trapezoidal, Gaussian, etc.).

Choosing the Classification Model.
Since ontologies are often specialized to some domain-specific applications (although they are used for many different purposes), it was preferred not to model the world around the robot "statically" by describing its relations "manually" in the beginning. Instead, the main interest is in one technique that could be taught and that can adapt to new situations.
The environment is partially observable because the robots sensors cannot give access to all the complete state of the environment at each point in time. Since its being dealt with a stochastic environment, the classification task is a sequential activity, a single classification at a time considering the previous state is performed, there is a dynamic environment and can be considered discrete, a factored representation is present the technique should support probabilities and uncertainty. Therefore the most suitable technique for classification is a Bayes classifier (Bayes network). It seemed to be a good start since it has good performances, even with less training data, is highly scalable, can adapt to a wide variety of classification tasks and is appropriate for a factored representation of data.

Fig. 2. Bayes Network
In this work the WEKA [22] framework was used to generate the Bayes network for this classification. In Fig.2 the Bayes network is represented with the different attributes and relations to the proposed output classification.

Reliability.
To integrate this work in reliability calculation a context factor must be added in the calculation. = Where is the reliability, is the module hazard rate, is the terrain factor and is the time. The terrain factor can be calculated by: Where is the terrain factor asserted to terrain x and is the total percentage of the operating time in terrain x. The proposed architecture results can be integrated in this factor by substituting the terrain concept by the context concept.

Field Tests and Experiment Results
From the first dataset collected, an 87.5% of correctly classified instances were obtained, using a 10-fold cross-validation evaluation on the training dataset. The confusion matrix represents TP (true positives), FP (false positives), FN (false negatives) and TN (true negatives). From Table 2 it can be understood that 119 instances were correctly classified as "indoor" out of a total of 121 indoor instances (true positives). A more detailed accuracy table is presented below (Table 3).  , also known as sensitivity or recall measures the proportion of positives that are correctly classified as such. FPR (False Positive Rate), also known as false alarm rate or fallout it's the complementary with the specificity (1specificity). Precision represents the positive predictive values. Specificity (also known as TNR -True Negative Rate) measures the proportion of negatives, which are correctly identified as such (complementary of FPR). F-measure a combined measure for precision and recall.
It was found that the number of GPS satellites is the most relevant attribute, although all other attributes are needed to increase systems consistency and accuracy.
A mixed environment test including the "previous state" attribute was done. In Fig.3, a mixed testing path is presented. The indoor path is represented in blue color, the outdoor path is represented in red color and the transition areas are represented in orange. In Table 4, the obtained confusion matrix is presented.  In this test the percentage of correctly classified instances was increased to 92.66% of overall accuracy. From the incorrectly classified instances, the 2 FP cases are located on step 6 of the Fig.3 and they occurred due to the presence of a glass wall in the room. Near the glass wall, the classifier can be deceived. Regarding the 19 false negative cases, 2 of them occurred on the step 5 of the path (Fig.3) which is the transition step, 6 of them occurred in step 18 due to the presence of a porch and the fact that the GPS attribute is slower to acquire satellites when moving from indoor to outdoor environments. The majority of the FN cases (11) occurred in step 17, which is another transition step. It's now possible to remake all the calculations for the real application scenario. In Table 5, those calculations are presented. Very good results were achieved in specificity and sensitivity (a perfect classifier should be 100% specific and 100% sensitive) as well as a decrease in the FPR. Considering the "previous state" attribute in the classification, the most relevant attributes where: "light", "GPS satellites", "previous state" and "temperature web".
As can be seen by these results this architecture is able to achieve similar results to those in [23] even without the previous state optimization (around 88%). When the previous state is included the results improve by approximately 5% in comparison.

Conclusions and Future Work
There are several context models, techniques and frameworks. From all of those possibilities the ones based on ontologies seem to be the ones with most widespread use. From all existing frameworks and for the intent of this architecture, machine-learning techniques, particularly Bayesian networks, seemed to be the more appropriate method for solving the systems classification problem. This is verified by the good results achieved by this system. One big reason for the good results in the system was the inclusion, in the architecture, of the previous state in the Bayes network. Future experiments should be considered with more linguistic terms in the fuzzy sets (for example, "morning", "afternoon", "late afternoon" or "night" instead of just "day" or "night" for the time). Increasing the attribute quantity can add a valuable improvement in the overall performance. However, increasing the number of attributes doesn't necessarily improve the systems accuracy.
It is believed that a good base was created for a more complex and detailed classification. As knowing if the robot is indoor or outdoor with good accuracy allows a detailed context sub-classification.