Learning Human Behaviour Patterns in Work...
Embed Size (px)
Transcript of Learning Human Behaviour Patterns in Work...
Learning Human Behaviour Patterns in Work Environments
Chih-Wei ChenStanford University
Stanford, [email protected]
Asier AztiriaUniversity of Mondragon
Mondragon, [email protected]
Hamid AghajanStanford University
Stanford, [email protected]
In this paper, we propose a flexible, human-orientedframework for learning the behaviour pattern of the usersin work environments from visual sensors. The knowledgeof human behaviour pattern enables the ambient environ-ment to communicate with the user in a seamless way andmake anticipatory decisions, from the automation of ap-pliances and personal schedule reminder to the detectionof unhealthy habits. Our learning method is general andlearns from a set of activity sequences, where the granu-larity of activities can vary for different applications. Al-gorithms to extract the activity information from the videosare described. We evaluate our method on video sequencescaptured in a real office, where the user’s daily routine isrecorded over a month. The results show that our approachis capable of not only identifying the frequent behaviour ofthe user, but also the time relations and conditions of theactivities.
1. IntroductionIntelligent Environments (IEs) are expected to support
people in their daily lives. A basic assumptions about IEs isthe change of perspective in the relationships between hu-mans and technology, shifting from a techno-centered per-spective to a human-centered one. This implies that IEsmust support people in their daily tasks, providing person-alized services adapted to their needs. Thus, IEs can bedefined as “digital environments that proactively, but sensi-bly, support people in their daily lives” . Let us considerthe following scenario:
Michael arrives at his office around 9 a.m., and goes di-rectly to his desktop. By then, his computer is automaticallyswitched on. After checking his email, he meets with his co-ordinator to plan the work to do. Then, he goes back to hisdesk and sometimes he prints his schedule. As the environ-ment has already learned his common behaviour, it is ableto send him reminders if it detects that Michael may haveforgotten an activity. Besides, the environment can suggesthim to take a break if he is working longer hours than usual.
Figure 1: Action Map of Michael’s morning ritual.
Human-centered computing has seen great progressin recent years , but the adaptation of the environ-ment should go beyond the traditional multimodal human-computer interaction framework. The environment shouldact proactively in order to adapt itself to the users and pro-vide personalized assistance. For that shift to take place, theenvironment must know users’ habits and needs, discover-ing such patterns in an unobtrusive and transparent way.
Assuming that human beings perform behaviours basedon habits, it could be inferred that patterns describing pastand present behaviours will define future behaviours aswell. In that sense, discovered patterns can be used to proac-tively activate/deactive some devices (e.g. switching on thecomputer automatically when Michael goes into the office).Apart from automating actions or devices, patterns can alsobe used to understand his behaviour and act in accordancewith it (e.g. issuing reminders). Therefore, unhealthy habitscan be detected (e.g. his work periods are too long). Mak-ing the environment more efficient in terms of saving energy(e.g. switching off the lights when he has gone out) or in-creasing safety (e.g. locking the door when he has gone out)are other aspects that can be supported by an IE when it isaware of users’ frequent behaviours.
While sensors of multiple modalities can be used to dis-cover behaviour patterns, in this work we focus on visualsensors because of their ability to observe the users in an un-obtrusive way. We develop a system consisting of a visualprocessing and a learning module that addresses the fol-lowing challenges: extracting information from the visualsensors reliably and discovering the pattern efficiently. Theunderlying visual processing module is capable of trackingmultiple people in a realistic environment. The trajectoryof the user allows location-driven routines to be identified.
We simplify the behaviour discovery problem by associat-ing the semantic locations of the user to activities. Whilemore detailed activity categories can be discovered by hu-man activity recognition techniques, this association is ef-fective in a workplace scenario where activities are stronglycorrelated with locations by their functionalities. For ac-tivities taking place in close proximity, we use a clusteringalgorithm on the visual data to separate activity classes intofiner granularity. The locations and the clustering results aremapped to semantic activities. Our Learning Frequent Pat-terns of User Behaviour System (LFPUBS) then learns theuser’s common behaviours. The objective of LFPUBS is todiscover accurate patterns that represent the user’s frequentbehaviours in a comprehensible way by means of ActionMaps. This model allows the expression of time relationsusing relative time references. Following our previous sce-nario, Michael’s morning behaviour represented in an Ac-tion Map is depicted in Figure 1.
Our work investigates the utilization of visual sensorsin learning comprehensive behaviour patterns. The contri-butions of this paper are as follows. First, the proposedvisual processing algorithms extract locations and activitymodes that are characteristic of people’s routines. Second,we apply a data mining approach for the discovery of thebehaviour patterns, including time relations and conditions.Finally, we show that more detailed behaviour understand-ing can be achieved if our system learns from activitiesof finer granularity. The proposed framework is general,not restricted to work environments and can be extended tolearn from a richer set of activities.
2. Related WorkUnderstanding human behaviour has attracted a signif-
icant number of researchers, and much work has been de-voted to modeling human behaviour at different temporalresolutions, from pose estimation and activity recognition tolong term behaviour pattern learning. In particular, spatial-temporal based [9, 14] or shape based  human actionrecognition algorithms have been developed for the under-standing of human motion and activity. Multimodal sen-sors in ambient intelligence environments [2, 5] or in mo-bile phones  have been integrated to discover patterns indiverse spatial and temporal scales, from a specific activ-ity such as cooking to a person’s daily life over a timespanof months. Other groups have tried to recognize affectiveand social signals in order to create anticipatory interfaces.A survey can be found in . Our work learns compre-hensive behaviour patterns, and can incorporate the activityrecognition or multimodal results to enrich the model.
Contextual information has also been extensively usedin the recognition of human poses  and pattern discov-ery . Understanding the pattern of human activities isalso beneficial for activities recognition. It has been shown
that prior knowledge about the structure of human activi-ties provides constraints in the learning process and betteraccuracy can be achieved .
3. User Location and Activity
Given the daily videos recored in the work environment,our system first extracts the locations of the users. The in-formation is subsequently sent to the learning layer for thediscovery of behaviour patterns. Here we describe the vi-sion tracking algorithm and the motion clustering methodused to label the users’ activities.
Tracking For tracking the user in the environment, weuse a tracking-by-detection approach similar to that usedin . The design philosophy is to build an efficient yetrobust tracker that runs in real-time to meet the interactivenature of the overall system. Our tracking framework inte-grates two complementary methods: detection associationand low-level tracking. For detection, we construct an adap-tive background mixture model for the incoming video, andobtain a binary foreground mask for each frame. The fore-ground and background segmentation not only reduces thesearch space for detection, but also provides an extra con-straint: only detection near the top of a foreground blobis valid, since the target is the head of a person. The Ω-shape head and shoulder silhouette template is then matchedagainst the edge map of the frame with the foreground maskapplied. The template matching is performed at multiplescales using Chamfer distance, therefore robust to clutteredbackgrounds and appearance variations.
Formally, let T denote the template, I the image frame,and E the edge map. The Chamfer distance at location x iscalculated as,
d(x, T ) =1
‖(x+ xt)− xe‖ (1)
where |T | is the number of points in the template T and ‖.‖can be either l1 or l2 norm. The Chamfer distance is effi-ciently computed by first computing the distance transformon the edge map E.
Now let xt and st be the location and scale of the trackedtarget at time t, and bt = (xt, st) denotes the bounding boxaround the target. We update the track as follows,
bt+1 = minbd∈D
d(xd, Tst) + α · corr(bt, bd) + βbt ∩ bdbt ∪ bd
where D is the set of detections returned by the head de-tector at time t+ 1, Ts the template at scale s, corr(b1, b2)the normalized correlation of the image patch inside b1 onIt and that inside b2 in It+1. The last term calculates theoverlap between the candidate detection and the previousbounding box, and α, β are weighting parameters.
When there is no detection, possibly due to no mo-tion (foreground person merges into background model) orheavy occlusion, our system falls back to low-level track-ing. We search in a local region and find the image patch inthe new frame that achieves maximum normalized correla-tion with the current target image patch. If the best matchhas a matching score below a predefined threshold, we donot update the location and keep the previous image patchas the appearance template. This allows the track to be as-sociated with new detections when they reappear.
Once the head location is found, the 2D coordinate ofthe user within the environment can be estimated given theheight of the user and the camera calibration parameters.The 2D location is then quantized into semantically mean-ingful regions, where each region is defined manually andis weakly associated with different user activity by its func-tionality. Examples of the region labels include personaldesks, printers, and coffee machines, which correspond towork, printing documents, and making coffee. Finally, therepresentation of the user’s location is the region label.
Motion Clustering While many activities are highlycorrelated to or even constrained by locations, there are sit-uations that cannot be disambiguated from the sole perspec-tive of location. For example, when the user is at his desk,he might be working on the computer or on papers. Thesedistinct activities have various implications and representdifferent state in the behaviour pattern. To further under-stand a person’s routine, we propose to incorporate addi-tional visual sensors in the environment to provide richerinformation.
Our approach to distinguish different activities is in-spired by the extensive research in human activities recog-nition. In particular, we focus on activities over a short tem-poral window, represented by a set a measurements .The measurements we consider are motion and appearance,represented by motion history image (MHI) and color-basedskin detection. The latter has been widely used for the de-tection of human, as well as describing the shape and sug-gesting the pose of the human body.
To classify an observation, representative exemplars aresampled for each class of activity from a training video.Each exemplar is represented by the motion history imageand skin detector result. To accelerate the matching process,principal component analysis (PCA) is employed to reducethe dimensionality of the data. The distances from the newobservation to the exemplars are then calculated in the re-duced feature space. The final assignment is determined byits k-nearest neighbors (k-NN).
4. Learning User’s Frequent BehavioursOnce the user’s activities are labeled by the visual pro-
cessing module, the learning module discovers the hiddenfrequent behaviours. LFPUBS consists of two submodules.
The underlying idea is the separation of the representationof the discovered patterns from the process of discoveringper se. The core of the representation module is a lan-guage (LLFPUBS) that provides a standard conceptualiza-tion of the patterns so that the environment is able to rep-resent all type of patterns in the environment. On the otherhand, the process of discovering is based on an algorithm(ALFPUBS) that discovers frequent patterns.
4.1. Representing patterns with LLFPUBS
Because of the complexity of IEs, defining a languagethat allows the environment to represent discovered patternsin a clear and unambiguous way is difficult but necessary.The language integrated within LFPUBS is based on ECA(Event-Condition-Action) rules. A frequent behaviour isdefined by means of an Action Map, which contains all ofthe specific relations between actions. In other words, anAction Map is created relating actions in pairs, and each ofthose relations is called an Action Pattern, which are de-fined by means of ECA rules. The complete Action Map isthen created by linking different Action Patterns.
In the same way as ECA rules, each Action Pattern re-lates two actions (defined by the ON and THEN clauses)and the specific conditions (defined by the IF clause) un-der which that relation occurs. Finally, unlike basic ECArules, LLFPUBS allows the environment to define the timerelation between both actions. Considering Michael’s be-haviour of having meetings. Using LLFPUBS it would berepresented as follows:(Action Pattern 14)ON occurs (simple,(Working,off),t0)IF context ()THEN do (simple,(On,Meeting),t) when t = t0 + 3s.
4.2. Learning patterns with ALFPUBS
Coupled with LLFPUBS , an essential component in theLearning Layer is the algorithm (ALFPUBS) that discov-ers the frequent behaviours of the users. The different stepsto be performed by ALFPUBS in order to discover the fre-quent behaviours of the users are depicted in Figure 2. Abrief description of each module follows:
Figure 2: The system diagram of the learning algorithm.
Identifying Frequent Sets of Actions The objective ofthis step is to discover the sets of actions that frequentlyoccur together (Frequent Sets). The underlying idea ofthe first step is both simple and efficient. Defining a de-manded minimum level (minimum confidence level), it dis-covers all those sets of actions that occur more times than
the minimum level. To discover Basic Frequent Sets inlarge amounts of data, the Apriori algorithm was used. InMichael’s case, this first step would discover the frequentco-occurrence of the following actions. An activity is trig-gered when the user enters the corresponding region anddeactivated upon departure.
‘Working On’; ‘Working Off’; ‘Meeting On’; ‘Meeting Off’;‘Printing On’; ‘Printing Off’;
Identifying Topology The step Identifying Frequent Setsdiscovers which sets of actions frequently occur together.In order to properly model the user’s behaviours defined bysuch sets of actions, it is necessary to define the order ofsuch actions. That is the goal of this step, to discover thefrequent order (defined as Topology) of the actions in thebehaviour of the user. For that, we use techniques appliedin the Workflow Mining area  , where models are dis-covered from event logs. Even so, because of the nature ofIEs, some particularities must be taken into account.
Unlike other domains where actions are unique, in IEsthere could be different occurrences of the same action. Infact, the nature of repetitive occurrences will probably bedifferent because the user can do the same action with dif-ferent purposes. The technique to discover repetitive ac-tions is based on the idea that the meaning of an action ismainly defined by the previous and next actions. Thus, wecollect the previous and next actions, and using the EM al-gorithm we define the number of occurrences we need foreach action. In Michael’s case, the only actions that needmore than one occurrence are the ‘Working On’ and ‘Work-ing Off’ actions.
Identifying Time Relations Although the topology de-fines sequential relationships between actions (defined bythe qualitative term ‘after’), more accurate time relations arenecessary. The objective of this step is to discover frequentquantitative Time Relations between the actions defined bythe topology.
Qualitative relations allow one to understand the logicalorder of the actions. Even so, quantitative Time Relationsprovide higher quality information, For example, we mightwant to automate a device such as switching on Michael’scomputer. If such a relation is defined by means of a qualita-tive Time Relation, the environment would not know whenit has to switch on the computer without the knowledgeof whether the time delay was 2 seconds, 5 minutes or 2hours. However, using quantitative relations (3 seconds inMichael’s case) allows the system to switch on the computerof the meeting area at the right time.
Quantitative Time Relations are discovered using clus-tering techniques. If any cluster covers more instances thana demanded minimum level, the mean value of the clusteris considered as quantitative Time Relation. In Michael’scase, this step discovers that he usually needs 3 seconds toreach the meeting area when he leaves the working area.
It also discovers the duration of each of the work periods,giving a quantitative value to those periods.
Identifying Conditions Finally, in order to achieve com-plete patterns, it is necessary to discover under what condi-tions each relationship occurs. It could happen that an ac-tion is followed by two (or more) different actions, so thatit is necessary to define under what conditions the user car-ries out each one of the actions. In Michael’s case, this stepdiscovers when he prints his schedule and when he does not.
In order to identify conditions, for each possible relation-ship a table is created. In each table the occurrences coveredby that relationship are collected, together with the calen-dar and contextual information collected when such occur-rences happened. Once the tables are created, separatingtables by using the information they contain allows one todiscover conditions. In that sense, the task of separatingcan be solved by treating it as a classification problem. TheJRip Algorithm  was used to accomplish this task. Itdiscovers that Michael prints his schedule if he has meet-ings before 9:15 a.m..
5. ExperimentsThe experiments to validate the visual processing mod-
ule, as well as the learning system, are carried out in a realoffice environment. During a period of a month, the systemrecorded 19 days of morning behaviour of an employee whobehaved in his usual manner, i.e. without any pre-definedbehaviour or modifying his routine. Data were collectedusing Axis network cameras, capturing VGA (640 × 480pixels) videos at 30 fps. Two cameras were used in this ex-periment: one camera installed on the wall for tracking thelocation of the user, and the other dedicated to monitoringthe desktop. Our tracking algorithms process the videos at6 fps on a laptop with a 1.66 GHz Core Duo processor.
Visual Processing We first evaluate the performance ofthe visual processing module. Groundtruth for one 35 min-utes long sample video from the recordings is manually la-beled. A detection matches to a groudtruth if the overlap-ping area is at least 50% of both rectangles. On the testsequence our tracker achieves 98.3% accuracy. The track islost mainly under two situations: if the target person movestoo fast and not in the upright position (thus no detection),or if the person moves his chair while his head remainsstatic. In the latter case, the detector might be confusedby the moving chair’s back, which resembles the silhouetteof a person’s head and shoulder. Examples of the trackingresults obtained from all videos are shown in Figure 3.
The 2D location is calculated from the head location inthe video frame. We assume that the person is either stand-ing or seated, and the person is standing during the initial-ization of the tracking. In most cases, only one of the heightassumption would lead to valid location within the office. Incase of ambiguity, the location closer to the person’s previ-
(a) Office layout. (b) Tracking results. (c) Desktop camera.
Figure 3: (a) Office layout The office is quantized into semantic areas by their functionalities, including Working, Meeting,Printing, Door and Special. (b) Tracking results The composite of tracking results from several days of the user in differentareas. The bold red bounding boxes show true positive on the target’s head, while the thin green bounding box indicates falsepositive. In this case the tracker mistakes the chair for a person’s head and shoulder, which shares similar silhouette. (c)Desktop camera The user is in the same location but doing different activities. The extra visual sensor helps disambiguatedifferent activities that cannot be classified by location alone.
Figure 4: Localization results for a half-hour long sample video. The groundtruth location of the target over time is shown.The boldface number in parentheses indicates the error (in seconds) of our localization algorithm. No number preceding thetime label means correct results. Our algorithm is capable of identifying the location of the user with low temporal error.
ous position is selected. The result from the same test se-quence used above is shown in Figure 4. As shown in thefigure, the locations of the user are correctly identified byour proposed method. When the tracker fails to follow thetarget immediately after he leaves a region, the localizationcannot follow until the tracker recovers. Another source oferror comes from projecting the image point back to the realworld coordinate. For examples, the printer is located at thefar end of the room from the camera. Even small error inhead location estimation would be amplified and leads tospurious 2D localization.
Finally, we evaluate the motion clustering on the secondcamera. An extra sequence not in the test set was recordedto collect the activity exemplars. In this project we con-sider two activities at the desk: working on the computervs. on papers. Example frames are shown in Figure 3. Us-ing k−NN, we achieve 82.7% accuracy on 7436 frames of
the user at the desk in the test sequence.Behaviour Learning Once user’s actions were identi-
fied, we run LFPUBS in order to discover his frequent be-haviours. In fact, the example we have used throughout thepaper (see Figure 1) is the behaviour of the experiment sub-ject discovered by LFPUBS. Each step, together with theruntime, of the learning process is analyzed in more detail:
Identifying Frequent Sets of Actions (26 ms.) The de-manded minimum confidence level is set to 50%, whichmeans that a behaviour has to occur at least in 50% of thedays to be considered as frequent. This step discovered oneFrequent Set of Actions that contains the actions ‘Work-ing On’, ‘Working Off’, ‘Meeting On’, ‘Meeting Off’,‘Printing On’ and ‘Printing Off’.
Identifying Topology (215 ms.) This step is essentialto providing comprehensible pattern because the employeeusually carried out the same action (e.g. ‘Working On’) sev-
eral times with different purposes. In that sense, the pro-cess of identifying repetitive actions was critical to createmeaningful patterns. LFPUBS was able to infer the needof 3 different occurrences for the actions ‘Working On’ and‘Working Off’.
Identifying Time Relations (210 ms.) The demandedminimum level to consider a Time Relation was 25%, andLFPUBS is able to identify quantitative Time Relations in6 out of 9 relationships. This is the critical step to identify,for example, how long the employee worked without anybreak, which subsequently allows an expert to decide if heneeds to adjust his behaviour. In our user’s case, LFPUBSdiscovered that he usually worked for 25 minutes withoutany break after he printed his schedule.
Identifying Conditions (68 ms.) Finally, LFPUBS wasable to identify conditions on which the user printed hisschedule or not. Due to the lack of other types of infor-mation (e.g. agenda, contextual, etc.), the only available in-formation was related to time. In our case, the user printedhis schedule if he had had meeting before 9:15 a.m..
Incorporating Additional Visual Sensors Besidesidentifying the frequent behaviours, the incorporation of ad-ditional visual sensors allows us to analyze the user’s be-haviour with finer granularity. Temporal smoothing is ap-plied to the motion clustering results. Based on the addi-tional information, LFPUBS is able to analyze the workingperiod in more details and discover that while the user con-stantly stays in front of the computer, he sometimes movesaway from the screen and works on papers (13 minutes onaverage).
6. ConclusionIntelligent Environments suggest a new paradigm where
environments adapt their behaviour based on needs andhabits of users instead of the other way around. For that, en-vironments should learn, without disturbing the users, theirbehaviour patterns. To achieve that goal, we have developeda system that is able to discover user’s frequent behaviours.Our proposed framework has proved its ability to discoveraccurate and comprehensible patterns. The patterns are rep-resented by means of Action Maps that allow one to definethe order of the actions as well as the time relations betweensuch actions and the conditions under which such relation-ships occur.
Although the categories of human activities consideredin our experiments are limited and require manual assign-ment, our proposed framework is general and flexible. Morecomplex patterns can be learned by incorporating multi-modal sensors and different activity recognition techniques.Other directions of future work include: learning behaviourand interaction pattern of multiple people; detection of be-haviour deviation from learned patterns; using a richer setof contextual information.
Acknowledgments This research was partly funded bythe Department of Energy under grant DE-AR0000018.
References J. C. Augusto. Ambient intelligence: the confluence of ubiq-
uitous/pervasive computing and artificial intelligence. Intel-ligent Computing Everywhere, pages 213–234, 2007. 47
 A. Aztiria, A. Izaguirre, and J. C. Augusto. Learning patternsin ambient intelligence environments: a survey. ArtificialIntelligence Review, 34(1):35–51, May 2010. 48
 A. Aztiria, A. Izaguirre, R. Basagoiti, and J. Augusto. Learn-ing about preferences and common behaviours of the user inan intelligent environment. In Behaviour Monitoring andInterpretation-BMI, pages 289–315. IOS Press, 2009. 48
 C.-W. Chen, R. C. Ugarte, C. Wu, and H. Aghajan. Dis-covering Social Interactions in Real Work Environments. InIEEE Automatic Face and Gesture Recognition, Workshopon Social Behavior Analysis, 2011. 48
 F. De La Torre, J. Hodgins, J. Montano, and S. Valcarcel.Detailed Human Data Acquisition of Kitchen Activities :the CMU-Multimodal Activity Database (CMU-MMAC). InWorkshop on Developing Shared Home Behavior Datasets toAdvance HCI and Ubiquitous Computing Research, 2009. 48
 K. Farrahi and D. Gatica-Perez. What Did You Do Today?Discovering Daily Routines from Large-Scale Mobile Data.In ACM Multimedia, 2008. 48
 A. Jaimes, N. Sebe, and D. Gatica-perez. Human-CenteredComputing : A Multimedia Perspective. In ACM Multime-dia, 2006. 47
 L.-P. Morency, C. Sidner, C. Lee, and T. Darrell. Head ges-tures for perceptual interfaces: The role of context in im-proving recognition. AI, 171(8-9):568–585, June 2007. 48
 A. Oikonomopoulos, I. Patras, and M. Pantic. Spatiotempo-ral localization and categorization of human actions in un-segmented image sequences. IEEE transactions on ImageProcessing, 20(4):1126–40, Apr. 2011. 48
 M. Pantic, A. Pentland, A. Nijholt, and T. Huang. Humancomputing and machine understanding of human behavior:A survey. In ICMI, 2006. 48
 W. van der Aalst, A. Weitjers, and L. Maruster. Work-flow mining discovering process models from event logs.IEEE Transactions on Knowledge and Data Engineering,18(9):1128–1142, 2004. 50
 A. Veeraraghavan, A. K. Roy-Chowdhury, and R. Chellappa.Matching shape sequences in video with applications in hu-man movement analysis. IEEE PAMI, 27(12):1896–909,Dec. 2005. 48
 I. H. Witten and E. Frank. Data Mining: Practical MachineLearning Tools and Techniques, 2nd ed. Elsevier, 2005. 50
 C. Wu, A. Khalili, and H. Aghajan. Multiview activityrecognition in smart homes with spatio-temporal features. InACM/IEEE ICDSC, 2010. 48
 Y. Yacoob and M. Black. Parameterized Modeling andRecognition of Activities. Computer Vision and Image Un-derstanding, 73, 1999. 49
 Z. Zeng and Q. Ji. Knowledge Based Activity Recognitionwith Dynamic Bayesian Network. In ECCV, 2010. 48