=Paper= {{Paper |id=Vol-2485/paper63 |storemode=property |title=Electroencephalogram Analysis Based on Gramian Angular Field Transformation |pdfUrl=https://ceur-ws.org/Vol-2485/paper63.pdf |volume=Vol-2485 |authors=Alexander Bragin,Vladimir Spitsyn }} ==Electroencephalogram Analysis Based on Gramian Angular Field Transformation== https://ceur-ws.org/Vol-2485/paper63.pdf
      Electroencephalogram Analysis Based on Gramian Angular Field
                            Transformation
                                                    A.D. Bragin1, V.G. Spitsyn1
                                                lflenylol@gmail.com|spvg@tpu.ru
                                1
                                  National Research Tomsk Polytechnic University, Tomsk, Russia
     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
     Keywords: motor imagery recognition, electroencephalogram, Gramian Angular Field, Convolutional Neural Network.

                                                                           1. First, the row is normalized to a segment [−1, 1]:
1.        Introduction                                                                         ( x  max( X ))  ( xi  min( X ))
                                                                                        xˆi  i                                    .    (1)
     Electroencephalography is one of the most popular non-                                            max( X )  min( X )
invasive methods for studying brain activity today. Signals of the         2. Further, the obtained values are translated into the polar
electroencephalogram (EEG) show the total electrical activity of       coordinate system as follows:
neurons in the cerebral cortex, studying these data, you can get a                                   i  arccos(xi )
lot of useful information about the human condition.                                                
                                                                                                         ri  i
                                                                                                                t       .               (2)
     The study of EEG is associated with many difficulties, such                                              N
as the dependence of signals on age, time of day, the presence of
noise, interference and a weak degree of structure.                        3. The GAF matrix is calculated by the formula:
     Classical mathematics methods based on time-frequency,                                  cos(1  1)  cos(1  n ) 
                                                                                                                                 
wave or component analysis can be used to study EEG. However,                                 cos(2  1)  cos(2  n ) 
their application often does not provide stable results of                            G                                            .  (3)
                                                                                                                              
recognition of various human conditions, and in some cases their                                                                 
application becomes extremely difficult due to the complexity of                            cos(n  1)  cos(n  n )
the algorithms [2, 4, 6, 7]. Signals of the brain are very complex,        The final matrix stores all the information about the series,
which is the main cause of this problem. Classical mathematical        except for the initial boundaries of the values that we lose in step
techniques (Fourier transforms, wavelet analysis, etc.) are based      (1) after the normalization procedure — that is, we can restore
on the selection of a useful signal from the entire data array and     the original series from the matrix obtained, but only scaled to
further algorithmic work with it. Often, the selection of such a       the interval [−1, 1].
useful signal is difficult for signals recorded in difficult               Based on the obtained matrices, images are formed for
conditions of psychophysiological experiments, and with the            further use (Fig. 1). The work uses single-color images, since
slightest change in state the technique may stop working.              color channels in this case do not carry useful information. This
     The use of artificial neural networks (ANNs) in application       allowed to reduce the number of image channels by 3 times
areas such as the brain-computer interface is today a promising        compared with the RGB option.
area of research [5, 9, 13]. 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].
     There are several approaches to the classification of time
series using ANNs [10]. 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.

2.        GAF transform
    The GAF (Gramian Angular Field) method [15] was used to
classify EEG signals using convolutional neural networks. In this                           Fig. 1. GAF image example
method, the time series is converted to a polar coordinate system.
The matrix G is built on the basis of the data obtained, each          3.      Deep         convolutional          neural      network
element of the matrix is equal to the cosine of the sum of the
                                                                       architecture
angles. The resulting matrix is converted into an image, which is
fed to the input of the convolutional neural network.                      In this work, the deep CNN architecture was developed,
    The preservation of the time dependence is ensured by such         adapted to classify an EEG signal taking into account the number
a transformation. The main diagonal is a special case at k = 0,        of measuring electrodes. Input images are fed to the input of the
containing the initial values and angular information.                 network in the form of a 64-channel image, where each channel
    The GAF matrix is a matrix constructed in a series as follows:     is a transformed electroencephalogram signal. The architecture



Copyright © 2019 for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).
of the deep CNN consists of the main layers: three convolutional    input of a neural network. Recognition accuracy was about 97%,
and three fully connected. Network parameters were determined       with an accuracy of 80% from the data source.
by the selection method.
                                                                    7.        Conclusion
4.        Used data
    The data presented in [3] were selected for research. Each           The article examined the possibility of using the GAF
