Towards Sustainable Smart Homes by a Hierarchical Hybrid Architecture of an Intelligent Agent

A smart home can be realized by the provision of services, such as building control, automation and security implemented in accordance with a user’s request. One of the important issues is how to respond quickly and appropriately to a user’s request in a “dynamic environment”. An intelligent agent infers the user’s intention and provides the intact service. This paper proposes a smart home agent system based on a hierarchical hybrid architecture of a user intention model, which models the user intention as a hierarchical structure and implements it in a dynamic environment. The conventional rule-based approach needs to obtain all information before it is executed, which requires a large number of rules and is hardly scalable as the control objects are increasing. On the other hand, the proposed system consists of several modules that construct a hierarchical user intention model. The smart home system needs to take account of the information, such as time, state of device and state of the home, in addition to users’ intention. We evaluate the performance of the proposed system in a dynamic environment and conduct a blind test with seven subjects to measure the satisfaction of service, resulting in the average score of 81.46.


Introduction
The advent of the smart grid, advanced communication infrastructures and energy storage systems is revolutionizing the patterns of electricity usage and energy conservation.Zhou et al. presented an overview of the architecture and functional modules of a smart home energy management system that takes account in the autonomous responsive demand and cyber-physical energy systems with renewable and stored energy sources [1].Li et al. proposed a system that enables smart homes to communicate, interact and negotiate with energy sources and devices in smart homes that achieve maximum overall energy efficiency and the minimum electricity bill [2].Tushar et al. performed a literature survey on smart grid testbeds around the world and presented the main accomplishments towards realizing a smart grid testbed [3].
On the other hand, a smart home is one of the appropriate targets that the agent-based systems support daily living when a user wants to obtain the relevant service [4].Generally, the intelligent agents applied to smart homes conduct the task for the user considering the change of the environments, such as users and devices, to provide the optimal services.The agent-based smart home system aims at meeting three requirements: transparency, reliability and interoperability.For the past decade, the rule-based systems have been dominant for agent control because they can be implemented easily and perform well in specific environments.However, a large number of rules is required in accordance with all the changeable states of the environment and the user's intention.Moreover, they are hardly scalable when a new home appliance is added because all of the conditions of the existing rules should be adjusted.
In this paper, we propose a smart home agent system with a hierarchical hybrid architecture to work out these problems of rule-based systems.To take into account the information only related with the service at hand, we focus on the user's intentions because the services are started from the user's request with intention.We implement the system considering the types and the information of human intention organized hierarchically.The response model for the immediate goal is modularized by each device in the smart home, such as lighting system, window and TV.The response model for private goals is realized to construct the sequence of the immediate goals by considering the hierarchical characteristics of the intention.This modular approach of behavior selection networks makes the system scalable.Experimental results confirm the superior reliability of the proposed system compared to the rule-based system.In addition, we compare the processing time, and the t-test confirms the statistical significance of the superiority.Seven subjects participated in the test.
The rest of the paper is organized as follows.Section 2 presents the related works for smart home service, the intelligent agent and human intention.Section 3 describes in detail the proposed system.Section 4 presents the experimental result and analyzes the results, and Section 5 concludes the paper.

Smart Home Service
Smart homes or home automation can be described as the introduction of technology within the home environment to provide convenience, comfort, security and energy efficiency to its occupants [5].There is a growing demand in designing a flexible smart home architecture that aims to interoperate among heterogeneous sensors, actuators and other services.The allocation by service management in the smart home needs to be agile to respond quickly and adaptively to the user's changing request and transparent to avoid human intervention.In other words, it must exhibit agent-like behaviors.Specifically, the smart home management should meet three types of user requirements [6] and some additional features, like security:

•
Transparency: In the real world, environmental changes in smart homes cannot be fully anticipated during design time.When a change occurs, the user's requirement may not be fulfilled as smoothly as in the normal condition.

•
Reliability: A user wants to receive reliable services.Achieving expected levels of reliability is a great challenge, especially when coupled with the ad hoc accretion of devices that may be expected in smart homes.

•
Interoperability: Operating a smart home requires the successful operation of many tasks, such as monitoring the status of devices, automating decision support and invoking services.

