<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Using Statistico-Relational Model for Activity Recognition in Smart Home</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Alexis Brenon</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Francois Portet</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Michel Vacher</string-name>
          <email>michel.vacherg@imag.fr</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>CNRS, LIG</institution>
          ,
          <addr-line>F-38000 Grenoble</addr-line>
          ,
          <country country="FR">France</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Univ. Grenoble Alpes, LIG</institution>
          ,
          <addr-line>F-38000 Grenoble</addr-line>
          ,
          <country country="FR">France</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>This paper presents the use of a model which mixes logical knowledge and statistical inference to recognize Activities of Daily Living (ADL) from sensors in a smart home. This model called Markov Logic Network (MLN) has different implementations and we propose to compare three of them, from the widely used Alchemy to the new generic framework DeepDive. Finally, we discuss the interest these software products can have for real time activity recognition.</p>
      </abstract>
      <kwd-group>
        <kwd>Activity Recognition</kwd>
        <kwd>Markov Logic Network</kwd>
        <kwd>Factor Graph</kwd>
        <kwd>Smart Home</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        Smart home, as described by De Silva [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], is a home-like environment (home,
at, etc.) equipped with sensors and actuators. These devices can be used to
provide various facilities to the inhabitants through ambient intelligence and
automatic controls. As listed by Peetoom et al. in their literature review [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ],
many laboratories have built their own smart home to study how technologies can
make life easier for people. Among those, researchers are interested in identifying
Activities of Daily Living (ADL) to characterize the user's context.
      </p>
      <p>
        The context is a generic term which generally regroup the location of the user,
its current activity, etc. [
        <xref ref-type="bibr" rid="ref3 ref4">3,4</xref>
        ] It is used by context-aware services, and so, activity
recognition is crucial to allow context-aware applications to provide more active
services.
      </p>
      <p>
        Activity recognition has been studied for a while and many techniques have