subject was in a chair with armrests and watched the image on       conversion method for detecting motor imageries in EEG signals.
the monitor. At the beginning of each test, the monitor displayed   Without the use of additional filtration, high results can be
a black screen with a fixing cross for two seconds, then the        achieved. The recognition accuracy of motor imageries of
subject had to imagine the movement of the hand depending on        movement with the right and left hand and the state of rest was
the instructions on the monitor for three seconds. After which      97% for the studied EEG signals. General results indicate that
there was a short break for several seconds, upon its completion    this method gives higher accuracy than the methods described in
the action was repeated.                                            the data source. The presented method of classification of
    The data set is EEG signals recorded using the BCI 2000         electroencephalograms can be used to build a brain-computer
system [1] and using 64 electrodes at a sampling frequency of       interface.
512 Hz. Frequency filters for data conversion were not used.
    The order of the experiment and the conversion of the source
                                                                    8.        Acknowledgments
data into GAF images are presented in Fig. 2. For the training of       The reported study was funded by RFBR according to the
neural networks, the data of the first subject were used.           research project № 18-08-00977 А.

                                                                    9.        References
                                                                    [1] Blankertz B. et al The BCI competition 2003: Progress and
                                                                         perspectives in detection and discrimination of EEG single
                                                                         trials// IEEE Transactions on Biomedical Engineering. –
                                                                         2004. – №6 (51). – P. 1044–1051.
                                                                    [2] Grubov V.V., Runnova A.E., Kurovskaуa M.K., Pavlov
                                                                         A.N., Koronovskii A.A., Hramov A.E. Demonstration of
                                                                         brain noise on human EEG signals in perception of bistable
                                                                         images // Proc. SPIE. 2016. V. 9707. DOI:
                                                                         10.1117/12.2207390
                                                                    [3] Hohyun Cho, Minkyu Ahn, Sangtae Ahn, Moonyoung
                                                                         Kwon, Sung Chan Jun, EEG datasets for motor imagery
                                                                         brain–computer interface, GigaScience, Volume 6, Issue 7,
                                                                         July                      2017,                     gix034,
                                                                         https://doi.org/10.1093/gigascience/gix034
                     Fig. 2. Experiment order                       [4] Hramov A.E., Koronovskii A.A., Makarov V.A., Pavlov
                                                                         A.N., Sitnikova E.Y. Wavelets in Neuroscience.
5.        Model structure                                                Heidelberg; New York; Dordrecht; London, Springer, 2015.
                                                                         318 p
    Electroencephalograms are signals received from 64              [5] W. Hsu and I. Chiang, "Application of neural network to
measuring channels. Each signal is converted to a separate image         brain-computer interface," 2012 IEEE International
using GAF conversion. The generated images are input to the              Conference on Granular Computing, Hangzhou, 2012, pp.
model. By analogy with the RGB representation, the resulting             163-168. doi: 10.1109/GrC.2012.6468559
GAF images are converted into an input vector, however, if 3        [6] Koronovskii A.A., Hramov A.E., Grubov V.V.,
channels are used in the case of the RGB image, one for each             Moskalenko O.I., Sitnikova E.Y., Pavlov A.N. Coexistence
color, in this case a 64 channel image containing the converted          of intermittencies in the neuronal network of the epileptic
EEG signal is input. The structural scheme of the final model is         brain // Phys. Rev. E. 2016. V. 93. DOI:
presented in Fig. 3.                                                     10.1103/PhysRevE.93.032220
                                                                    [7] van Luijtelaar G., Lüttjohann A., Makarov V.V.,
                                                                         Maksimenko V.A., Koronovskii A.A., Hramov A.E.
                                                                         Methods of automated absence seizure detection,
                                                                         interference bystimulation, and possibilities for prediction
                                                                         in genetic absence models // Journal of Neuroscience
                                                                         Methods. 2016. V. 260. P. 144.
                                                                    [8] Maksimenko V.A., Heukelum S., Makarov V.V.,
                                                                         Kelderhuis J., Lüttjohann A., Koronovskii A.A., Hramov
                                                                         A.E., Luijtelaar G. Absence Seizure Control by a Brain
                                                                         Computer Interface // Scientific Reports. 2017. V. 7. P.
                                                                         2487.
                                                                    [9] K. Nakayama and K. Inagaki, "A Brain Computer Interface
                      Fig. 3. Model structure                            Based on Neural Network with Efficient Pre-Processing,"
                                                                         2006 International Symposium on Intelligent Signal
                                                                         Processing and Communications, Tottori, 2006, pp. 673-
6.        Motor imagery recognition                                      676. doi: 10.1109/ISPACS.2006.364745
                                                                    [10] Nima Hatami, Yann Gavet, Johan Debayle. Classification
   The data of the first subject [17] were used to recognize             of Time-Series Images Using Deep Convolutional Neural
motor imagery. Images 128 by 128 pixels in size were fed to the          Networks. 2017 The 10th International Conference on
     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.