•
Security: A smart home allows us to control all of the appliances, lighting systems, door locks and climate controls remotely, which also introduces genuine concerns over how secure these automated living spaces actually are.
Table 1 shows the previous works for the smart home system, which is classified into two types: user state-based and user intention-based systems.The user state-based systems focus on the user's physical or mental condition that can be inferred from sensors.It obtains the user state and provides services that are defined by rules.However, these systems do not consider the user's specific intention because the user cannot express all needs through his or her own states [7].× Ontology Min [10] × Rule-based Wang et al. [11] × × Naive Bayes Wu et al. [4] × Rule-based Ge and Xu [12] × HMM Kim et al. [13] × × HMM Evchina et al. [14] × Ontology Zhao et al. [15] × Goal-network Soda et al. [16] × ×

Rule-based
Note: means the inclusion of the property, whereas × means the non-inclusion.
The user intention-based systems focus on the user's request.Kim et al. proposed speech recognition for smart homes using the hidden Markov model [13], which improved the accuracy of recognizing the user's request in smart homes.Zhao et al. proposed a system for multiple users, which considers how to provide the service for the requests from a large number of users [15].Soda et al. proposed a speech recognition method for the smart home system [16].Previous works that consider user intention studied the accuracy of the speech recognition lack analysis of the structure of users' intention and decision making process.As they offer the service using simple predefined rules, it is not suitable for real smart homes that need to provide the services with various information.

Intelligent Agent
An agent is a computer system situated in some environment that is capable of autonomous action in this environment in order to meet its design objectives [17].The intelligent agents can respond to user intentions and interact like humans.It has been applied for many of the services at home, tutoring, web and mobile environments.These agents make an action sequence or react intuitively to the user intention depending on the purpose of the service.For instance, the web agent considered the overall web environment, but did not consider end users [18].The agent for the patient monitoring service reacted intuitively in emergency situations [19].The intelligent agent was applied to various environments that require considering user intention in very complex situations.Table 2 shows the applications of an intelligent agent.
An agent control system for making a decision for an action is crucial to provide the relevant services, which is classified into two types: reactive and deliberative [24].The reactive control approach acts to decide the response immediately in flexible environments.The deliberative control system solves the problem of finding a sequence of actions that maps a given initial state to a goal state, where the environment and the actions are deterministic.The computational challenge is to devise effective methods to obtain such action sequences, called plans.The deliberative approach has a limitation of belonging to given environments and problems and requires many preprocessing steps.On the other hand, the reactive approach is not easy to apply to complex problems.A hybrid system that integrates the two approaches has been used to generate flexible behaviors to overcome the limitations [25].

Hierarchical Human Intention
In order to achieve the goal, a human classifies the intention and sets the relevant goals.Hamilton analyzed the human intention and goals [26,27].Figure 1 shows that intentions and goals can be organized hierarchically according to their level of abstractedness or the time required to complete them.In the bottom level, "movements" refer to the movement of the human body.These elements together form an "action".The movements and action are not the goal of human intention.They are just the operations for achieving the goals.The upper level consists of two goals: immediate and task goals.Each goal deals with each intention, but they have a number of differences.First, the immediate intentions have a material noun because of controlling the object expressed by the noun.Therefore, to achieve the goals, the human conducts control of the object considering the current situation without the need to infer the intention.The task goals are more abstract than the immediate goals.They consist of some immediate goals.When the human achieves these goals, they are divided into sub-goals as immediate goals.Prospective social intention represents the most significant goal, like the purpose of the system.We can solve the extension and the reactivity problem by the modularization of the user intention with reference to this hierarchical organization.

