Multiple classifier system for EEG signal classification with application to brain–computer interfaces

In this paper, we demonstrate the use of a multiple classifier system for classification of electroencephalogram (EEG) signals. The main purpose of this paper is to apply several approaches to classify motor imageries originating from the brain in a more robust manner. For this study, dataset II from BCI competition III was used. To extract features from the brain signal, discrete wavelet transform decomposition was used. Then, several classic classifiers were implemented to be utilized in the multiple classifier system, which outperforms the reported results of other proposed methods on the dataset. Also, a variety of classifier combination methods along with genetic algorithm feature selection were evaluated and compared in order to diminish classification error. Our results suggest that an ensemble system can be employed to boost EEG classification accuracy.


Introduction
A brain-computer interface (BCI) presents one of the most promising assistive technologies for improving the quality of life for physically impaired individuals, by providing a communication channel between the brain of the patient and the outside world, such that mental activities can be used to coordinate actions taking place in the environment [1].The electrical activity of the brain, which is monitored using invasive or noninvasive methods during specific cognitive tasks, is associated with various controlling commands by a set of pattern recognition algorithms comprising the brain-computer interface.
BCIs are primarily used as a rehabilitation strategy for patients in a late stage of amyotrophic lateral sclerosis (ALS) or locked-in syndrome [2].Other applications of BCI include research in neuroscience, controlling robotic elements, gaming and virtual reality [3][4][5][6][7][8].Sensorimotor cortex in humans is responsible for generating neural activity related to execution or imagination of movement.Whenever one imagines movement (i.e., motor imagery), these specific brain rhythms first become attenuated, and then stronger.These two changes are called event-related desynchronization (ERD) and synchronization (ERS), respectively.Hence, the patterns generated by motor imagery can be exploited in a BCI. Figure 1 visualizes ERD/ERS components.
Based on the fact that EEG signals are non-stationary, traditional methods for feature extraction like Fourier transform are not appropriate for analyzing such data.Wavelet is a time-frequency analysis method which decomposes the signal into several scales and is capable of discarding some of decomposed signals which makes it a suitable choice for signal processing [22][23][24][25].Other methods used for feature extraction include CSP, AAR parameters, AR spectral power and principal component analysis (PCA) [26].
CSP is used to filter channels containing the most informative and distinctive data from EEG.However, in this study, the raw EEG data being utilized are already containing three channels with the most informative data (i.e., Cz, C3, C4 that are considered to have the most informative data in a BCI based on motor imagery [27]); thus, despite the CSP being customary in motor-imagerybased BCI, it was not our first choice for feature extraction phase.Additionally, for the ensemble system to be productive, a diverse and distinctive feature space should be fed to experts.Also, in the genetic algorithm feature selection phase, there must be enough number of features to be optimized.Using wavelet transform and statistical measurements, a reasonably adequate number of features are generated making this transform ideal for our study.On the other hand, CSP does not generate as many diverse features as required for the GA feature selection and the ensemble system in our dataset.
Ensemble systems can be used to improve the productivity achieved by a single classifier [28].They move toward improving the performance of classification by considering decisions made by different types of classifiers.There are several reasons, which motivates one to exploit this technique such as small number of data samples for training and high dimension of data samples that makes classification process difficult for a single classifier [29][30][31].Esmaeili in [32] reported better EEG classification accuracy using multiple classifier combination.
Combining procedures can be divided into different categories from a variety of perspectives, three of which are considered here.The first perspective divides combining strategies into classifier selection and classifier fusion.Classifier selection follows a divide-and-conquer approach by assigning a particular part of the problem space to each classifier [33].On the other hand, in classifier fusion, all classifiers are trained over the entire problem space [31].
From the second viewpoint, two taxonomies are considered: trainable and non-trainable combining strategies.Non-trainable combiners are fixed algebraic rules, such as max, min, average or majority voting, while trainable combination rules, such as Stacked Generalization, determine their parameters during a learning procedure [29].
At last, considering how input data are involved with construction of ensemble, there are two main types of combining classifiers: static and dynamic.Dynamic techniques choose an ensemble specifically for each sample from a large pool of classifiers [34], as opposed to static ensemble construction methods which rely on the same set of classifiers for all samples.
In the present study, movement thoughts of left and right hand are primarily represented distinctively using discrete wavelet transform (DWT) and then classified using an ensemble of classifiers.To perform the classification in a better manner, we strived to train each classifier in the ensemble system using different training samples to increase diversity of each classifier.This also improves the accuracy of the ensemble system.
The organization of this study is as follows: The dataset used for this study is elucidated in Sect. 2. The approach used for preprocessing the raw signal using Butterworth band-pass filter is described in Sect. 3

