Motor Imagery EEG Recognition using Deep Generative Adversarial Network with EMD for BCI Applications

: The activities for motor imagery (MI) movements in Electroencephalography (EEG) are still interesting and challenging. BCI (Brain Computer Interface) allows the brain signals to control the external devices and also helps a disabled person suffering from neuromuscular disorders. In any BCI system, the two most essential steps are feature extraction and classification method. However, in this paper, the MI classification is improved by the performance of Deep Learning (DL) concept. In this proposed system two-moment imagination of right hand and right foot from the BCI competition three datasets IVA has been taken and classification methods utilizing Conventional neural network (CNN) and Generative Adversarial Network (GAN) are developed. The training time is reduced and non-stationary problem is managed by applying Empirical mode decomposition (EMD) and mixing their intrinsic mode functions (IMFs) in feature extraction technique. The experimental result indicates the proposed GAN classification technique achieves better classification accuracy in terms of 95.29% than the CNN of 89.38%. The proposed GAN method achieves an average positive rate of 62% and average false positive rate of 3.4% on BCI competition three datasets IVA whose EEG facts were resulting from the similar C 3, C 4, and Cz channels of the motor cortex.


INTRODUCTION
BCI converts the brain doings documented by the human scalp into PC control instructions to regulate the external strategies and thereby assisting incapacitated people in regaining their moto skills [1]. The use of EEGs to control intelligent wheelchairs has been investigated [2], as well as other external equipments. In the brain-computer interface (BCI), the characterization of EEG signals is formed as a significant component. Generally used EEG data contains event-associated SSVEP capabilities [3], and motor image (MI) [4]. The EEG signal has few different features compared to other types of signals. The gathered EEG signs vary according to the subject of the mental state [5]. Therefore, the EEG signs of each subject are different. EEG signs are non-stationary and non-linear, meaning the change of EEG data features over the period of time [6]. Furthermore, the EEG signals analysis is challenging since the composed EEG signals are normally combined with noise. Operative processes should, therefore, be in use to develop the SNR of the EEG data.
The EEG characteristics are controlled by the methods for assessing the frequency and the signal energy delivered in the Time-frequency or Time signal range. As far as the best authors, however, no comprehensive comparative analysis of these methods has been carried out using sophisticated linear and non-linear BCI classifiers in the BCI framework. Most of the comparative values given in the literature are limited to few techniques or only one classification [7]. Wavelet transform (WT) is basically used in the feature extraction process [8], normal spatial patterns (CSP) [9], and Principal Component Analysis (PCA) [10], EMD [11,12] and so on. Since EMD algorithm is able to optimally split the signal, it has been proven to be a suitable candidate for the examination of non-linear and unsteady EEG signals. For example, [13] uses the EMD algorithm to filter the motor imagery EEG signal. However, common EMD algorithms typically select Intrinsic Mode Functions (IMFs) based on the researcher's experience so that some EEG samples can mix unnecessary information or lose useful data. Additionally, features created using these existing schemes are usually designed by hand, which requires high level of expertise. Therefore, it is very significant to extract the EEG signal active features robotically.
In current period, particular DL methods have been used to categorize EEG signals, among which CNN is the special representative's model for classification. The greater advantage of the DL is that it can deal with nonlinear and transient data energetically to extract the feature representations from the unique data. In a study by Amin et al. [14], a multilayer CNN feature fusion model for classifying EEG signals is proposed, and this model extracts the spatial and temporal structures from EEG facts. To match the non-linear and transient features of the EEG signal, CNN features are applied to the autoencoder and the EEG signals are classified. The outcome expresses that the EEG signal detection accuracy has been enhanced. There are some approaches to join traditional feature removal methods with DL techniques [15]. For illustration, Xu et al. [16] used Wavelet transform to change 1-D EEG signals into 2-D time-frequency imageries and it was created as a CNN classifier. The main limitations of CNN for avoiding local optima depends on class imbalances over the data capacity, and initial parameter tuning. Compared with physical analysis of the classification task by using Convolutional Neural Network (CNN), it is found much more convenient, but it needs a certain volume of annotated training instance which cannot be acquired easily. Hence to overcome this issue, Generative Adversarial Network (GAN) is used for classification. In this regard, GAN has achieved satisfactory results. It is believed that GAN can be used to optimize feature information networks, confirm the efficiency of the features used, and improve the ability to select features.

