intelligible software delivery in smart environments supported by a macro and micro context...

13
Health Technol. (2013) 3:139–151 DOI 10.1007/s12553-013-0047-6 ORIGINAL PAPER Intelligible software delivery in smart environments supported by a macro and micro context awareness model Charles Gouin-Vallerand · Patrice Roy · Bessam Abdulrazak · Sylvain Giroux · Anind Dey Received: 3 October 2012 / Accepted: 13 February 2013 / Published online: 28 March 2013 © IUPESM and Springer-Verlag Berlin Heidelberg 2013 Abstract Smart environments help to increase the auton- omy and quality of life of people with special needs (PwSN) through adapted assistive services. In conjunction with context awareness and service delivery mechanisms, it is possible to dynamically deliver services to users by taking into account contextual information, e.g., user’s locations, devices’ states, current activities. However, implementing such systems in actual smart spaces is not trivial. The micro and macro context awareness model helps in defining layers on which contextual information are processed as close as possible from their sources (micro), without losing the ben- efits of information processing at a systemic level (macro). This paper describes the micro and macro context aware- ness model and its uses in the implementation of a service provision system for smart environments. Transparency and intelligibility are important factors in context awareness C. Gouin-Vallerand () el´ e-Universit´ e du Qu´ ebec, Montr´ eal, Canada e-mail: [email protected] P. Roy · B. Abdulrazak · S. Giroux Universit´ e de Sherbrooke, Sherbrooke, Canada P. Roy e-mail: [email protected] B. Abdulrazak e-mail: [email protected] S. Giroux e-mail: [email protected] A. Dey Carnegie Mellon University, Pittsburgh, USA e-mail: [email protected] system, which help developers to fully understand the full behavior of the systems and help users to learn how the sys- tems work. We therefore accompanied our micro and macro model with an intelligibility model which allow the gen- eration of explanations describing the system’s behaviors according to the processed context. Finally, results com- ing from the evaluations of the micro/macro model and comparison with related works are presented. Keywords Context-awareness · Smart environment · Service delivery · Intelligibility 1 Introduction The growing population of elders [33] with cognitive defi- ciencies and physical impairments, combined with the high costs and minimal supplies of caregiving resources, provide a compelling argument for a new vision of assistance at home [28]. Ubiquitous computing, context awareness and artificial intelligence techniques can transform human habi- tats into smart spaces able to provide assistance, contextual help and remediation by the environment. To assist these users in their daily living activities, dynamic and intelligent mechanisms are required to deploy assistive services on the different devices present in the smart environments, such as smart phones, tablets, desktop computers, laptops, embed- ded computers, etc. Such service provision mechanisms rely mainly on the use of contextual information from the envi- ronment and user profiles to accurately identify on which devices each service must be deployed. Context awareness is needed in situations where soft- ware and hardware must collaborate in order to cope with complex data. A context aware system hosts software com- ponents that infer additional, synthetic context from the raw

Upload: bessam-abdulrazak

Post on 13-Dec-2016

231 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Intelligible software delivery in smart environments supported by a macro and micro context awareness model

Health Technol. (2013) 3:139–151DOI 10.1007/s12553-013-0047-6

ORIGINAL PAPER

Intelligible software delivery in smart environmentssupported by a macro and micro context awareness model

Charles Gouin-Vallerand · Patrice Roy ·Bessam Abdulrazak · Sylvain Giroux · Anind Dey

Received: 3 October 2012 / Accepted: 13 February 2013 / Published online: 28 March 2013© IUPESM and Springer-Verlag Berlin Heidelberg 2013

Abstract Smart environments help to increase the auton-omy and quality of life of people with special needs (PwSN)through adapted assistive services. In conjunction withcontext awareness and service delivery mechanisms, it ispossible to dynamically deliver services to users by takinginto account contextual information, e.g., user’s locations,devices’ states, current activities. However, implementingsuch systems in actual smart spaces is not trivial. The microand macro context awareness model helps in defining layerson which contextual information are processed as close aspossible from their sources (micro), without losing the ben-efits of information processing at a systemic level (macro).This paper describes the micro and macro context aware-ness model and its uses in the implementation of a serviceprovision system for smart environments. Transparency andintelligibility are important factors in context awareness

C. Gouin-Vallerand (�)Tele-Universite du Quebec,Montreal, Canadae-mail: [email protected]

P. Roy · B. Abdulrazak · S. GirouxUniversite de Sherbrooke,Sherbrooke, Canada

P. Roye-mail: [email protected]

B. Abdulrazake-mail: [email protected]

S. Girouxe-mail: [email protected]

A. DeyCarnegie Mellon University,Pittsburgh, USAe-mail: [email protected]

system, which help developers to fully understand the fullbehavior of the systems and help users to learn how the sys-tems work. We therefore accompanied our micro and macromodel with an intelligibility model which allow the gen-eration of explanations describing the system’s behaviorsaccording to the processed context. Finally, results com-ing from the evaluations of the micro/macro model andcomparison with related works are presented.

Keywords Context-awareness · Smart environment ·Service delivery · Intelligibility

1 Introduction

The growing population of elders [33] with cognitive defi-ciencies and physical impairments, combined with the highcosts and minimal supplies of caregiving resources, providea compelling argument for a new vision of assistance athome [28]. Ubiquitous computing, context awareness andartificial intelligence techniques can transform human habi-tats into smart spaces able to provide assistance, contextualhelp and remediation by the environment. To assist theseusers in their daily living activities, dynamic and intelligentmechanisms are required to deploy assistive services on thedifferent devices present in the smart environments, such assmart phones, tablets, desktop computers, laptops, embed-ded computers, etc. Such service provision mechanisms relymainly on the use of contextual information from the envi-ronment and user profiles to accurately identify on whichdevices each service must be deployed.

Context awareness is needed in situations where soft-ware and hardware must collaborate in order to cope withcomplex data. A context aware system hosts software com-ponents that infer additional, synthetic context from the raw

Page 2: Intelligible software delivery in smart environments supported by a macro and micro context awareness model

140 Health Technol. (2013) 3:139–151

context provided by sensors and from other synthetic con-text. Context awareness enables such a system by assistingusers in performing daily life activities or warns special-ized personnel that human intervention is required. Softwarecomponents can consume context, produce context for oth-ers to consume, or use context to decide upon an applicationdomain-dependent course of action.

