uncertainty reasoning context-aware computing … · uncertainty reasoning context-aware computing...

9

Click here to load reader

Upload: truongnhan

Post on 08-Jun-2018

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: UNCERTAINTY REASONING CONTEXT-AWARE COMPUTING … · UNCERTAINTY REASONING CONTEXT-AWARE COMPUTING Reasoning about Uncertain Contexts in ... pervasive computing infrastructure,

62 PERVASIVEcomputing Published by the IEEE CS and IEEE ComSoc ■ 1536-1268/04/$20.00 © 2004 IEEE

U N C E R T A I N T Y R E A S O N I N G

C O N T E X T - A W A R E C O M P U T I N G

Reasoning aboutUncertain Contexts inPervasive ComputingEnvironments

Mark Weiser envisioned com-puting environments that arepervaded with so many com-puting devices and sensorsthat they seem to disappear

into the background, letting humans focus ondaily tasks rather than on underlying technolo-gies.1 To enable this vision, we must transformtoday’s “dumb,” context-insensitive, and iso-lated machines into intelligent, programmable,and context-aware clusters of machinery. How-ever, unobtrusiveness and context awarenessinvolve capturing and making sense of impre-

cise and sometimes conflictingdata and uncertain physicalworlds.

Different types of entities(software objects) in the envi-ronment must be able to reasonabout uncertainty. These in-clude entities that sense uncer-

tain contexts, entities that infer other uncertaincontexts from these basic, sensed contexts, andapplications that adapt how they behave on thebasis of uncertain contexts. Having a commonmodel of uncertainty that is used by all entitiesin the environment makes it easier for develop-ers to build new services and applications in suchenvironments and to reuse various ways of han-dling uncertainty.

We developed an uncertainty model based ona predicate representation of contexts and asso-ciated confidence values. This model forms thebasis for reasoning about uncertainty using var-ious mechanisms such as probabilistic logic, fuzzylogic,2 and Bayesian networks. Each of thesemechanisms is useful in handling uncertainty indifferent situations. We incorporated these mech-anisms in Gaia,3 a distributed middleware sys-tem that enables Active Spaces—physical spacesenhanced with ubiquitous computing devices—to form an interactive, programmable comput-ing and communication system. This articledescribes our model for uncertain contexts andhow Gaia handles uncertainty and various rea-soning mechanisms.

One of our goals was to make it easy fordevelopers to integrate the use of uncertainty intheir programs. Gaia’s context infrastructureprovides services and libraries that help entitiesacquire and reason about uncertain contextualinformation. We define the structure and prop-erties of context predicates in ontologies—thismakes it easier to develop programs that reasonabout context.

Model for dealing with uncertaintyOur model represents any piece of information

whose truth value is potentially uncertain as apredicate.

Context-aware systems can’t always identify the current contextprecisely, so they need support for handling uncertainty. A prototypepervasive computing infrastructure, Gaia, allows applications andservices to reason about uncertainty using mechanisms such asprobabilistic logic, fuzzy logic, and Bayesian networks.

Anand Ranganathan, Jalal Al-Muhtadi, and Roy H. CampbellUniversity of Illinois at Urbana-Champaign

Page 2: UNCERTAINTY REASONING CONTEXT-AWARE COMPUTING … · UNCERTAINTY REASONING CONTEXT-AWARE COMPUTING Reasoning about Uncertain Contexts in ... pervasive computing infrastructure,

The context predicateWe represent contexts as predicates,