RELATED WORKS
Lu et al. [17] has developed a deep learning technique based on a constrained Boltzmann and an FFT to classify the motor imaginary images. Extensive and systematic experiments were carried out with publicly available reference data sets. Ping Wang et al. [18] projected a scheme for MI classification based on the LSTM network. To achieve a strong classification, the 1d-AX (approximate aggregate one-dimensional) approach is used to obtain an effective signal demonstration for the LSTM network. Inspired by the CSP, the channel weighting method is used to improve the efficiency of the projected classification structure.
Xu et al. [19] has developed a new method for calculating the energy of the EEG topographic representation (ETR) to examine EEG patterns of brain activity using interlaced neural networks. Worldly ETR can customize training and identify multiple entities throughout the training model. By filtering out patterns of emerging EEG activity, the proposed structure lends itself to other conditions, such as the recognition of emotions and attention. Obeidat et al. [20] developed a Mobile BCI and it was studied and evaluated in a mobile wheelchair that implemented an edge model on small displays where visual overload occured. Understanding how the values of visual neuroscience distress the use of BCI spelling in a mobile context gives an insight into how the mobile fringing paradigm leaves behind the mobile line-by-line model.
Ge et al. [21] introduced sine wave signal, that spans the identical frequency range as the unique signals to enhance the MEMD presentation. To test the MEMD (SA-MEMD) method performance of the specific sinusoidal signal, the decomposition characteristics of MEMD, NA-MEMD and specific SA-MEMD were compared using synthetic signals and an actual BCI dataset. The results of the spectral decomposition specify that the specific SA-MEMD can evade the production and excessive decomposition of additional components, thus significantly reducing the mixing mode and incompatibility that occurs with MEMD and NOA-MEMD. Furthermore, the use of SA-MEMD as a signal pre-processing technique as an alternative of MEMD or NA-MEMD can expressively develop the accuracy of the BCI classification and reduce the computation time, suggesting that SA-MEMD is the powerful technology of spectral decomposition of BCI.
The outcomes show that a particular scheme can provide higher classification accuracy of EEG signals associated with other advanced technologies. In addition, this projected algorithm is used for online recognition of EEG signals, design and implementation of a BCI that straightly relates with the brain. An unanswered interesting query is how the idea of the DL scheme can be amended to motor image classification to significantly improve enactment. This study solved this problem by presenting a novel of GAN-based DL methodology in the frequency domain and the outcomes indicate the substantial possibility of DL in BCI.

PROPOSED METHOD
To solve the existing limitation and to improve the MI EEG Recognition performance in this work a new architecture is introduced which is detailed in Fig. 1. The Proposed new EEG Recognition architecture has been categorized into two major parts such as training and testing. Both the training and testing modules contain the Pre-processing and EMD is IMF extraction. The block wise description of the proposed architecture is defined in the section below. In this work, BCI three Data set IV A is used for analysis. The data set description is defined in section 4.

Preprocessing
The significant method for improving the quality of the EEG signal is named as a pre-processing step. Several processing steps have been implemented to reduce SNR and data amplitude, including removing data-artifacts on the input signal. The pre-processing phase involves the subsequent procedures; the assortment of signal segmentation and optimal electrodes.

Optimal Electrode Selection
The EEG channels optimise the selection where the functions of motor images are displayed as important since this can reduce the amplitude of the EEG records. In our work, EEG channels C4, C3 and Cz were used, which were found to be meaningless information for all channels [22]. In particular, the motor images of the left and right hand refer to the motor cortex C3 comprising the left portion and C4 comprising the right portion of the brain. The corresponding sensorimotor cortex area for the image of the right or left foot motor is Cz.

Data Segmentation
This method was executed to solve the difference in signal info and retain the number of trials as small as probable. As a first pre-processing phase, the fresh EEG data is uploaded from the .dat file that was divided and saved locally. The partitioning procedure releases the data and allocates the partition data matrix to the consistent program. In BCI, three seconds (or 3500 ms) of data acquisition reduces the classification course and affects the device's control process. Also, the EEG signal can be reflected stable: (1) the gap is a period shorter than one sec; (2) of the 3.5 seconds of data recorded, not more than 1 sec of the information section can be used. Based on the test and error, the subsequent phase was taken: features in 12 non-overlapping windows were removed for each test. The width or length of the selected window was 0.25 s (125 patterns). The recording period depends on the window length, it should be optimized. The optimized data gives us a clear sign of which portion of the three second recorded data gives a more relevant information about the imagery movement.