Numerous efforts have been made in the developmentof platforms to support Context-awareness for pervasivecomputing [9, 26]. Most applications and studies todayrely on smart spaces i.e. physical locations equipped witha set of sensors and actuators where the basic physicallayout is known beforehand. These spaces include any con-trolled environment where Context-awareness could play arole such as assisting people with disabilities (e.g. hospi-tals, hotel rooms, apartments, houses, classrooms). Thus,Context-aware services can have several benefits for PwSNand a number of projects proposed in the last years presentsolutions that increase the quality of life of PwSN. Forinstance, Giroux et al. [12] propose a framework to sup-port people with cognitive deficiencies, by monitoring thecurrent states of users’ activities through context aware-ness and assisting users step-by-step in their activities whenerrors or confusion are detected. Skubic et al. [29] usecontextual information from smart home sensors to continu-ously monitor users’ activities and assessing health changes,such as cognitive decline. Moreover, context awareness isoften implemented in user mobility scenarios, by usingmobile devices such as smart phones, embedded sensorsand location acquisition system, e.g. GPS. For instance,Hoey et al [16] use contextual information from smartphones to recognize wandering behaviors with people withdementia. A large number of other projects and publi-cations proposes solutions for PwSN based on contextawareness and these three last examples give an overviewof the possibility of context awareness for assisting andhelping PwSN.

In this paper, we present our work around the imple-mentation of a context and user aware service provisionsystem for smart environments (Section 3.2), based on themicro and macro context awareness model (Section 3). Themicro context awareness revolves around the subjective per-ception and the understanding an environment entity hasof its environment. On the other hand, the macro contextawareness is the global, emergent picture that componentshelp build of entities in their environment [2]. This modelhelps in managing the complexity related to the quan-tity of contextual information and context sources, as wellas providing headlines to build more versatile, dynamicand autonomous context aware systems. The micro/macromodel drove the development of our service provision sys-tem, and helps with the organization and use of contextualinformation.

On the other hand, to reach its goal, a context aware sys-tem based on a micro and macro model should tend towardtransparence, and propose to users and software develop-ers mechanisms to understand which contextual informationare used by the system and how these information have animpact on the system’s behavior. Intelligibility [6] focuseson telling users what a system did and why it did it.Thus, intelligibility aims to reduce the gap between theuser’s understanding of a system and the intrinsic reasoningmechanisms of this system. Therefore, we also present inthis paper a structure to support the intelligibility in a microand macro context awareness and its implementation in ourservice provision system (Section 3.3).

Finally, this paper presents also an evaluation (Section 4)of the micro and macro context awareness model, throughthe service provision system implementation, and a com-parison with two related works, Trumler et al. [30] andRanganathan et al. [27].

2 Related works

Context-awareness is used in situations where software andhardware have to cope with complex data. It often involvesSemantic Web technology [10] or devices that use externaldata to build a model (i.e. an awareness) of their sur-roundings, relationships with other devices [4] or subjectof interest [22]. Context-awareness also applies to softwarethat assists users and takes into account the relationshipsbetween users and their environment.

Context can refer to the situation of a device or of ahuman being. In [23], Context is defined as a setting inwhich an event occurs, which ties Context to a location.For Abowd, Dey et al. [3], context is any information thatcan be used to characterize the situation of an entity. Anentity is a person, place, or object that is considered rele-vant to the interaction between a user and an application,including the user and applications themselves. In [11], adistinction is made between situation-awareness, related tothe users location, and Context-awareness, related to con-ditions (temperature, weather, lighting,. . . ) that prevail inthat location.

Over the last two decades, several works have been per-formed on context awareness, mostly about its utilizationand modeling. Dey et al. [8] are among the first to have spec-ified and developed a solution that implements a frameworkand a context model for ubiquitous computing. The Con-text Toolkit [9] provides the functionalities to fill the gapbetween the hardware which collect the contextual informa-tion, e.g. the sensors, and the ubiquitous applications thatare using them.

In the CoWSAMI project, Athanasopoulos et al. [5] pro-pose a context aware framework based on web services as

Page 3: Intelligible software delivery in smart environments supported by a macro and micro context awareness model

Health Technol. (2013) 3:139–151 141

interfaces to context sources and dynamically updateablerelational views for storing, aggregating and interpretingcontext. Context rules are employed to provide mappingsthat specify how to populate context relations, with respectto the different context sources that become dynamic-ally available.

In the SOCAM architecture, Gu et al. [15] propose aframework to support the rapid prototyping of context awareservices. This framework is based on web ontologies torepresent contextual information and use several protocolsto discover context providers, bring information to the con-text interpreters and finally to the context aware services.

Several other works exists, proposing different appro-aches and technologies to support context awareness, e.g.the ESCAPE project [31] and Preuveneers [25].

On the other hand, some works in the area of serviceprovision have developed context aware mechanisms to sup-port service delivery in ubiquitous environments. Trumleret al. [30] are proposing a solution based on the socialbehavior of a cooperative group in the context of job assign-ments. This job assignments is based on the context of eachparticipating devices, reasoning on the capacity of nodesis made locally on each device and then forwarded to acentral node responsible for the repartition of the servicesamong the devices. In the Gaia project, Ranganathan andCampbell [27] propose some mechanisms related to theservice provision and software self-organization. Their solu-tion uses an ontology and semantic matching to find theright device configuration face to the software needs; soft-ware that must be deployed in a given mediated space.Ranganathan’s work on the software provision is mainlyfocusing on the hardware analysis and the environment spa-tial description, evacuating the user needs, capabilities andpreferences.

As these works are addressing the issues of definingmodels to represent contextual information and proposingmechanisms to distribute information among context con-sumers, they are not addressing particular questions abouttoday’s smart environments. How these systems can resolvethe complexity of today’s smart spaces with hundreds orthousands of context sources? How the user profiles can beintegrated to the context awareness and how the privacy ofthe profiles can be ensured? How the scalability of the con-text awareness can be supported for open environments suchas smart cities, with all the uncertainty related to these kindof environment?

