Design of Automated Real-Time BCI Application Using EEG Signals

This study proposed a design of real time BCI application using EEG recording, pre-processing, feature extraction and classification of EEG signals. Recorded EEG signals are highly contaminated by noises and artifacts that originate from outside of cerebral origin. In this study, pre-processing of EEG signals using wavelet multiresolution analysis and independent component analysis is applied to automatically remove the noises and artifacts. Consequently, features of interest are extracted as descriptive properties of the EEG signals. Finally, classification algorithms using artificial neural network is used to distinguish the state of EEG signals for real time BCI application.


Introduction
Electroencephalogram (EEG) is the recording of electrical activities of human brain using electrodes attached to the scalp.Conventionally, EEG is used for clinical diagnosis of epilepsy and sleep disorder.In recent decades, EEG have been studied and finding increasing use in Brain Computer Interface (BCI) application.The EEG signals are described in frequency bands of delta (0.5 to 4 Hz), theta (4 to 8 Hz), alpha (8 to 12 Hz) and beta (12 to 32 Hz), each of which is attributed to different aspects of brain activity.
In practical settings, EEG signals are often contaminated by noises and artifacts during the recording.There are two types of artifacts that contaminated the EEG signals, namely, biological and environmental artifacts. 1,2iological artifacts are signals arising from non-cerebral origin of the human body, such as cardiac, ocular or muscles activity.On the other hand, environmental artifacts are signals that originate from outside of human body, such as interference from external devices.Artifacts recorded in EEG signals distorted power spectrum and influenced the decision-making process of BCI application.Therefore, a pre-processing step to remove the noises and artifacts of EEG signals is necessary.and signal artifacts. 3,4Wavelet based multiresolution analysis using Discrete Wavelet Transform (DWT) is more effective in removing the target artifacts, while retaining the cerebral activities of interest in EEG signals. 5,6Meanwhile, Independent Component Analysis (ICA) algorithm using blind source separation is able to isolate the target artifacts into a separated Independent Component (IC). 2,7Combinatorial use of Wavelet Multiresolution Analysis (WMA) and ICA are able to isolate and remove noises and artifacts without incurring substantial loss of cerebral activities of interest in EEG signals. 1,8 this study, we designed an automated pre-processing step using WMA and ICA to remove noises and artifacts in EEG signals.Then, feature extraction and classification of EEG signals is applied for real time BCI application.

Wavelet Multiresolution Analysis
WMA incorporates the steps of DWT and inverse DWT. 8 The DWT is an implementation of wavelet transform using discrete set of wavelet scales and transitions. 6,9WT consists of sequential application of low-and highpass filters to decompose a discrete signal into multiple wavelet components, as shown in Figure 1.Here, x[n] represents a channel of EEG signal passed through a low pass filter, g[n] and a high pass filter, h[n] simultaneously.This process is repeated until each channel of the EEG signal is decomposed into n levels of wavelet details, i.e.D1(t), D2(y), ..., Dn(t) and a mother wavelet of An.
On the other hand, inverse DWT is applied in a similar but reversed sequence by combining wavelet details and mother wavelet into a discrete EEG signal.

Independent Component Analysis
ICA model describes multivariate signals as a mixture of its source components, by assuming that the multivariate signals, x are separable into their statistically independent and non-Gaussian source components, s.The relationship between the signals and its source components is described by the equation x As (1) In equation ( 1), A is the unknown mixing matrix estimated by using the ICA algorithms. 7,10The un-mixing matrix, W is then computed as the inverse of estimated mixing matrix.The source components, s are revealed by using the equation s Wx (1)   On the other hand, inverse ICA is accomplished by multiplying the inverse of estimated mixing matrix, W -1 with the source components, s.

Artificial Neural Network
Artificial Neural Network (ANN) is a computational model based on interconnected adaptive neurons that resemble the biological neural network. 11Each processing neurons operating in parallel receives input from the input layer or its preceding tier and further the processed information to its successive tier or output layer.ANN can be described by the transfer functions of their neurons, the learning rules and the connection formula. 12ANN are adaptive and able to learn by observing and weighting on the importance of input datasets.In supervised machine learning, ANN model trained with sufficient number of training data can be used to make prediction or classification on test data to determine the dataset in which the test data might belong.