EEG data
For this study, dataset III of BCI competition II was used [35].This dataset was obtained from a normal 25-year-old female sitting on a relaxing chair.The tasks assigned to the subject were motor imageries of left or right hand occurring randomly.The dataset concludes 280 9-second fixed trials.The first two seconds of each trial are quiet.At t = 3, an arrow cue pointed at right or left is displayed for 1 s and the subject is required to move a bar into the direction of the cue.g.tech amplifier and Ag/AgCl electrodes utilizing three bipolar EEG channels, measured over C3, Cz, and C4, were used to record the signals.
The EEG was sampled at 128 Hz and band-pass filtered between 0.5 and 30 Hz afterward.140 trials are reserved for training and 140 trials are reserved for testing, which were randomly selected from the entire 280 trials.

Preprocessing
In order to prepare the original signal obtained from each channel for feature extraction, we first extracted from t = 4 to t = 9.Then, we extracted the portion of signal consisting the l and b frequency bands, in which motor imageries occur.To achieve this goal, we used a sixthorder Butterworth band-pass filter.Figure 2 demonstrates raw and preprocessed signal from C3 channel in one epoch in the frequency domain.

Feature extraction
Experimenting different permutation of available channels led to the conclusion that using C3 and C4 channels for extracting features results in a more discriminative feature space.
We applied discrete wavelet transform in each stage and decomposed the signal into detail and approximation coefficients, respectively, representing low-frequency and high-frequency components.Then, we used wavelet coefficients at each level as features and reduced the dimension of feature space by extracting mean, min, max and standard deviation parameters from them. Figure 3 demonstrates the discrete wavelet transform decomposition process.

Classification
In our experiment, following classifiers were exerted and evaluated:

K nearest neighbor
The nearest neighbor is a classic classifier and is considered as one the simplest of all.K nearest neighbor (KNN) classification is based on finding closest training samples to an unseen point and assigning it to the most dominant class.Even though KNN due to the high dimension of EEG data is not a suitable choice [36], we chose it to increase the diversity among the base classifiers of our ensemble system.Based on empirical results for the dataset, we have come to the conclusion that using 13 nearest neighbors renders to better results for this classifier.To calculate distance between a target sample and other samples in the feature space, euclidean distance measure was used: where d(p, q) is the distance between the samples p and q, p i and q i are the ith feature of the sample and n is the number of features.

Multilayer perceptron
For our experiment, we wanted to evaluate a non-statistical classifier for comparing other classifiers.multilayer perceptron (MLP) fulfills this demand along with simpler implementation comparing to other neural networks [37].For revising the weights of neurons, we have used back propagation algorithm.First, the weights are set randomly and then the values of hidden and output layers are calculated: where O are the hidden layer neurons and Y are the output layer neurons.
where z is the sigmoid function and Z 0 is its derivative.Considering w1 as the value of hidden and input layer weights, and w2 as the value of hidden and output layer weights, DW for output neurons is calculated: where d is the deterministic output and g is the learning rate.Consequently, the value of DW for hidden neurons must be obtained: finally weights are updated:

Naive Bayesian
Bayesian classifier is a simple classic probabilistic classifier which is based on Bayes' theorem.In this classifier, each class with highest post-probability will be addressed as the resulting class [38].The simplicity of this classifier makes it an appropriate candidate for evaluating other classifiers.Power of rejection, meaning the capability of classifier to address an input sample as unpredictable, makes this classifier useful for dealing with uncertain conditions in EEG signal.Another compelling reason for using this classifier is the ability to produce outputs used for soft level combining in the ensemble system [30].The naive Bayesian classifier assumes that features are independent in each class and predicts the class of an incoming instance X containing features [x 1 .. x n ] by calculating the highest probability of C i given X [39]:

Linear discrimination analysis
Linear discrimination analysis (LDA) is a linear classifier, which assumes that the two classes are linearly separable [38].LDA separates the data using a hyperplane, which is obtained by seeking a projection such that Fisher criterion (i.e., simultaneously, maximizing the distance between centroids of each population while minimizing the interpopulation variance) is satisfied [38].Its drawback is reflected in its linearity, which yields poor results for complex nonlinear data.The within-class scatter matrix S w and the between-class scatter matrix S b are defined as: where l i is the mean of the class C i , l is the mean of all samples and c denotes the number of classes.Then, we seek a transformation matrix W, which maximizes the between-class scatter while minimizing the within-class scatter.We achieve that when the Fisher criterion satisfied: 3.3.5Support vector machine Support vector machine (SVM), another well-known binary linear classifier, also tries to select a hyperplane, with the exception that it improves its discrimination by maximizing the margins (i.e., the distance from the hyperplane to the nearest training samples called support vectors) [40,41].Margin maximization will result in increased generalization capability for unseen data points.SVM is a good choice for classification in a high-dimensional space and is known for not being sensitive to the risk of over training [42].Linear SVMs realize the large margin (i.e., optimal hyperplane) by minimizing the cost function below under the constraints where ||.|| 2 denotes the Euclidean norm, n is a vector of slack variables, b is the bias and C is a regularization parameter.It is of great importance to select an appropriate value for C, which controls the trade-off between the complexity and the number of non-separable points.

Classifier ensemble
Several methods exist for creating an ensemble system which we have implemented the followings: Bagging: In the bootstrap aggregating algorithm (aka bagging) given the data containing m training samples, n number of subsamples with the same size as the original data is selected (with replacement).An instance may appear more than once in a subsample or may not appear at all [43].Subsamples are used to train weak learners.Finally, a new instance is classified by winning a vote among constructing classifiers.
Adaboost: The Adaboost is a well-known algorithm for improving the accuracy of weak learners [44].It prognosticates the distribution over the training samples and denotes a weight for each classifier by using a weighted majority vote for predicting labels.Firstly, Adaboost designates a weight distribution to each sample and a subset of samples is chosen by each classifier for learning phase.The initial weights distribution is uniform.Next, a weak classifier creates a hypothesis in order to calculate the error of the classifier (Eq.14) [29].
where e t is the error term of each expert, x i is a sample, y i is the predicted output and D t (i) is the weight of each sample.For each classifier, there is a defined weight (Eq.15) which is used in updating weight distribution for the next expert (Eq.16).
where z t is a normalized term and is equal to the sum of weights distribution, b t is the weight for an expert, D t?1 (i) is the weight of sample for next expert and h t is a hypothesis.For predicting a test sample, all experts weighted votes are received for each class and the class that receives the highest vote in a voting process is considered as the final decision (Eq.17).
where v j is the result of experts supporting class j and W j represents class j.Behavioral knowledge space (BKS): BKS proposed by Haung and Suen uses the knowledge based on the behavior of classifiers.It is a table concluding k rows, each representing a classifier decision, t number of classes and number of arrangements of classifiers decisions (knowledge space) is equal to t k [45].In the training phase, BKS algorithm constructs a knowledge space with different arrangements of classifiers decisions and counts number of samples belonging to each class, the class with the most occurring samples is marked as the predicted label.In the test phase, using the decisions made by classifiers, a column is indexed in the knowledge space, which its label is considered as the predicted label.
Majority voting: Plurality majority voting technique gathers opinions of each classifier and checks which class label is most reported by classifiers and choose that label as the final decision for incoming test sample.Using the notion from [29], assume the opinion of an individual classifier as d t;j 2 f0; 1g which depicts support for class x j ; t ¼ 1. ..T and j ¼ 1. ..C, where T is the number of classifiers and C is the number of classes.The formulation for choosing class x j as the final decision would be expressed as Eq.18.
Weighted majority voting: Knowing that some classifiers perform better than others, their decision could be weighted and have more influence than other classifiers.This approach may further improve the performance obtained by plurality voting.Finding a weight for a classifier can be accomplished via several measures.Using genetic algorithms and the performance of the classifier as the fitness function, we estimated weights for the classifiers in the ensemble system.Assuming W t is the weight of the classifier, the formulation for choosing class j as the final decision via weighted majority would be expressed as Eq.19.
Combining continuous outputs: Classifiers are capable of reporting continuous outputs, which demonstrates their tendency toward a specific class.In our study, we applied several non-trainable algebraic combiners.Consider the notion in Eq. 20 which is taken from [46].l j ðxÞ ¼ n½d 1;j ðxÞ; . ..; d T;j ðxÞ ð20Þ where each element of the vector holds a continuous value representing the tendency of sample j to a class.Then, using n which is one of the following functions, l j (x) for each class is calculated and the class with the largest value is considered as the winner.Mean Rule: Using this rule, we calculated the average of all classifiers continuous output which shows support for x j : where 1/T is the normalization factor Min/Max/Median Rule: As the names of these rules imply, we also selected the minimum, maximum or median of classifiers continuous output as functions to choose the largest value as the winner class.
l j ðxÞ ¼ min Decision template: Decision template is an approach initially introduced by Kuncheva [31] for combining continuous outputs of an ensemble system.It works based on the principle of decision profiles.Decision profile is a matrix, which its rows represent classes and its columns represent classifiers soft labels.The average of decision profile for each class is equal to decision template of the class in the training set: where N j is the number of all samples which belong to class j.Considering X j as a training sample, W j is a class, C as the number of classes, T as the number of experts and m j (x) as distance between the decision profile of the test sample and decision template of class j, the Euclidean distance is calculated between decision template for each class and test sample decision profile (Eq.23), thus each class having the minimum distance is the predicted label [29].
Genetic ensemble feature selection: Using genetic algorithms, which is an evolutionary optimization technique, has been proven to be an effective way for finding the optimal feature subsets [47].Using GA for ensemble feature selection was first proposed by [48] by using the accuracy of base classifiers as the fitness function.Various combinations of features, generated in each generation, are represented by binary strings (i.e., each bit denotes the absence or presence of each feature).Until a certain stop criterion is met, generation process is repeated by producing offspring chromosomes from previous population parents and evaluating them by the fitness function to find the suboptimal solution.Using genetic algorithm to select optimal features for an individual classifier also yields diverse decisions.