Some of these works propose answers by using a stan-dardized definition of the contextual information through aSemantic Web language or addressing the complexity andheterogeneity of the smart environment through web servicetechnology. These works provided a basis for the conceptionof our context awareness model and the implementation ofour service provision system.

3 Context awareness model and strategies

Different strategies exist to compute on the contextual infor-mation of a given system or environment. Such strategies arerequired to manage the complexity related to the quantityof data and information sources in complex smart spaces.For instance, it is possible to divide the context awarenessof a given system in several sub-contexts called micro con-texts [7], related to specific devices or closed locations.At a second level, it is possible to aggregate and com-bine the micro contexts with other sources of informationto build a more global representation of the context in agiven environment, the macro context or macro contextawareness.

The macro context awareness is presented as somethingdirectly tied to a systemic model of the user and the con-ditions around this individual; the human is the center ofattention. The system’s main goal is to try to keep an up-to-date representation of a human and its environment. Thehuman, given its central role in the world, becomes not onlythe main mutator of context, but is also the focus of theactivity, making macro context awareness particularly wellsuited to applications that assist a given user in a smartenvironment.

On the other hand, the micro context awareness can bedefined as the context awareness for devices that can besplit up into three components: activity, environment andself. The activity describes the task the user/componentis performing at the moment or more generally whathis or her behavior is. The environment describes thestatus of the physical and social surroundings of theuser/component. Finally, the self describes the intrinsicinformation about the user/component, e.g., preferences,capabilities, etc. Micro context awareness in smart envi-ronments relies on distributed computing to share andpublish information between micro context components.Moreover, micro context components have to deal with adhoc communications directly related to the ad hoc topolo-gies of some environments. The hallmark constituents ofcontrolled spaces, for example key nodes, can be usedin micro context but cannot be depended upon by indi-vidual components. Micro context awareness is not onlyawareness of a single component, sometimes named rawcontext, but rather a model of context awareness that focuseson information available to the acting components andthat maintains no dependence on system-wide knowledgeor tools.

In comparison to the works presented in the previous sec-tion, we believe that a context aware system should use bothperspectives to build software that better adapt to differentsituations and are less complex to deploy and manage. Wewill now present how we build the service provision systemusing both layers.

Page 4: Intelligible software delivery in smart environments supported by a macro and micro context awareness model

142 Health Technol. (2013) 3:139–151

3.1 Architecture overview

We designed a distributed multi-level architecture (L0..Ln)that integrates the micro and macro Context awareness mod-els by providing structures, Context descriptions, ontologiesand services to embedded middleware and software.

Figure 1 presents this multi-level architecture from amacro perspective. From this perspective, the architectureis instrumented with customized nodes, fixed or mobile.Each Li node offers Li-level services. L1 nodes are hard-ware abstraction gateways that enable the system to interactwith L0 real world data (sensors and actuators). Li nodesare concentrators that aggregate the services offered by Lj,j < i nodes in a zone (location of influence). These concen-trator nodes aggregate lower-level services in a given zone.Zones group nodes according to some criteria (for example,physical proximity), and can overlap. The hierarchy can bebased on Agent needs: location (e.g. L1 is for devices, L2

for a room, L3 for a floor), processing requirements (e.g. aLi,i > 1 node concentrates instances of Li−1 nodes, to per-form load balancing), or to address security, confidentialityand ethical concerns. Mobile nodes can, at any time, gainor lose contact with individual nodes due to faults, distance,noise or other factors.

In hierarchical scenarios, L0 devices gather informationfrom sensors to build Context. This Context is retrievedby L1 devices and is used to create the first Context-aware functionalities related to a component and its neigh-borhood, i.e. raw Context. L2 devices aggregate microContext information from L1 devices, building a largervision of Context for a given zone, leading to Context-awareness from a macro perspective. In layers L3 and up,devices aggregate Context from lower layers and constructa global vision of the known environment. Mobile microContext-aware nodes, on the other hand, move freely fromzone to zone. Both their network neighborhood and their

conceptual level change with time and location. The appli-cation perspective of macro Context-aware systems, whereAgents have well-known roles in a well defined system, isreplaced by localized, per-node roles, resulting in a localrather than systemic perspective. The proposed service pro-vision framework, presented in the next section, focuseson the layers L0 to L2. A last aggregation of the contex-tual information is made in smart environment managementtools, deployed on environment managers and professionnalcaregivers mobile devices, and represent a last(L3) macrocontext layer.

3.2 The service provision system

An intelligent service provision system allows dynamic,fast and adapted service deployment toward the users inthe environments, based on the context of the environ-ment and takes into account different constraints such asthe users’ capabilities and their preferences. We imple-mented a middleware for smart homes/apartments dedicatedto the self-management of the software deployed in theseenvironments [13]. Rallying several technologies e.g. WebServices, OSGi, OWL ontologies and fuzzy logic, this mid-dleware uses the contextual information of the environmentsto find the devices that are the most adapted to the serviceneeds, user capabilities and preferences, device resourcesand environment topology. The main goal of the proposedservice provision system is to support the deployment ofthe assistive services into the smart environments for othersmart systems like activity recognition or error and failurerecognition systems to use. These systems use the serviceprovision functionalities by supplying information related tothe service to deliver, e.g. Which users are targeted?, Whichassistive services?, What are the service needs?, Is therea specific zone of the environment that is targeted by theassistance request?

Fig. 1 Overview of the macroand micro context awareness

Page 5: Intelligible software delivery in smart environments supported by a macro and micro context awareness model

Health Technol. (2013) 3:139–151 143

Service provision scenario Before explaining in details theservice provision system, a brief example illustrating aservice provision would help to assimilate the kind of con-textual information used by the system and what is type ofservices that are delivered to the users.

Suppose that an inhabitant from a smart apartment isstanding at the entrance of its kitchen around lunchtime.This inhabitant suffers from cognitive deficiencies thataffect his time organization. Thus, to remind him to pre-pare his meal, his electronic agenda requests to the systemto deliver a meal preparation assistant to the user in thekitchen area. The other information contained in the profileof the inhabitant are : the user has a poor visual acuity andan average field of vision, he moves at an average speed,he has a good hand strength and workspace, and he prefersthe tactile screens to the mouse peripherals and keyboards.The meal preparation assistant doesn’t need great resources: a display to present its interface and a pointing device.In the best case, this software should be deployed in thekitchen zone.