EMD
The EMD breaks any signal in the time domain into a group of AM-FM modules regardless of whether the signal is static or linear. Therefore, EMD-based segmentation is an adaptive and signal-based segmentation. The analyzed signal assumes that the EMD-type is an overlap of IMF drawn using the separation process. Traditional signal processing methods use predefined basic functions for the analysis of EEG signals based on Fourier transitions and wavelengths, which reduces the frequency of time. The secure linear support functions or apriori functions are only useful for static signals and might not be useful for the investigation of transient signals such as EEG. In biological systems the frequency of oscillations cannot be determined using traditional methods such as preestablished Fourier analysis and wavelet analysis since the EEG rhythms revolve around different frequency ranges. Some basic functions are not suitable for analysis of the EEG signal. For biomedical signals such as EEG, the EMD method achieves better localization of different frequency components μ and β of variation and rhythm between MI compared to methods based on short-term Fourier transform (STFT) and wavelet transformer. Based on [11], the EMD scheme robotically breaks the x(t) signal into a refined IMF D p (t), which can be seen as a finite and symmetrical function. The symmetry of the IMF was examined for classification. Each drawn IMF must meet two basic situations: (i) The sum of hands and the sum of zero crossings should not be greater than or equal to one. The EMD procedure for signal x(t) can be precised in the subsequent test procedure: Phase 1: Take one G 1 (t) = x(t). Phase 2: Regulate the extrema of G 1 (t). Phase 3: Calculate the down and upper envelopes E max (t) and E min (t), correspondingly, by interpolating the maxima and minima correspondingly Phase 4: Calculate the local mean as /2.
Phase 5: Subtract m(t) from the unique signal as G 1 (t) = G 1 (t) -m(t). Phase 6: Check whether G 1 (t) is an IMF by above mentioned two basic situations of IMF. Phase 7: Recap phase from (2) to (6) until an IMF G 1 (t) is resolute. When the IMF is initially determined, after considering a D 1 (t) = G 1 (t), it can be deliberated to the minor temporal scale in x(t) signal. To regulate the residual IMF components, find the residue rs 1 (t) of the data by subtracting D 1 (t) from the signal as rs 1 In the complete sifting course, the basis-functions and the remains can be stated as: where rs M (t) is the last residue. At the termination of the complete sifting course, the signal x(t) can be conveyed as a linear grouping of IMFs and an excess as trails: where M is the amount of IMFs and rs M (t) is the final residue. Fig. 2 represents the IMF extracted C3, Cz and C4 signals. Extracted first IMFꞌs values for C3, Cz and C4 electrode signals are added. After that, the absolute value is taken and it is converted into a 32 × 32 matrix, which is used for training and testing process for the classification procedure. The sample IMF added signals are shown in Fig. 4.

CNN Classification
CNN is a multilayer feed-forward neural network, which holds multiple layers such as pooling layer, ReLU layer and fully connected layer. Here mainly CNN is used to identify the feature of the images such as the edge and shape of the image.

Convolutional Layer
The first-come, first-served approach in CNN architecture is always of a complex level. CNN usually accepts the M × N × 1 input level. Here is the 2D image size with different M × N levels, where M represents the number of rows of pixels and N represents the number of columns of pixels in an image. CNN uses filters with specific parameters that have the same depth as the input image and are integrated with the filtered image. The filter indicates the curve or shape at which the input image is allowed. The contrast of the curved shape represented by the filter in the input image ends with higher values. The convection process can be signified by Eq. (3). Fig. 3 shows the architecture design of the pre-trained deep CNN networks using different layers.

Pooling Layer
This layer is carried out to reduce the size of the data. Grouping involves organizing matrix data into multiple sections and swapping the entire segment with a single value, reducing the size of the metric data. Some famous pooling features are max pool and average pool, where the arrays in a bucket change to the extraordinary or ordinary of all values in the current bucket.

Fully Connected Layer
These layers are reshaped to match the network-level architecture. A fully connected layer is a functional operation among a parameter, where the parameters of each input and output are linked. Like a traditional artificial neural network in general, this layer connects all activity from the earlier layer to the subsequent layer.

Soft-max Layer
The Soft-max function translates the inputs of the previous levels into probabilities for the classes. Therefore, this level plays a decisive role in the output, since it is the predicted output class that has the highest probability for certain inputs. Numerous deep neural networks can be used to classify images. Even though these networks have been pre-trained to categorize other images, transfer learning is needed to optimize the present classification problem. The hyper training criteria for all target networks remain unchanged. Dates are divided into several areas, the maximum number of which can be up to 25. The size of the mini-batch indicates the sum of examples after which the internal factors of the ideal are modernized. The size of the mini-batch for the training in this experimentation was 7 and the initial training rate for each workout was 0.0001 [23].

