Smart Home Technologies Decision Making Motivation n Intelligent

  • Slides: 51
Download presentation
Smart Home Technologies Decision Making

Smart Home Technologies Decision Making

Motivation n Intelligent Environments are aimed at improving the inhabitants’ experience and task performance

Motivation n Intelligent Environments are aimed at improving the inhabitants’ experience and task performance n n n Provide appropriate information Automate functions in the home Prediction techniques can only determine what would happen next, not what should happen next. n n Automated functions can be different from inhabitant actions Computer has to determine actions that would optimize inhabitant experience

Decision Making n Decision Making attempts to determine the actions the system should take

Decision Making n Decision Making attempts to determine the actions the system should take in the current situation n Should a function be automated ? What should be done next ? Decisions should be based on the current context and the requirements of the inhabitants n n Just programmed timers for automation are not sufficient Decision maker has to take into account the stream of data

Decision Making in Intelligent Environments n Example Decision Making Tasks in Intelligent Environments: n

Decision Making in Intelligent Environments n Example Decision Making Tasks in Intelligent Environments: n Automation of physical devices n n n Turn on lights Regulate heating and air conditioning Control media devices Automate lawn sprinklers Automate robotic components (vacuum cleaner, etc) Control of information devices n n n Provide recipe services in the kitchen Construct shopping lists Decide which types of alarms to display (and where)

Decision Making in Intelligent Environments n n Objectives of decision making: n Optimize inhabitant

Decision Making in Intelligent Environments n n Objectives of decision making: n Optimize inhabitant productivity n Minimize operating costs n Maximize inhabitant comfort Decision making process has to be safe n n Decisions made can never endanger inhabitants or cause damage Decisions should be within the range accepted by the inhabitants

Example Task n Should a light be turned on ? n Decision Factors: n

Example Task n Should a light be turned on ? n Decision Factors: n n n n Inhabitant’s location (current and future) Inhabitant’s task Inhabitant’s preferences Time of the day Other inhabitants Energy efficiency Security Possible Decisions n n Turn on Do not automate

Decision Making Approaches n Pre-programmed decisions n n Reactive decision making systems n n

Decision Making Approaches n Pre-programmed decisions n n Reactive decision making systems n n n Decisions are based on condition-action rules Decisions are driven by the available facts Goal-based decision making systems n n Timer-based automation Decisions are made in order to achieve a particular outcome Utility-based decision making systems n Decisions are made in order to maximize a given performance measure

Reactive Decision Making

Reactive Decision Making

Goal-Based Decision Making

Goal-Based Decision Making

Utility-Based Decision Making

Utility-Based Decision Making

Qualities of a Decision Making n n Ideal n Complete: always makes a decision

Qualities of a Decision Making n n Ideal n Complete: always makes a decision n Correct: decision is always right n Natural: knowledge easily expressed n Efficient Rational n Decisions made to maximize performance

Decision-Making Techniques n Reactive Decision Making n n Goal-Based Decision Making n n Planning

Decision-Making Techniques n Reactive Decision Making n n Goal-Based Decision Making n n Planning Decision theoretic Decision Making n n n Rule-based expert system Belief Networks Markov decision process Learning Techniques n n Neural Networks Reinforcement Learning

Rule-Based Decision Making n Decisions are made based on rules and facts n Facts

Rule-Based Decision Making n Decisions are made based on rules and facts n Facts represent the state of the environment n n Condition-Action rules represent heuristic knowledge about what to do n n Represented as first-order predicate logic Rules represent implications that imply actions from logic sentences about facts Inference mechanism n Deduction: {A, A B} B n n The left hand side of rules are matched against the set of facts Rules where the left hand side matches are active

Rule-Based Inference n Rules define what actions should be executed for a given set

Rule-Based Inference n Rules define what actions should be executed for a given set of conditions (facts) n n n Actions can either be external actions (“automation”) or internal updates of the set of facts (“state update”) Rules are often heuristics provided by an expert Multiple rules can be active at any given time n n Conflict resolution to decide which rule to fire Scheduling of active rules to perform sequence of actions

