<!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>Electroencephalogram Analysis Based on Gramian Angular Field Transformation</article-title>
      </title-group>
      <contrib-group>
        <aff id="aff0">
          <label>0</label>
          <institution>National Research Tomsk Polytechnic University</institution>
          ,
          <addr-line>Tomsk</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>This paper addresses the problem of motion imagery classification from electroencephalogram signals which related with many difficulties such on human state, measurement accuracy, etc. Artificial neural networks are a good tool to solve such kind of problems. Electroencephalogram is time series signals therefore, a Gramian Angular Fields conversion has been applied to convert it into images. GAF conversion was used for classification EEG with Convolutional Neural Network (CNN). GAF images are represented as a Gramian matrix where each element is the trigonometric sum between different time intervals. Grayscale images were applied for recognition to reduce numbers of neural network parameters and increase calculation speed. Images from each measuring channel were connected into one multi-channel image. This article reveals the possible usage GAF conversion of EEG signals to motion imagery recognition, which is beneficial in the applied fields, such as implement it in brain-computer interface GAF transform</p>
      </abstract>
      <kwd-group>
        <kwd>motor imagery recognition</kwd>
        <kwd>electroencephalogram</kwd>
        <kwd>Gramian Angular Field</kwd>
        <kwd>Convolutional Neural Network</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Electroencephalography is one of the most popular
noninvasive methods for studying brain activity today. Signals of the
electroencephalogram (EEG) show the total electrical activity of
neurons in the cerebral cortex, studying these data, you can get a
lot of useful information about the human condition.</p>
      <p>The study of EEG is associated with many difficulties, such
as the dependence of signals on age, time of day, the presence of
noise, interference and a weak degree of structure.</p>
      <p>
        Classical mathematics methods based on time-frequency,
wave or component analysis can be used to study EEG. However,
their application often does not provide stable results of
recognition of various human conditions, and in some cases their
application becomes extremely difficult due to the complexity of
the algorithms [
        <xref ref-type="bibr" rid="ref2 ref4 ref6 ref7">2, 4, 6, 7</xref>
        ]. Signals of the brain are very complex,
which is the main cause of this problem. Classical mathematical
techniques (Fourier transforms, wavelet analysis, etc.) are based
on the selection of a useful signal from the entire data array and
further algorithmic work with it. Often, the selection of such a
useful signal is difficult for signals recorded in difficult
conditions of psychophysiological experiments, and with the
slightest change in state the technique may stop working.
      </p>
      <p>
        The use of artificial neural networks (ANNs) in application
areas such as the brain-computer interface is today a promising
area of research [
        <xref ref-type="bibr" rid="ref5 ref9">5, 9, 13</xref>
        ]. The ability of ANNs to adaptive
learning, resistance to signal distortion and a good generalizing
effect makes them an excellent tool for classification [11, 12, 16].
      </p>
      <p>
        There are several approaches to the classification of time