Generative Adversarial Networks (GAN)
In this article, we use the Deep Convolutional Generative Adversarial Network (DCGAN) [24] as shown in Fig.5 as the extraction method. The same explanation was smeared to the other two records by changing the input dimensions. The generator (G) takes a 100 − D sample as input from a uniform distribution U(-1, 1). The input is fully linked to a hidden layer with an output size of 16384, which has then changed to 8 × 8 × 256. The layer with three de-convolution layers with the stride of 2x2 and a filter size of 5 × 5 is considered. The de-convolution layer filter amounts are 128, 64 and 32. Generator Outputs have the same size with motor imaginary of 3.5 seconds EEG signals. On the other hand, the generator is organized to differentiate between the originally produced EEG signals. This difference consists of three convoluted layers with a filter size of 5 × 5, and 2 × 2 strides, the sum of filters for the three convoluted layers being 128, 256 and 512 separately.
During training, the generator (G) produces signals that are identical and conducive to receive the generated signal. As an outcome, the discriminator (D) studies exclusive features from the original EEG signal by altering its parameters to three convoluted levels. This learning process is obscured since no network label is delivered. The knowledge of training a generating opposing setup is that the D and the G contest with each other until final equilibrium is reached. However, as the DCGAN is progressed, it is found that D was changing very quickly. This avoids the G from learning how to create high-quality fantasy engine models that are not different from real fantasy engine models. As a result, it becomes a trivial task to classify the generated imaginary movement patterns and original patterns.
To fix this, we appraise the G twice instead of each mini-batch as specified in, and adjust the start-stop monitor so that the D and G loss values (defined in equations 4 and 5 [24]) are tracked. The monitor will terminate DCGN training if D_loss remains higher than gloss over continuous training. In this work, the batch size of k = 256, step size = 20 and the grading-based teaching of Adam learning value of e3 (-8) as β 1 = 0.0001, β 2 = 0.0002 and = 6e3 (-8) is used. The result of appraising the generator two times, loss values, generator (1) once, and (2) BCI IV can be double-checked for each mini-burst using data from the dataset. It can be seen that the loss (gloss) of the generator is less and less than the difference in views (2), which means that the generated imaginary motor samples better match the original ones. The more advanced G, in turn, aids to develop the discrimination ability of the diffuser. The D and G reach their equilibrium after about 2000 steps, with the monitor completing training as soon as possible. The Convolution layers transferred from the trained discriminator are defined in Fig. 6. The D_loss and G_loss are defined as: where m is the batch size (256), x is the original motor imaginary of EEG signals, z is sampled from the distribution U (-1, 1).

DCGAN Technique used in Features Extracted
Trained convergence levels are used in the DCGAN badge as a feature extraction tool. Exactly, fantastic 3.5 second EEG signals are fed from the engine to the splitter and collect the smoothed properties at the output of the last layer of the convolution (4 × 4 × 512). These functions can now be used with any classifier to complete the task of sorting engine images. In this article, a humble neural network containing two fully linked planes with sigmoidal activation and pin sizes 256 and 2, correspondingly, is used. The first layer uses the sigmoid activation function and the second uses the soft maximum activation function. Both shifts have an abandonment rate of 0.4. This twoneural network training depends on the patient. Practice projected is applied to avoid excessive placement during neural network training. Proposed GAN model hyperparameters used in the Generator and Discriminator are defined in Tab. 2.

EXPERIMENTS
This unit discusses the model outcomes with different parameters by using both proposed and some existing schemes. The Projections are investigated using the tool such as MATLAB with 3.0 GHz frequency Intel i3 processor, the hard disk memory capacity space is 1TB and 8 GB RAM. Also, defining the simulation outcome efficiency of the proposed system is associated with some recent traditional schemes on the accessible datasets described below.

Dataset Description
In this work three data sets, IV A are used for the analysis. Five healthy volunteers reported this data set. The subject sat on a comfortable chair and rested on the armrests. This data set only contains data from 4 first sessions without feedback, which the following 3 motor images display. This is a visual display with ratio 3.5: (L) left arm, (R) right arm (f) and right leg. The production of the target signals was interrupted in random lengths of 1.75 to 2.25 s during which the subject could rest. The data format consists of 118 EEG channels and uninterrupted signals from markers, which represents 280 signal points in each of the 5 subjects (Aa, Aw, Al, Av, Ay). For particular markers, no target class facts were delivered for competition. For the competition to be used for this work, only the classes "right" and "leg" are given. To test and train the CNN and GAN model, dataset of 280 samples, a batch size of 10, and 300 epochs, the GAN would be trained with 3000 total iterations. One iteration of training results in possibly multiple updates to the discriminator and one update to the generator, where the number of updates to the discriminator is a hyper-parameter that is set to 1. Also, EMD IMF extraction is conducted for each train and testing section.