Example n Facts: n n Current. Time = 6: 30 Location(Current. Time, bedroom) Current.

Example n Facts: n n Current. Time = 6: 30 Location(Current. Time, bedroom) Current. Day = Monday Rules: n Internal actions: (Current. Day=Monday)^(Current. Time>6: 00) ^(Current. Time<7: 00)^(Location(Current. Time, bedroom)) ->Set(Location(Next. Time, bathroom)) n External actions: (Location(Next. Time, X)) -> Action(Turn. On. Light, X)

Rule-Based Expert Systems n Intended to simulate (and automate) human reasoning process n Domain

Rule-Based Expert Systems n Intended to simulate (and automate) human reasoning process n Domain is modeled in first-order logic n n n Experts provide sets of heuristic condition-action rules n n n State is represented by a set of facts Internal rules model behavior of the environment Rules with internal actions can model reasoning process Rules with external actions indicate decisions the expert would make The system can optionally be provided with queries by including them in the facts set.

Internal Rules n Internal rules have to model the behavior of the system n

Internal Rules n Internal rules have to model the behavior of the system n Persistence over time E. g. : (Location(Current. Time, X))^(No. Move(Current. Time)) -> Set(Location(Next. Time, X)) n Dynamic behavior of devices E. g. : (Temperature(Current. Time, X))^(Heating. On) -> Set(Temperature(Next. Time, X+2)) n Behavior of the inhabitants E. g. : (Location(Current. Time, bedroom)) ^(Current. Time>23: 00) ^(Light. On(Current. Time, bedroom)) -> Action(Turn. Off. Light, bedroom)

Rule-Based Expert Systems WORKING MEMORY (Facts) INFERENCE ENGINE PATTERN MATCHER RULE BASE EXECUTION ENGINE

Rule-Based Expert Systems WORKING MEMORY (Facts) INFERENCE ENGINE PATTERN MATCHER RULE BASE EXECUTION ENGINE AGENDA Rule-Based Expert System Architecture

Logic Inference Systems and Expert System Shells n Logic programming systems provide inference capabilities.

Logic Inference Systems and Expert System Shells n Logic programming systems provide inference capabilities. n Examples: n n n Prolog OTTER Expert system shells provide the infrastructure to build complete expert systems n Examples: n n CLIPS (for C) JESS (for Java)

Example System: IRoom n [Kul 02] Initial versions of the MIT IRoom project used

Example System: IRoom n [Kul 02] Initial versions of the MIT IRoom project used JESS as an inference engine to make decisions about activating devices n For example: If a person enters the room and the room is empty then turn on the light n Rules are programmed by the system designer before the room is used and then refined based on experience [Kul 02] Ajay Kulkarni. Design Principles of a Reactive Behavioral System for the Intelligent Room. . 2002.

Rule-Based Decision Making n Characteristics n n n Advantages n n n Complete and

Rule-Based Decision Making n Characteristics n n n Advantages n n n Complete and correct (given complete rules) Natural (given expert specified rules) Permits the system to be programmed relatively efficiently by an expert Can address relatively complex systems Problems n n n Quality of the rules is essential Behavior of the environment mimics the expert Anticipating all possible contexts is difficult

Planning Decisions n A planning system searches for a sequence of actions which can

Planning Decisions n A planning system searches for a sequence of actions which can achieve a defined goal. n n States can be represented as logic sequences Actions are defined as operators (symbolic representations of the effect and conditions of actions) which contain: n n Preconditions of actions Effects of actions A goal is a set of states Planning system uses constraints to efficiently search for a sequence of operators that lead from the start state to a goal state.

Example n n n Initial State : (Location(bedroom))^(Light(bathroom, off)) Goal: Happy(Inhabitant) Action 1: Make.

