Analysis And Classification Of Motor Imagery Using Deep Neural Network

ABSTCT: Motor imagery based on brain-computer interface (BCI) has aracted important research aention despite its diﬃculty. It plays a vital role in human cognition and helps in making the decision. Many researchers use electroencephalogram (EEG) signals to study brain activity with le and right-hand movement. Deep learning (DL) has been employed for motor imagery (MI). In this article, a deep neural network (DNN) is proposed for classication of le and right movement of EEG signal using Common Spatial Paern (CSP) as feature extraction with standard gradient descent (GD) with momentum and adaptive learning rate LR. (GDMLR), the performance is compared using a confusion matrix, the average classication accuracy is 87%, which is improved as compared with state-of-the-art methods that used diﬀerent datasets.


INTRODUCTION
Brain-computer interface (BCI) is a collection or system which translates brain activities, pa erns of a user via commands or messages for interactive uses, BCI it's also hardware and so ware communicative devices via brain and output devices [1]. Its records as well as analyze the brain activities by invasive or non-invasive modalities. Invasive modality involved electrocorticography (ECoG) and acquisition of electrical signals of single neurons. Noninvasive modality include recording electroencephalography(EEG) and magnetoencephalography (MEG) [1,2]. EEG is widely being used in BCI because of safety used, gives be er spatial as well as temporal resolution, wider bandwidth, be er signal to -noise ratio (SNR), and higher amplitude as well as lower artifact [3]. BCI gives a clear communication channel between the brain and external devices beyond the brain's normal output channels of peripheral nerves and muscles [4]. For the purposed of having the best communication channel between the human brain and devices, Motor imaginary (MI)-based brain-computer interfaces (BCIs) have called the a ention of researchers because systems can function using time-unlocked electroencephalogram (EEG) data [5]. All BCI systems deal with evoked potentials and motor imagery, the effect of external surrounding and hardware weakened the signal-to-noise ratio (SNR) of EEG signal, individual differences also caused low control accuracy as well as poor real-time transmission rate [6]. BCI-based EEG is a challenging task in the scienti c and engineering eld today because it interprets mental imagery command [7].

 Motor Imaginary Abd Its Wide Range Of Applications
Motor imaginary (MI) deals with the movement of many parts of the body obtained from sensory-motor cortex activation. using BCI and some algorithms lead to the classi cation of EEG signal characteristics behaviors or pa ern as well as design feedback to enable real-time or single-trial basis, a lot of technique had been employed such as; arti cial neural network, Bayesian learning, support vector machine, feed-forward back-propagation neural network (FFBPNN), linear discriminant analysis fuzzy -art neural network has been used for classi cation motor imagery [3].
A person with a mental disability required alternative assistive devices or ways to do motor tasks interlude with the surroundings. BCI had extended antiquity centered based on motor control applications such a helping people with disabilities [3][4][5][6][7][8] paralyzed body parts [9,10], cursor robotic arms, wheelchairs prosthesis limbs, etc. a lot of application was for the need of disabling community. e hemisphere of the human brain was segmented into four lobes with various functions these lobes were separated by the sulcus. e primary semantic sensory cortex (parietal lobe) and primary motor cortex (temporal lobe) are the very important region in BCI studies. To the present, motor imagery has been helped greatly in the eld of medicine to help people by connecting their minds to control devices as well as detecting their brain abnormalities [7]. e main goal of this research is to identify and classify the activities of MI, such as; imaging the movement of the le and right hand, foot, and tongue movement of BCI. Using deep neural network (DNN) and using co-space model (CSP) as extraction feature [7].

 Related Worked