Evaluation Metrics
The assessment metrics are used to evaluate the efficiency and classification of this proposed technique. For the segmentation, the valuation parameter includes sensitivity (SE), specificity (SP), Precision (P) and Accuracy (AC). The distinct presentation factors are: where tp, tn, fp and fn denote the sum of cases such as a truly positive and negative, false positive and negative.

RESULTS AND DISCUSSION
The proposed system is evaluated in two different ways, Qualitative analysis and Quantitative analysis.

Qualitative Analysis
The proposed system performance was analyzed in several ways. The section below discusses briefly the investigation of the scheme. In this section, for each subject, the performance is validated separately. And also to evaluate the qualitative analysis, the proposed system is analyzed with the convolutional neural network (CNN). The specificity (SP), sensitivity (SE), Precision (P), and Accuracy (AC) comparative analyses are distinct. The average five different class confusion matrices for all confusion matrices are defined in Fig. 7. The performance metric is calculated by using the confusion matrix of the CNN classifier performance in the right hand and right foot. In each class there are five subjects such as Al, Aa, Av, Aw and Ay. In this table, better values are highlighted in bold font. As it is noticed, the subject Ay achieved better precision, sensitivity, specificity values compared to other subjects. CNN and GAN achieved a better classification accuracy of 91.53% and 96.48% in Ay subject compared to other subjects.
Tab. 3 describes the comparison of average accuracy performance of two classifiers with each subject. The better accuracy values are highlighted in bold font. The right hand and right foot movements of parametric analysis are shown in Tab. 4. Fig. 8 expresses the graphical representation of electrode combination accuracy performances with and without EMD. The electrodes are named C3, C4 and Cz. In this graphical chart, GAN with EMD achieved better accuracy performance than without GAN and CNN classifier.

Quantitative Analysis
Tab. 5 presents the comparison of overall accuracy value of proposed GAN model and existing methods. In [25] author used the extraction method of AAR modelling and PSD modelling with LDA Regularisation method to achieve an accuracy of 62.2% and 69.4%. Later, wavelet packet decomposition extraction technique with KNN classification techniques is used by the author [13], to obtain better classification accuracy value of 92.58%. And another author [26] presented the Envelope analysis with DWT & Hilbert transform method for the feature extraction process and KNN and LSTM techniques are used for classification process to obtain better accuracy value of 91.43% in EEG signal classification. Later, the three authors [27][28][29] used the same technique of CSP system for feature extraction and SVM techniques for classification. But every author obtained different classification accuracy value, such as [27] author attained 76.34% and [28] author attained 66.4% and [29] attained 85%. Finally, EMD extraction techniques with CNN classification model performance are analyzed in this work. Another method of [30] used Noisy Pixels Detection Model for CT Images using Extreme Learning Machines and achieved detection accuracy value of 87.20%. The outcome classification accuracy of this model attained 89.38% which is better accuracy value than other previous existing methods. Proposed GAN classification technique in this work achieved a better classification accuracy value of 95.29%. After complete analysis, it is concluded that the proposed model provides a better classification accuracy value in EEG classification system.

CONCLUSION
This study conducts and evaluates the real EEG signs from several types of subjects with both right hand and right foot. Pre-processing and EMD IMF technique for extraction are proposed to make a better classification of this model. GAN and CNN model improve the classification of EEG signal. GAN achieves higher accuracy compared to other existing models. The experimentation is conducted by using the BCI three Data set IV dataset and compared with the proposed CNN classification method and GAN method. CNN model achieved 89.38% accuracy whereas the proposed GAN classification technique achieved a better classification accuracy of 95.29% and an average TPR of 62%, and the average false positive rate of 3.4%. The grades display that the proposed scheme is promising in BCI applications and initiates general identification of mental state based on motor imaging functions. In future, to develop a professional and intelligent wheelchair the following aspects will be undertaken: (1) Gathering and categorizing much difficult EEG signals to expand the function of the wheelchair, e.g. practice of EEG signal to control intellectual wheelchair speed. (2) Investigation of ways and means to improve the efficiency of the convoluted neural network, e.g. reduction of network factors and reduction of network training time. (3) The combination of EEG signal with other biotic signals for wheelchair control is an exciting technique because it enables more detailed control of the wheelchair and progresses the ability to suppress noise in the developed wheelchair system.