Hierarchical Goal Model
In our previous work, we developed the hybrid control system with STRIPS (Stanford Research Institute Problem Solver) and BSN (Behavior Selection Network) for smart homes [28].In this paper, we improve the system using the hierarchical goal model.Figure 2 shows the overview of the hierarchical intention model in reference to Hamilton's model.In the model, the immediate goal consists of one object, which is a device that can be adjusted by the agent in smart homes.The task goal consists of a set of immediate goals.There is a one to one correspondence between goal and intention.In the bottom level, "movements" refer to the movement of the human body.These elements together form an "action".The movements and action are not the goal of human intention.They are just the operations for achieving the goals.The upper level consists of two goals: immediate and task goals.Each goal deals with each intention, but they have a number of differences.First, the immediate intentions have a material noun because of controlling the object expressed by the noun.Therefore, to achieve the goals, the human conducts control of the object considering the current situation without the need to infer the intention.The task goals are more abstract than the immediate goals.They consist of some immediate goals.When the human achieves these goals, they are divided into sub-goals as immediate goals.Prospective social intention represents the most significant goal, like the purpose of the system.We can solve the extension and the reactivity problem by the modularization of the user intention with reference to this hierarchical organization.

Hierarchical Goal Model
In our previous work, we developed the hybrid control system with STRIPS (Stanford Research Institute Problem Solver) and BSN (Behavior Selection Network) for smart homes [28].In this paper, we improve the system using the hierarchical goal model.Figure 2 shows the overview of the hierarchical intention model in reference to Hamilton's model.In the model, the immediate goal consists of one object, which is a device that can be adjusted by the agent in smart homes.The task goal consists of a set of immediate goals.There is a one to one correspondence between goal and intention.

•
Definition 1. Global environment GE = {GE 1 , GE 2 , ..., GE i } expresses the state of devices for making the sequence of immediate goals.The physical layer is composed of simple sensors used to collect information of interest from the environment.Above the said layer, there is the gateway that handles sensor information and sends the response commands to the physical layer.The information processed by the gateway is essential for the intention handling module, which is responsible for recognizing user intention.Table 3 shows the task goal of the proposed system, which has three task goals, each of which has a sub-immediate goal, as shown in Figure 2. Note that energy saving is one of the main task goals, but the proposed system is mainly focused on providing appropriate services to the users rather than saving the energy in smart homes.We need further studies on this aspect in the future work.

Task Goal
Sub-Immediate Goal Energy saving {Light management, TV management, radio management} Appliance management {TV management, radio management} Air-condition management {Air-conditioner management, window management} Table 4 shows the immediate goal of the proposed system, which consists of various actions.In the table, an underlined action means to perform the same movement in different immediate goals.We define the three task goals and five immediate goals for the proposed smart home agent system.These specifications can be utilized for the rule-based systems, but our system has implemented them with flexible behavior selection networks in a hierarchical way as described in the following section.

