Automatic Classification of Motor Impairment Neural Disorders from EEG Signals Using Deep Convolutional Neural Networks

1 Abstract —The analysis of biomedical signals, such as the EEGs for measuring brain activity, provides means for the diagnosis of various cognitive tasks and neural disorders. These signals are frequently transformed into visual representations such as spectrograms, which can reveal characteristic patterns and serve as a basis for classification, when extracting specific features from them. We designed a new method that uses spectrogram images to feed them without any feature selection/extraction procedure directly into a deep convolutional neural network architecture and train it for the classification of motor impairment neural disorder in a person. The proposed method was tested on a set of (un)impaired subjects, where it outperformed the traditional machine learning methods. The results, obtained without any human intervention and by using all the default parameter values, turned out not to lag much behind an established state-of-the-art method, that takes advantage of using domain knowledge for the analysis of EEG recordings. Based on the experimental results we believe that the proposed method can be considered as a sound basis for further optimization towards a competitive, fully automated method for classification of EEG signals.


I. INTRODUCTION
In the recent years a tremendous amount of research effort has been devoted to the processing and analysing of electroencephalogram (EEG) signals, in order to be able to use the information from these signals to diagnose some kind of neurological disorder in a person.
The extent of possible diagnoses that can potentially be identified in this way has been increasing over the years and covers a wide range of neurological diseases, from mild cognitive impairments [1], through neurodegenerative diseases such as Alzheimer Disease [2], to the most severe forms of neurological disorders such as amyotrophic lateral sclerosis or cerebral palsy, where the patients may be severely physically impaired or even completely paralyzed [3].
EEG enlighten about the state of the brain i.e. about the electrical bustle going on in the brain [4].The electrical activity measured as voltage at different points of brain act as basis of EEG.These signals, which are generally time varying and non-stationary in nature, can be scrutinized using various signal processing techniques.Although the scope of EEG signal analysis and classification approaches is very broad, a general way is to first pre-process and filter the raw EEG signals, recorded from the electrodes placed on the scalp of the subject, in order to become readable [4].At this point, the filtered signals can be analysed in various ways and/or transformed to a different (e.g.time-frequency domain) representation.A variety of different approaches, including linear and nonlinear methods as well as principal/independent component analysis, may be used for the analysis of EEG data.Statistical methods can be further modified or combined with some other methods, especially machine learning techniques, to get better results [5], [6].
After transforming the EEG signals, they can be visually represented as spectrograms of each EEG channel.Spectrograms can be used to reveal patterns of continuous changes in brain oscillation activity during some predefined activity or performing a task [7].Characteristic patterns can differentiate between different states and/or situations, which forms a basis for later classification and diagnosis by qualified experts.
While traditional methods of computer vision and machine learning were not able to match human performance, the recent advancements in wide and deep artificial neural network architectures provided results that achieved near-human performance or have even outperformed humans [8].Deep neural network approaches to image classification have been recently studied frequently with success also in medicine.In [9] authors used deep maxpooling convolutional neural networks to detect mitosis in breast histology images.In [10] authors proposed a dual pathway, 11-layers deep, three-dimensional convolutional neural network for the challenging task of brain lesion segmentation.
Based on these encouraging results, in this paper we propose a new, fully automated method for the classification of EEG spectrogram images for the detection of motor impairments in patients using a deep convolutional neural network architecture.As such, the proposed method does not require any human intervention in a sense of using domain knowledge to guide and/or set-up the classification process.The two main goals of the research were to study whether the proposed method can be used to successfully classify a certain neurological disorder and how to appropriately transform raw EEG signals into spectrogram images to feed and learn the neural network with.The main advantage of the proposed method is the direct use of the spectrogram images for learning the neural network, which does not require a very demanding process of selecting and/or extracting the features, nor does require any other domain expert knowledge.If it turns out that the proposed method would achieve a solid result, this would mean that the classification is possible in a straightforward automatic manner.
The remaining of this paper is organized as follows.Section II details the proposed method.Section III presents the methodology employed for performing the experiment, results and comparison with traditional classifiers are presented in Section IV.Finally, Section V concludes the paper with our final thoughts and lists some future work possibilities.