On the other hand, the smart apartment is divided intoseveral zones, e.g. the kitchen area, the living room, etc.Several devices and their interaction peripherals are locatedin these zones. Especially, four devices are in the proximityof the user: a laptop at his one o’clock, a tablet at his teno’clock, a server in a closet at his four o’clock and finally aTV with its multimedia computer behind him in the livingroom. Each of these devices have their own resources anddifferent kinds of interaction peripherals. Figure 2 illustratesthis example with a map of the smart apartment. In thisfigure, some of the interaction modalities are shown, suchas the user’s visual acuity and his field of vision (the arc),the user’s mobility corresponding to a walking time of twoseconds or less (the circle). The kitchen zone perimeteris also shown (the rectangle). Logically, the most suitabledevice in this context corresponds to the device in thesethree zones: the kitchen tablet. However, several other con-textual information can change this logic, depending onthe preferences of the user or the resources’ utilization ofthe devices.

Each device in the environment is collecting the con-textual information related to its sensors and internal met-rics. These information are delivered to the service provi-sion reasoning engines of each device, at the micro-level(FLORE-D), which analyzed and, if required, abstractedand deliver the information to the reasoning engine at themacro-level (FLORE-C). Both kind of reasoning enginescompute scores on how each device have the right resourcesand context to support the meal preparation assistant. Inthis example (based on a real deployment scenario), thedevice with the highest score is, effectively, the kitchentablet with 71.74 points, followed by the kitchen laptop with63.50 points, the living room TV with 57.25 points and the

apartment’s server with 0 points. For instance, the kitchenlaptop received a lower score due to the distance betweenthe user and the display versus the user’s visual acuity.Moreover, the user prefers to use a touch screen (like thatof the tablet) rather than the keyboard or the touch pad ofthe laptop. The living room TV is situated behind the userand outside of the kitchen area, which both reduce its score.Finally, the apartment’s server did not have a connected dis-play and a pointing device, which fail in providing theseperipherals to the meal preparation application, and causeda DCQ attribution of 0 points. Therefore, the most suitabledevice to support the user and the meal preparation assistantin this context is the kitchen tablet.

In this example, each device have the tools to collect andrepresent its micro-context and analyze it with a reasoningengine. Depending on the kind of collected information, e.g.an approximation of the user position found by an infra-red sensor, the information is abstracted and sent to themacro-level. This micro-level information can be used bythe macro-level reasoning engine and matched with otherinformation provided by a smart environment ontology (e.g.user profile and environment topology). By using the macroand micro context awareness model, each layers (devicesand environment nodes) are able to compute deploymentscores independly, with corresponding inprecision factors,and have a certain autonomy in this computation. However,it is by exchanging information between layers and takingin account macro and micro-level deployment scores (seenext section) that the system is increasing its precision andeffectiveness.

System overview The service provision mechanisms usefour main context elements: user profiles, environmentdevice profiles, topology of the environment and softwareprofiles. Each service that needs to be deployed in the envi-ronment has hardware, software or contextual needs. On onehand, assistive applications like a meal preparer assistant ora context aware calendar and organizer, can target particularusers in the environments and can require specific peripheraldevices. On the other hand, users have physical capabili-ties and preferences (preferences toward specific interactionperipherals such as keyboard, touch screen, mouse, etc.)about the environment devices; the devices also have pro-files with capabilities e.g. their resources, connected periph-eral devices, etc. All these components are present in thesmart environments at different (or not) locations and arerelated to contextual zones e.g. the kitchen, the bathroom,the living room, etc. Finally, the user profiles describe auser’s physical capabilities, e.g. their visual acuity, walkingspeed or their hand workspace, their interaction preferencesand their location in the environment.

In our work, we used the micro and macro contextmodel to divide into layers the reasoning on the contextual

Page 6: Intelligible software delivery in smart environments supported by a macro and micro context awareness model

144 Health Technol. (2013) 3:139–151

Fig. 2 An example of a serviceprovision with some of theprocessed contextualinformation: user’s mobility(circle), user’s visual acuity andfield of vision (arc) and targetedzone (rectangle)

Kitchen's Laptop

DCQ = 63.50

Apartment's Server

DCQ = 0Kitchen's

TabletDCQ = 71.74

Living room's TV

DCQ = 57.25

information related to the service delivery. We thereforedivided the system into two kinds of components: Devicenodes and Coordinator nodes. To create these nodes andlink them to a macro or micro layer, we used our modeldefinitions as decision rules. If a node primarily requireinstrinsic information to fulfill its job, then it should be amicro context provider. On the other hand, if a node usesintensively data related to the smart environment structure,or data mined from the Web or ontologies, then it should berelated to the macro-level context.

Thus, device nodes collect the information related totheir hardware, their location in the environment and theirconnected interaction peripherals. This information is pro-cessed, along with an abstracted representation of the ser-vice to deploy (provided by the coordinator node), withina Fuzzy Logic controller. Fuzzy logic [17], based on thefuzzy set theory, allows reasoning at a high level using lin-guistic terms instead of numerical values, with conditionalrules (e.g., IF x IS a THEN y IS b). Fuzzy logic reasoningover the information involves three main steps: (i) fuzzifica-tion of the numeric inputs’ values into linguistic terms usingmembership functions; (ii) inferences of fuzzy rules withprevious linguistic terms, with three sub-tasks: aggregation

(combining the results of the different predicates), activation(assignation of the rules’ conclusions) and accumulation(combination of the conclusions to output fuzzy sets); (iii)defuzzification: conversion of the output fuzzy sets to anumerical output, where often a centroid method is usedto find the average value of the corresponding defuzzifica-tion sets. Figure 3 presents a simplified example, with onlyone fuzzy set, of how fuzzy logic is used, where the sys-tem uses information about devices’ resource consumptionto identify the best deployment target.

To determine which device to deploy a service to, contex-tual information is processed using two implementations ofa JFuzzyLogic controller.1 The contextual information asso-ciated with the device’s intrinsic data and service compo-nent profile are processed in a fuzzy controller in each envi-ronment device, producing Device Scores. Another fuzzylogic controller, located in a coordinating device, processesthe data related to the user profile and the environmenttopology, producing User Scores. Contextual informationare fuzzified using membership functions and fuzzy rules(15 rules for Device Scores and 41 rules for User Scores).

