<!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>Quantifying Attention in Computer-based Tasks</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Davide Carneiro</string-name>
          <email>dcarneiro@di.uminho.pt</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Dalila Durªes</string-name>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Javier Bajo</string-name>
          <email>jbajo@fi.upm.es</email>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Paulo Novais</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Algoritmi Center/Department of Informatics, Minho University Braga</institution>
          ,
          <country country="PT">Portugal</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>CIICESI, ESTG, Polytechnic Institute of Porto Felgueiras</institution>
          ,
          <country country="PT">Portugal</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Department of Articial Intelligence, Technical University of Madrid</institution>
          ,
          <addr-line>Madrid</addr-line>
          ,
          <country country="ES">Spain</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Attention-to-task is one of the most important Human cognitive abilities, allowing an individual to selectively focus on a specic issue (among many possible sources) and eectively carry out a task. Without this ability to focus, the individual would constantly switch between stimuli, hardly concluding any task. While attention can be inuenced by many internal and external factors, the purpose of this paper is not to analyse them but rather to propose an approach to monitor the attentional behaviour of computer users. The proposed approach may improve the individual's self-awareness as well as the team manager's knowledge about the state of the workforce. It may thus improve the denition of better attention-management strategies, with expected improvements in variables such as on-task behaviour, productivity or work quality.</p>
      </abstract>
      <kwd-group>
        <kwd>Human-Computer Interaction</kwd>
        <kwd>Keystroke Dynamics</kwd>
        <kwd>Mouse Dynamics</kwd>
        <kwd>Attention</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Nowadays, working, as well as many other activities (e.g. education) take place
wholly or partially at the computer. This represents a major shift that took place
in the span of a few years, but that denitely changed our relationship with the
workplace or the classroom.</p>
      <p>
        This new way of working or studying has, therefore, new characteristics that