II. THE PROPOSED METHOD
The proposed method consists of pre-processing the recorded EEG signal to reduce signal noise and transforming the filtered signal to the time-frequency domain using Fast-Fourier Transformation (FFT).From the transformed signal, we plotted a spectrogram for each channel.Spectrogram images are then used as an input data to our deep neural network which we train using leave-oneout principle.
We filtered frequency band from 0.5 Hz-7.5 Hz to remove low and high frequency noises and non-signal artefacts.Our primary focus was put on delta and theta waves frequency ranges, which based on previous work [2], [12] are containing spectral power changes which in most cases indicate some kind of brain pathologies.
FFT was used to transform the filtered signals to timedomain representations.FFT is considered as one of the most suitable methods for transforming signals between time and frequency domain, although some of the recent studies are proving that Wavelet transformation (WT) or short-time Fourier transformation (STFT) is a better choice [13].Used Fourier transform pairs are expressed as [13]: where . After transforming the signal to time-frequency domain, as defined in ( 1) and ( 2), we plotted spectrograms of each channel, representing power density of signal using logarithmic normalization which gave us graphical representation as shown in Fig. 2

B. Classification with Deep Convolutional Networks
In last decade, Convolutional Neural Network (CNN) is one of the most competitive neural network architectures for image classification tasks, in some cases even outperforming human performance [14].CNNs differentiate from widely used hand-crafted feature/classifier combinations for computer vision tasks by forming an endto-end trainable hybrid feature-extraction/classification architecture [15].
Since CNN architecture named LeNet was presented [16], [17], CNNs standard structure contains stacked convolutional layers, which are optionally followed by contrast normalization or pooling (also known as downsampling or sub-sampling), followed by one or more fullyconnected layers.A convolutional layer is usually composed of several feature maps (with different weight vectors), so that multiple features can be extracted at each location.Shifting the input of convolutional layer will shift the output, but will leave it unchanged otherwise.Once feature had been detected, its exact location becomes less important, as long as its approximate position relative to others features remains the same.Therefore, it is common, that each convolutional layer is followed by an additional layer, which performs a local averaging and subsampling.This results in reduced resolution of feature map and of the input to shifts and distortions.Successive layers of convolutions and subsampling are typically alternated, resulting in a "bi-pyramid": at each layer, the number of feature maps is increased as the spatial resolution is decreased [18].Fully-connected layer is layer which is having full connections to all activations in the previous layer as in regular neural networks.Their activations can be computed with a matrix multiplication followed by bias offset.
Our CNN architecture is based on LeCun's LeNet architecture [16] with slight adjustments in convolutional layers' parameters and learning parameters.As shown in Fig. 3, there are two convolutional layers with filter size 5 × 5 and stride 1 × 1, each of them followed by a pooling layer using maximization function with filter and stride size 2 × 2. First convolutional filter is having 20 filters applied and on second we're having 50 filters applied.After those four stacked layers we have one fully-connected layer outputting 500 filters to output layer which then classifies image as impaired or unimpaired.Image classification is done separately for each of the EEG channel spectrogram image.Final classification is made by combining sub-classifications from single channels using a majority voting scheme.

III. EXPERIMENTAL FRAMEWORK AND SETTINGS A. Experimental Settings
To test the proposed method we used the Colorado State University brain-computer (BCI) collection [19] of EEG signals, which were acquired using g.Tec g.GAMMASys active electrodes.Recordings where captured with eight active electrodes (8 channels) with sampling frequency of 256 Hz and a hardware bandpass filter from 0.5 Hz-100 Hz at -3 dB attenuation [20].
The dataset contains recordings of a total of 13 participants, nine of which with no known medical conditions.The remaining participants had severe motor impairments.Each of the recordings contains the three minutes long trial session, which data we used as an input to our EEG signal pre-processing step.
Because of the small size of the dataset, we used the leave-one-out testing approach, where we iteratively excluded one recording from the training set and used it for testing of the model, trained on all of the remaining recordings.
Training of our model was performed on machine with 2 dedicated Intel Xeon E5-2630 CPU cores running at 2.20 GHz and 32 GB of dedicated RAM memory.

B. Parameter Settings
Because we have limited training samples we've used the leave-one-out principle to train our CNN.Training was done for each channel separately, giving us total of 8 trained models which were then ensembled through algebraic combination rules (the majority voting) -if more than half of the channels were classified as impaired, the model classified the subject as being impaired; otherwise it was classified as being unimpaired.Before training, we proportionally resized images from original 2000 px × 1500 px resolution to 270 px × 202 px.Training of model was, taking into consideration the fact that the data set is unbalanced and small, done using only single batch of images, with total of 12 images, leaving one image for testing.For training parameters, we've used the learning rate of 1 × 10 -6 , weight initialization set with common initialization scheme known as Xavier [21] and rectified linear units (ReLU) [22] as activation function.For each training of our CNN, we did 50 repetitions with one iteration.

