Bayesian Modelling of the Temporal Aspects of Smart Home Activity with Circular Statistics

Tom Diethe, Niall Twomey, Peter A. Flach

Introduction

Activity recognition in smart homes is a cornerstone of modern health monitoring and ambient assisted living. Understanding when "Activities of Daily Living" (ADL)—such as eating, sleeping, or medication adherence—occur is vital for detecting deviations from healthy routines. Traditionally, researchers have treated time as a discrete feature, binning sensor events into fixed intervals (e.g., one-hour blocks). However, this approach suffers from significant information loss and artificial "border effects," where activities spanning the end of one bin and the start of another are split unnaturally.

Circular Statistics for Activity Recognition

Human behavior is inherently periodic, governed by 24-hour circadian rhythms. To address the flaws of linear time discretization, this research proposes treating time as a circular variable. By mapping time to a circle (0 to 24 hours), the "border effect" is eliminated: 11:59 PM becomes statistically adjacent to 12:01 AM. The primary challenge lies in performing efficient Bayesian inference on circular distributions, which are mathematically more complex than their linear counterparts.

Methodology: The Wrapped Normal Model

The authors utilize the Wrapped Normal (WN) distribution, which is effectively a standard Gaussian distribution "wrapped" around a circle. Because the standard WN involves an infinite sum that complicates inference, the paper introduces an Approximate Wrapped Normal (AWN) model. This approximation represents the WN as a finite mixture of Gaussians, making it more tractable for Bayesian methods.

Probabilistic graphical models for (a) a single Wrapped Normal distribution and (b) a mixture of Wrapped Normal distributions.

As shown in Figure 1, the model can be extended from a single distribution (a) to a mixture model (b). The mixture model allows the system to capture multimodal behaviors—activities that occur multiple times a day with distinct peaks, such as dressing in the morning and evening.

Inference and Model Selection

The paper evaluates two primary methods for Bayesian inference:

  1. Gibbs Sampling: A Markov Chain Monte Carlo (MCMC) approach that provides high accuracy but is computationally expensive and slow to converge.
  2. Expectation Propagation (EP): A deterministic approximation method. The authors demonstrate that EP is significantly faster than Gibbs sampling, reaching convergence in roughly 20% to 50% of the time.

Crucially, the use of EP allows for the calculation of "model evidence" (marginal likelihood). This enables the system to apply "Occam’s Razor" via automated model selection. By comparing Bayes factors, the model can autonomously determine the optimal number of mixture components ($K$) for a given activity, preventing over-fitting while accurately capturing complex temporal patterns.

Results and Discussion

The proposed framework was validated on both synthetic "toy" datasets and real-world data from the CASAS HH101 dataset, which contains three months of annotated sensor data from a single-resident apartment.

Key findings include:

  • Efficiency: EP provided a substantial speedup over Gibbs sampling with negligible loss in accuracy for real-world applications.
  • Multimodality: The model successfully identified activities with multiple daily peaks. For instance, the "Dress" activity was correctly modeled as a bimodal distribution, reflecting morning and evening routines.
  • Parsimony: The automated selection process correctly identified the number of modes for various activities, ensuring that the simplest model that explains the data is chosen.

Conclusion

By moving from discrete time bins to circular statistics, this work provides a more nuanced and mathematically sound representation of temporal patterns in smart homes. The combination of the Approximate Wrapped Normal model and Expectation Propagation offers a fast, scalable solution for activity recognition. Future research will focus on extending this univariate model to multivariate versions that incorporate sensor types and hierarchical models to share learned priors across different residents.

Summary updated

Abstract

Typically, when analysing patterns of activity in a smart home environment, the daily patterns of activity are either ignored completely or summarised into a high-level “hour-of-day” feature that is then combined with sensor activities. However, when summarising the temporal nature of an activity into a coarse feature such as this, not only is information lost after discretisation, but also the strength of the periodicity of the action is ignored. We propose to model the temporal nature of activities using circular statistics, and in particular by performing Bayesian inference with Wrapped Normal $$\mathcal {(WN)}$$ and $$\mathcal {WN}$$ Mixture $$\mathcal {(WNM)}$$ models. We firstly demonstrate the accuracy of inference on toy data using both Gibbs sampling and Expectation Propagation (EP), and then show the results of the inference on publicly available smart-home data. Such models can be useful for analysis or prediction in their own right, or can be readily combined with larger models incorporating multiple modalities of sensor activity.
BibTeX
@inproceedings{diethe2015bayesian,
  author = {Tom Diethe and Niall Twomey and Peter A. Flach},
  title = {{Bayesian Modelling of the Temporal Aspects of Smart Home Activity with Circular Statistics}},
  booktitle = {ECML/PKDD},
  year = {2015},
  doi = {10.1007/978-3-319-23525-7\_17},
}
Figure