## 2 Materials and Methods
### Proposed Methodology for Signal Processing
#### 2.3.4 Classification of Motor Imagery Tasks from EEG Signals  
For the classification of motor imagery task from EEG waves, we propose a hybrid neuronal network RBF based on RNN to which we add an additional MLP layer to increase performance. Radial Function Based (RBF) Neuronal Network  
Neural networks with radial transfer functions, also called type networks \"RBF\" (\"Radial Basis Functions\"), are considered universal approximators and consist of a number of N input units, K units on the hidden layer and M output units. These networks differ from the multilevel feedforward ones by the integration and transfer functions specific to the hidden level. A unit \(k\) on the hidden level produces a signal \(u_{k}\) corresponding to an input signal \(X\), given by the relation  
\[y_{k}=g_{k}\Big{(}\|X-C^{k}\|\Big{)} \tag{3}\]  
where \(C^{k}=(c_{k1},\ldots,c_{kN})\) is the vector of the weights of the connections to the unit hidden k, also called its center or prototype. Thus, the function of the integration associated with the hidden unit is based on the calculation of a distance between the input vector and the corresponding center. Euclidean distance is the most commonly used and is given by the relationship  
\[\|X-C^{k}\|^{2}=\sum_{i=1}^{N}\Big{(}x_{j}-c_{kj}\Big{)}^{2} \tag{4}\]  
Transfer functions are characterized by radial symmetry and have locality property, i.e., they produce significant values not only for small values of the argument but for large values tending to zero. The usual transfer functions are Gaussian or Cauchy. The network produces an output vector \(\mathrm{Y}\in\mathrm{RM}\) that has the components  
\[y_{i}^{2}=\sum_{i=1}^{N}\Big{(}w_{ik}c_{k}\|X-C^{k}\|\Big{)}-w_{i0} \tag{5}\]  
where \(W=(w_{ik})_{i=\overline{1,N},k=\overline{0,R}}\) is the matrix of the weights of the connections between the hidden and the output level. If the input data range is covered by the receptive fields of the units on the hidden layer, then a good behavior of the network will be obtained. RBF networks are universal approximators, the quality of the approximation depending on the number of hidden units. For example, 4 neurons in the output layer are needed to classify 4 classes of EEG signals (Figure 10). The EEG signals shown in Figures 11 and 12 were used to train and test the RBF neural network. Figure 10 shows the EEG signals related to MI left hand, and Figure 11 highlights the signals related to the MI right hand. Figure 11: EEG signals associated with MI left hand used for RBF training and testing. Figure 10: RBF neural network architecture used to classify EEG signals. Deep Neuronal Network  
To see the separability of the classes, various architectures of deep neural networks were used. As previously mentioned, the features provided as input data consist of the correlations extracted with the ICA and r2 algorithms. Thus, the networks were tested with a number of hidden layers ranging from 1 to 7. Additionally, the number of neurons on each layer varied between 8 and 256 (more precisely, 8, 16, 32, 128, 256 neurons per layer were used). The activations tested were sigmoid, tanh and arctan. They were used due to the fact that they are known to have good results, especially for class problems [48; 49], but also for estimation problems [50]. Results with activation functions that deny components' negatives (e.g., ReLU, Leaky ReLU) were not used in this paper because they provided random responses (an accuracy of around 50%). One possible reason for this is the phenomenon called dying ReLU. It refers to the fact that if too many weights take values below 0 the activation result will be 0, so data discrimination becomes impossible. The optimization technique used was Stochastic Gradient Descent (SGD). This algorithm is used in the field of deep neural networks and generally provides satisfactory results [51; 52; 53; 54].