1http://jfuzzylogic.sourceforge.net

Page 7: Intelligible software delivery in smart environments supported by a macro and micro context awareness model

Health Technol. (2013) 3:139–151 145

Fig. 3 Fuzzy logic examplewith device’s resourcesconsumption

The inference uses the min-max method for the aggrega-tion, minimum function for the activation and the maximummethod for the accumulation. Device scores and User scoresare merged together to produce a final Deployment score,by computing a weighted mean, with a weight related to theimportance of the User profile.

Score= (User.Score ∗ W)+(Device.Score ∗ (1−Weight))

2(1)

Therefore, this controller determines (based on fuzzysets, fuzzy rules and defuzzification set) if each device hasthe resources to support the services to deliver and at whichperformance/quality the device can support the service inquestion (with a performance score between 0 and 100).Such information is shared with the other components ofthe environment along with an abstracted representation ofthe device. The Device nodes have subjective views of theirsurrounding and a partial view of the environment throughthe data forwarded by the coordinator nodes or the otherdevice nodes.

The coordinator nodes have the responsibility to receiveservice provision requests and manage the reasoning pro-cess about which devices in the environment are the mostappropriate to support the services. Depending on the ser-vice needs, the coordinator nodes take into considerationthe profile of the users to determine which device is bestadapted to user capabilities and interaction preferences, andthe topology of the environment, i.e. in which environment

zones users and components (devices and peripherals) arein. This information is computed with the abstracted rep-resentation of the micro context and the performance scorecomputed by the device node. To do so, the coordinator nodeuses an OWL ontology and a second Fuzzy Logic controllerto make the final decision about where each service mustbe deployed. The contextual information processed by theCoordinator node is directly related to the macro contextawareness level. The users are the central focus point of thereasoning process in the Coordinator node and these nodeshave a systemic and consistent view of the environment con-text, partially provided by the abstracted micro contexts.Figure 4 presents the use and exchange of the contextualinformation between the Coordinator node and a Devicenode, respectively related to the macro and micro contextlevels.

One direct benefit of dividing the service provisionsystem in two context awareness layers is the reduction,on each layer, of the quantity of data managed. More-over, dividing the contextual information in different layersreduces the strong coupling that can exist between infor-mation, reducing the complexity of updating informationacross layers. For instance, in the service provision system,the Device nodes know their location in the environment,but don’t know directly in which logical zone they are, asthis depends on a more global view of the environment.

Another benefit of the micro and macro context aware-ness layers is to prevent the divulgence of sensitive informa-tion between software components. In the case of the service

Page 8: Intelligible software delivery in smart environments supported by a macro and micro context awareness model

146 Health Technol. (2013) 3:139–151

Fig. 4 Utilisation of thecontextual information in theservice provision system

provision system, user profiles are kept in the Coordinatornode, avoiding publication of private information such asuser interaction capabilities and preferences. Another ben-efit is the non-divulgence of the service profile, with eachDevice node receiving an abstracted representation of theservices to deploy until they are finally selected for thedeliveries, keeping private the real nature of the services andthe provided assistance. Finally, distributing the processingof the contextual information among layers and nodes has animportant impact on the performance of the system. Usingmacro and micro context layers allows leveraging of theprocessing capacities of the different devices in the environ-ment and reduces the computing time of the macro contextlayer (less information to process). Some results on the dis-tribution of the reasoning processes for the service provisionsystem are presented in Section 4.

3.3 Context intelligibility

Some context aware application support some level of intel-ligibility. Vermeulen et al. [32] and Kuleza et al. [18] exposeto the users the contextual information (e.g. sensors values)that is used in the reasoning process of their system, alongwith some explanations. They organized there explanationaround an interrogative form: Why? (i.e., why the systemtook a particular action), Why not? (i.e., why the system didnot take another action instead), What if? (i.e., what are theresults if the context is that), How to? (i.e., how can the sys-tem be made to produce these results). Lim and Dey [20]propose more intelligibility functionnalies with the Intelligi-bility Toolkit [19] by introducing new explanation models,also based on an interrogative form, e.g. How to ?, Whatif ?, Certainty, etc. They applied there intelligibility toolkit

to different reasoning models such as bayesian network andrules base model.

In [14], we proposed and evaluated an intelligibilitymechanisms for fuzzy logic, loosely based on the Intelli-gibility Toolkit of Lim and Dey. These mechanisms usedthe Why, Why not and What if explanations as structure toexplain system’s behaviors to the users. Moreover, we usedthe software provision framework, described above, as thetestbed to implement the intelligibility in a micro and macrocontext awareness model.

One of the biggest challenge in implementing this intel-ligibility was to create the right mechanisms to encapsulatethe meta-data about each micro and macro contexts, whichare used to generate the explanations. For instance, in theoriginal Intelligibility toolkit, as the framework is based ona macro model, there is no real problem with acceding toany contextual information and reasoning engine processes,as must of these data are locales. In the case of a macroand micro model, explanation generators need an access tometa-data about the contextual information and the systembehavior across several macro and micro layers.

Strategy and Command design patterns gave the rightstructures to implement such encapsulation. We designed astrategy object to encapsulate the creation of explanationsaround the Fuzzy Logic which can generate Why, Why notand What if explanations from the reasoning engine embed-ded in the coordinator node and the device nodes. As theway to get meta-data can differ for each kind of microand macro context, we encapsulated the way to retrievethe meta-data for each explanation generation methods, inCommand design pattern objects. For instance, in the soft-ware provision system, to get real time access to meta-datain micro context, the Command objects must send Web

Page 9: Intelligible software delivery in smart environments supported by a macro and micro context awareness model

Health Technol. (2013) 3:139–151 147

services calls to the device nodes, and must send SparQLqueries to the OWL ontology for the macro contextual infor-mation. Figure 5 presents an overview of the structure usedto create the intelligibility mechanism. During explanationgeneration, as information are provided by several sources,it is required to merge and aggregate information. We cre-ate strategies [14] to reduce, aggregate and simplify thequantity of information presented to the users through theexplanations, for instance by using the Weight of Evi-dence method [24]. This intelligibility model is dynamicallyscalable, as the number of micro-context providers are auto-matically integrated into the model through the discoverymechanisms of the service provision system.

