<!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>
      <journal-title-group>
        <journal-title>Confusion Matrix
Attentive Drowsed</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>with a Portable EEG Sensor and Supervised Machine Learning</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Silvia M. Massa</string-name>
          <email>silviam.massa@unica.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Giovanni Usai</string-name>
          <email>giovanniusai1@hotmail.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Daniele Riboni</string-name>
          <email>riboni@unica.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Dept. of Mathematics and Computer Science, University of Cagliari</institution>
          ,
          <addr-line>Via Ospedale 72, 09124 Cagliari</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Workshop Proce dings</institution>
        </aff>
      </contrib-group>
      <pub-date>
        <year>1094</year>
      </pub-date>
      <volume>286</volume>
      <fpage>0000</fpage>
      <lpage>0002</lpage>
      <abstract>
        <p>For several healthcare applications, it is important to monitor the attention level of people, especially in the fields of rehabilitation and psychology. The recent availability of cheap and portable EEG readers has enabled continuous and unobtrusive acquisition of EEG signals. Those signals may be preprocessed and analysed with machine learning algorithms to estimate the attention level of people without interfering with their current activities. In this paper, we report our experience with attention level estimation using two kinds of devices: an of-the-shelf portable EEG headset, and a more sophisticated Pervasive healthcare, human attention monitoring, EEG sensor data, supervised machine learning CEUR</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        The increasing availability of portable and wearable
sensors, more and more integrated in everyday objects, is
paving the way to a new generation of applications to
support personal health and well-being. Consequently,
impressive research eforts have been devoted to devise
efective techniques for recognizing human activities and
complex behaviors based on those sensor data [
        <xref ref-type="bibr" rid="ref1 ref2 ref3">1, 2, 3</xref>
        ].
      </p>
      <p>
        Interestingly, while a vast amount of healthcare
applications use sensor-based artificial intelligence for
addressing the physical dimension of health, the mental
dimension is less investigated [
        <xref ref-type="bibr" rid="ref4 ref5">4, 5</xref>
        ]. However, a
substantial portion of the world’s population deals with mental
disability. Many people with mental illnesses do not have
equal access to healthcare, education, and employment
opportunities, do not receive specific disability-related
services, and experience exclusion from everyday life
activities. Unfortunately, there is a large amount of diverse
ized solutions. Moreover, the design and implementation
of efective and eficient technologies is a complex and
expensive process involving challenging issues, including
usability and acceptability.
      </p>
      <p>In this paper, we evaluate the use of a cheap and
unobtrusive portable electroencephalography (EEG) sensor
for monitoring the human attention level. Indeed, the
ability to monitor human attention is fundamental for
treating several conditions, including the diagnosis and
nEvelop-O
(D. Riboni)
2.</p>
      <p>
        Material and methods
ing brainwave data on which we have applied the same
feature extraction and classification techniques. The first
dataset, named ‘Image-labeling dataset’, was acquired
using an of-the-shelf portable EEG headset with 4
channels. The second dataset, named ‘Epoc’, was acquired
using a more sophisticated EEG device with data acquired
from 7 channels. We experimented the performance of
machine learning algorithms in distinguishing attentive,
distracted, and drowsed states of the individual based
on EEG signal processing. In our experiments, only the
preprocessing phase of EEG data diverges. Indeed, the
data of the Epoc dataset are raw, so it was necessary
to employ Fast Fourier transform algorithms to extract
Delta, Theta, Alpha and Beta brainwaves. Delta waves
are related to deep sleep, unconsciousness, anesthesia,
and lack of oxygen; Theta waves activity occurs when a
person experiences emotional pressure, unconsciousness,
mental disabilities, which require ad-hoc and personal- In our work, we have considered two datasets
containor deep physical relaxation; Alpha waves are instead vis- Since brainwaves data in the dataset are raw, we
preible when an individual is in a state of consciousness, processed the data by applying the fast Fourier
transstillness, or rest, whereas when one is thinking, blinking form [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] to obtain Delta (0.5-4 Hz), Theta (4-8 Hz), Alpha
or otherwise stimulated, this wave type disappears (al- (8-14 Hz) and Beta (14-30 Hz) brainwaves. The
particpha block); finally, Beta waves is evident when a person ipant’s task consisted of controlling a train using the
thinks or receives sensory stimulation. Microsoft Train simulator program, through simple
keyboard commands, for a minimum duration of 30 minutes.
2.1. Image-labeling dataset At the end of the task, the recording is divided into three
10-minute fragments related to a particular mental state:
‘Attentive’ during the first fragment, ‘Distracted’ during
the second one, and ‘Drowsed’ during the last one.
      </p>
      <p>
        The first dataset, collected by our research group,