Immediate Goal Action
Light management {Turn on main light in living room, turn on lamp in living room, turn on light on wall, turn on light in kitchen, turn on light in corridor, turn on light in main room, turn on desk lamp in main room, turn off main light in living room, turn off light lamp in living room, turn off light on wall, turn off light in kitchen, turn off light in corridor, turn off light in main room, turn off desk lamp in main room, checking problem, solving problem} TV management {Turn on TV in kitchen, turn on TV in living room, turn on TV in main room, turn off TV The physical layer is composed of simple sensors used to collect information of interest from the environment.Above the said layer, there is the gateway that handles sensor information and sends the response commands to the physical layer.The information processed by the gateway is essential for the intention handling module, which is responsible for recognizing user intention.Table 3 shows the task goal of the proposed system, which has three task goals, each of which has a sub-immediate goal, as shown in Figure 2. Note that energy saving is one of the main task goals, but the proposed system is mainly focused on providing appropriate services to the users rather than saving the energy in smart homes.We need further studies on this aspect in the future work.

Task Goal Sub-Immediate Goal
Energy saving {Light management, TV management, radio management} Appliance management {TV management, radio management} Air-condition management {Air-conditioner management, window management} Table 4 shows the immediate goal of the proposed system, which consists of various actions.In the table, an underlined action means to perform the same movement in different immediate goals.We define the three task goals and five immediate goals for the proposed smart home agent system.These specifications can be utilized for the rule-based systems, but our system has implemented them with flexible behavior selection networks in a hierarchical way as described in the following section.

Hierarchical Agent Architecture
Figure 3 shows the agent control system based on the hierarchical intention model.There are two types of user intention: private and immediate intentions with reference to Grafton and Tipper's research that presented the hierarchical organization of tasks [29].When a person performs a complex task, it is divided into detailed sub-tasks, like Hamilton's hierarchical intention model.The deliberative planners of the proposed system straightforwardly derive "effect" values for each precondition, each task or path, based on global information, task-specific knowledge and cognitive activations [30].

•
Definition 5. Task goal module G T = {GE, E} consists of the global environments GE and the effects E as follows: where s GE is the state of global environment and s E represents whether the effect is executable or not.It has a binary value and can be collected by the sensors or the feedback massage of the device.In the system, it decides the states of precondition.

ExcutableE f f ect(E i
Tn , t) = where the precondition is one or more of the global environments.
The immediate task modules are inspired by the spreading activation algorithm [31].Each module is represented by the response value of which module affects the rates of change of other activations.
• Definition 6.The immediate goal module G I = {G IS , G IC } consists of the specific immediate goal module G IS and the common immediate goal module G IC .Both modules consist of the local environments LE and the action A of goal as follows.
The immediate goal is not achieved by a sequence, but achieved by the actions carried out continuously.These executable actions change in the current state of the local environment; the set of actions for achieving the immediate goal is not fixed.• Definition 7. The specific immediate goal module G IS = {LE, A S , A C , Γ} aims to respond to the intention in specific situations.This module consists of four parameters.A S defines the response to conduct the service, and A C presents the common responses that are performed on the various modules.For example, "turning off the light" is the response of intention that is to control the light only.Sending a warning message, however, is the response that can occur in several intentions.

Hierarchical Agent Architecture
Figure 3 shows the agent control system based on the hierarchical intention model.There are two types of user intention: private and immediate intentions with reference to Grafton and Tipper's research that presented the hierarchical organization of tasks [29].When a person performs a complex task, it is divided into detailed sub-tasks, like Hamilton's hierarchical intention model.The deliberative planners of the proposed system straightforwardly derive "effect" values for each precondition, each task or path, based on global information, task-specific knowledge and cognitive activations [30].
where GE s is the state of global environment and E s represents whether the effect is executable or not.It has a binary value and can be collected by the sensors or the feedback massage of the device.In the system, it decides the states of precondition.

Action Selection
This section presents how the response is selected for the intentions.Figure 4 shows the flowchart for generating the actions of the agent.First, when the user intention is sent to the response module, it is classified as private or immediate.If the user intention is private, it is sent to the task intention response module for dividing some sub-immediate goals.The system checks if the effect has satisfied all preconditions.If such an action exists, the effect is executed.
When the effect is excitable, the name of the immediate goal module B I is pushed into a sequence queue SQ.If an action that satisfies all preconditions does not exist, the planner sends an error message to the gateway.When the process of the planner is completed, the immediate goal modules are executed depending on the sequence until there is no more immediate goal.When the user intention is immediate or if the sequence is situated, the response modules are conducted in the immediate intention response module.First, the system searches for the immediate goal module that maps the name of the task or simple intention.If the task module exists, the system classifies executable actions in the module.The executable action at time t is calculated by Equation (4).

ExcutableAction(A i
In , t) =  Then, the module calculates each response level RL using Equation ( 5).The response level at time t is defined with reference to the activation level in BSN.
)) , , ( where , ( , , ) 0 , ( , , ) 0 , ( , , ) 0 Finally, the system selects one action and sends it to the gateway.Equation ( 9) represents how Then, the module calculates each response level RL using Equation ( 5).The response level at time t is defined with reference to the activation level in BSN.
where SP EW , SP PW and SP PG are backward spreading, forward spreading and delete spreading to b j from b k , respectively.
Finally, the system selects one action and sends it to the gateway.Equation ( 9) represents how to select the action.If the response level of the action is the same, the system selects the action randomly.
The user requests "Saving energy", and only general environment GE 1 has the value of one at Time 1.As the general environment "Save" represents the preconditions of E 1 , E 2 and E 3 , we can calculate the executable effects at Time 1 using Equation (11).
Finally, the system selects the effect E 1 ES "Get_info (TV)" in the executable effects, because the system selects one effect randomly when it has more than two executable effects.Equation (11) shows the calculation result of the effect "Get_info (TV)" at Time 1.The system selects the effect "Control (TV)" in the executable effects at Time 2 and pushes the name of the immediate goal (TV) into the sequence queue.After executing "Control (TV)," the state of general environments GE 1 and GE 10 changes into one.At Time 4, the system selects the effect "Pass (Radio)" and does not push the name of the immediate goal (Radio) into the sequence queue.After performing the making sequence process from Times 1-7, the system makes the sequence which consists of "Immediate goal (TV)" and "Immediate goal (Light)".
The immediate goal modules are executed by the order of the sequence.First, the system executes "immediate goal module (TV)".The bottom of Figure 5 shows the change of response levels in the system.In this figure, the response node is selected four times.At Time 6, the system selects the "Turning off light in living room" response node, and the agent sends the relevant response behavior to the user.Next, the "Checking problem" response node is selected.Then, the "Turning off TV in living room" response node and the "Checking problem" response node in "TV management" are selected consecutively.The "Checking problem" response node is a common node in specific task modules.The system identifies the problem of whether the response is performed or not in the real world using each response node in the two modules.Figure 6 represents one of the immediate goal modules, which consists of 12 local environments and eight actions.

Experiments
Figure 7 shows a smart home environment implemented using the Unity3D tool, while the intelligent agent is implemented using MS Agent and MFC.The smart home agent can perform services that manage the TV, radio and light system at home.In addition, the saving energy service conducts complex services, such as the management of all the TV, radio and light system according to the current state of the devices.

Experiments
Figure 7 shows a smart home environment implemented using the Unity3D tool, while the intelligent agent is implemented using MS Agent and MFC.The smart home agent can perform services that manage the TV, radio and light system at home.In addition, the saving energy service conducts complex services, such as the management of all the TV, radio and light system according to the current state of the devices.

Response Rate
One of the objectives of the proposed system is to overcome the limitation of the rule-based system that requires a large number of rules for smart homes in a dynamic environment.The experimental result confirms whether the system generates appropriate responses or not compared to the rule-based system.Table 5 shows the result.R100, R150 and R200 represent the rule-based systems that have 100, 150 and 200 rules, respectively.The results are the ratio of the number of appropriate responses by the system for the 10 situations.As the number of rules increases, the performance becomes similar to the proposed system.The rule-based system needs 200 or more rules for the same performance of the proposed system.In order to determine whether this difference is statistically significant or not, we conduct the paired t-test.

Processing Time
In this section, we evaluate the system to justify the modular method.The system is modularized by the hierarchical intention model to reduce the processing time.If the system considers all information to provide a service when it reacts to the user intentions, the processing time is slower than the system that can consider only the relevant information.As it is related to the scalability, it is very important for the smart home agent.The "Command + BSN" system represents the hybrid system using the user command and BSN, which needs the user's command when it generates the behavior to respond to private intention in the changeable environment.The "Rule + BSN" system represents the hybrid system using the rule-based system and BSN.
The experiment is conducted ten times with an Intel Core™ i7-2600L CPU, 16.0 GB RAM and Windows 7. Figure 8 shows the result of the processing time.As the result, the proposed method has the lowest time among other systems, resulting in being three-times faster than the rule-based systems.

Response Rate
One of the objectives of the proposed system is to overcome the limitation of the rule-based system that requires a large number of rules for smart homes in a dynamic environment.The experimental result confirms whether the system generates appropriate responses or not compared to the rule-based system.Table 5 shows the result.R100, R150 and R200 represent the rule-based systems that have 100, 150 and 200 rules, respectively.The results are the ratio of the number of appropriate responses by the system for the 10 situations.As the number of rules increases, the performance becomes similar to the proposed system.The rule-based system needs 200 or more rules for the same performance of the proposed system.In order to determine whether this difference is statistically significant or not, we conduct the paired t-test.

Processing Time
In this section, we evaluate the system to justify the modular method.The system is modularized by the hierarchical intention model to reduce the processing time.If the system considers all information to provide a service when it reacts to the user intentions, the processing time is slower than the system that can consider only the relevant information.As it is related to the scalability, it is very important for the smart home agent.The "Command + BSN" system represents the hybrid system using the user command and BSN, which needs the user's command when it generates the behavior to respond to private intention in the changeable environment.The "Rule + BSN" system represents the hybrid system using the rule-based system and BSN.
hierarchically according to their level of abstractedness or the time required to complete them.

Figure 1 .
Figure 1.Hierarchical organization of goals by Hamilton.
expresses the state of devices for making the sequence of immediate goals. Definition 2. Task goal } ,..., is when the user wants this goal by private intention.It decides what kind of global environment is needed and what kind of immediate goal is pushed to the sequence queue that saves the sequence of the immediate goal in the current global environment to achieve the task goal.that changes frequently when the action in the immediate goal is performed.The global environments decide whether to execute the immediate goal or not; on the other hand, the