Many studies have been conducted to improve the classi cation of Motor imaginary (MI) data. e efficiency of these systems almost depends on the features selected and the algorithms used for classi cation purposes. A method for motor imaginary (MI) was proposed for the classi cation of multichannel electrocorticogram (ECoG), Taking from patients with medically intractable focal epilepsy. Two features extraction method used, which is autoregressive (AR) model coefficients and local binary pa ern (LBP) operators. It gives spatial resolution and angular space knowledge along with the gradient boosting (GB) together with ordinary least squares (OLS) algorithm was used as a classi er for improving the efficiency Motor imaginary (MI) classi cation for ECoG based Brain-Computer Interface (BCI) system. e Results of the Experimental on the BCI Competition III data set I showed that the novel method had very good performance and gave a cross-validation accuracy of 88.8% and accuracy of 93%, respectively [1].
Proposed the alliance of continuous Wavelet Transform (CWT) together with deep-learning-based transfer learning to solve the problem, he achieved an accuracy of 97.06% [11]. A feed-forward back-propagation neural network (FFBPNN) was proposed based on the motor in order to improve the performance motor imagery classi cationplan. And the Accuracy was 99.8% [12] propound be er method for EEG Classi cation from the feature extraction and classi cation, he analyzed and compared the effectiveness of the following algorithms; CSP-LDA, SCSP-LDA, CSP-RDA, and SCSP-RDA, e detailed study showed that the classi cation performance of SCSP-RDA was be er than CSP-LDA, SCSP-LDA, CSP -RDA in decipher EEG signal and classi cation algorithms is be er than traditional algorithms, improved by 10.75% [13].
Presented EEG datasets for MI BCI from 52 subjects as well as the result of the psychological and physiological questionnaire, EMG datasets, the position of 3d electrodes, and EEGs for non -task-related states.
e data was analyzed based on the percentage of bad trials, evenrelated desynchronization/ synchronization (ERD/ERS) analysis.73.08% datasets gave reasonable approval information [14]. Joined fNIR and EEG signals for classi cation 8-class problems, by CNN -an arti cial intelligence tool. e classi cation accuracy on voluntary and imagery-related tasks using the bimodal approach for CNN-based BCI gave an excellent result [15].
A deep learning method upon on Restricted Boltzmann Machine (RBM) was proposed, particularly, Frequency domain representation of EEG signals was obtained through fast Fourier transform (FFT) and wavelet package decomposition (WPD) were got and trained three RBMs. And stacked up the RBMs together with the remaining layer to form a frequent deep belief network (FDBN). Conjugate gradient and backpropagation methods were used to ne-tune the FDBN. Public datasets were used and FDBN improved the performance over other states of -the art method [8]. Using and validating the percentage of bad trials, even related desynchronization/synchronization (ERD/ERS), e EEG datasets for the MI BCI dataset of 52 subjects as well as result of psychological and physiological questionnaire was used, it showed 73.08% of the data was statistically used for analysis.
Feature extraction method via time-series prediction based on the ANFIS for the BCI application was proposed, the result showed the potential use of the ANFIS time-series suggestion with MVFFV features in Motor imaginary (MI) classi cation. e ANFIS times series prediction together with MFFV features got be er results in the BCI eld [16]. He proposed and re ned the time-frequency-spatial approach and applied it to a one-dimensional "cursor control" BCI experiment with online feedback. Via offline analysis of the available data, then evaluated, the efficiency of the present refined way was compared with the original time-frequency-spatial methods.
e improved performance in forms of classification accuracy was found for the proposed approach, with a mean accuracy rate of 91.1% for two subjects studied [17]. e activity of EEG rhythms (mu rhythms) was studied, in connection to imaging of foot, tongue, right, and le -hand movement with 60 EEG electrodes in nine able-bodied subjects. e hand mu rhythms desynchronized all the subjects. While progressive hand region mu rhythm was studied during tongue or foot motor imagery in all the subjects. e reactive component frequency was 11.7Hz±0.4, while broad-banded the design chromized components at Centre 10.9Hz±0.9, the narrowband and higher frequency were observed on desynchronized components. e classi cation between the four-motor imagery based on EEG trial was improved [14]. CEMD and IDMSCNN method was proposed for improved the performance of motor imagery (MI) EEG signals classi cation. e best EMD algorithm is optimized properly and added two conditions to select effective IMFs. e multi-scale convolutional neural network was used as a feature extractor, the result shows that the algorithms can extract the best effective feature or information [18].
A method was proposed and developed for classifying new motor imagery using the Temporal Convolutional Network (TCN). e wider causal convolution within TCN was included, the temporal information in a parallel way with much higher computational efficiency than the traditional RNNs. Time stacked spatial EEG signal had been employed as the input to the TCN. Based on this, both the spatial distribution information and temporal variation of the brain signal were considered. e TCN method had a solution that obtained Applied Materials and Technology state-of-the-art performance on the multi-subject and multi -task motor imagery classi cation. e classi cation accuracy was 97.89% on 20 subjects and 5 tasks had been obtained [19]. e convolutional neural networks (CNN) were proposed to classify the motor imaginary MI-EEG signals.
ree algorithms were used, data augmentation along with an exclusive transfer learning strategy were used to solve the problem of few trials in motor imagery tasks. e analytical regression measured was applied to the raw data for mitigating the stress of EOG on EEG.
en, the simulation results vividly showed the contribution of the proposed algorithm via testing on BCI competition IV dataset 2b. Applying EOG noise removal and data augmentation methods result in a 0.07 improvement in the kappa coefficient. in addition, this proposed transfer learning method led to a 0.06 improvement in form of the kappa coefficient [20]. e analysis and discriminated the EEG pa erns of several force stages for motor imaginary (MI) using MRCPs. During the experiment, nine healthy subjects were used to carried-out the experiment, the hand force motor imagery tasks (30% MVC and 10% MVC). Based on MRCPs, the best good difference between the two levels of mental tasks was the manifestation of motor planning. e mean classi cation accuracy for features including both MRCP and CSP was 78.3%, which was 8.5% higher than the CSP-based features (p<0.001) and 2% higher than the MRCP-based features. e feasibility of using MRCPs for hand force motor imagery classi cation was achieved [21].
A consumer-grade brain-computer interface device was proposed which has four channels le with right-hand movement to design an interface to collect a total of closely 600 samples for le -and right-hand motor imagery (MI) from two subjects. Hilbert-Huang Transform was used as feature extraction, then support-vector machine (SVM) and k-nearest neighbors (k-NN) algorithms for learning the features and classification were used. is approach has few abilities to classify le -and right-hand motor imagery EEG signals [22].
A new source separation method was proposed, which used the correct model of the head to un-mix the EEG signals via a different source in terms of their physical locations. It recognized sources located in distinct physical regions of the brain. It's compared with independent component analysis (ICA), the new source separation method had the best spatial speci city as well as allowing higher classi cation accuracy of 8.6% [23].
A framework for overcoming EEG uncertainties in real-time multiclass MI BCI was proposed, the multiclass extension of the common spatial pa ern (CSP) was used for artifact rejection and joint approximate diagonalization (JAD) was used as feature extraction .an adaptive resonance theory (ART) based neuro-fuzzy classi er named self-regulated supervised Gaussian fuzzy adaptive system art (SRSG-Fas Art) was used for multi-class applications. It showed be er multiclass classi cation accuracy as related to state of art method [24]. e workability of Spiking Neural Network (SNN) models in pa ern recognition was tested for classi cation EEG signal with ve tasks i.e. rest, le hand, right hand, foot, and tongue movements in motor imaginary MI, the performance of other traditional classi ers as well as the performance of input features with constant values and input feature were compared power spectral density and wavelet decomposition was used as feature extraction stage, the result showed that with a smaller number of Spiking neurons, simple problems can be solved [25]. Using complementary information to ERD/ ERS-based features. It was proposed aiming to improve the performance of motor imaginary-based EEG classification with the few-channel condition, and together support vector learning (ESVL) based approach was used to connect the advantages of the ERD/ERS-based features and the event-related potential-based features in motor imaginary-based EEG classification. ESVL classifier could be used posterior probabilities to get ensemble learning and the ESVL-based motor imagery classification approach had the advantage of the merits of ERD/ERS based feature and event-related potential based feature to improve the experimental performance [26].
SCP was proposed with Deep ELM as a classi er with Good efficiency [27]. Motion-onset VEP DBN using EEG time points as classi er with 3.5 improvement [28]. SSVEP and CNN were proposed using Band power as classi er w99.28% & 94.03% improvement [29]. P300, CNN with EEG time as a classi er with an accuracy of 95.5% [30]. Band power using DBN with Signi cant improvement [8]. EEG based on CNN was proposed MDA is 82.17%, FBCSP is 84.0% [31]. Band power based on DBN was used with improved accuracy [32]. Band power based on CNN+DBN was proposed with improved of 9% [33]. Workload with Band power and Adaptive DBN was proposed [34]. Motor imagery based on band power using DBN as a classi er with 5.26% improvement [35]. ErrP,P300,MRCP.Motor imagery based on EGE time point using CNN as a classi er with 2% improved [36]. Motor imagery based on EEG Raw data 9% improvement [37]. Motor imagery based on EEG Raw using CNN-VAE as classi er with 3% improved [38].