Experimental results
Table 1 demonstrates a summary of classification error obtained by groups which attended in BCI competition II and utilized dataset III.Each row denotes classification error of a certain group.Table 2 displays recognition error of the classification systems we implemented.Using genetic algorithm for feature selection and weighted majority voting as the classification approach yields the best recognition rate.
For choosing the optimum number of neighbors for KNN classifier, we evaluated several numbers which is demonstrated in Fig. 4.
Additionally, after several experiments, we found optimum number of hidden layer neurons for MLP which yields better recognition rate.Figure 5 demonstrates recognition rate for different number of hidden layers.Furthermore, as mentioned earlier, using C3 and C4 channels for feature extraction evolves the recognition rate.Table 3 demonstrates different permutations of channel selection and their recognition rates using different classifiers.
To show the classification results and compare single classifiers to proposed method, we used a confusion matrix (Table 4).A confusion matrix is a square matrix, which includes information about actual and predicted labels designated by a classification system.The contribution presents several approaches for classification of EEG signal based on ERS/ERD phenomena.We reduced the dimensions of the recorded data and extracted features using Wavelet transform.Based on the fact that EEG signals are vulnerable to noise, there may exist noisy and useless features in the feature vector, and therefore using a feature selection method such as genetic algorithm is salutary in finding the optimum feature space.Ultimately, weaker classifiers when joint can create an  ensemble system which increases precision when classifying motor imageries arising from the brain.

Fig. 1 a
Fig. 1 a ERD/ERS components in an observed brain signal.b Topographical map of ERD/ERS components in a hand movement motor imagery (The image originally appeared in [9])

Fig. 4 Fig. 5
Fig. 4 Various number of nearest neighbors were evaluated, 13 number of nearest neighbors renders to the best results

Table 2
Obtained results from classification experiments.Using weighted majority voting yields the best results

Table 3
Recognition rate of various channel(s) selection

Table 4
Confusion matrix of the base classifiers and the proposed multiple classifier system