can represent, at the same time, challenges and opportunities. On the one hand,
working for long hours at the computer may have a negative impact in the
individual’s health, namely due to the lack of physical exercise. For the same reason,
these jobs also tend to be considered as more boring when compared to
traditional more physical and active ones [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Asides from other aspects, this means
that these jobs may cause a certain lethargy, fatigue or sleepiness, especially
when carried out for long hours [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
      </p>
      <p>One of the common ways of countering these negative eects is to advise
people to make breaks and pauses at regular intervals, taking small walks or
simply exiting the working space for a while, as a way to activate the mind and
the body. However, this is done either at rigid intervals (e.g. every hour) or left
at the responsibility of the individual.</p>
      <p>The rst approach has the drawback that we are not all equal: while one
individual may maintain performance even after working for some hours straight,
another may feel bored after an hour. Moreover, the same individual may
behave dierently in dierent days, depending on factors such as motivation, task
characteristics, time of the day, and many other internal and external factors.</p>
      <p>The latter approach may also have drawbacks. Namely, the notion of
attention is a rather subjective one and dependent on the individual’s interpretation.
Moreover, despite the individual’s state, she/he may continue working because
there are deadlines to meet.</p>
      <p>
        In all these situations, the main problem is the lack of an eective
measure of attention [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], that can objectively quantify this concept. The denition
and quantication of such a measure is the key element in this paper, provided
through real-time analytics [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. It is especially suited for milieus where people
work with the computer for long periods of time (e.g. software houses, banking,
call centres, academia). It is designed with the purpose to provide team
managers or human-resources personnel with important knowledge about how each
individual behaves throughout the day or how each individual reacts to events
(e.g. increased/decreased workload).
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Approach</title>
      <p>The measure of user attention proposed in this paper is based on task
characteristics, keystroke and mouse dynamics, activity level and application usage
tracking.</p>
      <p>Task characteristics are dened by the team manager or responsible and
include, among others, the names of the applications that are related to the task.
These names are dened using an approach close to natural language, which is
then translated to regular expressions. As an example, the team manager can
provide rules such as "Contains ’Microsoft’" or "Starts with ’Adobe’". These
rules are then used by the system to determine which applications are
workrelated, allowing to quantify the time spent interacting with them versus with
others, non-work-related applications.</p>
      <p>
        Keystroke and mouse dynamics include ways to characterize the user’s
interaction with the computer through the mouse and the keyboard. The system
extracts 16 features that include mouse velocity, typing rhythm, distance
travelled by the mouse, writing latency, among others, that fully characterize the
user’s interaction patterns. In previous work we have explored, to a large extent,
how these features relate to worker performance or how they are inuenced by
stress, namely in the academic context [
        <xref ref-type="bibr" rid="ref5 ref6">5, 6</xref>
        ]. In this work, these features are
revisited to dene a way of quantifying the level of activity of the user.
      </p>
      <p>Indeed, the level of activity is a very important factor to consider when
analysing attention as it provides the necessary context to interpret the
otherwise poor information regarding attention (i.e. application usage). For instance,
a given user may have a work-related application in foreground but leave the
computer and come back after an hour. This does not mean that the user was
devoted to the task for that hour since the application was focused but there
was no interaction going on. This approach allows to point out these situations
as well as to provide a level of activity. All in all, it improves the accuracy of the
quantication of attention.</p>
      <p>Finally, application usage tracking considers the analysis of how users spend
their time at the computer. The developed system tracks changes in the active
application, recording its name and the time at which the change took place.
This allows to quantify the amount spent interacting with each application, in
a given period of time. The knowledge about task characteristics allows thus
to infer how much time was spent interacting with work-related applications.
Moreover, it also allows to infer other behaviours such as listening to music while
working or to identify moments in which the worker is no longer producing or
has completely abandoned the task.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Architecture</title>
      <p>In order to implement this approach, a system was developed with an
architecture as described in Figure 1. It is divided in three major components. The
raw data is generated in the devices, then pre-processed (by redundancy
elimination) and stored locally whenever possible (as in personal computers) in a SQLite
database. Then data is synchronized with the web servers in the cloud. The
target database is MongoDB (object-oriented DB). MongoDB 4 is a database that
is half way between relational and non-relational systems. It provides indexes on
collections, it is lockless and provides a query mechanism. MongoDB provides
atomic operations on elds like relational systems MongoDB supports automatic
sharding by distributing the load across many nodes with automatic failover and
load balancing, on the other hand CouchDB achieves scalability through
asynchronous replication. MongoDB supports replication with automatic failover and
recovery. The data is stored in a binary JSON-like format called BSON that
supports boolean, integer, oat, date, string and binary types. The communication
is made over a socket connection (in CouchDB it is made over an HTTP REST
interface).</p>
      <p>One of the most interesting applications of this system is to monitor student’s
attention in the classroom. In fact, this system has been in the past year in
the Caldas das Taipas Higher School, located in northern Portugal. Dierent
classes, with dierent characteristics, are being continuously followed throughout
the year. This vast data-collection will allow teachers to assess the inuence on
attention of aspects such as the time of the day, breaks, classes’ contents, classes’
objectives, and learning styles. The aim is that with this knowledge, teachers
are able to improve their teaching strategies, adapting them to improve student
attention.
4 https://www.mongodb.com</p>
      <p>As an example, we briey analyse the data collected for two dierent classes:
a bells-letters class (12F) and a vocational class (12I). Both classes took place
at the same time but in dierent rooms and the contents and aims of each class
were the same: an application to teach algorithmic concepts. The teacher dened
the applications that were necessary to carry out the task as those containing
the strings "code.org" and "Microsoft Word".</p>
      <p>The Visualization layer provides intuitive ways for the team manager (in this
case the teacher) to assess the behavioural dierences between these two classes.
Figure 2 shows the evolution of the general attention of each class, calculated
through the running average (bells-letters class (a) and vocational class (b)). It
is possible to conclude that attention in the bells-letters class is generally higher
but with a tendency to decrease while in the vocational class it starts relatively
lower but with a tendency to increase over time. The teacher may have access
to this information in real time or after the class takes place. In either case, the
teacher may interpret this knowledge in its proper context (e.g. characteristics
of the group of students, aims of each course, etc.) and look for ways to improve
student attention.</p>
      <p>The system also provides easy access to information regarding the level of
activity of the users, which quanties the degree of interaction between the
user and the computer. For example, Figure 3, which considers the same data
described before, shows that the general level of activity is higher in the
bellsletters class (12F) than in the vocational class (12I), as evidenced by a faster
use of the mouse.</p>
      <p>With this kind of information, the teacher is able to better understand
students, and perceive not only which students or groups of students are more
attentive to tasks but also, and perhaps more important, which tasks are more
motivating and engaging, allowing to better steer classes in the future.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Conclusions</title>
      <p>Concluding, the proposed system is able to quantify the level of attention of a
group of people, in real time. Moreover, it also measures the level of activity
using keystroke and mouse dynamics, through features such as mouse velocity,
keyboard typing speed, among others. This, together with information about
the task (e.g. required applications) allows to quantify the actual attention of
each computer user to the current task, in real-time. Such information can
signicantly improve existing approaches, by providing an accurate measure based
on which better decisions can be taken to manage attention.</p>
      <p>When compared to existing approaches, the main advantage of this system
is that it is not based on productivity measures, i.e., it is not based on how
much the worker is producing but rather on how the worker is producing. This
is an advantage as productivity-based initiatives often have a negative impact
on productivity that stems from the added pressure on the worker. Moreover,
user privacy is protected by masking sensitive information such as the keys
pressed or the specic applications used. That is, the team manager has only
access to the compiled data and not to the raw data. For these reasons, we
believe that this approach may constitute an eective and interesting approach
to implement attention monitoring initiatives, in milieus such as the workplace
or the classroom.</p>
    </sec>
    <sec id="sec-5">
      <title>Acknowledgement</title>
      <p>This work has been supported by COMPETE: POCI-01-0145-FEDER-007043
and FCT Fundaªo para a CiŒncia e Tecnologia within the Project Scope:
UID/CEC/00319/2013.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Kuppermann</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lubeck</surname>
            ,
            <given-names>D.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mazonson</surname>
            ,
            <given-names>P.D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Patrick</surname>
            ,
            <given-names>D.L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Stewart</surname>
            ,
            <given-names>A.L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Buesching</surname>
            ,
            <given-names>D.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Filer</surname>
            ,
            <given-names>S.K.</given-names>
          </string-name>
          :
          <article-title>Sleep problems and their correlates in a working population</article-title>
          .
          <source>Journal of General Internal Medicine</source>
          <volume>10</volume>
          (
          <issue>1</issue>
          ) (
          <year>1995</year>
          )
          <fpage>2532</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Black</surname>
          </string-name>
          ,
          <string-name>
            <surname>C.D.</surname>
            ,
            <given-names>O</given-names>
          </string-name>
          <string-name>
            <surname>'Connor</surname>
            ,
            <given-names>P.J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>McCully</surname>
            ,
            <given-names>K.K.</given-names>
          </string-name>
          :
          <article-title>Increased daily physical activity and fatigue symptoms in chronic fatigue syndrome</article-title>
          .
          <source>Dynamic Medicine</source>
          <volume>4</volume>
          (
          <issue>1</issue>
          ) (
          <year>2005</year>
          )
          <fpage>1</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Treisman</surname>
            ,
            <given-names>A.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gelade</surname>
          </string-name>
          , G.:
          <article-title>A feature-integration theory of attention</article-title>
          .
          <source>Cognitive psychology 12(1)</source>
          (
          <year>1980</year>
          )
          <fpage>97136</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Kejariwal</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kulkarni</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ramasamy</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Real time analytics: algorithms and systems</article-title>
          .
          <source>Proceedings of the VLDB Endowment</source>
          <volume>8</volume>
          (
          <issue>12</issue>
          ) (
          <year>2015</year>
          )
          <fpage>20402041</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Carneiro</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Castillo</surname>
            ,
            <given-names>J.C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Novais</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>FernÆndez-Caballero</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Neves</surname>
          </string-name>
          , J.:
          <article-title>Multimodal behavioral analysis for non-invasive stress detection</article-title>
          .
          <source>Expert Systems with Applications</source>
          <volume>39</volume>
          (
          <issue>18</issue>
          ) (
          <year>2012</year>
          )
          <fpage>1337613389</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Pimenta</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Carneiro</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Novais</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Neves</surname>
          </string-name>
          , J.:
          <article-title>Monitoring mental fatigue through the analysis of keyboard and mouse interaction patterns</article-title>
          .
          <source>In: Hybrid Articial Intelligent Systems</source>
          . Springer (
          <year>2013</year>
          )
          <fpage>222231</fpage>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>