<!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>Patterns of Confusion: Using Mouse Logs to Predict User's Emotional State</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Avar Pentel</string-name>
          <email>pentel@tlu.ee</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Tallinn University, Institute of Informatics</institution>
          ,
          <addr-line>Tallinn</addr-line>
          ,
          <country country="EE">Estonia</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>This paper describes an unobtrusive method for user confusion detection by monitoring mouse movements. A special computer game was designed to collect mouse logs. Users' self-reports and statistical measures were used in order to identify the states of confusion. Mouse movement's rate, full path length to shortest path length ratio, changes in directions and speed were used as features in the training dataset. Support Vector Machines, Logistic Regression, C4.5 and Random Forest were used to build classification models. Models generated by Support Vector Machine yield to best classification results with fscore 0.946.</p>
      </abstract>
      <kwd-group>
        <kwd>confusion detection</kwd>
        <kwd>behavioral biometrics</kwd>
        <kwd>mouse dynamics</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        The ability to recognize, interpret and express emotions plays a key role in human
communication and increasingly in HCI. In the context of learning systems, the
ability to detect user emotional states, gives promising applications to adaptive
recommendations, adaptive interfaces, etc. Usually special equipment is used for emotion
detection: electroencephalogram, skin conductance, blood volume pressure [
        <xref ref-type="bibr" rid="ref1 ref2">1,2</xref>
        ] or
gaze and facial data [
        <xref ref-type="bibr" rid="ref3 ref4">3,4</xref>
        ]. But when it goes to real life application, we can relay no
more, than unobtrusive standard computer inputs like mouse or keyboard.
      </p>
      <p>
        The theory of “embodied cognition” [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] gives a theoretical framework studying