IV. RESULTS
The classification results obtained on testing instances for all 8 channels separately and combined using the majority voting is presented in Table I.Subjects denoted as s21-s25 represent persons without known neural disorders (marked as F -false cases), while subjects s11-s16 represent patients with motor impairments (marked as T -true cases).
As we can see, our method classified correctly 8 out of 9 unimpaired persons, and 1 out of 4 impaired personsachieving the overall accuracy of 69.23 %.The F1-score is 65.64 %, the sensitivity 25.00 % and the specificity 88.89 %.
We have also compared the performance of our proposed method with the performance of traditional classification methods: Linear Regression (LR), Linear Discriminant Analysis (LDA), K-Nearest Neighbours (KNN), Classification and Regression Trees (CART), Naïve Bayes (NB) and Support Vector Machine (SVM).For fair comparison, we trained all classifiers without any feature selection, as we did not use any while training our proposed method.From the results, presented in Table II, we can see that KNN and SVM classifiers matched our CNN's overall accuracy, but fall behind on sensitivity -in other words, neither of the mentioned two classifiers did correctly classify any of the impaired persons' recordings.On the other hand, both LDA and CART performed better regarding the sensitivity metric, with 2 out of 4 correctly classified impaired persons, but their overall accuracy and especially specificity are quite worse.
In order to further compare the methods, we also computed the F1 score, which is generally used in medicine and can be interpreted as a weighted average of the precision and recall, where precision is the number of correct positive predictions (correct predictions of impaired persons) divided by the number of all positive predictions, and recall is the number of correct positive predictions divided by the number of all positive instances (impaired persons).Looking at the Fig. 4, focusing on the F1 score, we can see that our proposed method outperformed all other methods and achieved the best result with 65.64 %, followed by CART classifier with 62.54 %, while all other methods performed much worse.When compared to KNN and SVM, the two methods which achieved the same accuracy as our CNN, our method performed better in the aspect of F1 score, by the margin of 11 %.We must add, however, that our proposed method is the most computationally demanding of all the compared methods.Nevertheless, regarding the fully automated nature and good results, we believe that it is a sound candidate for this kind of tasks.When compared to the state-of-the-art classification approach [20], which achieved 74 % overall accuracy -81.7 % accuracy on unimpaired and 61.5 % accuracy on impaired persons -we may say that our proposed method was not very far behind (less than 5 %).However, we must keep in mind the fact that our method is fully automated and does not require any human intervention (e.g.feature selection, domain expert knowledge) in the whole process of EEG pre-processing, transformation and classification.Furthermore, we did not tune any of the parameters when training the CNN and just used the default values.As literature reports that even a small amount of parameter adjustments and fine-tuning can achieve a significant growth in performance of CNN [23], we may reasonably expect that, by fine-tuning the proposed method, the results will further improve.

V. CONCLUSIONS
In this paper, we presented a process of transforming a raw EEG signal into spectrogram images using Butterworth bandpass filtering on frequency range of 0.5 Hz-7.5 Hz, a FFT to transform signal to time-domain representations and logarithmic normalization to represent power density of transformed signal.Afterwards those spectrograms images were used to train our LeNet based CNN using leave-oneout principle.The obtained results are very promising, considering the totally and utterly automatic nature of the proposed classification method.
In the future, we would like to expand our work with the use of larger EEG datasets, different time-domain transformations (e.g.Short-time Fourier Transformation, Morlet Wavelet Transformation, Continuous Wavelet Transformation), CNN architectures and parameter settings.We would also like to do a more elaborated performance comparison between our proposed approach using different transformations and performance of widely used traditional approaches.

Fig. 1 .
Fig. 1.EGG signal of a single recording session for each channel with bandpass filtering applied. .
Fig. 2. Spectrogram images of EEG recording on channel C3 used for training the Convolutional Neural Network: a) represents spectrogram of an impaired person; b) represents spectrogram of an unimpaired person.Shown on Fig. 2(a) presents a spectrogram of an impaired brain activity on channel C3 while in Fig. 2(b) a spectrogram of an unimpaired brain activity is presented.If we visually compare Fig. 2(a) and Fig. 2(b) we can recognise a slight difference between the two, especially in power density of signal of an impaired brain activity compared to the power density of an unimpaired person.

Fig. 4 .
Fig. 4. Comparison of overall accuracy and F1 score of all tested classification methods.