Example n n n Initial State : (Location(bedroom))^(Light(bathroom, off)) Goal: Happy(Inhabitant) Action 1: Make. Happy Precondition: (Location(X))^(Light(X, on)) Effect: Add: Happy(Inhabitant) n Action 2: Turn. On. Light(X) Precondition: Light(X, off) Effect: Delete: Light(X, off), Add: Light(X, on) n Action 3: Move(X, Y) Precondition: (Location(X))^(Light(Y, on)) Effect: Delete: Location(X), Add: Location(Y) n Plan: Action 2, Action 3, Action 1

Example Start Location(bedroom) Light(bathroom, off) Turn. On. Light Location(bedroom) Light(bathroom, on) Move. To Location(bathroom)

Example Start Location(bedroom) Light(bathroom, off) Turn. On. Light Location(bedroom) Light(bathroom, on) Move. To Location(bathroom) Light(bathroom, on) Make. Happy(Inhabitant) Finish

Example Planning Systems n Partial Order Planners n Derive plans without requiring to find

Example Planning Systems n Partial Order Planners n Derive plans without requiring to find actions in sequence n n SNLP (Univ. of Washington) Graph. Plan (CMU) n n Builds and prunes graph of possible plans Conditional Planners n Derive plans under uncertainty by constructing plans that work under given conditions n UCPOP (Univ. of Washington) n n Partial Order Planner with Universal quanitification and Conditional effects CPOP Sensory Graph. Plan (CMU)

Planning Decisions n Characteristics n n n Advantages n n n Complete and correct

Planning Decisions n Characteristics n n n Advantages n n n Complete and correct (given complete rules) Relatively natural formulation Permits a sequence of actions to be found that performs a given task Goals can be defined easily Problems n n n Requires complete description of the system Uncertainty is difficult to handle Planning is generally very complex

Decision Theory n Decision theory addresses rational decision making under uncertainty n Uncertainty is

Decision Theory n Decision theory addresses rational decision making under uncertainty n Uncertainty is represented using probabilities n n Uncertainty due to incomplete observability Uncertainty due to nondeterministic action outcomes Uncertainty due to nondeterministic system behavior Utility theory is used to achieve rational decisions n n Utility is a measure of the expected “value” of a given situation or decision Rational decisions are the ones that yield the highest expected utility in the current situation

Modeling Uncertainty n The current situation can be represented as a Belief state, i.

Modeling Uncertainty n The current situation can be represented as a Belief state, i. e. as a probability distribution over the states indicating the likelihood that any given state xi is the current state {(x 1, P(x 1)), (x 2, P(x 2)), …, (xn, P(xn))} n The probability of a state can be expressed as the probability of all state attributes P(x)=P(a 1, a 2, …, an) n Uncertainties from incomplete observability and nondeterminism can be modeled as conditional probabilities n n State transition model: Observation model: P(o | x)

Bayes Rule n Bayes rule permits to invert cause and effect when calculating probabilities

Bayes Rule n Bayes rule permits to invert cause and effect when calculating probabilities n n It is often easier to estimate P(e | c) Probability of a state given a set of sensor readings, P(x | o) , can be calculated knowing the observation probabilities P(o | x)

Utility Theory n Utilities U(A) represent the “value” of a given situation or decision