a.
Deep learning (DL) Deep learning is machine learning that used the model to learn to carry out classi cation tasks from EEG signal, text, images, etc. neural network was used to implement deep learning. e term deep simply means the number of network layers, the higher the layers, the deeper the network. ere are 2 to 3 layers with the traditional network and more than hundreds of layers with the deep network. b.
Application of deep learning EEG signal analysis, Face recognition, voice recognition, and classi cation, text interpretation, sound recognition, traffic sign recognition, lane classi cation, driver assistance, smartphone app, an ATM.
Deep learning has a degree of accuracy compared to other models due to the following properties: mass data can be access easily, a large amount of data can be accessed within a short period, and the model was built by Applied Materials and Technology experts [39].
DNN joint several nonlinear layers via simple mechanisms working in parallel and inspired by biological nervous systems. DNN has input, hidden, and output layers connected through neurons or nodes, the output layer was used as the input of the next layer [40].
In this papers we Used a deep neural network (DNN) and using co-space model (CSP) as a feature extractor, the summary research done using a deep neural network were given in the table below.

METHODOLOGY
A. Experimental Data BCI data set was obtained at(h p://gigadb.org/ dataset/100295), for classi cation with 52 subject, both male and female of 20 to 25years, sat on a chair and relax with arm rests.by imaging the le and right hand movement, the experiment was approved by the institutional review board of gwangju of science and technology.
e data was recorded using 64 Ag/AgCl active electrodes. 64 channel were used using based on 10-10 system, the channel are; AF7, AF3, AFZ, AF4, AF8, Iz with sample rate of 512hz. EEG Data was collected using BCI2000, at time interval of 3s to 9s, with 140 test trials, 120 training and 2 classess, at sample rate of 128Hz, the signal were lter between 0.5-30Hz, the time taken for each trial was 9s long. e anterior '+', posterior '-'of the bipolar EEG channel were measured with C3, CZ, and C4 [16].

b. Flow Chart of Proposed BCI System
Deep learning neural network (DNN) based on pre-processing EEG signals using co-space model (CSP) as feature extractor, the steps involved are shown in Figure  1 below. Data Processing e signal is ltered using a Bandpass lter and the signal frequency is divided into two bands, Beta and Mu band respectively. e deep neural network was used Common Spatial Pa ern (CSP) as the feature extractor.

D. Common Spatial Pa ern (CSP)
Common Spatial Pa ern (CSP) is used as a feature extraction algorithm, used for spatial ltering, usually done for two-class classi cation purposes. spatial distribution component of all classes can be extracted from multichannel data, the idea of CSP algorithms is to diagonalize the matrix to get a set of optimal lters for projection, the difference between the variance of the two types of signals will be maximized, hence, high discrimination accuracy of the feature vector will be obtained [4]. e main basis of CSP Algorithms is spatial lter W, the parameter and equations are as fellow; e category of the preprocessed EEG data is as follow; e known classify (j E [16]) Xi sample covariance matrix can be calculated with following equation: en, normalized covariance of the class can calculate as a fellow, using the following equation, For j= 1 or 2, and nj is the number of trials in each class. e eigenvalue decomposition will be performed using the following equation; W lter the EEG signal using the relation as fellow; Z N+T = W NxN X E NxT , N is the number of a channel of the EEG signals, T denoted the number of the sample point in one test. From the lter matrix Z N+T the feature fp vector as well illustrated in equation 4, the channel number N of the EEG signal will be equal to or less than the feature dimension.
Consequently, by composing the matrix Zp of the rows and last m rows extracted from Z (2M <N) e Generalized Rayleigh quotient based sparse CSP are as fellow; Where T is the transpose matrix. Hence, W, X 1 , X 2 (Xi/i = 1,2) = and (P X1 , P X2 /i = 1,2). e constant value K was multiplied to numerator and denominator, and the equation 5 does not change that is J (W), Le ing the value W T P X2 W = 1, the extreme value of W T P X1 W, W as simpli ed and transform as;

Applied Materials and Technology
(1)

Applied Materials and Technology
By taking the partial derivatives (7) of Lagrangian concerning W, it equal to zero, then P X2 -1 P X1 W λW Based on the above formula, CSP algorithms will be converted into eigenvalue for solving complex EEG signals.
With generalized eigenvalues, Gradient Descent with momentum and adaptive LR was used to compare future extraction results, repeated 5000 times.

e. Gradient Descent Method
Gradient descent is a rst-order iterative optimization algorithm used for obtaining a local minimum of a differentiable function, it's based on the observable multi-variable function F(x) within a point the function will decrease rapidly by from a to the direction of F at a,-∆F(a) Also, γ is a smaller positive real number F (a n ) ≥ F (a n + 1 ) Consequently, F (X 0 ) ≥ F (X 1 ) ≥ F (X 2 ) ≥ F (X 4 ) and so on if the chosen is large to estimate, it will hang or swing around the optimal point, not following the actual result but if chosen small vast amount of iteration and change the approach of the optimum iteration, GDs have being used by researchers classi cation available data. e classi cation performance of motor imaginary (MI) was improved with momentum and adaptive LR [41].

f. Encoder and Decoder
Encoder and decoder were used for converting EEG signal from one form to another for easy processing as well as sending and receiving the signal [42]. Performance Evaluation In this research, the performance accuracy classi cation was evaluated in percentage (%) for both testing and train data.
where TP is true positive, TN is true negative, FN is false negatice and FP is false positive.

h. Linear Regression
Linear regression is a technique that shows and investigates the relationship between two variables, it's used to identify the relationship between our target and output result. And the accuracy, precision, and analysis of the impact of the model of the system are measured. It's given by equations as K= M+IX Where M and X are de ned by equations as: hence, X and K are two variables, I is slope, M is vertical libe, X is rst data A value used and K is second data set used.

ANALYSIS AND RESULT
ree models were used in this research the minimum error of the training and testing was a target as =0.001-0.05, learning rate and maximum epoch are 0.01and 15000 respectively, gradient descent (GD) and gradient descent with momentum and LR (GD LR) functions, have similar design and parameter for processing.

Applied Materials and Technology
e experimental result of the models have an accuracy of 82% with the GD training method as well as GDMLR, the performance depend on the number of iteration that occurs, as more details shown in Figure  3 and Figure 4. e training performance is obtained by Improving Data and Algorithm Tuning. e quality of the models is generally constrained by the quality of training data best performance is obtained at 0.042096 at epoch 19881 shown in Figure 5.

DISCUSSION
e deep neural network was used for the classi cation EEG data le hand and right hand of Motor imaginary (MI), with the following range-band of frequency 8-30Hz, 8-14Hz, and 14-30Hz, mu rhythms are best for feature extraction frequency range of (8-14Hz) and improve the performance with the beta band (14-30Hz), lastly, using confusion matrix models for knowing the performance of classi cation, be er classi cation can be achieved with mu band. e Speci city and sensitivity of the test confusion matrix were found to be 81.4% and 82.0 % respectively shown in gure 9 and 10, and for the train confusion matrix the speci city and sensitivity are also found to be 85.7% and 87.1%, misclassi cation rates were found to be 17.9% and 13.6%.
Our result showed that GDMALR training has a be er performance and is used for classi cation MI than normal GD. Large data required the higher the network parameter to increase the speed of processing, large data affect the system efficiency.
e number of iteration depends on by desired pa ern recognition accuracy. Deep neural networks use the above information for the classi cation of Motor imaginary (MI). Positive regression is obtained as shown in g.7. With intercept of o.1 and training rate of 0.91193 which show less variation, e classi cation curve and number of iteration, the number of iteration is much higher than the number of trials, for 20000 iterations, the time taken was 19s which is equal to 0.95s for each iteration, which showed that the method is fast, the best training performance is at 0.042066 at epoch 19861 shown in Fig. 5, the best performance is at 0.0015998 at epoch 23 which is the best controlling ow of data and avoiding over ing and minimizing the loss. From the Fig. 6. e validation error was zero at 20000 iterations, this means the model used is working perfectly for classi cation Motor imaginary (MI).

CONCLUSION
In this work, an approach to classify motor imagery (MI) EEG signals using a deep neural network (DNN) with CSP feature extraction with standard gradient descent (GD) method and gradient descent method with momentum and adaptive LR (GDMLR) has been proposed. the classi cation accuracy was found to be 87% which is an 11% improvement.
In future work, we plan to use more recent feature extraction and classi cation methods such as spiking neural network, joint time frequency-space classi cation and improve this technique to develop a model based on BCI classi cation tasks.