# Ensemble Voting-Based Multichannel EEG Classification in a Subject-Independent P300 Speller
## 2 Overview of Classifiers
### Convolutional Neural Network  
CNN has become quite popular in BCI research over the last decade. CNN can process multichannel EEG data without additional dimensionality reduction and preprocessing.  
CNN has shown good results when applied in BCI research. For instance, residual blocks as part of the ResNet architecture achieved 96.77% accuracy for one subject and 93.3% for another [28]. Still, the model is not subject-independent, as the difference between the results was more than 3% [28]. That is why standalone CNN is not a very popular choice for the P300 speller. CNN can be combined with a long-short term memory (LSTM) neural network in an autoencoder for more efficient dimensionality reduction [29]. It also can be used in ensemble models. The ensemble voting classifier comprised of two CNNs achieved 96.5% accuracy, and the same accuracy was obtained by ensemble learning with SVM [30].  
1D CNN architecture was applied for multichannel EEG data. The depth of the output of a convolutional layer becomes equal to the number of filters applied. For example, by applying 16 kernels, we obtained the output of the same width and length, but with a depth of 16. The CNN architecture used for multichannel EEG classification is presented in Figure 2.  
The CNN uses several convolutional layers, followed by the pooling layers. To achieve faster dimensionality reduction, we used an \(8\times 8\) kernel (or filter). The pooling layers used a \(2\times 2\) kernel, which found the maximum among the input values, as max pooling turned out to be more efficient than average pooling. By comparing different activation functions, such as sigmoid, tanh, and rectified linear unit (ReLU), the CNN model achieved 76.53% accuracy on validation during 20 training epochs using the ReLU activation function, 73.21% using the tanh, and only 61.08% accuracy using the sigmoid. Moreover, while using the sigmoid and the tanh activation functions, the error gradient vanished due to multiple hidden layers. Therefore the ReLU, which is computationally less expensive, was used here. The ReLU function is defined as  
Figure 2: Architecture of the CNN used: features are extracted using convolutional and pooling layers, followed by linear layers.  
\[\text{ReLU}(\bar{X}_{i})=\text{max}(0,\bar{X}_{i}), \tag{3}\]  
where \(\bar{X}_{i}\) is the feature vector resulting from the previous layer.  
The last linear layer of the CNN uses softmax as an activation function. The softmax function is a generalization of the sigmoid function, and when the number of classes is two, the softmax function reduces to the sigmoid function. It is calculated as  
\[\text{softmax}(\bar{X}_{i})_{j}=\frac{e^{x_{j}}}{\sum_{k=1}^{K}e^{x_{k}}}, \tag{4}\]  
where the exponential of each data point \(x_{j}\) is normalized by the sum of the exponentials of all K data points of the feature vector \(X_{i}\). The output of the linear layer was a vector of length of 2. It represented the probability of the input EEG data being a target P300 component \(P(X_{i},y=1)\) or a nontarget component \(P(X_{i},y=-1)\).