To make the software provision system more intelligibleto users, we proposed to organize the explanations arounda layout based on the three Fuzzy Logic reasoning steps(fuzzification, inference, defuzzification), as Fuzzy Logic isthe principal reasoning method used by the provision sys-tem. Such a strategy introduces users to the general conceptsof fuzzy logic and builds a logical organization modeled onthe real implementation of the system. Secondly, each rea-soning step must be made more intelligible by reducing theamount of presented information and specific knowledgeimplications. For instance, it is not required to show a com-plete definition of the fuzzification functions to users (whichrequires advanced math skills to understand); instead, asummary introducing the membership values and linguis-tic terms for each input is more appropriate. Thus, to makefuzzy logic systems more intelligible, we need to support:(i) fuzzification: presents the system’s inputs and a sum-mary of the related linguistic terms/membership value; (ii)inference: shows the users a limited list of fuzzy rules andtheir conclusions/results. Introducing the users to the sub-steps of inference (aggregation, accumulation, activation)should be done with caution as it increases the complexityfor users; (iii) defuzzification: summarizes the inference’sconclusions, and introduces the system’s outputs and theway they are computed (i.e., centroid, center of area, rightor left max value).

Adding the intelligibility structure to the service pro-vision system didn’t add a significant workload and pro-cessing time to the system itself (Section 4). Must ofthe workload related to the intelligibility is made by theGUI representation of the explanations (Fig. 6). More-over, we evaluated the intelligibility support in our systemthrough a user study. We selected ten participants withtwo kinds of backgrounds: with computer science and I.T.professionals and experts (5 participants) and with peoplefrom the general population (5 participants). Each partici-pants had to use the intelligibility features of the GUI andprocceed to the deployment of software in a virtual smartapartment. The results of the study demonstrate that intel-ligibility and explanations help both I.T./C.S. professionalsand less technical people to understand fuzzy logic. Intel-ligibility even helped the less technical participants to gainan understanding that was close to the technical experts.Moreover, the study highlighted the importance for users tocompare data (why not?) and experiment with system mod-ification (what if?). However, the quantity of information inthe explanations can rapidly overwhelm users, particularlyusers without a background in I.T., situation that we haveexperimented during the study. More work will be requiredto increase the effectiveness of the design of explanationsand the GUI, but the preliminary results shows that our intel-ligibility strategies provide useful information to users onthe behavior of context-aware system.

3.4 Implementation

The service provision system is build over the OSGi frame-work. OSGi is a Service Oriented Architecture (SOA)framework that gives the support for the modularization ofthe ubiquitous applications and the management of theirlife cycles. Thus, the service provision system uses thesefunctionalities to deploy and manage the service modulesin the environment’s devices. As the proposed system is adistributed framework, the Apache CXF dOSGi and WS-Discovery are used as communication support between the

Fig. 5 Overview of theintelligibility feature in theservice provision system

Page 10: Intelligible software delivery in smart environments supported by a macro and micro context awareness model

148 Health Technol. (2013) 3:139–151

Fig. 6 Screenshot of the management tool providing intelligibility functionalities

device and the coordinating device, which host the serviceprovision reasoning engine (FLORE).

On the top of the OSGi framework, we have implementedseveral modules that are cooperating to provide the serviceto the users in the smart environment (Fig. 7). The Environ-ment Management Coordinator node have the job to managethe device discovery, maintain the environment ontology,receive the service provision requests and manage them withthe help of the FLORE. The Device nodes are deployedon the environment devices and host the service moduleto provide to the users. They also perform some reasoningon the context such as on the hardware resources and theinteraction peripheral availabilities.

As the provision functionalities use contextual infor-mation and the user profiles to find the optimal way toprovide the services to the environment users, a way todescribe and contain these description is needed. A power-ful way to represent this information is by using semanticlanguage, describing the environment information and con-nections residing between the concepts. The service pro-vision framework describe the ubiquitous environmentthrough a meta-ontology [1] described in the Web OntologyLanguage (OWL), which presents the context informationthrough Resource Description Framework (RDF) conceptsand semantic connection in OWL format. To hold and main-tain this information, the system use the JENA framework.

The fuzzy logic controller used by the service provi-sion system was implemented over the JFuzzy Logic API,which uses the Fuzzy Control Language (FCL IEC 61131)to define the membership and defuzzification functions andthe fuzzy rules. Among other benefits, the FCL allows aclean and easy implementation of the fuzzy logic controller,and allows the proposed system to be rapidly scalable andadaptable to new context, by introducing new rules andfunctions.

4 Evaluation and results

Throughout the technical evaluation of the service provi-sion system, we evaluated the macro and micro contextawareness approach applied to service delivery in a smartapartment. The evaluation was conducted in a real smartapartment (apartment in the infrastructure of the DOMUSLaboratory at the University of Sherbrooke), composed of 8device nodes, 1 coordinator node, 25 and more interactionperipherals and over 50 context sources e.g., sensors, local-isation system. We use different kinds of user archetypesin five assistance scenarios based on the validation used byGouin-Vallerand et al. [13].

Firstly, we compared our approach with the similar workof Trumler et al. [30], which can be categorized as a micro

Page 11: Intelligible software delivery in smart environments supported by a macro and micro context awareness model

Health Technol. (2013) 3:139–151 149

Environment Management

Ontology Manager

Ontology

Device Management

FLORE Device

Coordinator NodeDevice Node #X

Descr.Device

Sensors & Services

FLORE Coordinator

Discovery Module

Communication layerSOA-OSGi

Bundle 1

Bundle 2

Bundle N

...

Logging System

Contextual Information Gatherer

Legend

Web service

File

OSGi service call

Web service call

Management Tools

Fig. 7 The service provision system architecture with its two main components: the Environment Management Coordinator and the Device Node