series using ANNs [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. A key factor in the success of the
recognition of human activities using EEG is the effective use of
data obtained from measuring sensors. In this paper, we use the
method proposed in [16]. In this method, the time series is
converted into images, after which a convolutional neural
network (CNN) is used to analyze them.
      </p>
      <p>The GAF (Gramian Angular Field) method [15] was used to
classify EEG signals using convolutional neural networks. In this
method, the time series is converted to a polar coordinate system.
The matrix G is built on the basis of the data obtained, each
element of the matrix is equal to the cosine of the sum of the
angles. The resulting matrix is converted into an image, which is
fed to the input of the convolutional neural network.</p>
      <p>The preservation of the time dependence is ensured by such
a transformation. The main diagonal is a special case at k = 0,
containing the initial values and angular information.</p>
      <p>
        The GAF matrix is a matrix constructed in a series as follows:
xˆi 
1. First, the row is normalized to a segment [
        <xref ref-type="bibr" rid="ref1">−1, 1</xref>
        ]:
(xi  max( X ))  (xi  min( X ))
2. Further, the obtained values are translated into the polar
coordinate system as follows:
 i  arccos (xi )
 ri  tNi .
3. The GAF matrix is calculated by the formula:
      </p>
      <p> cos(1 1)
G  cos(2 1) 
  

cos(n 1) 

cos(1  n ) </p>
      <p>
cos( 2 n ) .</p>
      <p> </p>
      <p>
cos(n n )</p>
      <p>
        The final matrix stores all the information about the series,
except for the initial boundaries of the values that we lose in step
(1) after the normalization procedure — that is, we can restore
the original series from the matrix obtained, but only scaled to
the interval [
        <xref ref-type="bibr" rid="ref1">−1, 1</xref>
        ].
      </p>
      <p>Based on the obtained matrices, images are formed for
further use (Fig. 1). The work uses single-color images, since
color channels in this case do not carry useful information. This
allowed to reduce the number of image channels by 3 times
compared with the RGB option.
(1)
(2)
(3)
Fig. 1. GAF image example
convolutional
neural
network</p>
    </sec>
    <sec id="sec-2">
      <title>3. Deep architecture</title>
      <p>In this work, the deep CNN architecture was developed,
adapted to classify an EEG signal taking into account the number
of measuring electrodes. Input images are fed to the input of the
network in the form of a 64-channel image, where each channel
is a transformed electroencephalogram signal. The architecture
of the deep CNN consists of the main layers: three convolutional
and three fully connected. Network parameters were determined
by the selection method.
4.</p>
    </sec>
    <sec id="sec-3">
      <title>Used data</title>
      <p>
        The data presented in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] were selected for research. Each
subject was in a chair with armrests and watched the image on
the monitor. At the beginning of each test, the monitor displayed
a black screen with a fixing cross for two seconds, then the
subject had to imagine the movement of the hand depending on
the instructions on the monitor for three seconds. After which
there was a short break for several seconds, upon its completion
the action was repeated.
      </p>
      <p>
        The data set is EEG signals recorded using the BCI 2000
system [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] and using 64 electrodes at a sampling frequency of
512 Hz. Frequency filters for data conversion were not used.
      </p>
      <p>The order of the experiment and the conversion of the source
data into GAF images are presented in Fig. 2. For the training of
neural networks, the data of the first subject were used.</p>
    </sec>
    <sec id="sec-4">
      <title>Model structure</title>
      <p>Electroencephalograms are signals received from 64
measuring channels. Each signal is converted to a separate image
using GAF conversion. The generated images are input to the
model. By analogy with the RGB representation, the resulting
GAF images are converted into an input vector, however, if 3
channels are used in the case of the RGB image, one for each
color, in this case a 64 channel image containing the converted
EEG signal is input. The structural scheme of the final model is
presented in Fig. 3.</p>
    </sec>
    <sec id="sec-5">
      <title>Motor imagery recognition</title>
      <p>The data of the first subject [17] were used to recognize
motor imagery. Images 128 by 128 pixels in size were fed to the
input of a neural network. Recognition accuracy was about 97%,
with an accuracy of 80% from the data source.
7.</p>
    </sec>
    <sec id="sec-6">
      <title>Conclusion</title>
      <p>The article examined the possibility of using the GAF
conversion method for detecting motor imageries in EEG signals.
Without the use of additional filtration, high results can be
achieved. The recognition accuracy of motor imageries of
movement with the right and left hand and the state of rest was
97% for the studied EEG signals. General results indicate that
this method gives higher accuracy than the methods described in
the data source. The presented method of classification of
electroencephalograms can be used to build a brain-computer
interface.
8.
9.</p>
    </sec>
    <sec id="sec-7">
      <title>Acknowledgments References</title>
      <p>The reported study was funded by RFBR according to the