been used. One of them relies on computer vision which leads to ethical,
acceptance and computational problems. To get around this issue, many projects
use only simple and ubiquitous sensors [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] and more recently, a project used
microphones to extract information from the audio stream [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
      </p>
      <p>
        Given all these kinds of data, inference have been done following two main
approaches. On the one hand, a set of rules can be de ned by a domain expert to
infer high-level information from low-level sensors' data [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. On the other hand,
machine learning and statistical models learned on corpus can be used to
generalize already seen behaviors [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. A third approach, explained in Section 2, uni es
the logical models and the statistical ones [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ].
      </p>
      <p>Main implementations of statistico-relational model will be compared in
Section 3 against a multi-modal corpus. Finally, we will discuss the different
perspectives considered in Section 4.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Statistico-Relational Models</title>
      <p>
        Markov Logic Network (MLN) is one of the statistico-relational models,
primarily introduced by Domingos et al. [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. It is a template model to construct Markov
networks (also named Markov random elds) from a set of weighted rst-order
logic formulas. Based on both of these pillars, MLN combines their advantages to
handle at the same time the complexity and the uncertainty of a representation
of the real world. As Domingos et al. explain in their paper, the MLN formalism
subsumes many other probabilistic models allowing it to be more concise and to
handle easily non-independent and identically distributed models.
      </p>
      <p>
        MLN is used to infer the most probable state of a world given some evidences
which is called Maximum A posteriori Probability/Most-Probable Explanation
(MAP/MPE) inference. This can be easily done using a SAT solver able to
handle the weights of the formulas [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. Another task of MLN is to compute the
probability that a formula is true in a speci c world. This is done thanks to the
Markov Chain Monte Carlo inference algorithm.
      </p>
      <p>With the logical models, a domain expert is needed to transfer its knowledge.
MLNs take a step to avoid this expensive phase, allowing it to learn the weights
from an annotated corpus. In the same way, some attempts have been made to
learn the structure of a MLN using Inductive Logic Programming techniques.</p>
      <p>
        It exists different implementations of MLN. The most well known is Alchemy3 [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]
developed by the University of Washington. It makes it possible to de ne MLNs
based on a de ned syntax similar to Prolog and to proceed to weight learning
and inference on given data. Developed in C++, Alchemy is, to best of our
knowledge, no longer maintained since 2013. Nevertheless, it is still widely used
by researchers, as in the previous study made in our team. That is why we
decided to use it as a baseline to compare other implementations.
      </p>
      <p>
        Then, Stanford University launched another project, called Tuffy4, using
a similar implementation to Alchemy moving from C++ to Java and relying
on PostgreSQL. Usage of an external relational database management system
(RDBMS) improves dramatically the time and space efficiency of Tuffy
inference phase [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. In 2014, Tuffy development stopped in favor of DeepDive.
      </p>
      <sec id="sec-2-1">
        <title>3 http://alchemy.cs.washington.edu/ 4 http://i.stanford.edu/hazy/tuffy/</title>
        <p>
          DeepDive5 is the new project of the Hazy Research group6. It is a generic
framework primarily designed for knowledge base creation (KBC) which can
handle many problems [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]. Born out of the ashes of Tuffy, DeepDive also
use the external RDBMS PostgreSQL to manage the data. But DeepDive does
not use the exact MLN de nition of Domingos et al. to handle the logical and
statistical parts of the model. Its implementation is based on Factor Graphs
(FG) instead of Markov networks. FG is a very generic graphical model which
can handle many other problems solved with different graphical models [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ].
3
        </p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>First Results on ADL Recognition</title>
      <p>Until now, we have measured the learning performance of the different available
software. The learning performance is the score of the system when it infers on
the exact same data set than the learning one.</p>
      <p>
        In our case, we use a multi-modal corpus which regroups a full range of
sensors values, some computed higher level data (room where the user stayed
the longest, agitation level, etc.) and the actual activity of the user. This corpus is
composed of 26 hours of experiments on 21 persons, divided into 1 minute long
time windows, represented by 94 values [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. For our rst approach, the MLN
structure (logical knowledge) is very naive, as we suppose that all the feature
values are relevant. Thus, every value implies an activity with a certain degree
of truth. This is not optimal but gives us a rst baseline to beat.
      </p>
      <p>We ran the following experiments: (1) weight learning and inference with
Alchemy; (2) inference with Tuffy (based on Alchemy learning); (3) weight
learning and inference with DeepDive. We used Alchemy 1.0, Tuffy-0.3 and
DeepDive-0.6.0 on a computer with 24 Intel Xeon CPUs at 2.4GHz with 145GB
of RAM running Debian 8 (Jessie) in all of our experiments.</p>
      <p>As you can see in Table 1, the execution time of Tuffy and DeepDive is
improved by an order of magnitude compared to Alchemy. The small differences
in F1-score let's suppose that the three approaches are comparable in
performance. We also extract the weights learned by Alchemy and by DeepDive.
The correlation between the two sets of weights is about 0.69, highlighting a
quite high positive linear correlation which can con rm that both systems work
the same way, and that their results can be seen as equivalent.</p>
      <sec id="sec-3-1">
        <title>5 http://deepdive.stanford.edu/ 6 https://twitter.com/HazyResearch</title>
        <p>Learning time</p>
        <p>Inferring time</p>
        <p>F1-Score
Alchemy +3 days 3h 45' 89 %
Tuffy 3'51" 90 %
DeepDive 23" 10" 91 %
Table 1. Execution time and F1-score of different implementations of
statisticorelational models</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Perspectives</title>
      <p>One of the goals of our project is to build a system able to give context
information to arti cial intelligence. As explained in the Section 1, the user activity
is one of the context components.</p>
      <p>
        To do so, our system must be able to infer user activity in real time (the
user must not feel a lag because of computation time) and to adapt itself to
the user, all along its life. Sensor values are coming all along the day, and so
our system must be able to handle on-line classi cation or incremental learning.
DeepDive is designed as an incremental framework, and can execute the next
learning and inferring phases in less time than the one measured in a one shot
test (see Table 1) as shown in its description paper [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ].
      </p>
      <p>Then, we will try to implement a reinforcement learning algorithm,
decreasing weight of irrelevant formulas. This raises different questions, as in which
proportion can we change the weight? Can we change only one weight, or does
the modi cation must impact other weights? How to know which weights to
modify?</p>
      <p>Finally, we would like the user be allowed to add or remove some formulas
without any technical skills. Once these formulas are added to our model, how
can we take them into account? Does our model must be fully re-learned?</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>De Silva</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Morikawa</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Petra</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          :
          <article-title>State of the art of smart homes</article-title>
          .
          <source>Engineering Applications of Arti cial Intelligence</source>
          <volume>25</volume>
          (
          <issue>7</issue>
          ) (
          <year>2012</year>
          )
          <volume>1313</volume>
          {
          <fpage>1321</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Peetoom</surname>
          </string-name>
          ,
          <string-name>
            <surname>K.K.B.</surname>
          </string-name>
          ,
          <string-name>
            <surname>Lexis</surname>
            ,
            <given-names>M.A.S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Joore</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dirksen</surname>
            ,
            <given-names>C.D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>De Witte</surname>
            ,
            <given-names>L.P.</given-names>
          </string-name>
          :
          <article-title>Literature review on monitoring technologies and their outcomes in independently living elderly people</article-title>
          .
          <source>Disability and Rehabilitation: Assistive Technology</source>
          (
          <year>2014</year>
          )
          <volume>1</volume>
          {
          <fpage>24</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Dey</surname>
            ,
            <given-names>A.K.</given-names>
          </string-name>
          :
          <article-title>Understanding and using context</article-title>
          .
          <source>Personal Ubiquitous Comput</source>
          .
          <volume>5</volume>
          (
          <issue>1</issue>
          ) (
          <year>January 2001</year>
          )
          <volume>4</volume>
          {
          <fpage>7</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Coutaz</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Crowley</surname>
            ,
            <given-names>J.L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dobson</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Garlan</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Context is key</article-title>
          .
          <source>Communications of the ACM</source>
          <volume>48</volume>
          (
          <issue>3</issue>
          ) (
          <year>2005</year>
          )
          <volume>49</volume>
          {
          <fpage>53</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Chahuara</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fleury</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Portet</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vacher</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>On-line human activity recognition from audio and home automation sensors: comparison of sequential and non-sequential models in realistic smart homes</article-title>
          .
          <source>Journal of Ambient Intelligence and Smart</source>
          Environments (Accepted Paper)
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Skillen</surname>
            ,
            <given-names>K.L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chen</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nugent</surname>
            ,
            <given-names>C.D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Donnelly</surname>
            ,
            <given-names>M.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Burns</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Solheim</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          :
          <article-title>Ontological user modelling and semantic rule-based reasoning for personalisation of help-on-demand services in pervasive environments</article-title>
          .
          <source>Future Generation Computer Systems</source>
          <volume>34</volume>
          (
          <issue>0</issue>
          ) (
          <year>2014</year>
          )
          <volume>97</volume>
          { 109 Special Section:
          <article-title>Distributed Solutions for Ubiquitous Computing</article-title>
          and
          <string-name>
            <given-names>Ambient</given-names>
            <surname>Intelligence</surname>
          </string-name>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Cook</surname>
            ,
            <given-names>D.J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Crandall</surname>
            ,
            <given-names>A.S.</given-names>
          </string-name>
          , L.,
          <string-name>
            <surname>T</surname>
          </string-name>
          .B.,
          <string-name>
            <surname>C.</surname>
            ,
            <given-names>K.N.</given-names>
          </string-name>
          :
          <article-title>Casas: A smart home in a box</article-title>
          .
          <source>IEEE Computer 46(6)</source>
          (
          <year>2013</year>
          )
          <volume>26</volume>
          {
          <fpage>33</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Domingos</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kok</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Poon</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Richardson</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Singla</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          :
          <article-title>Unifying logical and statistical ai</article-title>
          .
          <source>In: Proceedings of the Twenty-First National Conference on Arti cial Intelligence</source>
          , AAAI Press (
          <year>2006</year>
          ) 2{
          <fpage>7</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Niu</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Re</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Doan</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shavlik</surname>
            ,
            <given-names>J.W.</given-names>
          </string-name>
          :
          <article-title>Tuffy: Scaling up statistical inference in markov logic networks using an rdbms</article-title>
          .
          <source>PVLDB</source>
          <volume>4</volume>
          (
          <issue>6</issue>
          ) (
          <year>2011</year>
          )
          <volume>373</volume>
          {
          <fpage>384</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Wu</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          , Zhang,
          <string-name>
            <given-names>C.</given-names>
            ,
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            ,
            <surname>Re</surname>
          </string-name>
          ,
          <string-name>
            <surname>C.</surname>
          </string-name>
          :
          <article-title>Incremental knowledge base construction using deepdive</article-title>
          .
          <source>CoRR abs/1502</source>
          .00731 (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Loeliger</surname>
            ,
            <given-names>H.A.</given-names>
          </string-name>
          :
          <article-title>An introduction to factor graphs</article-title>
          .
          <source>Signal Processing Magazine</source>
          , IEEE
          <volume>21</volume>
          (
          <issue>1</issue>
          ) (
          <year>Jan 2004</year>
          )
          <volume>28</volume>
          {
          <fpage>41</fpage>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>