## 4 Pattern Recognition
### Restricted Boltzmann Machines
These sessions were carried out using smiley feedback (see Figure 11b), which the initial state was centered and gray-colored. At the second two, a warning tone was emitted, which preceded a cue that lasted from second 3 to 7.5. According to the given cue, subjects had to move the smiley to the left or right by imagining hand movements towards those directions. The smiley changed color from gray to green or red and the curvature of the mouth from happy to sad if the direction was either correct or incorrect according to the cue, respectively. Figure 10: EEG and EOG electrode montage. Figure 9: One Iteration 4-Fold Cross Validation partition of the data set. ### Data Processing

Two different approaches were designed for the data processing step. The first one consisted of testing the performance of the classifiers with a large range of frequency bands and without any EOG removal. To do this, the data were transformed into a frequency domain between (8-30) Hz, which is the range in which changes in amplitude occur. Then, the second approach was to reduce the frequency bands into two different ranges, (8-12) Hz and (22-30) Hz, and the EOG was removed using the previously proposed regression. A specific SOM was trained for over 50 epochs for each one of the nine subjects to obtain an internal representation of both classes in order to observe if they could be easily discriminated against. Each SOM had 100 units distributed in a 10 \(\times\) 10 matrix (see Figure 12), an initial learning rate \(\eta_{0}=0.2\), an initial lattice width of (\(\sigma_{0}=10\)) and updating constants \(\tau_{\eta}=100\) and \(\tau_{\sigma}=4\). Being an unsupervised method, the training dataset was used to tune the weights of the SOM, and the testing dataset was used to observe the final internal representation that it could generate. In this case, the first three sessions were used as training data and the remaining two as testing data. Figure 11: The paradigm of the recorded data. Figure 12: Neuron Distribution over the SOM. The other techniques were supervised methods, where the testing dataset was used to check the final classification accuracy of each method. K-fold cross-validation was done to better evaluate the results of these algorithms, with \(k=5\). In other words, the data were split so that one of the recorded sessions was considered as testing data and the reminding sessions as training data. This process was repeated five times, then the accuracy was averaged. As LDA calculates the mean and scatter matrices, it does not require any specific training parameter, so the process is as straightforward as shown in Section 4.2. For the SVMs, since this problem is a binary classification problem, there was no need to use any expansion method. However, the SVMs were trained on a radial basis using the kernel function \(K(x_{i},x_{j})=exp(-(1/2\sigma^{2})||x_{i}-x_{j}||^{2})\), which is one of the most common kernels used for BCI. The box constraint parameter \(C=1e-2\) was used since it gave the best overall results. A 1000-neuron Artificial Neural Network was trained using backpropagation, which had a learning rate of 0.05 and a momentum of 0.01. The weights were initialized through a normal distribution \(N(0,0.01^{2})\). The ANN has trained over 100 sweeps (or epochs) with batches of 100 randomly selected EEG trials. Finally, the RBM initial training parameters (weights, biases and rates) were obtained from [56] and adapted after some preliminary analysis. The RBM was trained over 100 epochs, each comprising Contrastive Divergence updates derived from 10 Gibbs sampling iterations (CD10). The training datasets were composed of mini-batches of 100 randomly selected EEG trials. The weights were drawn from a normal distribution \(N(0,0.1^{2})\) for the Gaussian-Binary connections and \(N(0,0.01^{2})\) for the Softmax-Binary connections, with each bias initialized at zero. The weights and biases were updated with a learning rate of \(10^{-3}\) and a momentum of 0.5 with an increment of 0.1 at 40% and 80% of the learning process.