context aware system. As Trumler et al. did, we evaluateour system by counting the number of messages exchangedfor a given service delivery job. The number of messagesexchanged in a distributed system for a specific job, can bea good way to compare the intrinsic complexity of systems[21], when the types of data and the amount of informa-tion are fixed. In the case of the macro and micro contextaware service provision system, the number of messagesexchanged between the nodes correspond to Messages =(a × d) + d + 1 where d is the number of Device nodeand a is the number of services to deliver. Therefore, forfive services to deploy in an environment with ten devices,the number of messages is 61 messages. For the sameconfiguration, the solution of Trumler et al. in a similarconfiguration used 35 messages. However, if the nature ofthe information is the same (XML stream) in both works,the amount of information used by each system is different.Compared to Trumler et al.’s work, our service provisionsolution uses a more complete description of the servicesto deliver and involve the topology and the user profile inthe reasoning process. Moreover, the Trumler et al.’s workgroups several informations together in the same message,which reduce the amount of messages but not necessarilythe complexity behind their reasoning process.

On the other hand, Ranganathan et al. [27] proposes acentralized solution involving the processing of the informa-tion based on a macro context awareness perspective. Theymeasured the performance of their work based on comput-

ing, where their system took an average processing time of0.93 second on a Pentium M 1.7 GHz system, for a scenariowith two services deployed among five devices. In compar-ison, our micro and macro solution takes 0.55 second fora similar scenario with eight devices, plus the computingrelated to the user profiles and where the system was com-posed of devices ranging from Intel Core 2 Duo 2.4 GHz toTablets processors. This computing time included the Webservice calls related to the 23 messages/requests exchangedduring the service provision.

Of course, comparing computing times from systemswith different hardware and setups is difficult. To push thecomparison further, we measured the average computingtimes related for the system’s software components and thecommunications (Table 1). By using the Passmark bench-mark scores of the processors, 434 for the Pentium M and1508 for the Core 2 Duo2, which give a ratio of 3.47 infavor of the Core 2 Duo. Using this ratio with the aver-age computing times of the Coordinator and Device node(0.12+0.06 seconds), the approximation (with an unknownerror margin) of the computing time of the proposedsolution on a Pentium M would be of 0.62 s (0.18 × 3.47).One conclusion from this exercise is that the web servicecalls represent a bottleneck for the performance of our sys-tem. In the case of the service provision, the distributednature of the system cannot be avoided and is an intrinsic

2Passmark benchmark: www.cpubenchmark.net

Page 12: Intelligible software delivery in smart environments supported by a macro and micro context awareness model

150 Health Technol. (2013) 3:139–151

Table 1 Processing times of the service provision system’scomponents

Component Average computing time (sec)

Coordinator node 0.12

All device nodes 0.06

One device node 0.01

All web service calls 0.28

One web service call 0.011

part of the solution. However, by adding to approximatedcomputing time the web service calls (assuming that thereis only small variations between the two hardware), theperformance of the proposed solution is around the Ran-ganathan et al.’s result, with more data processed and thebenefit of the micro context awareness in the favor ofour work.

Finally, these results show that the proposed service pro-vision system implemented using a micro/macro contextawareness approach gave results that are at least equiva-lent to the other related works. As the complexity and theamount of data processed by our solution are higher, we hadto use state of the art technologies (e.g. web services, OSGiframework, OWL ontologies, Fuzzy Logic controllers) tohelp us in implementing our approach, which would havebeen more difficult 5 years ago without them.

5 Conclusion

Today’s smart environments are synonymous to contextawareness, component dynamism and adapted services toassist the users in their daily living activities. If contextawareness brings tools to increase the system adaptationto the surrounding environment, its implementation is nottrivial. The micro and macro context awareness approacheshelp categorize to which kind of context each system com-ponent should be related, depending on the role of thecomponents and the type of processed information. In thispaper, we present our work around the implementation ofa service provision system for smart spaces, based on amodel where the processing of the contextual informationis divided between a macro and a micro context awarenesslayer. This approach allows us to manage the complex-ity related to the contextual information, by processingdata as close as possible to their context sources, with theDevice Nodes, without losing the benefits of informationprocessing at a systemic level, with the Coordinator nodes.Moreover, we demonstrate that our macro and micro layersapproach gave more autonomy, scalability and adaptabilitythan single layer approaches (e.g. Ranganathan’s and Trum-ler’s models) without a cost in the system performance.

We are currently working on the formalization of a modelof the macro and micro context awareness approach andwe are planning to implement it in large-scale systems forcontrolled smart spaces (e.g. smart homes) and open smartspaces (e.g. smart cities). The formalization of the modelwill help in implementing the functionalities to support bothcontext layers, in environments where the quality of servicecan vary greatly.

With smart environments and smart cities being morepopular to support dependant people or for mediated envi-ronments, our micro and macro context-awareness modelwill bring tips and clues for developers wishing to buildpolyvalent, autonomous and scalable context-aware sys-tem. Moreover, with the popularity of the cloud computing,where macro-level context-aware bundles can be deployed,and micro-level counterpart in mobile devices, the modelproposed in this paper all make sense. This is also thedirection that our future work will take.

Conflict of interest The authors declare that they have no conflictof interest.

References

1. Abdulrazak B, Chikhaoui B, Gouin-Vallerand C, Fraikin B.A standard ontology for smart spaces. Int J Web Grid Serv.2010;6(3):244–68.

2. Abdulrazak B, Roy P, Gouin-Vallerand C, Giroux S, BelalaY. Macro and micro context-awareness for autonomic perva-sive computing. Int J Bus Data Commun Netw (IJBDCN). 2011;7(2):48–68.

3. Abowd GD, Dey AK, Brown PJ, Davies N, Smith M,Steggles P. Towards a better understanding of context andcontext-awareness. In: Proceedings of the 1st international sym-posium on Handheld and Ubiquitous Computing. HUC ’99.London: Springer-Verlag; 1999. p. 304–307. http://dl.acm.org/citation.cfm?id=647985.743843.

4. Alonso E, Kristofferson P, McCann J. Building ambient intelli-gence into a ubiquitous computing management system. In: Inter-national symposium of Santa Caterina on challenges in the internetand interdisciplinary research. SSCCII-2004, Amalfi; 2004. http://dev.pubs.doc.ic.ac.uk/ambient-intelligence/.

5. Athanasopoulos D, Zarras A, Issarny V, Pitoura E,Vassiliadis P. Cowsami: interface-aware context gathering inambient intelligence environments. Pervasive Mobile Com-put. 2008;4(3):360–89. http://linkinghub.elsevier.com/retrieve/pii/S1574119207000740.

