## 3 Results
### Neuronal Network
\begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Number of Neurons**} & \multicolumn{2}{c}{**Training**} & \multicolumn{2}{c}{**Testing**} \\ \cline{2-5}  & **Cost** & **Accuracy** & **Cost** & **Accuracy** \\ \hline
8 & 0.51 & 72.87 & 0.35 & 94.65 \\
16 & 0.52 & 74.00 & 0.38 & 84.65 \\
32 & 0.58 & 72.89 & 0.41 & 84.62 \\
64 & 0.53 & 74.00 & 0.38 & 93.23 \\
128 & 0.59 & 64.25 & 0.38 & 82.35 \\
256 & 1. In the second stage, optimization, validation and an increase in generalization capacity, the database used in stage one was divided into 80% for training and 20% for testing (another test was conducting for ordering the datasets into 80% for training, 10% for validation and 10% for testing) using the SGD optimization algorithm. The algorithms presented in this article were developed in the LabVIEW 2020 SP1 programming environment with a 17-inch high-performance portable computing system with an Intel processor, four cores @ 3.2 GHz, 16 GB DDR3 RAM @ 1600 MHz, 256 GB SSD, 1 TB HDD, and high-performance dedicated video card, optimized for computer graphics, with task motor imagery detection for optimized for computer graphics to train and test the MLP-RNN neural network with ICA and r\({}^{2}\) algorithms. The final part of a deep network is represented by one or more fully connected multilayer perceptron (MLP) layers that perform the classification part, using as inputs the outputs of the initial recurrent part (characteristics automatically extracted by it) obtained for each applied signal network input. The optimizer is the algorithm that decides in which direction and how strongly to change the weights in the network. In order to adjust the parameters of a network (weights and displacements), an optimizer must be used that decides the modification strategy according to the gradients obtained with the help of the loss function. The algorithm used is Calibrated Stochastic Gradient Descent (CSGD). The optimizer requires specifying the size of the optimization step, also called the learning rate, which in our tests was kept constant at \(10^{-5}\). It is, practically speaking, an iterative optimization process that aims to reduce the error (respectively the difference between the expected output and the one obtained in that iteration) estimated using a cost (or loss) function. In this way, those inputs and characteristics that are the most relevant for obtaining the desired output are enhanced. This experiment resulted in a classification accuracy of 95.67%, recall of 0.96 and micro average F1 score of 0.97. The confusion matrix is shown in Table 5 and the classification report is given in Table 6.  
This was to be expected as the cost does not provide information on accuracy. The latter is calculated according to the formula  
\[\text{accuracy}=\frac{\text{number of cases classified correctly}}{\text{number of total cases}} \tag{8}\]  
and the cost function used is binary cross-entropy and behaves according to the following law  
\[\mathcal{L}=-\frac{1}{n}\sum_{i=1}^{N}y_{i}log(g)+(1-y_{i})log(1-g) \tag{9}\] \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Classes** & **Precision** & **Recall** & **F1 Score** \\ \hline Background Noise & 1 & 1 & 1 \\ Single MI task & 0.99 & 0.98 & 0.98 \\ Two MI tasks & 0.98 & 0.97 & 0.97 \\ Average/total & 0.98 & 0.95 & 0.96 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Classification report for MLP–RNN with ICA and r2. \begin{table}
\begin{tabular}{c c c c} \hline \hline  & \multicolumn{4}{c}{**Predicted Label**} \\ \cline{3-4}  & \multicolumn{2}{c}{**Background Noise**} & **Single MI Task** & **Two MI Tasks** \\ \hline \multirow{3}{*}{True Label} & Background Noise & 1.00 & 0.00 & 0.00 \\  & Single MI task & 0.00 & 0.96 & 0.06 \\ \cline{1-1}  & Two MI tasks & 0.00 & 0.93 & 0.57 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: The confusion matrix from MLP–RNN with ICA and r2. In the field of neural networks, there are two phenomena that can occur during training: underfitting and overfitting.