# Decoding Visual Motions from EEG Using Attention-Based RNN
## 5 Results and Discussion
### Performance of Attention-Based GRU with Skip Connections  
Five-fold cross-validation is used to obtain the final classification results of the dataset that contained 6000 trials. To make sure that the attention layers for AL-GRU and GRU-AL have the same size, the state size of GRU is set to 31, consistent with the number of signal channels. Table 2 shows the decoding accuracies of the attention-based GRU with skip connections for different numbers of stacked layers. The performance of GRU improves after the addition of skip connections, which alleviates the degradation caused by the increase in network depth. AL-GRU achieves the best classification rate of 61.74% when the number of stacked layers is four, better than that obtained in EEGNet-8,2, but worse than that obtained in DeepConvNet.  
The parameters numbers for these three structures are 2.4k, 28.5k, and 184.5k, respectively. It seems that DeepConvNet has obvious superiority due to its complex structure and the larger parameter amount. The attention mechanism boosts the performance of GRU, especially when there are few stacked layers. This may be because the attention mechanism improves the limited feature extraction ability of the shallow network, so that it can learn high-level features which are more robust among trials. The confusion matrices of AL-GRU, EEGNet-8,4, and DeepConvNet are shown in Figure 5.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Motion** & **Contraction** & \multicolumn{2}{c}{**Expansion**} & \multicolumn{2}{c}{**Rotation**} & \multicolumn{2}{c}{**Translation**} \\ \hline RTs (ms) & 346.88 \(\pm\) 66.53 & 338.95 \(\pm\) 65.03 & 328.66 \(\pm\) 67.86 & 341.72 \(\pm\) 59.16 \\ \hline \multirow{3}{*}{\(p\)-VALUES} & C-E & 1.00 & E-C & 1.00 & R-C & 0.076 & T-C & 1.00 \\  & C-R & 0.076 & E-R & 0.898 & R-E & 0.898 & T-E & 1.00 \\  & C-T & 1.00 & E-T & 1.00 & R-T & 0.434 & T-R & 0.434 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Reaction times (RTs) and \(p\)-values for multiple comparison tests.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Layers** & **GRU** & **SC-GRU** & **AL-GRU** & **GRU-AL** & **EEGNet-8,4** & **DeepConvNet** \\ \hline
1 & 57.08 \(\pm\) 0.11 & 59.44 \(\pm\) 1.02 & 58.60 \(\pm\) 0.37 & & \\
2 & 57.16 \(\pm\) 0.58 & 58.04 \(\pm\) 0.99 & 59.90 \(\pm\) 0.18 & 59.68 \(\pm\) 0.75 & & \\
3 & 54.66 \(\pm\) 1.86 & 59.20 \(\pm\) 1.30 & 60.76 \(\pm\) 1.39 & 59.86 \(\pm\) 1.45 & 60.02 \(\pm\) 1.84 & 64.82 \(\pm\) 0.89 \\
4 & 55.04 \(\pm\) 2.20 & 60.36 \(\pm\) 1.99 & 61.74 \(\pm\) 1.86 & 61.24 \(\pm\) 1.80 & & \\
5 & 53.84 \(\pm\) 0.70 & 59.62 \(\pm\) 0.91 & 59.80 \(\pm\) 1.22 & 59.68 \(\pm\) 0.52 & & \\
6 & 53.52 \(\pm\) 2.03 & 59.46 \(\pm\) 2.02 & 59.98 \(\pm\) 1.03 & 59.18 \(\pm\) 1.98 & & \\ \hline \hline \end{tabular}
\end{table}
Table 2: Accuracies of models with different number of layers (%).  
The confusion pattern from the confusion matrix for the single-trial EEG classification is apparent. The model is prone to misprediction between contraction and expansion and between rotation and translation. The recall for a category less than 50% suggests that the model tends to mistake it for the other similar category. For example, the recall of DeepConvNet for contraction is 39.40%, with more than half of the contraction examples being incorrectly predicted as expansion. The performance of the models needs to be further improved.