6. Bellotti V, Edwards K. Intelligibility and accountability: humanconsiderations in context-aware systems. Hum Comput Interact.2001;16(2):193–212.

7. Biswas J, et al. Health and wellness monitoring through wearableand ambient sensors: exemplars from home-based care of elderlywith mild dementia. Annals Telecommun 2010;65:505–21.

8. Dey AK. Providing architectural support for building context-aware applications. Ph.D. thesis. Georgia Institute of Technology;2000.

9. Dey AK, Abowd GD, Salber D. A conceptual framework anda toolkit for supporting the rapid prototyping of context-awareapplications. Hum Comput Interact. 2001;16:97–166.

Page 13: Intelligible software delivery in smart environments supported by a macro and micro context awareness model

Health Technol. (2013) 3:139–151 151

10. Feki MA. A logic based approach for context reasoning inassistive environment. In: Proceedings of the 2nd internationalconvention on rehabilitation engineering & assistive technology.iCREATe ’08. Kaki Bukit TechPark II, Singapore: SingaporeTherapeutic, Assistive & Rehabilitative Technologies (START)Centre, 2008. p. 277–280. http://dl.acm.org/citation.cfm?id=1983222.1983296.

11. Gessler S, Martin M, Weiss S. Context awareness in futurelife scenarios: impact on service provisioning platforms. In:IEEE/IPSJ International Symposium on Applications and theInternet Workshops. 2005. p. 144–7.

12. Giroux S, Bauchet J, Pigot H, Lussier-Desrochers D, LachappelleY. Pervasive behavior tracking for cognitive assistance. Interna-tional conference on pervasive technologies related to assistiveenvironments, PETRA 2008. 2008. p. 86:1–7.

13. Gouin-Vallerand C, Giroux S, Abdulrazak B. Tyche project: acontext aware self-organization middleware for ubiquitous envi-ronment. In: 13th International Conference on High PerformanceComputing and Communications (HPCC). 2011.

14. Gouin-Vallerand C, Lim BY, Dey AK. In: Proceedings ofthe 2012 ACM conference on ubiquitous computing. New York:UbiComp ’12, ACM. 2012. p. 74–777. http://doi.acm.org/10.1145/2370216.2370389.

15. Gu T, Pung HK, Zhang DQ. A service-oriented middlewarefor building context-aware services. J Netw Comput Appl. 2005;28:1–18. http://dl.acm.org/citation.cfm?id=1053030.1053031.

16. Hoey J, Yang X, Quintana E, Favela J. Lacasa: location andcontext-aware safety assistant. In: Proceeding of international con-ference on pervasive computing technologies for healthcare. SanDiego; 2012.

17. Klir GJ, Yuan B. Fuzzy sets and fuzzy logic: theory and applica-tions. Upper Saddle River: Prentice-Hall, Inc.; 1995.

18. Kulesza T, Wong WK, Stumpf S, Perona S, White R, BurnettMM, Oberst I, Ko AJ. In: Proceedings of the 14th inter-national conference on Intelligent user interfaces: IUI ’09. 2009.p. 187–96.

19. Lim BY, Dey AK. In: Proceedings of the 12th ACM internationalconference on Ubiquitous computing. New York: Ubicomp’10, ACM; 2010. p. 13–22. http://doi.acm.org/10.1145/1864349.1864353.

20. Lim BY, Dey AK. In: Proceedings of the 13th international con-ference on Ubiquitous computing. New York: UbiComp ’11,ACM; 2009. p. 415–24. http://doi.acm.org/10.1145/2030112.2030168.

21. Lynch NA. Distributed algorithms. San Francisco: Morgan Kauf-mann Publishers Inc.; 1996.

22. Miaou SG, Shih FC, Huang CY. In: The third IASTED interna-tional conference on telehealth. Anaheim: Telehealth ’07, ACTAPress; 2007. p. 7–12. http://dl.acm.org/citation.cfm?id=1672136.1672139.

23. Neovius M, Sere K, Yan L, Satpathy M. A formal model ofcontext-awareness and context-dependency. IEEE InternationalConference on Software Engineering and Formal Methods. 2006.p. 177–85.

24. Poulin B, et al. In: Proceedings of the 18th conference on Innova-tive applications of artificial intelligence - vol. 2: IAAI’06. 2006,p. 1822–9.

25. Preuveneers D. Context-aware adaptation for ambient intelli-gence: LAP Lambert Academic Publishing; 2010. https://lirias.kuleuven.be/handle/123456789/267553.

26. Preuveneers D, Van den Bergh J, Wagelaar D, Georges A, RigoleP, Clerckx T, Berbers Y, Coninx K, Jonckers V, De BosschereK. Towards an extensible context ontology for ambient intelli-gence. In: Markopoulos P, Eggen B, Aarts E, Crowley J, editors.Ambient intelligence, lecture notes in computer science, vol. 3295.Berlin: Springer; 2004. p. 148–59.

27. Ranganathan A, Shankar C, Campbell R. Application polymor-phism for autonomic ubiquitous computing. Multiagent Grid Syst.2005;1(2):109–29.

28. Rialle V, Ollivet C, Guigui C, Herv C. What do family caregiversof alzheimer’s disease patients desire in smart home technologies?Methods Inform Med. 2009;47:63–9.

29. Skubic M, Guevara RD, Rantz M. Testing classifiers for embed-ded health assessment. In: Donnelly, MP, Paggetti, C, Nugent, CD,Mokhtari, M, editors. ICOST. Lecture notes in computer science,vol. 77251: Springer; 2012. p. 198–205.

30. Trumler W, Klaus R, Ungerer T. In: Third international con-ference on autonomic and trusted computing 2006, ATC. Lecturenotes in computer science, vol. 4158: Springer; 2006. p. 90–9.http://dblp.uni-trier.de/db/conf/atc/atc2006.html#TrumlerKU06.

31. Truong H, et al. In: EuroSSC,ser. Lecture notes in computerscience: Springer; 2007. p. 207–22.

32. Vermeulen J, Vanderhulst G, Luyten K, Coninx K. 2010 sixthinternational conference on intelligent environments (IE). 2010.p. 271–6.

33. White C. Health care spending growth: how different is the UnitedStates from the rest of the OECD? Health Affair. 2007;26(1):154–61.