Figure 1 .
Figure 1.Hierarchical organization of goals by Hamilton.

E 1 P1
is one of the effects in G T1 .It can decide what kind of global environment is collected and what immediate goals are pushed into the sequence queue as follows.

Figure 3 .
Figure 3.The agent control system based on a hierarchical intention model.

G
. It can decide what kind of global environment is collected and what immediate goals are pushed into the sequence queue as follows.

Figure 3 .
Figure 3.The agent control system based on a hierarchical intention model.

Figure 4 .
Figure 4. Flow chart of the response module.
spreading, forward spreading and delete spreading to j b from k b , respectively.

Figure 4 .
Figure 4. Flow chart of the response module.

Figure 5 .
Figure 5.An example of generating a sequence of actions.

Figure 5 . 15 Figure 5 .
Figure 5.An example of generating a sequence of actions.

Figure 7 .
Figure 7. Implementation of the smart home agent.

Figure 7 .
Figure 7. Implementation of the smart home agent.

Table 1 .
Previous works for smart home services.

Table 2 .
Applications of an intelligent agent.
LE 2 , ..., LE i } represents the information that changes frequently when the action in the immediate goal is performed.The global environments decide whether to execute the immediate goal or not; on the other hand, the local environments decide the actions that achieve the immediate goal.•Definition 4. Immediate goal G I is when the user wants this goal for the immediate intention.
• Definition 2. Task goal G T = {G T1 , G T2 , ..., G Tn } is when the user wants this goal by private intention.It decides what kind of global environment is needed and what kind of immediate goal is pushed to the sequence queue that saves the sequence of the immediate goal in the current global environment to achieve the task goal.•Definition 3. Local environment LE = {LE 1 ,

Table 3 .
Task goal of the proposed system.

Table 4 .
Immediate goal of the proposed system.

Table 3 .
Task goal of the proposed system.

Table 4 .
Immediate goal of the proposed system.light in living room, turn on lamp in living room, turn on light on wall, turn on light in kitchen, turn on light in corridor, turn on light in main room, turn on desk lamp in main room, turn off main light in living room, turn off light lamp in living room, turn off light on wall, turn off light in kitchen, turn off light in corridor, turn off light in main room, turn off desk lamp in main room, checking problem, solving problem} {Open left window in balcony, open right window in balcony, open right window in main room, open left window in main room, open center window in back garden, open right window in back garden, open left window in back garden, close left window in balcony, close right window in balcony, close right window in main room, close left window in main room, close center window in back garden, close left window in back garden, close right window in back garden, checking problem, solving problem}

•
Definition 8.The common immediate goal module G IC = {LE, A, Γ} is not used in specific situations.Sometimes, it is conducted as a sub-task in the specific task modules. in kitchen, turn off TV in living room, turn off TV in main room, checking problem, solving problem} Radio management {Turn on radio in kitchen, turn on radio in living room, turn on radio in main room, turn off radio in kitchen, turn off radio in living room, turn off radio in main room, checking problem, solving problem} Air-Conditioner management {Turn on air-conditioner in living room, turn off air-conditioner in living room, checking problem, solving problem} Window management {Open left window in balcony, open right window in balcony, open right window in main room, open left window in main room, open center window in back garden, open right window in back garden, open left window in back garden, close left window in balcony, close right window in balcony, close right window in main room, close left window in main room, close center window in back garden, close left window in back garden, close right window in back garden, checking problem, solving problem} GE 1 E10 × s 11 GE 11 E10 × s 12 GE 12 E10 × s 13 GE 13 E10 )E 10 ES

Table 5 .
The t-test result of response rate.

Table 5 .
The t-test result of response rate.