Design of System
This study proposed a design of real time BCI application using the following steps: EEG recording, pre-processing, feature extraction and classification.The design of the system is illustrated in Figure 2.

EEG Pre-processing
Automated pre-processing step is applied to the recorded EEG signals using the following steps: (1) Wavelet Multiresolution Analysis is applied to decompose each channel by DWT to 8 levels with mother wavelet of db8. 5 Then, only the wavelet components of D3 to D8 corresponding to the frequency range of 0.5 to 32 Hz is retained to remove unwanted noises and artifacts outside the frequency range of interest.(2) Blind source separation using ICA is applied to isolate the artifactual components, in this case, the eye blink artifacts to be removed by wavelet denoise algorithm. 1,13(3) Separated ICs and wavelet components are recombined using inverse ICA and inverse DWT respectively to reconstruct the clean EEG signals as shown in Figure 4.

Feature Extraction
The pre-processed EEG signals are separated into 1 second epochs and features of interest are extracted by using DWT.Each channel of the EEG signal is decomposed to wavelet details each represent the frequency bands of EEG signals defined as delta (0.5 to 4 Hz), theta (4 to 8 Hz), alpha (8 to 16 Hz) and beta (16 to 32 Hz) bands.The coefficients of the wavelet details are taken as features that characterize the properties of the EEG signals in each corresponding frequency band.

Classification
Classification of EEG signals is conducted using ANN.The ANN model is trained using both target and nontarget datasets and applied to classify the test data in real time BCI application.In this study, we applied the system to classify target state of "alert with eyes-open" and nontarget state of "relax with eyes-closed". 14By using 1190 epochs of data and 10 layers of hidden neurons, an overall accuracy of 97.6 % calculated using 10 fold cross validation is achieved as shown in Table 1.P -705

Discussion
The Wavelet based multiresolution analysis are applied as wavelet decomposition is more effective in preserving the structure of the EEG signals in both time and frequency domains. 5,13Mother wavelet of db8 is selected due to its balanced performance and computational simplicity for real time application. 5ter the pre-processing steps, feature extraction using wavelet decomposition is applied to extract the features of interest.The features of interest are the coefficients of wavelet details each corresponding to frequency bands activities of delta, theta, alpha and beta band.The wavelet coefficients are computed due to its better performance in characterizing the structure of EEG signals.Lastly, supervised machine learning using trained ANN model is applied for classification of EEG signals.We are eager to apply the system in BCI applications in real time setting.

Conclusion
This study proposed a design of automated real time BCI application using EEG signals.EEG signals are notably noisy and contaminated by artifacts.The proposed pre-processing steps using WMA and ICA effectively removed the noises and artifacts with minimal distortion to the cerebral activities in frequency bands of interest.Then, feature extraction is applied using DWT to extract the coefficient of wavelet details corresponding to each frequency band of interest.Lastly, classification algorithm using ANN are applied to classify the EEG signals in real time BCI application.

Fig. 1 .
Fig. 1.Block diagram of Discrete Wavelet Transform (DWT) of a discrete signal, x[n].The annotation ↓2 denotes sampling reduction by a factor of 2, i.e. two-fold down-sampling of the signal.

Fig. 4 .
Fig. 4. Similar segment of EEG signals after pre-processing step is applied.Eye blink artifacts and high frequency noises are removed while underlying cerebral activities within frequency range of interest (0.5 to 32 Hz) is retained.

Table 1 .
Classification result for "alert with eyesopen" and "relax with eyes-closed" EEG signals.
proposed system design function to automatically filter and classify target data of EEG signals in real time BCI application.Recorded raw EEG signals are preprocessed using a combination of WMA and ICA to remove noises and artifacts while retaining cerebral activities in frequency bands of interest.The preprocessing steps are important as EEG signals are highly contaminated by noises and artifacts in a practical setting.