mouse movements in order to predict mental states. Barsalou suggests that this
bidirectional relationship between mental states and bodily states emerges because the
core of social and cognitive information processing lies in the simulation of original
information [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. There are some studies [
        <xref ref-type="bibr" rid="ref10 ref7 ref8 ref9">7,8,9,10</xref>
        ] about mouse movement and
emotions, which all suggest a link between mouse movement and emotions. Yet, most of
these studies are conducted with relatively small samples. Secondly, all these studies
are dependent on the specific context of an experiment, and general link between
emotions and mouse movements is not investigated.
      </p>
      <p>In the current study, we aim to find a link between confusion and mouse
movements and try to avoid both of previously mentioned shortcomings by using larger
sample, and avoiding specific context in our experiment.</p>
    </sec>
    <sec id="sec-2">
      <title>Methodology</title>
      <sec id="sec-2-1">
        <title>Data Collection Procedure and Sample</title>
        <p>A simple computer game was built to collect user mouse data. The idea of the game
come from Christmas Calendar chocolate boxes, where the chocolates are hidden
behind numbered doors. There are usually numbers from 1 to 24, and in order to make
the right door harder to find, numbers are randomly arranged and they look
differently. Similarly, we designed a game, which fills screen with randomly arranged
buttons labeled with numbers 1 to 24. All buttons are different size and color (Fig.1).
User task is to click on all buttons in the right order as fast as possible. To keep up the
motivation, the game was installed in school computer class as a part of login system,
i.e. in order to log in users were forced to play this game. There was also an option to
play it many times. It was also publicly announced, that best performers would be
awarded. For every game session mouse activity (movements and clicks) was logged.</p>
        <p>
          Our logging procedure was an event based, which means that mouse position was
not recorded in fixed interval, but only if difference in position of mouse occurred. In
our case this difference of position was set to 30 pixels. Our mouse logs consisted
triples of x and y coordinates and timestamp. We recorded data from 516 game
sessions played by 262 individual users. As each game session consisted of 24 searching
tasks (to find next number), we had all together 12384 comparable records, each of
them presenting mouse movement logs between two button clicks.
We also interviewed selected participants (N = 44) right after the game. Reviewing
together the whole game session again, we asked to describe the emotions during the
game. Initially we asked users to position his/her emotions on Russell’s circular
model [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ], but pre testing revealed, that in the current set of the experiment, users
were only able to describe two categories of emotions - the state of confusion and the
state of content. Therefore we continued to collect self-report data on a 7 point Likert
scale where 1 = content, and 7 = confused. While users were not able to specify the
exact time when the state of confusion began or end, we divided the game session to
24 separate searching tasks, and linked those emotion feedback data to a whole task.
All together we got 44 x 24 = 1056 tasks labeled with emotion data.
        </p>
        <p>It is intuitively clear, that in such circumstances, confusion and target finding speed
are related. While target finding speed differs individually, all these finding scores
were standardized session-wise, and then Pearson correlation with confusion
selfreport data were found. As expected, there was significant correlation between
confusion and standardized finding time (r = 0.86). Also, all tasks associated with
confusion, had standardized finding speed half standard deviation below the mean, and
those associated with a feeling of content, half standard deviations above the mean.
While our interviews covered only less than 10% of all game sessions, we extended
this relation to all other game sessions too.</p>
        <p>We suppose, that very quick results may not include confusion at all, i.e. user is
aware from the beginning about the location of the target. But in order to minimize
possible confusion, which may be present in the beginning of each task, we divided
finding time to the half and used only the last half of log data as characterizing
nonconfusion. Similarly, it is obvious, that in tasks that were characterized as confusing,
the state of confusion does not cover the whole time between two button clicks.
Obviously, confusion must end in some moment, when user notices the next button. It is
reasonable to suppose that confusion ends somewhere in the second half of the
searching process. Therefore, we split each of these slower result logs to the half and
used only the first half of searching task as characterization of confusion (Fig. 2.).</p>
        <p>Out of these two subsets we excluded repeated sessions by the same users, and
extreme results. From the remaining data we created balanced training dataset of 2282
records.
2.3</p>
      </sec>
      <sec id="sec-2-2">
        <title>Features</title>
        <p>In the current study, we extracted 33 features based on distance, speed, direction and
direction change angles (Table 1.). Feature selection procedure with Chi Squared
attribute evaluation and SVM attribute evaluation revealed, that strongest features
were those of speed based and those of based on relations of shortest distance and
actual distance. Best models with those attributes yield to F-score 0.96 width SVM
and Logistic regression.</p>
        <p>Actual mouse path length between two button clicks divided by task
completion time.</p>
        <p>Actual mouse path length between two button clicks divided by shortest path,
and then divided by task completion time.</p>
        <p>Number of mouse movements in particular direction. We divided movement
directions to 8 distinctive segments as north, northeast, east, etc. We counted
all movements in particular direction segment, and divided to all movements.</p>
        <p>Mouse movements’ path was recorded as consecutive straight lines of 30px
length. We measured each angle between two consecutive movements and
extracted 18 features representing turns from 0 to 180 degrees by 10-degree
step. Counted results were normalized by whole number of movements.</p>
        <p>All turns greater than angle A (A counted by 45-degree step).
* Excluded in training feature set of the models titled as “target unknown” in Table 2.
** Excluded in all training feature sets.</p>
        <p>For our final model we had to exclude features that were related to speed, because
speed was previously used by us for associating tasks with emotional states. Without
speed related features, models F-score dropped from 0.96 to 0.946.</p>
        <p>As our goal was to identify confusion patterns without knowing the real target, we
also excluded the feature that was calculated by using information about shortest
distance. All reminded features were based on movement direction and direction
changes. Direction based features were number of movements on specific direction
divided by mouse path length. Direction changes were measured as the angle between
previous and next movement. Within these features strongest features were direction
changes closer to 180 degrees, more than 135 degrees and between 160 and 170
degrees.
2.4</p>
      </sec>
      <sec id="sec-2-3">
        <title>Machine Learning Algorithms and Technology</title>
        <p>
          For classification we tested four popular machine-learning algorithms: Logistic
regression, Support Vector Machine, Random Forest, and C4.5. Motivation of choosing
those algorithms is based on literature [
          <xref ref-type="bibr" rid="ref12 ref13">12,13</xref>
          ]. The suitability of listed algorithms for
given data types and for given binary classification task was also taken in to account.
In our task we used Java implementations of listed algorithms that are available in
freeware data analysis package Weka [
          <xref ref-type="bibr" rid="ref14">14</xref>
          ].
        </p>
        <p>For evaluation, we used 10 fold cross validation. We partitioned our data into 10
even sized and random parts, and then using one part for validation and another 9 as
training dataset. We did so 10 times and then averaged validation results.
3</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Results</title>
      <p>As mentioned before, when excluding all speed-based features, our SVM model
with standardized data yield to F-score 0.946. When excluding all distance-based
features, results dropped considerably, but all our classifiers still yield to F-scores
over 0.8. In following table (Table 2.) are presented results of different classifiers
generated with features that are calculated using data about known target (i.e. the
shortest path) and without these features.
Simple feature set of directions, direction changes and relations between actual and
shortest distance proved to be useful in classification confused and non-confused user.
As we can see from Table 1, knowing the target makes predictions better, but even
without knowing the target, frequent direction changes in mouse movement, are still
good predictors of confusion. This might be an indirect confirmation to studies about
the correlation between gaze and mouse movements.</p>
      <p>However, we have to address the limitations of such set of experiment. Depending
on the tasks and page layout, user mouse movements might differ considerably. Our
results are applicable in situations, where users have to find something particular on
unfamiliar (web) environment, in set of menus, links or graphical elements. But our
approach might not work in web page considered for reading. For example, while
somebody is used to fallow line with mouse cursor while reading the text, the mouse
logs will show frequent changes in directions, which in by our model will predict
confusion. Therefore more study is needed in different types of environments.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>G.</given-names>
            <surname>Chanel</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Kronegg</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Grandjean</surname>
          </string-name>
          , and T. Pun, “
          <article-title>Emotion Assessment : Arousal Evaluation Using EEG's and Peripheral Physiological Signals,”</article-title>
          <source>in Proc. Int. Workshop on Multimedia Content Representation, Classification and Security</source>
          , pp.
          <fpage>530</fpage>
          -
          <lpage>537</lpage>
          (
          <year>2006</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>E.</given-names>
            <surname>Leon</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Clarke</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Callaghan</surname>
          </string-name>
          , and
          <string-name>
            <given-names>F.</given-names>
            <surname>Sepulveda</surname>
          </string-name>
          , “
          <article-title>A user-independent real-time emotion recognition system for software agents in domestic environments</article-title>
          ,
          <source>” Engineering Applications of Artificial Intelligence</source>
          , vol.
          <volume>20</volume>
          , no.
          <issue>3</issue>
          , pp.
          <fpage>337</fpage>
          -
          <lpage>345</lpage>
          (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Happy</surname>
            ,
            <given-names>S.L.</given-names>
          </string-name>
          et al.
          <source>Automated Alertness and Emotion Detection for Empathic Feedback During E-Learning, IEEE Digital Library</source>
          (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Jaques</surname>
          </string-name>
          , N. et al.
          <article-title>Predicting Affect from Gaze Data during Interaction with an Intelligent Tutoring System</article-title>
          ,
          <source>Lecture Notes in Computer Science</source>
          Volume
          <volume>8474</volume>
          , pp
          <fpage>29</fpage>
          -
          <lpage>38</lpage>
          (
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>P. M. Niedenthal</surname>
          </string-name>
          ,
          <article-title>"Embodying emotion,"</article-title>
          <source>Science</source>
          , vol.
          <volume>316</volume>
          , pp.
          <fpage>1002</fpage>
          -
          <lpage>1005</lpage>
          , (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>L. W.</given-names>
            <surname>Barsalou</surname>
          </string-name>
          ,
          <article-title>"Grounded cognition,"</article-title>
          <source>Annual Review of Psychology</source>
          , vol.
          <volume>59</volume>
          , pp.
          <fpage>617</fpage>
          -
          <lpage>645</lpage>
          , (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>J.</given-names>
            <surname>Scheirer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Fernandez</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Klein</surname>
          </string-name>
          , and
          <string-name>
            <given-names>R. W.</given-names>
            <surname>Picard</surname>
          </string-name>
          ,
          <article-title>"Frustrating the user on purpose: a step toward building an affective computer," Interacting with computers</article-title>
          , vol.
          <volume>14</volume>
          , pp.
          <fpage>93</fpage>
          -
          <lpage>118</lpage>
          , (
          <year>2002</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Zimmermann</surname>
            ,
            <given-names>P. S.</given-names>
          </string-name>
          <string-name>
            <surname>Guttormsen</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          <string-name>
            <surname>Danuser</surname>
            , and
            <given-names>P.</given-names>
          </string-name>
          <string-name>
            <surname>Gomez</surname>
          </string-name>
          ,
          <article-title>"Affective computing - a rationale for measuring mood with mouse and keyboard,"</article-title>
          <source>International journal of occupational safety and ergonomics</source>
          , vol.
          <volume>9</volume>
          , pp.
          <fpage>539</fpage>
          -
          <lpage>551</lpage>
          , (
          <year>2003</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Zimmermann</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          <article-title>"Beyond Usability-Measuring Aspects of User Experience,"</article-title>
          <source>Doctoral Thesis</source>
          (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Maehr</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          <article-title>eMotion: Estimation of User's Emotional State by Mouse Motions: VDM Verlag, (</article-title>
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Russell</surname>
            ,
            <given-names>J. A.</given-names>
          </string-name>
          <year>1980</year>
          .
          <article-title>A Circumplex Model of Affect</article-title>
          .
          <source>Journal of Personality and Social Psychology</source>
          . Vol.
          <volume>39</volume>
          , No.
          <volume>6</volume>
          .
          <fpage>1161</fpage>
          -
          <lpage>1178</lpage>
          (
          <year>1980</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Wu</surname>
            ,
            <given-names>X.</given-names>
          </string-name>
          et al.
          <article-title>Top 10 algorithms in data mining</article-title>
          .
          <source>Knowledge and Information Systems</source>
          . vol
          <volume>14</volume>
          ,
          <fpage>1</fpage>
          -
          <lpage>37</lpage>
          . Springer (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Mihaescu</surname>
          </string-name>
          , M. C.
          <article-title>Applied Intelligent Data Analysis: Algorithms for Information Retrieval and Educational Data Mining</article-title>
          , pp.
          <fpage>64</fpage>
          -
          <lpage>111</lpage>
          . Zip publishing, Columbus, Ohio (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Weka</surname>
          </string-name>
          .
          <article-title>Weka 3: Data Mining Software in Java</article-title>
          . Machine Learning Group at the University of Waikato. http://www.cs.waikato.ac.nz/ml/weka/
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>