research project № 18-08-00977 А.
Machine Vision (ICMV 2017), ICMV Committees, Nov
2017, Vienne, Austria. 10.1117/12.2309486. hal-01743695
[11] R. Östberg, ‘Robustness of a neural network used for image
classification : The effect of applying distortions on
adversarial examples’, Dissertation, 2018.
[12] Qinglong Wang , Wenbo Guo , Kaixuan Zhang , Alexander
G. Ororbia, II , Xinyu Xing , Xue Liu , C. Lee Giles,
Adversary Resistant Deep Neural Networks with an
Application to Malware Detection, Proceedings of the 23rd
ACM SIGKDD International Conference on Knowledge
Discovery and Data Mining, August 13-17, 2017, Halifax,
NS, Canada
[13] Vasilyev A.N., Liburkina S.P., Kaplan A.Y. Lateralization
of EEG patterns in humans during motor imagery of arm
movements in the brain-computer interface // Zhurnal
Vysshei Nervnoi Deyatelnosti Imeni IP Pavlova. 2016. V.
66. № 3. P. 302-312.
[14] Wang, Z.; Oates, T. Imaging time-series to improve
classification and imputation. In Proceedings of the
Twenty-Fourth International Joint Conference on Artificial
Intelligence, Buenos Aires, Argentina, 25–31 July 2015; pp.
3939–3945.
[15] Wang, Z., Oates, T. Encoding time series as images for
visual inspection and classification using tiledconvolutional
neural networks, Association for the Advancement of
Artificial Intelligence (AAAI) conference,2015.
[16] J. Yim and K. Sohn, "Enhancing the Performance of
Convolutional Neural Networks on Quality Degraded
Datasets," 2017 International Conference on Digital Image
Computing: Techniques and Applications (DICTA),
Sydney, NSW, 2017, pp. 1-8. doi:
10.1109/DICTA.2017.8227427 Nima Hatami, Yann Gavet,
Johan Debayle.
[17] Zhiguang Wang и Tim Oates. “Spatially Encoding
Temporal Correlations to Classify Temporal Data Using
Convolutional Neural Networks”. В: CoRR
abs/1509.07481 (2015). url:
http://arxiv.org/abs/1509.07481.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Blankertz</surname>
            <given-names>B.</given-names>
          </string-name>
          et al The BCI competition
          <year>2003</year>
          :
          <article-title>Progress and perspectives in detection and discrimination of EEG single trials/</article-title>
          / IEEE Transactions on Biomedical Engineering.
          <article-title>-</article-title>
          <year>2004</year>
          . - №
          <volume>6</volume>
          (
          <issue>51</issue>
          ). - P.
          <fpage>1044</fpage>
          -
          <lpage>1051</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>Grubov</surname>
            <given-names>V.V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Runnova</surname>
            <given-names>A.E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kurovskaуa</surname>
            <given-names>M.K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pavlov</surname>
            <given-names>A.N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Koronovskii</surname>
            <given-names>A.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hramov</surname>
            <given-names>A.E.</given-names>
          </string-name>
          <article-title>Demonstration of brain noise on human EEG signals in perception of bistable images //</article-title>
          <source>Proc. SPIE</source>
          .
          <year>2016</year>
          . V. 9707. DOI:
          <volume>10</volume>
          .1117/12.2207390
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Hohyun</given-names>
            <surname>Cho</surname>
          </string-name>
          , Minkyu Ahn, Sangtae Ahn, Moonyoung Kwon,
          <article-title>Sung Chan Jun, EEG datasets for motor imagery brain-computer interface</article-title>
          ,
          <source>GigaScience</source>
          , Volume
          <volume>6</volume>
          ,
          <string-name>
            <surname>Issue</surname>
            <given-names>7</given-names>
          </string-name>
          ,
          <year>July 2017</year>
          , gix034, https://doi.org/10.1093/gigascience/gix034
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <surname>Hramov</surname>
            <given-names>A.E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Koronovskii</surname>
            <given-names>A.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Makarov</surname>
            <given-names>V.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pavlov</surname>
            <given-names>A.N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sitnikova</surname>
            <given-names>E.Y.</given-names>
          </string-name>
          <article-title>Wavelets in Neuroscience</article-title>
          . Heidelberg; New York; Dordrecht; London, Springer,
          <year>2015</year>
          . 318 p
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>W.</given-names>
            <surname>Hsu</surname>
          </string-name>
          and
          <string-name>
            <surname>I. Chiang</surname>
          </string-name>
          ,
          <article-title>"Application of neural network to brain-computer interface,"</article-title>
          <source>2012 IEEE International Conference on Granular Computing, Hangzhou</source>
          ,
          <year>2012</year>
          , pp.
          <fpage>163</fpage>
          -
          <lpage>168</lpage>
          . doi:
          <volume>10</volume>
          .1109/GrC.
          <year>2012</year>
          .6468559
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <surname>Koronovskii</surname>
            <given-names>A.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hramov</surname>
            <given-names>A.E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Grubov</surname>
            <given-names>V.V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Moskalenko</surname>
            <given-names>O.I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sitnikova</surname>
            <given-names>E.Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pavlov</surname>
            <given-names>A.N.</given-names>
          </string-name>
          <article-title>Coexistence of intermittencies in the neuronal network of the epileptic brain // Phys.</article-title>
          <string-name>
            <surname>Rev. E.</surname>
          </string-name>
          <year>2016</year>
          . V. 93. DOI:
          <volume>10</volume>
          .1103/PhysRevE.93.032220
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>van Luijtelaar G.</given-names>
            ,
            <surname>Lüttjohann</surname>
          </string-name>
          <string-name>
            <given-names>A.</given-names>
            ,
            <surname>Makarov</surname>
          </string-name>
          <string-name>
            <given-names>V.V.</given-names>
            ,
            <surname>Maksimenko</surname>
          </string-name>
          <string-name>
            <given-names>V.A.</given-names>
            ,
            <surname>Koronovskii</surname>
          </string-name>
          <string-name>
            <given-names>A.A.</given-names>
            ,
            <surname>Hramov</surname>
          </string-name>
          <string-name>
            <surname>A.E.</surname>
          </string-name>
          <article-title>Methods of automated absence seizure detection, interference bystimulation, and possibilities for prediction in genetic absence models //</article-title>
          <source>Journal of Neuroscience Methods</source>
          .
          <year>2016</year>
          . V. 260. P.
          <volume>144</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <surname>Maksimenko</surname>
            <given-names>V.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Heukelum</surname>
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Makarov</surname>
            <given-names>V.V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kelderhuis</surname>
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lüttjohann</surname>
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Koronovskii</surname>
            <given-names>A.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hramov</surname>
            <given-names>A.E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Luijtelaar</surname>
            <given-names>G.</given-names>
          </string-name>
          <string-name>
            <surname>Absence Seizure</surname>
          </string-name>
          <article-title>Control by a Brain Computer Interface</article-title>
          // Scientific Reports.
          <year>2017</year>
          . V. 7. P.
          <volume>2487</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>K.</given-names>
            <surname>Nakayama</surname>
          </string-name>
          and
          <string-name>
            <given-names>K.</given-names>
            <surname>Inagaki</surname>
          </string-name>
          ,
          <article-title>"A Brain Computer Interface Based on Neural Network with Efficient Pre-</article-title>
          <string-name>
            <surname>Processing</surname>
          </string-name>
          ,
          <article-title>"</article-title>
          <source>2006 International Symposium on Intelligent Signal Processing and Communications, Tottori</source>
          ,
          <year>2006</year>
          , pp.
          <fpage>673</fpage>
          -
          <lpage>676</lpage>
          . doi:
          <volume>10</volume>
          .1109/ISPACS.
          <year>2006</year>
          .364745
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <surname>Nima</surname>
            <given-names>Hatami</given-names>
          </string-name>
          , Yann Gavet,
          <string-name>
            <given-names>Johan</given-names>
            <surname>Debayle</surname>
          </string-name>
          .
          <source>Classification of Time-Series Images Using Deep Convolutional Neural Networks. 2017 The 10th International Conference on</source>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>