<!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>Matching Networks for Personalised Human Activity Recognition</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Sadiq Sani</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Nirmalie Wiratunga</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Stewart Massie</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Kay Cooper</string-name>
          <email>k.cooperg@rgu.ac.uk</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>School of Computing Science and Digital Media</institution>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>School of Health Sciences, Robert Gordon University</institution>
          ,
          <addr-line>Aberdeen AB10 7GJ, Scotland</addr-line>
          ,
          <country country="UK">UK</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Human Activity Recognition (HAR) has many important applications in health care which include management of chronic conditions and patient rehabilitation. An important consideration when training HAR models is whether to use training data from a general population (subject-independent), or personalised training data from the target user (subject-dependent). Previous evaluations have shown personalised training to be more accurate because of the ability of resulting models to better capture individual users' activity patterns. However, collecting su cient training data from end users may not be feasible for real-world applications. In this paper, we introduce a novel approach to personalised HAR using a neural network architecture called a matching network. Matching networks perform nearest-neighbour classi cation by reusing the class label of the most similar instances in a provided support set. Evaluations show our approach to substantially out perform general subject-independent models by more than 5% macro-averaged F1 score.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        Automatic recognition and tracking of human activity using wearable sensors
is increasingly being adopted for health care applications e.g. management of
chronic low back pain in SelfBACK 1 [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. An important consideration for
HAR applications is classi er training, where training examples can either be
acquired from a general population (subject-independent), or from the target user
of the system (subject-dependent). Previous works have shown using
subjectdependent data to result in superior performance [
        <xref ref-type="bibr" rid="ref2 ref3 ref5 ref6">5, 2, 3, 6</xref>
        ]. The relatively poorer
performance of subject-independent models can be attributed to variations in
activity patterns, gait or posture between di erent individuals [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. However,
training a classi er exclusively with user provided data is not practical in a
real-world con guration as this places signi cant burden on the user to provide
su cient amounts of training data required to build a personalised model.
      </p>
      <p>1The SelfBACK project is funded by European Union's H2020 research and
innovation programme under grant agreement No. 689043.</p>
      <p>
        In this paper, we introduce an approach to personalised HAR using matching
networks. Matching Networks are a type of neural network architecture
introduced for the task of one-shot learning [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] which is a scenario where an algorithm
is trained to recognise a new class from just a few examples of that class. Given
a (typically small) support set of labelled examples, matching networks are able
to classify an unlabelled example by reusing the class labels of the most similar
examples in the support set. At the same time, because classi cation is only
conditioned on the support set, matching networks behave like non-parametric
models and can reason with any set of examples that are provided at runtime,
without the need for retraining the network. This makes our system potentially
able to continuously adapt to changes in the user's context.
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Personalised HAR using Matching Networks</title>
      <p>The aim of matching networks is to learn a model that maps an unlabelled
example x^ to a class label y^ using a small support set S of labelled examples.
This is illustrated in Figure 1. Given a set of instances X = fxg and a set of class
labels L = fyg, an embedding function f which in this case a neural network
parameterised by , the function a is an attention mechanism that takes the
embedded representation of a test instance x^ and a support set S and returns a
probability distribution P (yjx^; S) over class labels y of instances in S. To train
the matching network for personalised HAR, we also de ne a set of users U
where each user uj 2 U is comprised of a set of labelled examples as follows:
Next we de ne a set of training instances Tj for each user uj as follows:</p>
      <p>Tj = f(Sj ; Bj )gl
i.e., Tj is made up of user-speci c support and target set pairs Sj and Bj
respectively, where Sj = f(x; y)jx 2 ui; y 2 Lg and Bj = f(x; y)jx 2 uj ; x 62
Sj g. Note that the set of labels in Sj is always equivalent to L because we are
interested in learning a classi er over the entire set of activity labels. Accordingly,
Sj contains m examples for each class y 2 L and the cardinality of Sj is jSj j =
m jLj. Both Sj and Bj are sampled at random from uj l times to create Tj .
Each Bj is used with it's respective Sj by classifying each instance in Bj using
Sj and computing loss using categorical cross entropy. The network is trained
using stochastic gradient descent and back propagation.
(1)
(2)
3</p>
    </sec>
    <sec id="sec-3">
      <title>Evaluation</title>
      <p>Evaluation is conducted on a dataset of 50 users with 9 activity classes (Standing,
Sitting, Lying, Walking Slow, Walking Normal, Walking Fast, Up Stairs, Down
Stairs) where each user performs each activity for about 3 minutes. We adopt a
hold-out validation strategy where 8 out of the 50 users are randomly selected
for testing. To simulate user provided samples for creating personalised support
sets, we hold out the rst 30 seconds of each test user's data for creating the
support set. This leaves approximately 150 seconds of data per activity which
are used for testing, Performance is reported using macro-averaged F1 score.</p>
      <p>In the evaluation, we explore the performance of our matching network
against a number of baseline approaches. Accordingly we compare the following
algorithms:
{ kNN: Nearest-neighbour classi er trained on the entire training set
{ SVM: Support Vector Machines trained on the entire training set
{ MLP: A Feed-forward neural network trained on the entire training
{ MNet: Our personalised matching network approach
All algorithms use 5-second window sizes for signal partitioning and discrete
cosine transform for feature representation.
performs both SVM and MLP by more than 5% which shows the e ectiveness of
our matching network approach at exploiting personal data for activity
recognition.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Conclusion</title>
      <p>In this paper, we presented a novel approach for personalised HAR using
matching networks. There are two main advantages to the approach we presented.
Firstly, our approach is able to achieve high accuracy using only a small set of
user provided examples (30 seconds in this work) which makes it more practical
for real-world applications compared to subject-dependent training which
requires the end user to provide large amounts (possible hours) of labelled training
data. Secondly, our approach does not require retraining the model at runtime
when new data becomes available which makes it very adaptable.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Bach</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Szczepanski</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Aamodt</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gundersen</surname>
            ,
            <given-names>O.E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mork</surname>
            ,
            <given-names>P.J.</given-names>
          </string-name>
          :
          <article-title>Case representation and similarity assessment in the selfback decision support system</article-title>
          .
          <source>In: Proceedings of 24th International Conference on Case-Based Reasoning</source>
          . pp.
          <volume>32</volume>
          {
          <fpage>46</fpage>
          . Springer International Publishing (
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Berchtold</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Budde</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gordon</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schmidtke</surname>
            ,
            <given-names>H.R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Beigl</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          : Actiserv:
          <article-title>Activity recognition service for mobile phones</article-title>
          .
          <source>In: Proceedings of International Symposium on Wearable Computers</source>
          . pp.
          <volume>1</volume>
          {
          <issue>8</issue>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Jatoba</surname>
            ,
            <given-names>L.C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Grossmann</surname>
            ,
            <given-names>U.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kunze</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ottenbacher</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Stork</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          :
          <article-title>Context-aware mobile health monitoring: Evaluation of di erent pattern recognition methods for classi cation of physical activity</article-title>
          .
          <source>In: Proceedings of 30th Annual International Conference of the IEEE Engineering in Medicine and Biology Society</source>
          . pp.
          <volume>5250</volume>
          {
          <issue>5253</issue>
          (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Longsta</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Reddy</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Estrin</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Improving activity classi cation for health applications on mobile devices using active and semi-supervised learning</article-title>
          .
          <source>In: Proceedings of 4th International Conference on Pervasive Computing Technologies for Healthcare</source>
          . pp.
          <volume>1</volume>
          {
          <issue>7</issue>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Sani</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wiratunga</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Massie</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cooper</surname>
          </string-name>
          , K.:
          <article-title>knn sampling for personalised human activity recognition</article-title>
          .
          <source>In: Proceedings of International Conference on CaseBased Reasoning</source>
          . pp.
          <volume>330</volume>
          {
          <fpage>344</fpage>
          . Springer (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Tapia</surname>
            ,
            <given-names>E.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Intille</surname>
            ,
            <given-names>S.S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Haskell</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Larson</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wright</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>King</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Friedman</surname>
          </string-name>
          , R.:
          <article-title>Real-time recognition of physical activities and their intensities using wireless accelerometers and a heart rate monitor</article-title>
          .
          <source>In: Proceedings of 11th IEEE International Symposium on Wearable Computers</source>
          . pp.
          <volume>37</volume>
          {
          <fpage>40</fpage>
          .
          <string-name>
            <surname>IEEE</surname>
          </string-name>
          (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Vinyals</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Blundell</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lillicrap</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wierstra</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Matching networks for one shot learning</article-title>
          .
          <source>In: Proceedigns of Advances in Neural Information Processing Systems</source>
          . pp.
          <volume>3630</volume>
          {
          <issue>3638</issue>
          (
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>