following the convention that the pred-icate’s name is the type of context beingdescribed (such as location, tempera-ture, or time).4,5 This gives us a simple,uniform representation for differentkinds of contexts. Many predicates aredefined to have arguments in a subject-object format (ContextType(<Subject>, <Object>)or in a subject-verb-object format (ContextType(<Subject>, <Verb>, <Object>). Wecan also use relational operators suchas “=” and “<” as arguments. Examplecontext predicates include

location(jeff, in, room 3105)activity(room 3102, meeting)light(room 3220, dim)office(chetan, room 3216)

Some contexts (such as office) are cer-tain, whereas others (such as location andactivity) might be uncertain. The type ofcontext constrains the values that thepredicate arguments can take. For exam-ple, if the type of context is location, thefirst argument must be a person orobject, the second argument must be apreposition or a verb such as entering, leav-ing, or in, and the third argument must bea location. We type-check the predicateswhenever they are used in rules or otherreasoning mechanisms.

Our context model gives a commonrepresentation for context that all entitiesin our environment use; the model itselfdoesn’t describe what operations can beperformed on contexts. Instead, it providesa common base on which various reason-ing mechanisms can be specified to han-dle context. Using predicates to representcontext information is helpful becausewe can plug them directly into rules andother reasoning and learning mechanismsfor handling uncertainty. Moreover, it letsus describe context in a uniform way thatis independent of programming language,operating system, or middleware.

OntologiesWe specify the predicates’ structures

and semantics in an ontology thatdefines various context types as well asthe arguments that the predicates musthave.6 Each context type corresponds toa class in the ontology. The ontology iswritten in DAML+OIL,7 which is fastbecoming the de facto language of theSemantic Web.8

We use the ontology to check predi-cates’ validity. It also makes including

context predicates in rules easierbecause we know the predicates’ struc-ture and the kinds of values differentarguments can take. Using ontologiesalso lets different ubiquitous comput-ing environments interoperate, becausewe can define translations between theterms used in these environments’ontologies. Ontological descriptions alsohelp reduce the possibility of one kindof uncertainty: how different entitieswill interpret the same piece of contextinformation.

Confidence valuesWe model uncertainty in our envi-

ronment by attaching a confidencevalue between 0 and 1 to predicates.This value measures the probability (inthe case of probabilistic approaches) orthe membership value (in the case offuzzy logic2) of the event correspondingto the context predicate being true. Forexample, prob(location(carol, in, room 3233)) =0.5 means that the probability thatCarol is in Room 3233 is 0.5. Gaia usesthese confidence values in variousways.

Reasoning using probabilistic andfuzzy logic

Our use of probabilistic logic is basedon earlier work.9 This logic lets us makestatements such as “the probability of Eis less than 1/3” and “the probability ofE is at least twice the probability of F,”where E and F are arbitrary events. Thelogic has a complete axiomatization, andthe complexity of deciding satisfiabilityin it is no worse than that of proposi-tional logic.

Probabilistic logic lets us write rulesthat reason about events’ probabilitiesin terms of the probabilities of otherrelated events. For writing rules in prob-abilistic logic and performing reasoning,we use XSB (http://xsb.sourceforge.net),a kind of Prolog that uses tabling andindexing to improve performance. Besidesstandard Prolog, XSB also allows pro-gramming in HiLog.10 Because HiLoghas a higher-order syntax, it lets predi-cates appear as arguments of other pred-icates. This allows unification on thepredicate symbols themselves as well ason their arguments. However, the seman-tics of HiLog is first-order and has asound and complete proof procedure. Weneed such higher-order logic syntax towrite rules about the probabilities of con-text predicates. An example rule (writtenin XSB) is

prob(X, Y, union, P) :- prob(X, Q), prob(Y, R), disjoint(X, Y), (P is Q + R).

This rule essentially says that Pr(X ∪Y) = Pr(X)+ Pr(Y) if X and Y are disjoint events—thatis, they never occur together. X and Y can

APRIL–JUNE 2004 PERVASIVEcomputing 63

Using predicates lets us describe context

in a uniform way that is independent

of programming language,

operating system, or middleware.

Page 3: UNCERTAINTY REASONING CONTEXT-AWARE COMPUTING … · UNCERTAINTY REASONING CONTEXT-AWARE COMPUTING Reasoning about Uncertain Contexts in ... pervasive computing infrastructure,

be context predicates. For example, Xcould be location(Bob, in, Room 2401) and Ycould be location(Bob, in, Room 3234). X and Yare disjoint events, since Bob can’t be intwo different locations at the same time.

Fuzzy logic is somewhat similar toprobabilistic logic. In fuzzy logic, confi-dence values represent degrees of mem-bership rather than probability. Fuzzylogic is useful in capturing and repre-senting imprecise notions such as “tall,”“trustworthy,” and “confidence” and rea-soning about them. We base this modelon the fuzzy predicate logic developedby Petr Hajek11 and adapt it to perva-sive computing environments. We canthus write rules involving various con-text predicates and then reason on thebasis of these rules.

Bayesian networksBayesian networks are directed acyclic

graphs, where the nodes are random vari-ables representing various events and thearcs between nodes represent causal rela-tionships. In our model, each value thata variable can take corresponds to a cer-tain context predicate. To specify aBayesian network’s probability distribu-tion, you give the prior probabilities ofall root nodes (nodes with no predeces-sors) and the conditional probabilities of

all nonroot nodes (given all possible com-binations of their direct predecessors).

Figure 1 shows an example of aBayesian network that infers the activ-ity taking place in a room. Take theActivity node at the root of the network,for instance. The random variable activ-ity can take values such as “meeting,”“presentation,” “idle,” and so on, withdifferent probabilities. Assuming thatwe’ve trained the network for Room2401, these values correspond to thecontext predicates activity(room 2401, meeting),activity(room 2401, presentation), activity(room 2401,idle), and so on. These context predicateshave different probability values basedon what the network deduces.

Bayesian networks are a powerful wayof handling uncertainty, especially whenthere are causal relationships betweenvarious events. They are useful for per-forming probabilistic sensor fusion andhigher-level context derivation. In ourenvironment, root nodes in the Bayesiannetwork represent the information to bededuced, while the leaves are sensedinformation. The intermediate nodes areimportant subgoals that are helpful tothe deduction process.

Context infrastructureIn Gaia, our prototype pervasive com-

puting infrastructure, different entitiesare aware of their context and adapt theirbehavior to it.4 The infrastructure pro-vides support for gathering context infor-mation from sensors and delivering ap-propriate context information to entities.It also lets entities infer higher-level con-texts from low-level sensed contexts. Dif-ferent kinds of entities are involved inGaia’s context infrastructure (see Figure2). All parts of the infrastructure havesupport for handling uncertain contexts:

• Context Providers are sensors orother data sources of context infor-mation. They allow other agents (orContext Consumers) to query themfor context information. Some Con-text Providers also have an eventchannel in which they regularly sendcontext events. Thus, other agentscan either query a Provider or listenon the event channel to get contextinformation. Context Providers canassociate a probability measure withthe context information they pro-vide, if the information is uncertain.They get information on the seman-tics of the context they provide (thatis, whether it’s certain or not) and thecontext predicates’ structure fromthe ontologies.

• Context Synthesizers get sensed con-texts from various Context Providers,deduce higher-level or abstract con-texts from these simple sensed con-texts, and then provide these deducedcontexts to other agents. For example,we have a Context Synthesizer thatinfers the activity occurring in oursmart room based on informationsuch as the number of people in theroom and the applications that arerunning. Context Synthesizers alsoassociate a probability measure withthe context information they provide,if the information is uncertain.

• Context Consumers are entities (con-text-aware applications) that get dif-

64 PERVASIVEcomputing www.computer.org/pervasive

U N C E R T A I N T Y R E A S O N I N G

Activity

NumberOfPeopleInRoom MPEGPlayer

PPTRunningOnScreenPPTController

SoundLevel

MP3PlayerAttendanceApp

LightStatus

Presenter

PDFViewer

VisualStudio

Figure 1. A Bayesian network for inferringactivity.

Page 4: UNCERTAINTY REASONING CONTEXT-AWARE COMPUTING … · UNCERTAINTY REASONING CONTEXT-AWARE COMPUTING Reasoning about Uncertain Contexts in ... pervasive computing infrastructure,

ferent types of contexts from ContextProviders or Context Synthesizers.They reason about the current contextand adapt the way they behave accord-ing to it. They can use various mecha-nisms for reasoning about context,such as rules written in different typesof logic and learning mechanisms suchas Bayesian learning. These reasoningmechanisms can take into account anyuncertainties in context information.

• Context Provider Lookup Serviceenables Context Providers to adver-tise what they offer and agents to findappropriate Context Providers.

• Context History Service lets agentsquery for past contexts, which arelogged in a database.

• Ontology Server maintains the ontolo-gies that describe different types ofcontextual information.

Each Active Space has one Context Pro-vider Lookup Service, one Context His-tory Service, and one Ontology Server.

Structure of a reasoning entityFigure 3 illustrates the structure of an

entity (application, device, or service)that uses reasoning to deal with uncer-tain contexts. Each entity has a knowl-edge base associated with it, in which rel-evant facts and rules are asserted. TheKB contains facts about the current con-text in the form of context predicates aswell as information from other services,such as authentication and access con-trol services. When a Context Provideror other service detects a change in thecurrent context, it sends an event on itsevent channel. The KB listens to variousevent channels and updates itself when achange happens.

The common model for context helpsframe uniform, easy-to-use APIs for the

interactions between entities. ContextProviders, the KB, the Reasoning En-gine, and the application or service usethe same predicate representation ofcontext. Applications and services rea-son about facts in the KB using a par-ticular reasoning mechanism (for exam-ple, Bayesian inference or fuzzy logic).They query the reasoning engine througha fixed API to get information they needto make decisions or to get inferred facts.The use of a fixed interface between theapplication or service and the reasoningengine lets us plug in different reasoningengines for reasoning about uncertaincontexts. Thus, adding new reasoningengines (say, based on neural networks)in the future will be easy.

One of the goals of our infrastruc-ture was to let developers concentrateon developing rules or networks forreasoning and not be burdened withthe low-level details involved in gettingentities to operate in the environment.Developers who want to use reasoningin their entities specify the kinds offacts the KB must contain (that is,which context predicates are requiredby the reasoning engine to perform the

inferencing). The Context Infrastruc-ture automatically takes care of updat-ing the KB with the current contextinformation by making it listen to theappropriate event channels. The devel-oper also specifies the reasoning mech-anism in the form of rules or a Bayesiannetwork.

Support for probabilisticand fuzzy logic

Some entities in Gaia use probabilis-tic or fuzzy logic in the form of ruleswritten in Prolog or HiLog. The infra-structure provides easy mechanisms fordevelopers to specify inference rules forthese entities. Our Ontology Explorerbrowser lets developers find definitions

APRIL–JUNE 2004 PERVASIVEcomputing 65

ContextProvider

ContextHistory

ContextConsumer

ContextConsumer

ContextProvider

ContextProvider

ContextSynthesizer

Context ProviderLookup Service

OntologyServer

Figure 2. Gaia context infrastructure.

Context Providers,authentication,

access control services

Assert

Event channels Entity knowledge base

Application/ user interface/ service/device

Query

Reasoning engine

Entity

Figure 3. Structure of an entity that usesreasoning.

Page 5: UNCERTAINTY REASONING CONTEXT-AWARE COMPUTING … · UNCERTAINTY REASONING CONTEXT-AWARE COMPUTING Reasoning about Uncertain Contexts in ... pervasive computing infrastructure,

of various terms and contextual infor-mation as well as relationships betweenterms; they can also browse the ontolo-gies to get the terminology used in theenvironment. We have also developed aGUI that lets developers construct rulesin probabilistic and fuzzy logic. ThisGUI lets developers construct contextpredicates (based on their definitions inthe ontologies) and combine them in dif-ferent rules.

Support for Bayesian networksUsing Microsoft’s Belief Network

(MSBN) software, Gaia developers cancreate Bayesian networks representingcausal relationships between events12

and then enter prior probability distri-

butions on the nodes. The developerassociates each network node with aspecific context predicate. Construct-ing a Bayesian network involves iden-tifying causal dependencies between dif-ferent events, which might not be aneasy task. In our environment, devel-opers browse the ontology of contextinformation to know what contexts areavailable and how they might relate toone another.

The developer or a system adminis-trator trains the networks on real datato get more accurate probability distrib-utions for the various nodes. Then,applications, services, or end users canuse it to infer the probabilities of contextconditions and other events. The Con-text Infrastructure supplies the currentcontext as evidence to the network. Onthe basis of this evidence, the networkcan infer the probability distributions of

the network’s root nodes. MSBN usesclique tree propagation methods to cal-culate probabilities exactly. This infer-ence method, however, could take expo-nential time and wouldn’t work for verylarge networks. So far, though, the kindsof problems we’ve used Bayesian infer-encing for involve fairly small networks(less than 50 nodes), and we haven’tencountered any performance problems.However, for larger networks, we wouldhave to employ other approximate infer-ence strategies.

ExamplesGaia handles uncertainty in three

broad areas: sensing context informa-tion, inferring context information, and

enabling applications to use uncertaincontext information. (See the “RelatedWork” sidebar for information on oth-ers’ uncertainty research.)

Uncertainty in sensing contextTwo examples of Context Providers

that provide uncertain contexts are radiofrequency identification badges for loca-tion detection and various authentica-tion devices.

RFID badges. Many location-sensing sys-tems cannot resolve an object’s locationaccurately, but only do so within sometolerance. In our environment, we detectpeople’s locations using RF-based badges.Badge detectors are placed in differentparts of the building.

We use badges to try to determine if acertain person is in a certain room. Twofactors contribute to uncertainty in a per-

son’s location. One factor is the uncer-tainty of whether the badge is actuallyin the room. Because a badge detector’srange can fall outside the room it’s mon-itoring, the detector might sense peopleas they move outside (for example,through a nearby corridor). Thus, theprobability that the badge is actually inthe room is the area of the room withinthe badge detector’s circle of detectiondivided by the area of the circle of detec-tion. If there are other badge detectorsnearby, then one or more of them mightsense the person’s badge, and we can cal-culate the probability that the badge isactually in the room using a sensor-fusion procedure. Similar probabilitymeasures can be worked out if 802.11-based access points are used to sensepeople’s locations.

Another factor that causes uncer-tainty in using badges for location track-ing is the fact that the person associatedwith the badge might not be carrying it.The person might have left the badge ona desk, or someone might have stolen it.Quantifying this uncertainty and asso-ciating it with a probability value ismore difficult. Such behavior variesfrom person to person and is difficult togeneralize to all people.

To partially address this problem, inour system, we assign a probabilityvalue to the event of a person actuallyhaving the badge in hand. This proba-bility value is not entirely ad hoc; it’s anintuitive sense of how reliable the loca-tion-sensing device is. For example, thevalue of this probability is less for abadge than it is for a smart ring because,intuitively, a ring is less likely to be mis-placed or stolen. However, such a solu-tion isn’t entirely satisfactory, and we arelooking at other ways of dealing withsuch immeasurable factors.

More generally, any location ContextProvider (associated with a badge, ring,fingerprint recognizer, or similar device)uses probabilistic logic to evaluate the

66 PERVASIVEcomputing www.computer.org/pervasive

U N C E R T A I N T Y R E A S O N I N G

Constructing a Bayesian network

involves identifying causal dependencies

between different events, which might not

be an easy task.

Page 6: UNCERTAINTY REASONING CONTEXT-AWARE COMPUTING … · UNCERTAINTY REASONING CONTEXT-AWARE COMPUTING Reasoning about Uncertain Contexts in ... pervasive computing infrastructure,

probability of a person being in a certainroom. The main inference rule is

Prob (location(X, in, Y)) = Prob (device associated with person is in Y)× Prob (device is actually with person X)

There are other issues that come intoplay as well in determining whether thebadge is actually in the room, such aspeople’s behavior and the typical amountof time people spend in the room. Ourcurrent algorithm serves only as a firstlevel of approximation in determininglocation on the basis of probabilisticlogic; more complex algorithms couldconsider other factors. For example,inferring that a user has forgotten hisbadge is possible using other informa-tion such as his login into a machine thatis situated away from his badge. Also,the time elapsed since the last detectionof a badge is a useful indicator of the cer-

tainty that the user (and his badge) is stillin the room. We plan on adding rulesthat incorporate these conditions as well.

Authentication devices. Various biomet-ric authentication devices such as fin-gerprint readers, face and voice recogni-tion software, and so on give a measureof confidence while recognizing users.They also use probabilistic logic to eval-uate the degree of confidence in authen-tication. These devices typically use pat-tern-matching algorithms (such as neuralnetworks) to compare the sample fin-gerprint or face with a database of storedfingerprints or faces. The extent of thematch gives a measure of the device’sconfidence that the person has been cor-rectly identified. Like active badges,authentication devices also have rules toevaluate the probability that people areindeed who they claim to be. Authenti-cation devices then associate this proba-

bility with the authentication contextpredicate they provide.

Inferred contextGaia has various components that try

to infer higher-level context from basic,sensed contexts. If the basic, sensed con-texts are themselves uncertain, then theinferred contexts will also be uncertain.We need to somehow combine the prob-ability or confidence measures from dif-ferent sensors to get a measure of uncer-tainty for the inferred combined context.We can use probabilistic logic or Bayesianapproaches to do this.

Authentication. Users have a variety ofdevices in pervasive computing environ-ments to identify themselves to the sys-tem, including wearable devices, voiceand face recognition, badges containingidentification information, fingerprintidentification, and retinal scans. The

APRIL–JUNE 2004 PERVASIVEcomputing 67

T here has been work in addressing the problem of uncertainty

in context information. However, none of the existing work

addresses the problem in a general way. Anind Dey and colleagues

suggest that ambiguous information can be resolved by a media-

tion process involving the user.1 However, considering the poten-

tially large quantities of context information involved in pervasive

computing environments and the rapid rate at which context can

change, this approach places an unreasonable burden on the user.

Hui Lei and colleagues describe a context service that allows con-

text information to be associated with quality metrics, such as

freshness and confidence,2 but their model of context lacks for-

mality. Paul Castro and colleagues use Bayesian networks for sen-

sor fusion,3 but their work considers only location information.

Albrecht Schmidt and colleagues associate each of their context

values with a certainty measure that captures the likelihood that

the value accurately reflects reality.4 Philip Gray and Daniel Salber

include information quality as a type of meta-information in their

context model, and describe six quality attributes: coverage, res-

olution, accuracy, repeatability, frequency, and timeliness.5 How-

ever, they all do not specify ways of handling the uncertainty or

reasoning about it. The model described by Karen Henricksen and

colleagues6 supports quality by allowing associations between

objects to be annotated with a number of quality parameters,

which capture the dimensions of quality considered relevant to

that association. However, the model doesn’t give any way of

using these quality metrics in real-life situations.

REFERENCES

1. A. Dey, J. Manko, and G. Abowd, Distributed Mediation of ImperfectlySensed Context in Aware Environments, tech. report GIT-GVU-00-14,Georgia Inst. of Technology, 2000.

2. H. Lei et al., “The Design and Applications of a Context Service,” ACMMobile Computing and Comm. Rev., vol. 6, no. 4, Oct. 2002.

3. P. Castro et al., “A Probabilistic Room Location Service for Wireless Net-worked Environments,” UbiComp 2001: Ubiquitous Computing, LNCS2201, Springer-Verlag, 2001, pp. 18–34.

4. A. Schmidt et al., “Advanced Interaction in Context,” Proc. 1st Int’lSymp. Handheld and Ubiquitous Computing (HUC 99), LNCS 1707,Springer-Verlag, 1999, pp. 89–101.

5. P. Gray and D. Salber, “Modeling and Using Sensed Context in theDesign of Interactive Applications,” Proc. 8th IFIP Conf. Eng. Human-Computer Interaction (EHCI 01), LNCS 2254, Springer-Verlag, 2001, pp.317–336.

6. K. Henricksen, J. Indulska, and A. Rakotonirainy, “Modeling ContextInformation in Pervasive Computing Systems,” Pervasive 2002, LNCS2414, Springer-Verlag, 2002, pp. 167–180.

Related Work

Page 7: UNCERTAINTY REASONING CONTEXT-AWARE COMPUTING … · UNCERTAINTY REASONING CONTEXT-AWARE COMPUTING Reasoning about Uncertain Contexts in ... pervasive computing infrastructure,

authentication process should let usersauthenticate themselves to the systemusing various means. At the same time,authentication information from differ-ent devices is associated with differentlevels of confidence because some authen-tication mechanisms (for example, bio-metrics features and DNA samples) aremuch stronger than others (such as pass-words and badges). Also, depending onthe context, the level of confidence asso-ciated with some mechanisms mightchange. For example, if a system suspectsthat someone’s password has been com-promised, it might reduce the level ofconfidence associated with passwords.

Intuitively, it’s also reasonable toassume that the more devices the useremploys to authenticate himself or her-self, the greater the system’s confidencein that user’s identity. The authentication

service performs a kind of sensor fusion.It collects authentication informationfrom the different devices and determinesthe net confidence of authentication incase the user uses more than one deviceto authenticate himself. This net confi-dence, expressed as a confidence value,is then used in various access control deci-sions. Once authentication is complete,the authentication service asserts newinformation about the authenticatedprincipals and the confidence values asso-ciated with them, as well as additionalinformation.13 For example,

authenticatedUsing(bob, mechanism1)authenticatedUsing(bob, mechanism2)confidenceLevel(mechanism1, 0.6) confidenceLevel(mechanism2, 0.8)

possessRole(bob, grad student) possessRole(bob, teaching assistant)

The authentication service uses a sim-ple rule to combine confidence values.Let’s assume a principal tries to authen-ticate herself using n different authenti-cation methods, and all these attemptswere successful. If the confidence valuesassociated with these authenticationmethods are V1, V2, … , Vn, then the netconfidence Vnet associated with thisauthentication is given by the formula(derived from probability theory)

Vnet = 1 – (1 − V1)(1 − V2) … (1 − Vn).

Access control policies use the confi-dence values of authentication and therole names associated with a principal,as we illustrate later.

Room activity example. Figure 1 showsa subset of the Bayesian network we useto infer activity in our smart room. Thenetwork consists of various nodes rep-resenting basic context information(whether a PDFViewer is running, thelight and sound levels, the number ofpeople). Some nodes represent the activ-ity of a single user (such as the Presen-ter node, which indicates if a person isgiving a presentation in the room).Finally, an Activity node describes theactivity in the room as a “Presenta-tion,” “Demo,” “Meeting,” “Seminar,”“Idle,” and so on. On the basis of evi-dence collected from various ContextProviders, the network assigns proba-bilities to the different possible activi-ties in the room.

We trained the network on data wecollected from the smart room. Thetraining process helped us assign proba-bility distributions to the different nodes.We can now use the network to deduceactivity in the room on the basis ofsensed contexts. At any point of time,the context infrastructure obtains thestate of various leaf nodes. The Bayesianinferencing algorithm then calculates theconditional probability distribution ofthe Activity node given the states of theleaf nodes.

We evaluated the accuracy of ourBayesian network in deducing the cor-rect activity in the room. In our test run,we took 210 observations (one everyhalf hour, 30 per day for a week). In eachobservation, the network assigned prob-abilities to different activities (such as ameeting or a presentation) on the basis ofthe room’s context (such as the light sta-tus or presence of people). We found thatthe network assigned the highest proba-bility to the actual activity in the roomin nearly 84 percent of the observations.One possible reason why the networkperformed well is that we used the smartroom in only a limited number of waysthat followed fairly learnable and dis-tinct patterns, so the network could eas-ily learn the activity patterns.

Applications’ use of uncertaincontext information

Applications in Gaia use the proba-bilities of various contexts to influencetheir decisions and behaviors. The appli-cations get context predicates and theirassociated probabilities from ContextProviders and Context Synthesizers, andthey reason about the uncertain contextinformation using fuzzy logic or Bayesianinferencing mechanisms. If they don’twant to deal directly with the probabil-ity distributions of different contextpredicates, they can assume that the pred-icate with the maximum probability istrue and the rest are false.

68 PERVASIVEcomputing www.computer.org/pervasive

U N C E R T A I N T Y R E A S O N I N G

The more devices the user

employs to authenticate himself or

herself, the greater the system’s confidence

in that user’s identity.

Page 8: UNCERTAINTY REASONING CONTEXT-AWARE COMPUTING … · UNCERTAINTY REASONING CONTEXT-AWARE COMPUTING Reasoning about Uncertain Contexts in ... pervasive computing infrastructure,

Access control. Access control decisionsin Gaia use fuzzy reasoning. Access con-trol policies for various applications andservices are based on linear inequalitieson the confidence values of contextinformation. Gaia grants access to aresource to a particular principal if theprincipal has been authenticated to a sat-isfactory level and if the context has beensensed with a certain degree of accuracy.For example, the following is an accesscontrol rule written in Prolog:

canAccess(P, display) :- confidenceLevel(authenticated(P), C), C > 0.7, Prob(activity(2401,cs 101 presentation), Y),

Y > 0.8, possessRole(P, presenter)

This example states that a principal Pmay access the display if P has beenauthenticated with a confidence value ofat least 0.7, the activity in the room is apresentation with probability of at least0.8, and P is the presenter for this pre-sentation activity. The authenticated predi-cate is asserted on the basis of informa-tion from the Authentication Service,and the activity predicate is obtained fromthe Activity Context Provider (whichitself uses a Bayesian network to get theprobability associated with an activity).The minimum probabilities are set onthe basis of how critical the resource is.The Access Control service sets the roleinformation on the basis of what role theuser has chosen or what role the user’sschedule or the system administrator hasassigned to the user. Using a logic-basedlanguage gives us a powerful, expressive,yet simplistic language for writing secu-rity policies. Developers use our infra-structure to write access control rules fortheir applications and services and thento deploy them in the environment.

Troubleshooting. We also use a Bayesiannetwork for troubleshooting the envi-ronment. Given the presence of various

symptoms, the network infers the prob-abilities of various Gaia services, appli-cations, devices, or other resources hav-ing failed. For example, if the smartroom doesn’t detect people’s presencein the room, this implies that the SpaceRepository (which maintains a data-base describing the room’s currentstate) or the Authentication Servicecould have failed with certain condi-tional probabilities.

Figure 4 shows a subset of this net-work. The network consists of nodessuch as EventManager and Authentica-tionService that represent the state of dif-ferent Gaia entities. Other nodes repre-sent certain kinds of failures (orsymptoms of failures). For example, theCanCreateEventChannel node repre-sents whether or not creating an eventchannel is possible. We trained the net-work over a period of time using datalogged from the environment. We nowuse it to determine which services orapplications to troubleshoot or restarton the basis of observing certain symp-toms. Again, we built and deployed thisnetwork using the mechanisms our infra-structure provides for creating and rea-soning with Bayesian networks. We arelooking at enhancing the network byusing temporal information.

Learning based on Bayesian net-works and explicit rules writtenin probabilistic or fuzzy logicare useful in different scenarios.

Bayesian networks are useful forlearning the probability distributions ofevents and enable reasoning aboutcausal relationships between observa-tions and the system state. They, how-ever, must be trained before they can beused, but because they are flexible andcan be retrained easily, they can adapt tochanging circumstances.

Probabilistic logic is useful when wehave precise knowledge of events’ prob-abilities; fuzzy logic is useful when wewant to represent imprecise notions.Both probabilistic and fuzzy logic areuseful in scenarios where getting datato train a Bayesian network is difficult.This is especially true in the area ofsecurity. In our prototypical pervasivecomputing environment, getting train-ing data for authentication and accesscontrol operations was difficult, mainlybecause getting data implied attackingthe system in some manner and mea-suring how often such attacks were suc-cessful. Our context model provides acommon base for the different reason-ing mechanisms, besides allowing newreasoning mechanisms to be easily

APRIL–JUNE 2004 PERVASIVEcomputing 69

SpaceRepository

EventManager Machine

AuthenticationService

CanDetectPeople

CanCreateApplications

CanLogInOnHandheld

CanCreateEventChannel

CanAccessRemoteFS

WirelessNetwork

WiredNetwork

CanDetectEntities

Handheld

Figure 4. Bayesian network for trouble-shooting in Gaia.

Page 9: UNCERTAINTY REASONING CONTEXT-AWARE COMPUTING … · UNCERTAINTY REASONING CONTEXT-AWARE COMPUTING Reasoning about Uncertain Contexts in ... pervasive computing infrastructure,

incorporated in the future. Our infra-structure also provides support fordevelopers to incorporate the use of rea-soning in the services and applicationsthey develop. In particular, many devel-opers have used Gaia’s rule-creation GUIto develop and deploy access controlrules based on fuzzy logic for their enti-ties. The support our infrastructure pro-vides for building, training, and deploy-ing Bayesian networks has also allowedus to rapidly incorporate Bayesian rea-soning in many of our entities.

Reasoning about uncertainty hashelped make components in our perva-sive computing environment morerobust and more capable of adapting tochanging dynamics. We envision severalenhancements to our infrastructure forcoping with and reasoning about uncer-tainty. Different applications respond touncertain context information in differ-ent ways. For example, highly criticalapplications require context informationwith a high level of confidence beforethey can take action, whereas less criti-cal applications can operate with less cer-tain context information. We are study-ing what levels of confidence in contextinformation are required by differentapplications. An important aspect ofuncertainty is the freshness of contextinformation. We hope to quantify fresh-ness and develop axioms or rules to dealwith it.

Another enhancement is the use ofplausibility measures14 in situationswhere we can’t associate a specific num-ber like a probability but where wecould say that one event is more or lesslikely than another. While a probabilitymeasure maps an event to a numberbetween 0 and 1, a plausibility measurejust associates an event with an elementin a partially ordered set. This wouldenable us to express the fact that a fin-gerprint sensor might more accuratelydetermine a person’s location than abadge detector could.

REFERENCES1. M. Weiser, “The Computer for the Twenty-

First Century,” Scientific Am., vol. 265, no.3, Sept. 1991, pp. 94–104.

2. L. Zadeh, “Fuzzy Sets as Basis for a Theoryof Possibility,” Fuzzy Sets and Systems, vol.1, 1978, pp. 3–28.

3. M. Roman et al., “A Middleware Infra-structure for Active Spaces,” IEEE PervasiveComputing, vol. 1, no. 4, 2002, pp. 74–83.

4. A. Ranganathan and R.H. Campbell, “AMiddleware for Context-Aware Agents inUbiquitous Computing Environments,”ACM/IFIP/USENIX Int’l MiddlewareConf., LNCS 2672, Springer-Verlag, 2003;http://choices.cs.uiuc.edu/~ranganat/Pubs/MiddlewareForContext-FinalVersion.pdf.

5. A. Ranganathan et al., “ConChat: A Con-text-Aware Chat Program,” IEEE Perva-sive Computing, vol. 1, no. 3, July–Sept.2002, pp. 51–57.

6. A. Dey, J. Manko., and G. Abowd, Dis-tributed Mediation of Imperfectly SensedContext in Aware Environments, tech.report GIT-GVU-00-14, Georgia Inst. ofTechnology, 2000.

7. I. Horrocks, “DAML+OIL: A DescriptionLogic for the Semantic Web,” IEEE Bull.Tech. Committee on Data Eng., 2002. vol.25, no. 1, Mar. 2002, pp. 4–9.

8. P. Castro et al., “A Probabilistic Room Loca-tion Service for Wireless Networked Envi-ronments,” UbiComp 2001 Conf., LNCS2201, Springer-Verlag, 2001, pp. 18–34.

9. J. Halpern, R. Fagin, and N. Megiddo, “ALogic for Reasoning about Probabilities,”Information and Computation, vol. 87,nos. 1–2, 1990, pp. 78–128.

10. W. Chen, M. Kifer, and D.S. Warren,“HILOG: A Foundation for Higher-OrderLogic Programming,” J. Logic Program-ming, vol. 15, no. 3, 1993, pp. 187–230.

11. P. Hajek, “Fuzzy Predicate Calculus andFuzzy Rules,”Fuzzy If-Then Rules in Com-putational Intelligence, D.A. Ruan and E.E.Kerre, eds., Kluwer Academic Publishers,2000, pp. 27–35.

12. C.M. Kadie, D. Hovel, and E. Horvitz,MSBNx: A Component-Centric Toolkit forModeling and Inference with Bayesian Net-works, tech. report MSR-TR-2001-67,Microsoft Research, 2001.

13. J. Al-Muhtadi et al., “Cerberus: A Context-Aware Security Scheme for Smart Spaces,”IEEE Int’l Conf. Pervasive Computing andCommunications (PerCom 2003), IEEE CSPress, 2003.

14. J. Halpern and N. Friedman, “PlausibilityMeasures: A User’s Guide,” Proc. 11thConf. Uncertainty in AI, Morgan Kauf-mann, 1995, pp. 175–184.

For more information on this or any other comput-ing topic, please visit our Digital Library at www.computer.org/publications/dlib/.

70 PERVASIVEcomputing www.computer.org/pervasive

U N C E R T A I N T Y R E A S O N I N G

the AUTHORS

Anand Ranganathan is adoctoral candidate andresearch assistant working onthe Gaia project in the Uni-versity of Illinois at Urbana-Champaign’s Departmentof Computer Science. Hisresearch interests include

context-aware computing, mobile computing,the Semantic Web, and automated reasoningand learning. He received his BTech in computerscience from the Indian Institute of Technology inMadras. Contact him at 1330 SC, 201 N. Good-win, Urbana, IL 61801; [email protected].

Jalal Al-Muhtadi is a doc-toral candidate and researchassistant working on theGaia project at the Universityof Illinois at Urbana-Cham-paign, where he researchesmiddleware and infrastruc-ture security and privacy

issues. He received his MS in computer sciencefrom the University of Illinois at Urbana-Cham-paign. Contact him at 1330 SC, 201 N. Good-win, Urbana, IL 61801; [email protected].

Roy H. Campbell is a pro-fessor of computer scienceat the University of Illinois atUrbana-Champaign. Hisresearch interests includeoperating systems, distrib-uted multimedia, networksecurity, and ubiquitous

computing. He received his PhD in computingfrom the University of Newcastle upon Tyne.Contact him at 3122 SC, 201 N. Goodwin,Urbana, IL 61801; [email protected].