Utility Theory n Utilities U(A) represent the “value” of a given situation or decision A and model preferences n n The utility function for a particular system is not unique Only relative differences between utility values are important n n n U(A) > U(B) A preferred to B U(A) = U(B) agent indifferent to A and B Utilities for uncertain situations can be calculated as the expected value of the utility of all possibilities U({(x 1, P(x 1)), …, (xn, P(xn))) = i P(xi)* U(xi)

Rational Decisions n n The rational decision is the one that leads to the

Rational Decisions n n The rational decision is the one that leads to the highest utility Rational decisions in Decision theory requires n Complete causal model of the environment P(xi | xj, d) n Complete knowledge of the observation (sensor) model P(o | xi) n Knowledge of the Utility function for all states U(xi)

Markov Decision Processes n Markov Decision Processes (MDPs) form a probabilistic model of all

Markov Decision Processes n Markov Decision Processes (MDPs) form a probabilistic model of all possible system behavior n n MDPs can be described by a tuple <S, A, T, R> representing states, actions, transition probabilities, and reinforcements. System has to obey the Markov assumption P(xt+1|xt, dt, xt-1, dt-1, …, x 0) = P(xt+1 | xt, dt) n Reinforcement represents the instantaneous change in utility obtained in a given state n n Models costs and payoffs Are generally sparse and delayed

Utility Function for MDPs n n n In an MDP, the utility of a

Utility Function for MDPs n n n In an MDP, the utility of a state under a given policy can be defined as the expected sum of discounted reinforcements The optimal utility function U* can be computed using Value iteration Optimal policy (decision strategy) can be extracted from the utility function

MDP Example n n n S = {(1, 1), (1, 2), … (4, 3)}

MDP Example n n n S = {(1, 1), (1, 2), … (4, 3)} A = { , , , } T: P(intended direction) = 0. 8, P(right angle to intended) = 0. 1 R: +1 at goal, -1 at trap, 0. 04 in all other states =1

MDP Example Optimal Utilities Optimal Policy

MDP Example Optimal Utilities Optimal Policy

Markov Decision Processes n Characteristics n n Advantages n n Complete and Correct Takes

Markov Decision Processes n Characteristics n n Advantages n n Complete and Correct Takes into account transition uncertainty Makes optimal decisions Automatically calculates the utility function Problems n n Requires complete probabilistic description of the system Requires complete observability of the state

Partially Observable MDPs n Partially Observable Markov Decision Processes (POMDPs) extend MDP by permitting

Partially Observable MDPs n Partially Observable Markov Decision Processes (POMDPs) extend MDP by permitting states to be only partially observable. n Systems can be represented by a tuple <S, A, T, R, O, V> where <S, A, T, R> is an MDP and O, V are mapping observations about the state to probabilities of a given state n n n O = {oi} is the set of observations V: V(x, o) = P(o | x) To determine an optimal policy, an optimal utility function for the belief states has to be computed

POMDPs n Characteristics n n Advantages n n n Complete and Correct Takes into

POMDPs n Characteristics n n Advantages n n n Complete and Correct Takes into account all uncertainty Makes optimal decisions Problems n n Requires complete probabilistic description of the system Optimal solution is so far intractable (dynamic decision networks and approximation techniques exist and work for small state spaces)

Learning Decisions n Learning techniques permit decisions to be learned from past experience and

Learning Decisions n Learning techniques permit decisions to be learned from past experience and feedback from the inhabitants or the environment. n Supervised learning n n Requires the desired decision to be specified during training Reinforcement learning n Learns by experimentation from scalar reward feedback n n n Inhabitant feedback (e. g. device interactions) Explicit environment feedback (e. g. energy consumption) Implicit feedback (e. g. prediction of comfort of inhabitant)

Feedforward Neural Networks n Neural networks are a supervised learning mechanism that can be

Feedforward Neural Networks n Neural networks are a supervised learning mechanism that can be trained to make decisions based on a set of training examples. n n Training for reactive decisions involves the presentation of a set of examples (xi, d(xi)) , where d(xi) is the desired decision to be made in configuration xi. Training for goal-based or utility-based decisions involves learning a model that maps input (xi, d(xi)) to the outcome of the action f(xi, d(xi)) and then selecting the decision with the best outcome.

Example System: Regulation in the Adaptive House [DLRM 94] n Neural network learns to

Example System: Regulation in the Adaptive House [DLRM 94] n Neural network learns to regulate the lights in the house to maintain a given light intensity. 1. Learns a network that predicts the light intensity if a given set of lights are turned on n Input: n n The current light device levels (7 inputs) The current light sensor levels (4 inputs) The new light device levels (7 inputs) Output: n The new light sensor levels (4 outputs) [DLRM 94] Dodier, R. H. , Lukianow, D. , Ries, J. , & Mozer, M. C. (1994). A comparison of neural net and conventional techniques for lighting control. Applied Mathematics and Computer Science, 4, 447 -462.

Example System: Regulation in the Adaptive House continued 2. Decisions are made by comparing

Example System: Regulation in the Adaptive House continued 2. Decisions are made by comparing the output of the network for all possible decisions (i. e. combinations of lights to be turned on) with the desired light intensity and taking the decision that most closely matches it. Set point p State xi : : Decision d : : Prediction f(xi, d) n Decision:

Neural Networks n Characteristics n n Advantages n n Efficient Can learn arbitrary decision

Neural Networks n Characteristics n n Advantages n n Efficient Can learn arbitrary decision functions from training data Generalizes to new situations Fast decision making Problems n n Requires training data that contains desired decision or a goal/objective Requires design of sufficient input representation

Reinforcement Learning n Reinforcement learning learns an optimal decision strategy from trial and error

Reinforcement Learning n Reinforcement learning learns an optimal decision strategy from trial and error and sparse reward feedback. n n n On-line method to solve Markov Decision Processes (or, with extensions, POMDPs). Reward, R, is a signal encoding the instantaneous feedback to the system. System learns a mapping from states to decisions, *(xi), which optimizes the expected utility.

Q-Learning n Q-learning is the most popular reinforcement learning technique for MDPs. n Learns

Q-Learning n Q-learning is the most popular reinforcement learning technique for MDPs. n Learns a utility function for state-action pairs n n n Learns by experimentation. n n Q(x, d) Utility U(x) = maxa Q(x, d) Update Q(xi , d) after each observed transition from state xi by comparing the expected utility of (xi, d) with the expectation computed after observing the actual outcome xj. Q(xi, d) = Q(xi, d) + * (R(xi) + maxd’ Q(xj, d’) - Q(xi, d)) Decisions are made to optimize Q-values n (x) = argmaxd Q(x, d)

Example System: Regulation in the Adaptive House [Moz 98] n n Neural network regulators

Example System: Regulation in the Adaptive House [Moz 98] n n Neural network regulators can control lighting and heating to achieve a given set point Set point is learned using reinforcement n n Energy usage Inhabitant interactions with light switches or thermostats [Moz 98] Mozer, M. C. The neural network house: An environment that adapts to its inhabitants. In Proc. AAAI Spring Symposium on Intelligent Environments (pp. 110 -114). Menlo, Park, CA, 1998.

Example System: Mav. Home n Uses Q-learning on a state space including device status

Example System: Mav. Home n Uses Q-learning on a state space including device status and the Active Le. Zi prediction. n State st at time t st = (xt, pt) n Reinforcement includes multiple metrics n n n Energy usage Number of inhabitant-device interactions Decisions are device interactions and an action representing the decision not to perform an action. System operates event-driven, making a decision every time an event happens. Learner is pre-trained using the Active Le. Zi predictor.

Example System: Mav. Home n Example task: getting up in the morning and taking

Example System: Mav. Home n Example task: getting up in the morning and taking a shower.

Example System: Mav. Home n Home learns to automate light activations such as to

Example System: Mav. Home n Home learns to automate light activations such as to minimize energy usage without increasing the number of inhabitant interactions

Reinforcement Learning n Characteristics n n Advantages n n n Optimal policies (given enough

Reinforcement Learning n Characteristics n n Advantages n n n Optimal policies (given enough training) Can learn optimal decision strategies without explicit training Can deal with multiple objectives Problems n n n Trial and error learning can lead to spurious actions leading to potential safety issues Requires complete state space representations Can be very complex

Conclusions n Decision making is an integral component of intelligent environments. n n n

Conclusions n Decision making is an integral component of intelligent environments. n n n Different decision making approaches apply to different conditions based on the available information. n n Automates devices Determines information to inhabitants Reactive / Goal-based / Utility-based Programmed / Learning Decision-making approaches can be “mixed”. Many open issues remain: n How to deal with complexity of intelligent environments? (Hierarchical systems, multi-agent systems, etc) n How to assure safety and acceptability of learning decision makers ?