considers the attention level of annotators labeling a series
of images. A detailed description of the dataset can be
found in [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. For the EEG data collection, we used the 2.3. Feature extraction
Muse2 headband version 2 of InteraXon1. Muse consists
of 4 electrodes that can collect information on brain ac- The various brainwaves signals were divided into
10tivity with a 256Hz sampling frequency in a non-invasive second long non-overlapping sliding windows. For each
way. The Muse electrodes gather signals from channels window, we calculated 7 features: mean and median,
TP9, AF7, AF8 and TP10. These electrodes are named variance and standard deviation, maximum, minimum,
and positioned according to the International System 10- and diference between maximum and minimum values.
20 [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. We used the mobile application Mind Monitor2 These features are computed for each value of
brainalong with the Muse sensor for receiving the EEG signals. waves Delta, Theta, Alpha, Beta, for each channel. Hence,
For the sake of this work, we collected: we use 112 features for the Image-labeling dataset (4
channels), and 196 features for the Epoc dataset (7 channels).
• The date and time of the recording.
• Brainwaves Delta, Theta, Alpha, Beta [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] for each
sensor.
      </p>
      <sec id="sec-1-1">
        <title>2.4. Classification of human attention level</title>
        <p>
          The brainwave values are absolute band powers, based
on the logarithm of the spectral power density (PSD) of Feature vectors are used to train and test a Random Forest
the EEG data for each channel. These values are calcu- (RF) classifier [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]. In various problems and classification
lated internally by the Mind Monitor application with a domains, including problems with small training datasets,
data rate of 10Hz. RF have often been found among the most accurate
clas
        </p>
        <p>
          The participant’s task was to label indoor images that sifiers. RF and random trees were also successfully used
appeared randomly in a data annotation interface by se- for run-time brain-computer interface applications [
          <xref ref-type="bibr" rid="ref13">13</xref>
          ].
lecting one of the eight buttons with the correct label. The RF randomly selects a subset of the available features
The task took 30 minutes to complete. At the end of to train a decision tree classifier on it; then it repeats the
the task, the ‘Attentive’ and ‘Distracted’ classes were as- process with other subsets of random features to
gensigned to the first 10 and last 10 minutes of the recording, erate many decision trees. The final decision is made
respectively. by combining the results of all decision trees using an
ensemble approach.
        </p>
      </sec>
      <sec id="sec-1-2">
        <title>2.2. Epoc dataset</title>
        <p>
          The second dataset was taken from the work of [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]. For
the EEG data collection, the authors used the Epoc EEG Our technique has been evaluated using two cross
valiheadset 3 with 12 electrodes. The data are collected with a dation approaches. In the first approach, named
subjectsampling rate of 128 Hz. The device was modified to allow specific cross validation, the data of each volunteer was
electrode placement on the frontal and parietal areas of taken into account separately, performing a sequential 5
the scalp. Among the available channels, only O1, O2, P7, fold cross validation on each volunteer’s dataset. In the
P8, AF4, F3, F7, named and positioned according to the second approach, which we name leave-one-person-out
International System 10-20, were used in the presented cross validation, k fold cross validation was carried out,
work, since the other ones gave no insightful information in which each fold corresponds to the data collected by a
for attention monitoring, or were afected by an excessive single volunteer.
level of noise. The results obtained by applying the first cross
validation approach to the Image-labeling dataset are reported
        </p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>3. Experimental evaluation</title>
      <p>1https://choosemuse.com/
2https://mind-monitor.com/
3https://www.emotiv.com/epoc/
Tester 1
Tester 2
Tester 3
Tester 4
Tester 5
Tester 6
Overall
68%
62%
86%
84%
82%
100%
80%</p>
      <p>Attent.</p>
      <p>41
19
Attent.</p>
      <p>47
32
Attent.</p>
      <p>49
5
Attent.</p>
      <p>50
9
Attent.</p>
      <p>48
10
Attent.</p>
      <p>60
0
Attent.</p>
      <p>295
75</p>
      <p>Attent.</p>
      <p>Distracted</p>
      <p>Table 3 and Table 4 report the results of the
subjectspecific approach applied to the Epoc dataset to solve the
attentive/distracted and attentive/drowsed classification
problems, respectively. Finally, Table 5 and Table 6 show
the results obtained by applying the
leave-one-personout approach to the Epoc dataset to solve the same
problems. We can make similar considerations to those made
previously comparing the results of Tables 1 and Table 2,
although in this case, the gap between the results
obtained with the application of the two approaches is less
evident. In particular, in the subject-specific approach,
we have an overall Accuracy of 72% (Table 3) and 86%
(Table 4), compared to an accuracy of 68% (Table 5) and
80%</p>
      <p>Attentive
Drowsed</p>
    </sec>
    <sec id="sec-3">
      <title>4. Discussion and research directions</title>
      <p>Considering the Image-labeling dataset, we can observe
that the average accuracy of distinguishing attentive and
distracted states is 80% when we use a subject-specific
cross validation approach; i.e., when the classifier is
trained on the data of the same individual used for testing.
Unfortunately, when we use a leave-one-person-out cross
validation approach, the accuracy drops to 61%, which is
a rather weak result for a binary classification problem.
With the latter approach, we use more extensive training
data, but those data are acquired from diferent people
than the individual used for testing.</p>
      <p>With the Epoc dataset, we achieved similar results.
Indeed, the average accuracy of distinguishing
attentive and distracted states is 72% when we use a
subjectspecific cross validation approach. With the same
approach, the average accuracy of distinguishing attentive
and drowsed states is 86%. The recognition achieved with
the latter problem is higher, probably because
drowsiness is easier to distinguish from attentiveness with
respect to distraction. Also with this dataset, using a
leaveone-person-out cross validation approach determines
a considerable drop of accuracy; i.e., 68% accuracy in
distinguishing attentive from distracted states, and 80%
accuracy in distinguishing attentive from drowsed states.</p>
      <p>
        These results indicate that our method achieves
relatively high accuracy only when the system is trained with
data acquired from the final user of the system. Training
the system with data acquired from diferent persons
determines a relevant drop in accuracy. This fact
undermines the practical utility of this technique for some
applications, since the system would require an initial
training phase by the user which may be time-expensive
and uncomfortable. This problem may be addressed by
using transfer learning methods explicitly proposed for
EEG data [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ].
      </p>
      <p>Another worth noting finding of our experiment is that
the more sophisticated device used for the Epoc dataset
achieves essentially the same accuracy of the simpler
device used for the Image-labeling dataset. This result
indicates that even an of-the-shelf device may be efective to
support some attention-aware applications. Future work
includes investigating diferent machine learning
algorithms for the classification task, including deep learning
methods, to improve the accuracy of the system, and
feature selection techniques to reduce overfitting.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>J.</given-names>
            <surname>Ye</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Dobson</surname>
          </string-name>
          ,
          <string-name>
            <surname>S. McKeever</surname>
          </string-name>
          ,
          <article-title>Situation identification techniques in pervasive computing: A review, Pervasive and mobile computing 8 (</article-title>
          <year>2012</year>
          )
          <fpage>36</fpage>
          -
          <lpage>66</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>L.</given-names>
            <surname>Chen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Hoey</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C. D.</given-names>
            <surname>Nugent</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D. J.</given-names>
            <surname>Cook</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Yu</surname>
          </string-name>
          ,
          <article-title>Sensor-based activity recognition</article-title>
          ,
          <source>IEEE Transactions on Systems, Man, and Cybernetics</source>
          , Part C (
          <article-title>Applications</article-title>
          and Reviews)
          <volume>42</volume>
          (
          <year>2012</year>
          )
          <fpage>790</fpage>
          -
          <lpage>808</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>F.</given-names>
            <surname>Gerina</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. M.</given-names>
            <surname>Massa</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Moi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Reforgiato</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Riboni</surname>
          </string-name>
          ,
          <article-title>Recognition of cooking activities through air quality sensor data for supporting food journaling</article-title>
          ,
          <source>Hum</source>
          .-centric
          <string-name>
            <surname>Comput</surname>
          </string-name>
          .
          <source>Inf. Sci</source>
          .
          <volume>10</volume>
          (
          <year>2020</year>
          )
          <fpage>1</fpage>
          -
          <lpage>26</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>R.</given-names>
            <surname>Guo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>He</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Gao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Qi</surname>
          </string-name>
          , G. Owens,
          <article-title>Pervasive and unobtrusive emotion sensing for human mental health, in: 2013 7th international conference on pervasive computing Technologies for Healthcare and Workshops</article-title>
          , IEEE,
          <year>2013</year>
          , pp.
          <fpage>436</fpage>
          -
          <lpage>439</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>E.</given-names>
            <surname>Khodabandehloo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Riboni</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Alimohammadi</surname>
          </string-name>
          ,
          <article-title>Healthxai: Collaborative and explainable ai for supporting early diagnosis of cognitive decline</article-title>
          ,
          <source>Future Generation Computer Systems</source>
          <volume>116</volume>
          (
          <year>2021</year>
          )
          <fpage>168</fpage>
          -
          <lpage>189</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>L.</given-names>
            <surname>Furman</surname>
          </string-name>
          ,
          <article-title>What is attention-deficit hyperactivity disorder (ADHD)?</article-title>
          ,
          <string-name>
            <given-names>J. Child</given-names>
            <surname>Neurol</surname>
          </string-name>
          .
          <volume>20</volume>
          (
          <year>2005</year>
          )
          <fpage>994</fpage>
          -
          <lpage>1002</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>S. M.</given-names>
            <surname>Massa</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Pibiri</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Riboni</surname>
          </string-name>
          ,
          <article-title>Towards EEGbased performance assessment in dataset annotation tasks</article-title>
          ,
          <source>in: Proc. of PerCom Workshops</source>
          , IEEE,
          <year>2021</year>
          , pp.
          <fpage>465</fpage>
          -
          <lpage>470</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>H. H.</given-names>
            <surname>Jasper</surname>
          </string-name>
          ,
          <article-title>The ten-twenty electrode system of the international federation</article-title>
          ,
          <source>Electroencephalogr. Clin. Neurophysiol</source>
          .
          <volume>10</volume>
          (
          <year>1958</year>
          )
          <fpage>370</fpage>
          -
          <lpage>375</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>M.</given-names>
            <surname>Teplan</surname>
          </string-name>
          , et al.,
          <source>Fundamentals of EEG measurement, Measurement science review 2</source>
          (
          <year>2002</year>
          )
          <fpage>1</fpage>
          -
          <lpage>11</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>C. I.</given-names>
            <surname>Aci</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Kaya</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Mishchenko</surname>
          </string-name>
          ,
          <article-title>Distinguishing mental attention states of humans via an EEG-based passive BCI using machine learning methods</article-title>
          ,
          <source>Expert Syst. Appl</source>
          .
          <volume>134</volume>
          (
          <year>2019</year>
          )
          <fpage>153</fpage>
          -
          <lpage>166</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>H. J.</given-names>
            <surname>Nussbaumer</surname>
          </string-name>
          ,
          <article-title>The fast fourier transform</article-title>
          ,
          <source>in: Fast Fourier Transform and Convolution Algorithms</source>
          , Springer,
          <year>1981</year>
          , pp.
          <fpage>80</fpage>
          -
          <lpage>111</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>L.</given-names>
            <surname>Breiman</surname>
          </string-name>
          , Random forests,
          <source>Machine learning 45</source>
          (
          <year>2001</year>
          )
          <fpage>5</fpage>
          -
          <lpage>32</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>F.</given-names>
            <surname>Lotte</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Bougrain</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Cichocki</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Clerc</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Congedo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Rakotomamonjy</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Yger</surname>
          </string-name>
          ,
          <article-title>A review of classiifcation algorithms for EEG-based brain-computer interfaces: a 10 year update</article-title>
          ,
          <source>Journal of neural engineering 15</source>
          (
          <year>2018</year>
          )
          <fpage>031005</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>Z.</given-names>
            <surname>Wan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Yang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Huang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Zeng</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Liu</surname>
          </string-name>
          ,
          <article-title>A review on transfer learning in EEG signal analysis</article-title>
          ,
          <source>Neurocomputing</source>
          <volume>421</volume>
          (
          <year>2021</year>
          )
          <fpage>1</fpage>
          -
          <lpage>14</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>