IntroductionUse Allen’s Temporal Relations [3] to identify temporal relations among Activities in Daily Life of the resident.
Allen’s relations form the basic representation of the temporal intervals, which when used with constraints become a powerful method of expressing expected temporal orderings between events in a smart environment.
In this poster we consider the problem of activity prediction based on the discovery and application of temporal relations.
Smart Home Goals:
Data Collection Environment
Literature cited
Temporal Relations
“It is common to describe scenarios using time intervals rather than time points” - James F. Allen
Step 3: Temporal Rules Enhancement to the Prediction.
Mining Sensor Data in Smart Environment for Temporal Activity Prediction
Vikramaditya R. Jakkula & Diane J. CookWashington State University
First International Workshop on Knowledge Discovery from Sensor Data (Sensor-KDD '07)
Conclusions
Figure 2. Real & Synthetic Datasets.
Figure 3. Smart Home Scenario illustrated using temporal relations.
AcknowledgmentsThis work is supported by NSF grant IIS-0121297.
Contact Us:Vikramaditya R. Jakkula [email protected] Diane J. Cook [email protected]
Algorithm : Temporal Interval Analyzer Input: data timestamp, event name and state Repeat While [Event && Event + 1 found] Find paired “ON” or “OFF” events in data to determine temporal range. Read next event and find temporal range. Identify relation type between event pair from possible relation types (see Table 1). Record relation type and related data. Increment Event Pointer Loop until End of Input.
.
Due to small datasets used, we use the top rules generated with a minimum confidence of 0.5 and a minimum support of 0.01.Confidence level above 0.5 and support above 0.05 could not be used, as they could not result in any viable rules.
The major goal of MavHome project is to design an environment that acts as an intelligent agent and can acquire information about the resident and the environment in order to adapt the environment to the residents and meet the goals of comfort and efficiency. This sensor network consists of around 100 sensors include motion, devices, light, pressure, humidity and more. Unified project incorporating varied AI techniques cross disciplinary with mobile computing, databases ,multimedia, and others.
Figure 1. MavHome Smart Home Architecture [1]
Food “Contains” wateror
Water “Before” pillsor
Food “Meets” pillsor
Food “Contains” water “before” pills
Food Food
WaterWater
PillsPills
Time Interval
Why Temporal Relations?
Temporal Relation Usable
Before XAfter During Contains XOverlaps XOverlapped-By Meets XMet-by Starts Started-By Finishes Finished-By Equals
Allen’s 13 Relations
Experimentation & Results
Step 1: Process raw data to form temporal intervals
Datasets
Parameter Setting
No of Days
No of Events
No of Intervals Identified
Size of Data
Synthetic 60 8 1729106KB
Real 60 17 1623104KB
[3]
Raw Sensor Data
Timestamp Sensor State Sensor ID3/3/2003 11:18:00 AM OFF E163/3/2003 11:23:00 AM ON G12
Identify Time Intervals
Date Sensor ID Start Time End time.03/02/2003 G11 01:44:00 01:48:0003/02/2003 G19 02:57:00 01:48:00
Associated Temporal Relations
Date time Sensor ID Temporal Relation Sensor ID3/3/2003 12:00:00 AM G12 DURING E163/3/2003 12:00:00 AM E16 BEFORE I14
Step 2: Association rule generation using WekaUse Apriori classifier in Weka [2] for generating best rules with a given support and confidence.
Equation to calculate evidence using Probability of occurrence:
P(Z|Y) = |After(Y,Z)| + |During(Y,Z)| + |OverlappedBy(Y,Z)| + |MetBy(Y,Z)| + |Starts(Y,Z)| + |StartedBy(Y,Z)| + |Finishes(Y,Z)| + |FinishedBy(Y,Z)| + |Equals(Y,Z)| / |Y|
Results:
DATA SET ACCURACY% ERROR%
REAL (WITHOUT RULES)
55 45
SYNTHETIC (WITHOUT RULES)
64 36
REAL (WITH RULES) 56 44
SYNTHETIC (WITH RULES)
69 31
Online Model: Enhance existing ALZ prediction [4].Predictionc:=P(C|P) :=P(C|P)SEQ+P(C|P)TEM/Global – (α * P(C|P)TEM)
Where α = | #CPHRASE| / | #CGLOBAL |.
Real data had 1.86% and synthetic data had 7.81% prediction improvements.Good model for offline prediction of multiple events.Cannot adapt to online dynamic model of the environment.
Pseudo code: Temporal Rules Enhanced prediction.[1] Get the current predicted output and check for any rule which satisfies it. If yes proceed else goto next predicted.[2] Now we check for the relation and based on the evidence as calculated by equation displayed below if it is greater than Mean+2* Std. Dev. Then add this to the predicted. [3] If relation is after the evidence becomes cumulative until greater then Mean +2*Std. Dev.
[1] G. Michael Youngblood, Lawrence B. Holder, and Diane J. Cook. Managing Adaptive Versatile Environments. Proceedings of the IEEE International Conference on Pervasive Computing and Communications, 2005.
[2] Ian H. Witten, Eibe Frank. 2005. Data Mining: Practical Machine Learning Tools and Techniques, 2nd Edition. Morgan Kaufmann, San Francisco.
[3]James F. Allen, and George Ferguson, Actions and Events in Interval Temporal Logic, Technical Report 521, July 1994.
[4] K. Gopalratnam & D. J. Cook (2004). Active LeZi: An Incremental Parsing Algorithm for Sequential Prediction. International Journal of Artificial Intelligence Tools. 14(1-2):917-930.
Unique and new Approach.Real data had 1.86% and synthetic data had 7.81% improvement.Larger datasets would be incorporated.Extended model includes direct application of temporal relations based probability to calculate the prediction.expansion of the temporal relations by including more temporal relations, such as until, since, next, and so forth, to create a richer collection of useful temporal relations.
Sample of the best rules observed in a real smart environment dataset:
Activity=C11 Relation=CONTAINS 36 ==> Activity=A14 36 Activity=D15 Relation=FINISHES 32 ==> Activity=D9 32 Activity=D15 Relation=FINISHESBY 32 ==> Activity=D9 32 Activity=C14 Relation=DURING 18 ==> Activity=B9 18