Next Article in Journal
Adaptive Filtering for Multi-Track Audio Based on Time–Frequency-Based Masking Detection
Previous Article in Journal
How Time Window Influences Biometrics Performance: An EEG-Based Fingerprint Connectivity Study
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

EEG-TCNTransformer: A Temporal Convolutional Transformer for Motor Imagery Brain–Computer Interfaces

by
Anh Hoang Phuc Nguyen
,
Oluwabunmi Oyefisayo
,
Maximilian Achim Pfeffer
and
Sai Ho Ling
*
Faculty of Engineering and Information Technology, University of Technology Sydney, Ultimo, NSW 2007, Australia
*
Author to whom correspondence should be addressed.
Signals 2024, 5(3), 605-632; https://doi.org/10.3390/signals5030034
Submission received: 7 August 2024 / Revised: 9 September 2024 / Accepted: 18 September 2024 / Published: 23 September 2024

Abstract

:
In brain–computer interface motor imagery (BCI-MI) systems, convolutional neural networks (CNNs) have traditionally dominated as the deep learning method of choice, demonstrating significant advancements in state-of-the-art studies. Recently, Transformer models with attention mechanisms have emerged as a sophisticated technique, enhancing the capture of long-term dependencies and intricate feature relationships in BCI-MI. This research investigates the performance of EEG-TCNet and EEG-Conformer models, which are trained and validated using various hyperparameters and bandpass filters during preprocessing to assess improvements in model accuracy. Additionally, this study introduces EEG-TCNTransformer, a novel model that integrates the convolutional architecture of EEG-TCNet with a series of self-attention blocks employing a multi-head structure. EEG-TCNTransformer achieves an accuracy of 83.41% without the application of bandpass filtering.

1. Introduction

Artificial intelligence (AI) is versatile and supports people in various areas, such as intelligent medicine, transportation, education, and entertainment. Brain–control interface (BCI) is a research field in AI that learns and extracts information in human brain waves to control assistive devices such as prosthetic hands [1], intelligent wheelchairs [2], and exoskeletons [3]. In 2013, the Centers for Disease Control and Prevention estimated that about 5.4 million people, which accounted for 1.7% of the United States population, had been living with paralysis [4]. Regarding the methods for collecting brain waves, BCI can be categorised into invasive, partially invasive, and non-invasive. Electrode devices are implanted directly into human skulls for invasive methods. However, the risk and potential complications after surgery have restricted patients to invasive methods. Non-invasive methods place electrodes on the scalp’s surface to record data. There are many non-invasive modalities, such as electroencephalography (EEG) [5], positron emission tomography (PET) [6], magnetoencephalography (MEG) [7], functional near-infrared spectroscopy (fNIRS) [8], and magnetic resonance imaging (fMRI) [9].
Convolutional neural network methods have contributed to most of the significantly advanced studies in brain–control interfaces by effectively extracting spatial and temporal features from EEG signals. However, the emergence of Transformer methods, which have advanced techniques with powerful self-attention mechanisms, promises to enhance the modelling of long-term dependencies and feature relationships. This study explores the integration of CNN and Transformer techniques, aiming to leverage their combined strengths for improved accuracy and efficiency in motor imagery BCI applications. By extensively evaluating the EEG-TCNet and EEG-Conformer models, including their architecture, hyperparameters, and the impact of bandpass filtering, this research seeks to identify the most effective strategies for enhancing overall performance. Additionally, this study introduces EEG-TCNTransformer, a novel BCI-MI model that incorporates TCN and self-attention and achieves an accuracy of 83.41% without a bandpass filter. The source code of EEG-TCNTransformer isavailable on GitHub, accessed on 17 September 2024.

2. Background

Traditional machine learning methods require handcrafted feature extractors and a classification network. In terms of extracting the spatial features, a common spatial pattern (CSP) [10] and an extended version of CSP, which is a filter bank CSP (FBCSP) [11], are the most common methods. Moreover, short-time Fourier transform (STFT) [12] and continuous wavelet transform (CWT) [13] are used to extract the time–frequency features. Additionally, the feature extractors must be combined with classification, such as support vector machine (SVM) [14], Bayesian classifier [11], and linear discriminant analysis (LDA) [15], to classify the target tasks. However, EEG signals are non-stationary and have a low signal-to-noise ratio, so deep learning methods are researched to improve the weaknesses of traditional machine learning methods.
Regarding traditional deep learning methods, convolutional neural network (CNN) methods are the most common methods that achieve various state-of-the-art studies. Lawhern proposed EEGNet [16], which is applied to multiple BCI paradigms, including movement-related cortical potentials (MRCPs), error-related negativity responses (ERNs), sensory-motor rhythms (SMRs), and P300 visual-evoked potentials. ShallowNet, proposed by Schirrmeister (2017) [17], measures the performance of different deep levels in convolution networks, from 5 convolution layers to 31 convolution layer residual networks, using ResNet architecture. EEG-TCNet [18] incorporates convolution layers in EEGNet and temporal convolutional networks (TCNs) [19], which can exponentially increase the receptive field size by using dilated causal convolution [20,21]. Moreover, recurrent neural networks (RNNs), gated recurrent unit (GRU), and long short-term memory (LSTM) are combined with CNN methods to learn long sequence data [22].
The transformer method is an advanced method that allows the learning of features in parallel and improves the learning of long sequence dependency [23]. Because of the structure of multi-head attention, the transformer method can efficiently capture the relationships in features through attention mechanisms. Liu proposed a Transformer-based one-dimensional convolutional neural network model (CNN-Transformer), which uses 1D-CNN to extract low-level time–frequency features and a transformer module to extract higher-level features [24]. Hybrid CNN-Transformer [25] was proposed as a complex architecture with spatial Transformer and spectral Transformer to encode raw EEG signals to an attention map, and then utilise CNN to explore the local features and temporal Transformer to perceive global temporal features. EEG-Conformer [26], proposed by Song, is a lightweight model with a shallow convolution to extract temporal and spatial features and self-attention mechanisms to learn the relationships in the time domain.
This study aims to research the contributions of different hyperparameters and different bandpass filter parameters to the CNN method and the Transformer method in MI-BCI. EEG-TCNet and EEG-Conformer were selected for this study. Therefore, there are two sub-projects, as follows:
  • First sub-project: EEG-TCNet and EEG-Conformer are trained and validated with different hyperparameters (i.e., filters, kernel sizes).
  • Second sub-project: EEG signals are preprocessed with a bandpass filter, then input in training and testing EEG-TCNet and EEG-Conformer.
In this research, a new model is introduced, EEG-TCNTransformer, inspired by EEG-TCNet and EEG-Conformer. EEG-TCNTransformer has the advantage of learning low-level temporal features and spatial features by the novel convolution architecture from EEG-TCNet and extracting the global temporal correlation from the self-attention mechanism. Moreover, EEG-TCNTransformer uses raw EEG data, so the bandpass filter is omitted.

3. Methods

3.1. Dataset

The data studied in this project are from the BCI Competition in 2008 [27]. Data Group 2A, accessed on 17 September 2024, is a set of experimental data on motor imagery for electric wheelchair control. It includes four motor tasks: move the left hand, move the right hand, move both feet, and move the tongue, which represent turn left, turn right, move forward, and move backward, respectively. This dataset includes 22 EEG channels and 3 EOG channels, collected from 9 participants over 2 sessions on 2 different days. Each session consists of 6 runs with 48 trials each. The data from each session are stored in one MATLAB file.
In Figure 1, each trial is between 7.5 s and 8.5 s. It starts with a prompt beep and a cross displayed on the screen. Two seconds later, the cue of this trial displays on the screen in the form of an arrow. The four directions it points to represent moving forward, moving backward, turning left, and turning right. This instruction stays on the screen for 1.25 s. The participant is required to perform motor imagery for the next 3 s. At the end of the trial, there is a 1.5 s short break before the next trial, which could be increased randomly to 2.5 s to avoid adaption.
At the beginning of the data collection, EOG data for each subject were also recorded for the elimination of interference information. These EOG data are removed from this study.
In this study, EEG-LAB is used as the primary tool for data visualisation. EEG-LAB is an add-on for MATLAB that provides various features for analysing electrophysiological data, including processing of EEG, visualisation, and integration of algorithms. Figure 2 shows the visualisation of the EGG signals in EEG-LAB.

3.2. Preprocessing

Data preprocessing was conducted to ensure the best and most relevant data for training the models, employing multiple techniques.
The three extra EOG channels measure eye movements and are easily influenced by non-study-induced factors such as attention levels and blinks. Therefore, these channels were excluded from training to avoid introducing noise and confounding variables.
During motor imagery, there is usually a change in neural oscillations indicating Event-Related Desynchronisation (ERD) and Event-Related Synchronisation (ERS), which are mostly observed in the alpha (8–13 Hz) and beta frequency bands (18–24 Hz) [28]. These provide good features for model training. Signal filtration was employed to increase the signal-to-noise ratio. The sharp transition band between the pass and stop bands, as well as the low ripple in the pass band, made the Chebyshev type 2 bandpass filter (Figure 3) the filter of choice. The effectiveness of this filter is primarily determined by the order of the filter N and, to a lesser extent, the stop-band attenuation requirement R s . The amplitude response is given as
H ( f ) = 1 1 + ε 2 T n 2 ( f s f )
where
ε is parameter related to the ripples in the stop-band;
T n is the nth-order Chebyshev polynomial;
f s is the stop-band edge frequency; and
fis the frequency variable.
The ripple factor is related to the stop-band attenuation by
ε = 10 0.1 R s 1 .
These two hyperparameters, N and R s , were included in the hyperparameter optimisation process.
In addition, z-score normalisation is applied to the signals to ensure that all channels are on the same scale, increasing comparability and handling variability in the dataset. The z-score normalisation is defined as
z = x μ σ
where
zis the standardised value;
xis the original value;
μ is the mean of the distribution; and
σ is the standard deviation of the distribution
Furthermore, due to the limited size of the training dataset, data augmentation was applied by segmenting and recombining signals in the time domain [30]. As illustrated in Figure 4, each training trial is divided into multiple non-overlapping segments. A large amount of new data are generated by randomly concatenating segments from different trials of the same class. This technique was specifically applied to the Conformer model. Further research is needed to analyse the impact of data augmentation across a broader range of models.

3.3. EEG-TCNet

The first model in this study is EEG-TCNet, which is incorporated from the EEGNet and TCN modules. The EEGNet module in EEG-TCNet is slightly modified, with 2D temporal convolution at the beginning to extract the frequency filters, followed by a depthwise convolution to extract frequency-specific spatial filters. The third part of the EEGNet module is a separable convolution extract temporal summary for each feature map from depthwise convolution and mixes the feature maps before going into the TCN module.
Regarding the TCN module, based on the idea of the temporal convolutional network (TCN), the TCN module in EEG-TCNet could be described as follows (Figure 5):
(a)
Causal Convolutions: TCN aims to produce the output of the same size as the input, so TCN uses a 1D fully convolutional network with each hidden layer having the same size as the input layer. To keep the length of subsequent layers equal to the previous ones, zero padding of length (kernel size: 1) is applied. Moreover, to prevent information leakage from a feature to the past in training, only the inputs from time t and earlier determine the output at time t.
(b)
Dilated Convolutions: The major disadvantage of regular causal convolutions is that the network must be extremely deep or have large filters to obtain a large receptive field size. A sequence of dilated convolutions could increase the receptive field exponentially by increasing dilation factors d.
(c)
Residual Blocks: In EEG-TCNet, the weight normalisation in the original TCN is replaced by batch normalisation. The residual blocks have a stack of two layers of dilated convolution, batch normalisation with ELU, and dropout. The skip connection 1 × 1 convolution is applied from the input to the output feature map to ensure the same shape of input and output tensors.
Figure 6 visualises the architecture of EEG-TCNet. EEG-TCNet has a temporal convolution module, depthwise convolution, separable convolution, TCN, and a fully connected network. Two-dimensional temporal convolution learns the frequency information, and then feature maps are extracted from the frequency-specific spatial information by depthwise convolution before the temporal summary for each feature map is learned by separable convolution. The TCN continues to extract the temporal information from feature maps after separable convolution and, finally, classification by the fully connected network.

3.4. EEG-Conformer

The second model in this study is EEG-Conformer, proposed by Song [26], based on the concept of using CNN to learn the low-level temporal and spatial features in EEG signals combined with self-attention to learn the global temporal dependencies in EEG feature maps. EEG-Conformer could be described in detail as follows:
(a)
Convolution module: The EEG signals after preprocessing and augmenting are learned through two 1D temporal and spatial convolution layers. The first temporal convolution layer learns the time dimension of input, and then the spatial convolution layer learns the spatial features. The spatial features are the information between the electrode channels. Then, the feature maps go through batch normalisation to avoid overfitting and the nonlinearity activation function ELU. The average pooling layer smooths the feature maps and rearranges to put all feature channels of each temporal point as a token into the self-attention module.
(b)
Self-attention module: The self-attention module has advantages in learning global features and long sequence data, which improve the CNN weaknesses. The self-attention module calculates as below:
A t t e n t i o n ( Q , K , V ) = S o f t m a x ( Q K T k ) V ,
where Q is a matrix of stacked temporal queries, K and V are temporal matrices that denote key and value, and k is the length of tokens.
Multi-head attention (MHA) is applied to strengthen representation performance. The tokens are separated into the same shape h segments, described as follows:
M H A Q , K , V = h e a d 0 ; ; h e a d h 1 ,
h e a d l = A t t e n t i o n ( Q l , K l , V l ) , l = 1 , 2 , , h ,
where MHA is the multi-head attention Q l , K l , V l R m × k / h , indicating the query, key, and value acquired by a linear transformation of a segment token in the lth head, respectively.
(c)
Classifier module: The features from the self-attention module go through two fully connected layers. The Softmax function is utilised to predict M labels. Cross-entropy loss is utilised as a cost function as follows:
L = 1 N b i = 1 N b c = 1 M y log y ^ ,
where N b is the batch size, M is the number of target labels (M = 4), y is the ground truth, and y ^ is the prediction.
Figure 7 visualises the architecture of an EEG-Conformer architecture. The network starts with a shallow convolution module; temporal information of the input is extracted by temporal convolution, and then the spatial information is extracted by spatial convolution. After that, the global temporal dependencies in feature maps are learned by the self-attention module. Finally, the classifier module, including fully connected networks, produces the prediction.

3.5. EEG-TCNTransformer

The concept of EEG-TCNTransformer is inspired by EEG-TCNet and EEG-Conformer. EEG-TCNet performs well in learning the local features in EEG signals because of the EEGNet and TCN modules. Besides that, EEG-Conformer solves the problem of global feature dependencies, which improves the learning of long sequence inputs. EEG-TCNTransformer has a convolution module, self-attention module, and classifier module.
(a)
Convolution module: The sequence of a 2D convolution layer, depthwise convolution layer, separable convolution layer, and average pooling layer extracts the temporal and spatial information in EEG signals. After that, a sequence of TCN blocks continues to learn large receptive fields efficiently with small parameters because of dilated causal convolution and a residual block structure. In this study, the different numbers of filters k in a TCN block and the numbers of a TCN block T are validated to select the best hyperparameter for EEG-TCNTransformer. Then, the average pooling layer smooths the features and rearranges the features to the shape of channels of each temporal point.
(b)
Self-attention module: Six self-attention blocks with a multi-head attention architecture learn the global temporal dependencies in features from the convolution module. The self-attention module calculates as below:
A t t e n t i o n ( Q , K , V ) = S o f t m a x ( Q K T k ) V ,
where Q is a matrix of stacked temporal queries, K and V are temporal matrices that denote key and value, and k is the length of tokens.
Multi-head attention (MHA) is applied to strengthen representation performance. The tokens are separated into the same shape h segments, described as follows:
M H A Q , K , V = h e a d 0 ; ; h e a d h 1 ,
h e a d l = A t t e n t i o n ( Q l , K l , V l ) , l = 1 , 2 , , h
where MHA is the multi-head attention Q l , K l , V l R m × k / h , indicating the query, key, and value acquired by a linear transformation of a segment token in the lth head, respectively.
(c)
Classifier module: Two fully connected layers transform the features into M labels that calculate probability distribution by the Softmax function. The loss function is the cross-entropy loss, as follows:
L = 1 N b i = 1 N b c = 1 M y log y ^
where N b is the batch size, M is the number of target labels (M = 4), y is the ground truth, and y ^ is the prediction.
Figure 8 visualises the architecture of an EEG-TCNTransformer architecture. Instead of a shallow convolution module in EEG-Conformer, the temporal convolution, depthwise convolution, and separable convolution are used to extract the temporal information, frequency-temporal information, and temporal summary from feature maps. The TCN module exploits the temporal features from feature maps before the global temporal dependencies are learned by the self-attention module. Finally, the classification is produced by the classifier module.

4. Experiments and Results

4.1. Experimental Setup

The training environment was set up on a Linux computer with CPU AMD Ryzen 9 5900X, GPU RTX 3080, and CUDA 12.1. EEG-TCNet was implemented in the Python 3.6.8 code using TensorFlow. EEG-Conformer and EEG-TCNTransformer were implemented in the Python 3.10.14 code using PyTorch. The Conda environment is used in this experiment to change the Python version.

4.2. Training and Testing Preparation

A four-class motor imagery (001-2014) dataset can be retrieved from https://bnci-horizon-2020.eu/database/data-sets (accessed on 17 September 2024); there are 18 data files for 9 subjects, so 1 subject has 1 training data file ending with T (A01T, A02T, A03T, …) and 1 testing data file ending with E (A01E, A02E, A03E, …). Before training, there are 2 different data preparation procedures:
  • Without a bandpass filter, data are loaded from Matlab files, and for each trial, T = 1000 , which is equivalent to 4 s from the cue section to the end of the motor imagery section.
  • With a bandpass filter, data are exactly the same as above; then the data are processed by a bandpass filter step with the order of the filter N and the minimum attenuation required in the stop band r s .
The data preparation without a bandpass filter is utilised for training and evaluating models with different hyperparameters; then the data preparation with a bandpass filter is utilised for evaluating the influence of different bandpass filters on models’ performance. After the data preparation stage, the processed data are trained with 3 models, EEG-TCNet, EEF-Conformer, and EEG-TCNTransformer. For each model, there are different configurations, as follows:
  • Regarding EEG-TCNet, each subject is trained with 1000 epochs with a learning rate of 0.001, the criterion is categorical cross-entropy, the optimiser is Adam, and the activation function is ELU.
  • With regard to EEG-Conformer, each subject is trained with 2000 epochs with a learning rate of 0.0002, the criterion is cross-entropy, the optimiser is Adam, the activation function in the convolution module and classification module is ELU, and the activation function in self-attention blocks is GELU.
  • With respect to EEG-TCNTransformer, each subject is trained 5000 epochs with a learning rate of 0.0002, the criterion is cross-entropy, the optimiser is Adam, the activation function in EEGNet module, TCN module and classification module is ELU, and the activation function in self-attention blocks is GELU.
The accuracy metric is utilised to measure the performance.
A c c u r a c y = C o r r e c t p r e d i c t i o n s A l l p r e d i c t i o n s

4.3. EEG-TCNet with Different Hyperparameters

The detailed architecture of EEG-TCNet is described in Table 1. C and T denote the number of EEG channels and the number of time points. In the first sub-project, C = 22 and T = 1000 because the time points used in training are 4 s from the cue section to the end of the motor imagery section. The baseline hyperparameters of EEG-TCNet are F 1 = 8 , K E = 32 , F T = 12 , K T = 4 , the same as those for the authors. Besides that, the dropout values in the EEGNet module and the TCN module are ρ e = 0.2 ,   ρ t = 0.3 , the same as in the original paper. Where ρ e is dropout in EEGNet module and ρ t is dropout in TCN module.
In the first sub-project, EEG-TCNet is trained with different numbers of filters and kernel sizes in the EEGNet module and TCN module, as described in Table 2.
In Table 3, the contribution of each F 1 , K E , F T , K T to the performance of EEG-TCNet is examined by keeping the baseline value of three parameters and changing one parameter. The average accuracy of EEG-TCNet increases when F 1 and K E increase. The average accuracy of EEG-TCNet drops when it increases F T to 12 while increasing F T to 14 improves the average accuracy of EEG-TCNet. Increasing K T to 6 also improve the accuracy, but the performance declines when increasing K T to 8. The detailed accuracy of 9 subjects is in Table A1.
After training 81 experiments, a fixed result and a variable result are selected. In terms of the fixed result, the best hyperparameters F 1 = 10 , K E = 48 , F T = 12 , K T = 8 for all 9 subjects are selected based on the average accuracy. Regarding the variable result, the best hyperparameters F 1 , K E , F T , K T for each subject are selected. Table 4 shows the hyperparameters of the variable model.
Table 5 compares the accuracies between the baseline model, fixed model, and variable model. The fixed model is better than the baseline model in subject 2, subject 4, subject 6, and subject 9, whereas others are nearly equal. When each subject is selected as the best result in the variable model, the final performance is much higher than the baseline model, especially for subject 2, subject 4, subject 5, subject 6, and subject 9.
Figure 9 shows a column chart of a comparison in accuracy between baseline EEG-TCNet, EEG-TCNet with the best tuning hyperparameters (optimised fix model), and EEG-TCNet with the best hyperparameters of each subject from different trainings. This experiment aims to research the impact of different hyperparameters on EEG-TCNet. The variable model is obviously better than the baseline and fixed model because each subject is the best hyperparameter from numerous training experiments.

4.4. EEG-TCNet with Different Bandpass Filter Parameters

In sub-project 2, EEG-TCNet with baseline hyperparameters is trained with different orders of the filter and the minimum attenuations required in the stop band of Chebyshev type 2, described in Table 6. The parameters N and r s are defined in cheby2 of SciPy API for Python (3.12.5).
After training 45 experiments, a fixed result and a variable result are selected. With regard to the fixed result, the best Chebyshev type 2 parameters N = 7 , r s = 40 for all 9 subjects are selected based on the average accuracy. Regarding the variable result, the best Chebyshev type 2 parameters N, r s for each subject are selected. Table 7 summarises the variable result.
Table 8 compares the accuracy of 9 subjects and the average accuracy between baseline EEG-TCNet, EEG-TCNet with a fixed bandpass filter, and EEG-Net with a variable bandpass filter. The performance of EEG-TCNet decreased after using Chebyshev type 2 in preprocessing in both a fixed bandpass filter and a variable bandpass filter. The detailed accuracy of 9 subjects is in Table A2.
Figure 10 shows a comparison of accuracies between baseline EEG-TCNet, EEG-TCNet with the best bandpass filter parameters (fixed bandpass filter), and EEG-TCNet with the best bandpass filter parameters of each subject from different trainings. This experiment aims to research the impact of different bandpass filter parameters on EEG-TCNet. Figure 10 shows that the bandpass filter does not improve the performance of EEG-TCNet.

4.5. EEG-Conformer with Different Hyperparameters

The architecture of the convolution module of EEG-Conformer is described in Table 9.
In sub-project 1 with EEG-Conformer, the model is trained with different numbers of temporal filters in convolution module k and different numbers of self-attention blocks N, described in Table 10. The baseline model in the original study has k = 40 and N = 6 .
In Table 11, the contribution of each k ,   N to the performance of EEG-TCNet is examined by keeping the baseline value of one parameter and changing one parameter. The increasing k improves the average accuracy, but the performance declines when k rises from 40 to 60. The average accuracy decreases when N is from 6 to 7 and then increases slightly when N is from 7 to 10, but the average accuracy is still lower than N of 6. The detailed accuracy of 9 subjects is in Table A3.
After training 25 experiments, the fixed hyperparameters selected are k = 20 and N = 10 . The variable hyperparameters are described in Table 12.
Table 13 compares and visualises the accuracies of the EEG-Conformer baseline model, fixed model, and variable models. Their accuracies are nearly equal in each subject. However, subject 2 in the fixed model has higher accuracy than that in the baseline model.
Figure 11 shows a comparison of accuracies between baseline EEG-Conformer, EEG-Conformer with the best tuning hyperparameters (optimised fix model), and EEG-Conformer with the best hyperparameters of each subject from different trainings. This experiment aims to research the impact of different hyperparameters on EEG-Conformer. This is evidence that different hyperparameters do not enhance EEG-Conformer.

4.6. EEG-Conformer with Different Bandpass Filter Parameters

In the second sub-project with EEG-Conformer, the baseline model is trained with different orders of the filter and the minimum attenuations required in the stop band of Chebyshev type 2, as described in Table 14.
After training 45 experiments, a fixed result and a variable result are selected. With regard to the fixed result, the best Chebyshev type 2 parameters N = 4 , r s = 20 for all 9 subjects are selected based on the average accuracy. Regarding the variable result, the best Chebyshev type 2 parameters N , r s for each subject are selected. Table 15 summarises the variable result.
Table 16 compares and visualises the accuracies of baseline EEG-Conformer, EEG-Conformer with a fixed bandpass filter, and EEG-Conformer with a variable bandpass filter. Chebyshev type 2 contributes to improving the accuracy of subject 1, subject 2, subject 4, and subject 7. Other subjects are approximate to the baseline model. The variable result obtained an average accuracy of 84.61%. The detailed accuracy of 9 subjects is in Table A4.
Figure 12 shows a comparison of accuracies between baseline EEG-Conformer, EEG-Conformer with the best bandpass filter parameters (fixed bandpass filter), and EEG-Conformer with the best bandpass filter parameters of each subject from different trainings. This experiment aims to research the impact of different bandpass filter parameters on EEG-Conformer. The improvement in accuracy shows that the bandpass filter contributes to the robustness of EEG-Conformer.

4.7. EEG-TCNTransformer with Different Hyperparameters

The different number of filters k in the TCN block and number of TCN blocks T are validated to select the best hyperparameters. In Table 17, the average of all subjects is summarised with different k and T. With each T, the more filters k, the higher the average accuracy, but the average accuracy stops increasing and decreases at a level of filters. With T = 1 , the average accuracy is highest at k = 60. With T = 2 , the average accuracy is highest at k = 60. With T = 3 , the average accuracy is highest at k = 70. Overall, T = 3 and k = 70 produce the best average accuracy of 83.41%. The detailed accuracy of 9 subjects is in Table A5.
In Table 18, the most improvement is seen in subject 2; EEG-TCNTransformer is higher than EEG-Conformer by about 10.95% and higher than EEG-TCNet by about 7.77%. Subject 6 and subject 9 of EEG-TCNTransformer are also more improved significantly than those of EEG-Conformer, by about 4.65% and 6.44%, respectively. Additionally, EEG-TCNTransformer improves subject 1 and subject 4 by about 3.91% and 3.95%, respectively. The average accuracy of EEG-TCNTransformer is 83.41% (confidence interval = 95.2%), which is higher by 3.77% than the average accuracy of EEG-Conformer and 6.86% than the average accuracy of EEG-TCNet.
In Table 19, EEG-TCNTransformer improves subject 2 by about 11.16% compared with EEG-Conformer, but only higher by 2.59% than EEG-TCNet. Subject 9 of EEG-TCNTransformer has the highest improvement in precision, about 6.44% and 9.85% compared with EEG-Conformer and EEG-TCNet, respectively. Moreover, EEG-TCNTransformer also improves the precision of subject 1, subject 4, subject 5, and subject 6 compared with both EEG-TCNet and EEG-Conformer. The average precision of EEG-TCNTransformer is 83.43%, which is higher by 3.77% than the average precision of EEG-Conformer and 4.36% than the average precision of EEG-TCNet.
In Table 20, the recall of subject 2 of EEG-TCNTransformer is significantly higher than that of EEG-Conformer by 12.62% and higher than that of EEG-TCNet by 9.97%. Moreover, EEG-TCNTransformer improves the recall of subject 6 and subject 9 by about 6.49% and 5.28% compared with EEG-Conformer. Additionally, EEG-TCNTransformer also improves the recall of subject 1, subject 4, and subject 5. The average recall of EEG-TCNTransformer is 84.05%, which is higher by 3.89% than the average recall of EEG-Conformer and 7.49% than the average recall of EEG-TCNet.
Table 21 is a comparison table of F1 score between baseline EEG-TCNet, baseline EEG-Conformer, and EEG-TCNTransformer. EEG-TCNTransformer improves the F1 score of subject 2 by about 10.23% and 6.67% compared with EEG-Conformer and EEG-TCNet, respectively. Moreover, EEG-TCNTransformer improves the F1 score of subject 1, subject 4, subject 5, subject 6, and subject 9 from 3.2% up to 4.44%. The average F1 score of EEG-TCNTransformer is 83.25%, which is higher by 3.63% than the average F1 score of EEG-Conformer and 7.23% than the average F1 score of EEG-TCNet.
Besides that, Figure 13 provides the confusion matrices of 9 subjects of EEG- TCNTransformer below. Models of subject 3, subject 4, subject 5, subject 7, subject 8, and subject 9 perform well in classifying 4 classes: left hand, right hand, foot, and tongue. Subject 1 has an incorrect classification of about 9 to 10 samples in the foot and tongue classes. Subject 2 has some incorrect classifications between the tongue and other classes and between the foot and other classes. Subject 6 also has some incorrect classifications in the left hand and other classes and between the right hand and other classes.
-2.2in

4.8. EEG-TCNTransformer with Different Bandpass Filter Parameters

The bandpass filter is also added to the preprocessing to validate the performance of EEG-TCNTransformer. Table 22 describes the average accuracy of different orders of the filter N = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10) with the minimum attenuations required in the stop band r s = (10, 20, 30). The highest average accuracy when training EEG-TCNTransformer with a bandpass filter is 80.27%, while increasing r s reduces the performance (Table A6). Therefore, the bandpass filter is inefficient for EEG-TCNTransformer.

5. Discussion

This research aims to study the contribution of changing hyperparameters and changing bandpass filter parameters of Chebyshev type 2 to a CNN method and a Transformer method in brain–computer interface motor imagery. Regarding the CNN method, EEG-TCNet is a novel study for research. The increase in the number of filters and kernel sizes in EEG-TCNet architecture provides better performance. However, the bandpass filter Chebyshev type 2 in data preprocessing is inefficient for training EEG-TCNet. In terms of the Transformer method, EEG-Conformer is chosen for this research. The average accuracy improves when the number of filters is between 20 and 40. The Chebyshev type 2 bandpass filter was found to contribute significantly to the accuracy of each subject, producing an average accuracy of 83.41%. However, EEG-TCNet still has other hyperparameters, such as dropout, depth of TCN blocks, depth in EEGNet module, or EEG-Conformer, still having dropout and head number in multi-head that cannot be examined in this study because of the limit of training resource and time.
In this research, a new model called EEG-TCNTransformer is created, which combines the convolution parts of EEG-TCNet and the sequence of self-attention blocks. The average accuracy of EEG-TCNTransformer improves when the number of TCN blocks increases, which learns better the low-level temporal features in temporal and spatial features. The number of filters also contributes to the performance, but it gets overfitting at specific filters. Moreover, the bandpass filter is inefficient for EEG-TCNTransformer, so the raw EEG data with standardisation are used in training and testing. Therefore, the optimised hyperparameters for EEG-TCNTransformer generate better accuracy for each subject compared with baseline EEG-TCNet and baseline EEG-Conformer without a bandpass filter in preprocessing, and the average accuracy of EEG-TCNTransformer is 83.41%.

6. Conclusions

Brain–computer interface motor imagery is an emerging research topic in artificial intelligence. This study explores the contributions of hyperparameters and bandpass filters to the performance of EEG-TCNet and EEG-Conformer. The average accuracy of EEG-TCNet is improved when increasing the number of filters and kernel size, but the bandpass filter is inefficient in training. In contrast, the bandpass filter significantly improves the accuracy of EEG-Conformer, where the performance is unimproved when increasing the number of self-attention blocks. Furthermore, a new model, EEG-TCNTransformer, incorporates the convolution architecture of EEG-TCNet and a stack of self-attentions with a multi-head structure. This EEG-TCNTransformer outperforms with an average accuracy of 83.41%. In future, various techniques within the transformer architecture will be explored to enhance the global feature correlation for EEG-TCNTransformer.

Author Contributions

Conceptualisation, A.H.P.N. and O.O.; methodology, A.H.P.N. and O.O.; software, A.H.P.N.; validation, A.H.P.N.; formal analysis, A.H.P.N.; investigation, A.H.P.N. and O.O.; resources, A.H.P.N.; data curation, A.H.P.N.; writing—original draft preparation, A.H.P.N. and O.O.; writing—review and editing, A.H.P.N., O.O., M.A.P. and S.H.L.; visualisation, A.H.P.N.; supervision, M.A.P. and S.H.L.; project administration, M.A.P. and S.H.L. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

This study’s EEG dataset is already accessible in the BNCI Horizon 2020 database. Ethical review and approval were waived for this study, due to the use of publicly available datasets.

Informed Consent Statement

This study used publicly available dataset where informed consent was obtained from all subjects involved in the study.

Data Availability Statement

The data are available in the BNCI Horizon 2020 database found on this link: https://bnci-horizon-2020.eu/database/data-sets (accessed on 17 September 2024).

Conflicts of Interest

The authors declare no conflicts of interest.

Appendix A. TCNet Training Results

Appendix A.1. Experiment EEG-TCNet with Different Hyperparameters

Table A1 shows the accuracy of 9 subjects when changing F 1 , K E , F T , K T in EEG-TCNet architecture.
Table A1. Accuracy of EEG-TCNet with different F 1 , K E , F T , K T .
Table A1. Accuracy of EEG-TCNet with different F 1 , K E , F T , K T .
F 1 K E F T K T S1S2S3S4S5S6S7S8S9Average Accuracy (%)
61610479.3659.3691.2167.1175.7256.2875.0981.9275.0073.45
61610682.2160.0794.5172.3775.7262.3376.1784.1379.5576.34
61610882.9259.7295.2474.5675.7266.9881.2382.6676.5277.28
61612480.7866.4393.7766.2377.9058.1493.1483.0382.9578.04
61612680.4360.7893.7776.7580.8064.1988.4583.0383.3379.06
61612883.6367.4991.2167.9880.8065.1276.5383.7684.4777.89
61614475.0953.0088.2867.1175.7254.8876.1781.5575.0071.87
61614678.6561.4889.3873.6875.7264.6592.7882.2976.8977.28
61614882.5660.4295.6074.1275.7268.8492.0676.7576.1478.02
63210476.5163.9691.2172.3779.3553.4975.0982.2975.3874.40
63210682.2168.2094.5165.3576.0964.6591.3480.0780.6878.12
63210876.1657.9595.2475.4478.9963.2688.0986.7285.2378.56
63212481.4956.8991.5870.1872.1061.4077.6282.6684.4775.38
63212680.4365.3794.8774.5679.3561.8691.7080.4481.4478.89
63212882.5656.1893.4175.8878.6261.4091.7084.8785.9878.96
63214483.6359.0194.5167.9870.6560.0090.2578.6079.1775.98
63214676.1661.8497.0780.2673.5560.9381.2383.7681.8277.40
63214885.0566.7891.2171.4975.3660.9387.7377.8676.8977.03
64810487.5463.9693.4170.6175.3657.6775.8182.6678.0376.12
64810679.3659.3689.7470.6176.4565.5890.2583.3979.1777.10
64810878.6563.2593.0472.8181.1663.2691.7081.9282.9578.75
64812478.6551.9491.9469.3073.9164.6584.1281.9283.7175.57
64812688.2664.6697.0763.6079.3563.2690.9781.5581.8278.95
64812883.2761.8494.8777.6379.7166.5176.1783.3982.2078.40
64814479.0057.9591.2170.1871.3859.5390.2584.1381.0676.08
64814677.2256.5493.0471.9378.9961.8676.9084.1379.5575.57
64814883.2765.7292.6776.3277.5457.6778.3481.9280.3077.08
81610479.3662.5489.7471.0572.4660.0090.2585.9883.3377.19
81610682.2167.1495.2469.3076.4567.9190.6182.2980.6879.09
81610883.2767.4994.1476.3280.4366.5191.3480.0775.7679.48
81612482.9260.7893.0467.9866.3062.7993.1480.8182.2076.66
81612681.4966.4393.4170.6177.1764.6588.8184.5085.2379.15
81612882.2167.4994.1478.0773.9167.4488.4583.7685.6180.12
81614478.6557.6088.6466.2380.4360.4792.7884.1382.2076.79
81614679.7267.1493.0468.8680.4355.8188.8183.3979.1777.37
81614881.1461.1392.6775.8879.3566.5188.0979.7080.6878.35
83210485.7765.7295.2475.8876.0956.7488.8181.9275.7677.99
83210682.5667.4993.7778.5179.7164.6590.2585.6184.8580.82
83210882.5665.7294.1476.3284.0665.5892.4284.1386.3681.26
83212482.9261.1391.5864.9176.4559.5391.3481.9279.1776.55
83212683.6366.4394.8775.0075.7266.5187.7385.2484.4779.96
83212882.9261.4894.5173.6879.3565.1291.3476.7582.2078.59
83214479.3660.7897.0772.3777.9061.8688.4582.2987.1278.58
83214681.8567.8494.5171.0575.7265.5889.1785.6179.9279.03
83214882.9257.6095.6073.6880.8065.1289.8982.6683.3379.07
84810482.2154.0692.3163.6075.3658.1475.0979.7079.9273.38
84810681.8566.0895.2476.3278.2662.7985.9282.2979.1778.66
84810883.2764.6695.2478.9580.0767.9186.6483.0384.8580.51
84812481.1462.1994.8770.1878.9960.4784.1279.3482.2077.05
84812681.8567.4993.4172.3776.8158.6088.8183.0383.3378.41
84812882.9261.4890.8476.3279.7165.5890.6181.1883.7179.15
84814483.9956.1894.8775.0078.2662.7989.5384.1383.7178.72
84814681.1472.4495.6080.2680.0762.7991.3484.1381.4481.02
84814880.7865.3794.8771.0578.6264.1980.8784.1384.4778.26
101610482.5661.8493.7765.7977.1758.6088.0984.1383.3377.25
101610680.0762.5493.0471.9379.3562.7989.1784.1379.5578.06
101610880.4365.7293.7776.3277.9065.5892.0683.7682.9579.83
101612481.4964.6693.0473.6874.2858.6094.5884.1379.1778.18
101612683.6363.9692.6769.7477.9063.2692.7882.6682.5878.80
101612881.1462.9093.7773.6881.8866.5192.4282.6683.7179.85
101614481.4960.7894.1476.3279.3565.1292.0684.8782.2079.59
101614680.4366.0895.2475.4477.1768.8491.3483.3978.4179.59
101614882.2164.6693.0477.6377.5466.9889.5384.1379.1779.43
103210483.2764.3195.2474.5674.6462.3389.1781.9281.4478.54
103210685.0569.6194.1479.8277.9062.7989.5380.8184.0980.42
103210885.0568.9095.6076.3276.8166.0590.6183.7684.8580.88
103212481.8558.6695.9769.3079.7163.7290.2583.7679.1778.04
103212682.9265.0293.7771.9379.7161.4089.8985.2484.4779.37
103212881.8569.9693.4174.1280.4366.5189.1784.8786.3680.74
103214484.7062.9094.1470.1877.9060.9389.8983.0385.2378.76
103214683.9966.7895.2471.9383.3361.8692.0683.0384.4780.30
103214882.9262.5494.8774.1281.5268.3790.2586.7285.9880.81
104810483.6361.1394.1468.4278.6258.6090.9783.3971.9776.77
104810684.7062.5493.7773.2576.4566.9889.8983.3985.9879.66
104810884.7065.7293.7773.2576.4562.7982.6785.2483.7178.70
104812482.2165.0294.8769.7476.0959.5377.2685.2482.2076.91
104812683.6372.7993.4169.3078.9964.1990.6184.1385.2380.25
104812886.1271.0294.8780.2676.8169.3087.0081.1885.2381.31
104814481.8559.7294.8772.3777.5456.7490.2584.5081.4477.70
104814682.2168.9096.7077.1978.9960.9391.3487.8279.5580.40
104814886.1269.9695.6075.8880.4360.9388.0983.7682.9580.42

Appendix A.2. Experiment EEG-TCNet with Different Parameters of Chebyshev Type 2 Filter

Table A2 shows the accuracy of 9 subjects when training EEG-TCNet with different parameters N, r s in the bandpass filter.
Table A2. Accuracy of EEG-TCNet with different bandpass filter parameters N , r s .
Table A2. Accuracy of EEG-TCNet with different bandpass filter parameters N , r s .
NrsS1S2S3S4S5S6S7S8S9Average Accuracy (%)
42076.8751.2492.3165.3537.6850.7075.0978.9779.1767.49
43080.4352.6591.5858.3335.8745.5871.8483.3979.1766.54
44077.9448.4189.3852.6334.7846.9873.2983.3982.2065.44
45076.8747.3591.9456.5833.3347.4468.5978.6079.1764.43
46077.9438.5291.2151.7535.8744.6561.3785.2484.0963.40
47080.7833.5791.5850.0035.8746.5163.5481.9278.0362.42
48081.4941.3492.3146.4935.5145.5854.8777.1276.1461.21
49079.7234.9893.7745.6134.0643.7251.6259.7866.2956.62
410077.9436.0491.2143.4237.3241.8648.7453.8748.1153.17
52078.6554.0692.3166.2346.7443.2674.7384.1379.5568.85
53081.8551.2489.0166.6735.8745.1274.7383.3981.4467.70
54078.6550.5391.9458.3332.6148.3777.9883.3980.3066.90
55076.5148.7691.5854.3935.5144.1971.1282.2982.2065.17
56073.6749.1291.2157.4637.6849.7769.3182.6680.6865.73
57076.1649.8289.7456.1435.8743.2663.9081.5581.8264.25
58082.2134.6391.9454.8236.9651.1664.9880.0782.5864.37
59072.9536.0491.5847.3734.0650.2358.8481.5580.6861.48
510077.5835.3494.5142.9836.5945.1251.9974.1778.0359.59
62081.4956.1890.4859.2135.5140.0084.8479.3482.5867.74
63078.6552.3089.0156.5834.4248.8479.7884.5076.8966.77
64078.6549.8289.7464.4737.3245.1273.6579.7083.3366.87
65080.4347.0092.6760.9636.5946.0581.9579.3480.3067.25
66076.5150.8889.7449.5634.7844.6572.2080.4474.6263.71
67078.2953.3692.3157.0237.6847.9167.8781.9283.3366.63
68078.6536.7591.5852.1931.5249.7768.2383.3981.0663.68
69076.1640.6490.4857.8933.7054.8866.0680.8184.4765.01
610079.3637.4692.6752.6334.7849.7766.4382.2982.9564.26
72077.9454.4289.7469.7436.2346.0575.0981.9273.8667.22
73081.8556.1891.2164.9144.5745.1278.7081.5581.4469.50
74079.0051.9490.4872.3756.8851.1682.6782.2978.7971.73
75073.6751.5988.6451.3232.2543.2674.0183.0378.0363.98
76080.0748.4190.8458.7734.7849.3076.1781.9278.0366.48
77079.0050.1890.4849.5638.4147.9170.4083.0381.0665.56
78074.7349.1290.4854.3932.9740.0072.9282.2980.6864.18
79080.4335.3491.2149.5638.7754.8866.0679.7081.4464.15
710079.7235.3490.4853.9535.5148.8467.8783.7683.3364.31
82075.0950.1887.5555.2636.5946.9876.1783.3975.0065.13
83080.0755.1292.3163.6038.7744.1981.9580.8181.8268.74
84076.1652.3091.5863.6038.4152.0983.3981.5579.5568.73
85075.8050.8890.4859.6538.7747.9180.5180.8184.0967.65
86081.4948.0693.0454.8237.3248.8480.5180.4481.8267.37
87079.0054.0689.7451.3229.3540.0077.6281.5581.4464.90
88079.0047.0090.1148.6835.1443.7271.4880.4484.8564.49
89078.2945.9490.1145.1838.7752.0975.8181.9280.6865.42
810076.8746.6491.5849.5637.3246.5167.1580.8180.3064.08

Appendix B. EEG-Conformer Training Results

Appendix B.1. Experiment EEG-Conformer with Different Hyperparameters

Table A3 reveals the accuracy of 9 subjects that experiment with different hyperparameters k , N in EEG-Conformer architecture.
Table A3. Accuracy of EEG-Conformer with different hyperparameters k , N .
Table A3. Accuracy of EEG-Conformer with different hyperparameters k , N .
kNS1S2S3S4S5S6S7S8S9Average Accuracy (%)
20688.2658.6694.8773.2576.4562.7987.0087.0879.5578.66
30686.4857.9595.2473.6875.3659.0787.0086.3581.0678.02
40683.9957.9594.5178.0778.6263.7288.8188.5682.5879.64
50686.1254.4293.7774.1275.3658.6089.5387.8281.0677.87
60684.3457.6093.7772.3778.6260.4785.2087.8279.5577.75
20786.8361.1394.8773.2576.8159.0785.5688.1979.1778.32
30786.4859.0193.7774.1276.4563.2690.9787.8281.8279.30
40785.4155.1294.8771.9376.4558.1490.6189.3082.5878.27
50784.7052.6594.8773.2576.0958.1488.4588.1979.5577.32
60785.0551.9494.8774.5677.5460.0089.5388.1982.2078.21
20885.4161.4893.4171.4976.8161.4084.4888.5682.9578.44
30886.8353.7194.8771.4975.7260.0090.2589.3081.4478.18
40885.7756.1894.1471.9378.2660.0091.3487.4581.4478.50
50887.5454.0693.4171.4978.9963.7284.8488.1979.9278.02
60884.3453.3693.4173.6878.2662.3390.2588.1980.3078.24
20987.5460.4294.1477.6376.4565.5881.9589.3080.6879.30
30986.8355.4893.7776.3278.2661.4090.2588.1981.0679.06
40985.7754.4292.6774.5677.9059.0792.0687.8282.9578.58
50986.1254.7794.5174.5675.3660.4790.2586.7283.3378.45
60987.1953.3693.4171.9376.4559.5390.6187.8282.2078.06
201087.5460.4291.9475.8877.9064.1988.0988.5682.9579.72
301087.5454.0694.1473.2577.5460.9392.4289.3084.0979.25
401085.7750.8894.5178.5179.3559.0791.7088.1979.9278.65
501087.1956.1894.1472.3777.9059.0785.5688.5681.8278.09
601086.4852.3094.5175.4477.5460.4788.8189.3083.7178.73

Appendix B.2. Experiment EEG-Conformer with Different Parameters of Chebyshev Type 2 Filter

Table A4 below illustrates the accuracy of 9 subjects trained with different parameters N , r s in the bandpass filter.
Table A4. Accuracy of EEG-Conformer with different bandpass filter parameters N , r s .
Table A4. Accuracy of EEG-Conformer with different bandpass filter parameters N , r s .
NrsS1S2S3S4S5S6S7S8S9Average Accuracy (%)
42090.0463.9692.6781.5879.7166.9894.9588.5688.2682.97
43090.7560.0792.3181.5865.9465.5893.8688.5687.1280.64
44091.1056.8992.6781.5857.9765.5892.7888.5687.5079.40
45089.6859.3693.0478.9555.0765.5890.6187.8288.2678.71
46087.9060.0793.7778.0749.6464.6584.1288.5687.5077.14
47086.4849.8293.7771.0546.0163.7280.8787.4586.3673.95
48087.1948.7693.7762.2845.6564.6577.2684.5085.6172.19
49086.4847.3593.4159.6543.1257.6768.2378.2375.0067.68
410081.8545.9491.5856.5839.8653.9559.2167.5366.2962.53
52090.3959.3693.7786.4075.3671.1695.3187.0887.5082.93
53091.8160.4293.4182.8967.7563.2694.2287.0886.7480.84
54090.3962.9094.1485.0959.4264.6592.4286.7287.1280.32
55090.3958.3092.6783.3356.1665.5893.1488.1987.5079.48
56088.9759.3693.0479.8254.7164.1991.3488.5685.9878.44
57087.9061.4893.7777.1950.0066.5184.8488.1987.5077.49
58085.4155.8392.6773.2548.9165.1283.7588.5687.8875.71
59087.5450.1893.4165.3543.8468.8478.7086.3588.6473.65
510086.1249.1294.1461.4044.5766.0570.7684.8782.9571.11
62088.6159.0192.3180.7078.2668.8496.3988.5687.5082.24
63091.4657.6093.7782.4673.5563.2694.5887.4587.1281.25
64091.1059.7293.4184.2164.1366.5193.8686.7287.1280.75
65089.6861.1391.9483.7759.4266.0594.2288.5686.7480.17
66089.5860.7693.4079.1752.7862.8591.3286.8187.8578.28
67090.0460.0793.0479.3953.9966.0592.4287.0886.3678.71
68087.5460.7893.7778.0751.8166.5187.7388.5688.2678.11
69085.7758.3093.4176.3249.6465.5884.8489.3086.3676.61
610085.0553.3693.4172.8147.1065.1281.5985.9887.8874.70
72089.3261.4893.0485.9675.0070.7095.3186.7287.1282.74
73089.6859.7293.4185.0969.9367.9194.9586.7287.8881.70
74091.1059.0194.1484.2168.4864.6593.8687.4586.7481.07
75091.1060.0793.4184.2164.4966.0591.3487.4586.7480.54
76089.6860.7893.0484.2160.1466.9892.7888.9385.9880.28
77089.3258.6693.4181.1454.7167.4493.1487.4585.9879.03
78090.0459.3692.6780.7053.6269.3088.0987.0887.8878.75
79087.9061.8492.3178.0750.3665.1290.2588.9387.5078.03
710085.4160.0793.4177.1948.5563.7285.5688.9388.2676.79
82090.2859.7293.7582.2969.1063.5495.4988.5487.8581.17
83091.1061.4893.4185.5371.3865.5894.5886.7286.7481.84
84090.0462.9093.0483.3369.2067.9194.2288.1988.2681.90
85091.8160.7893.7782.8967.7565.5893.1487.0885.6180.94
86091.1060.7893.7782.4662.3265.5893.1487.8286.7480.41
87089.6859.7292.3182.0257.9766.5191.7088.5687.5079.55
88090.3959.0193.4182.0256.1666.5191.3487.4585.6179.10
89090.0458.6692.6780.7055.8068.3789.1786.7287.5078.85
810088.9760.7892.3175.4451.8166.0591.3488.5687.1278.04

Appendix C. EEG-TCNTransformer Training Results

Appendix C.1. Experiment EEG-TCNTransformer with Different Hyperparameters

Table A5 displays the accuracy of 9 subjects that train EEG-TCNTransformer with different numbers of TCNet blocks T and numbers of filters k in TCN block.
Table A5. Accuracy of EEG-TCNTransformer with different hyperparameters T , k .
Table A5. Accuracy of EEG-TCNTransformer with different hyperparameters T , k .
TkS1S2S3S4S5S6S7S8S9Average Accuracy (%)
11085.4160.4291.2179.8256.5260.0085.2084.8779.1775.85
12082.5666.4392.6778.0763.4159.0786.2885.6176.8976.78
13085.0566.0891.9484.2174.6466.9888.8184.1383.3380.57
14084.3469.2693.4181.1476.0959.0790.2585.2484.8580.40
15085.0562.1993.4180.2676.8157.6789.1784.5084.8579.32
16087.1966.0893.4180.7078.2664.6589.5385.6187.5081.44
17083.9966.4395.2477.6377.5465.1289.1786.7288.2681.12
18086.4863.9695.6079.3976.4566.9890.2584.5087.8881.28
19085.4163.6095.2480.2677.5459.5391.3488.1987.5080.96
110087.5461.8494.8781.5877.9058.1490.9786.7284.8580.49
21085.7765.0290.4870.1868.1258.6089.5384.8776.1476.52
22085.0571.3892.3180.7066.3064.6587.7386.3576.8979.04
23083.6367.4993.0484.2181.5265.1289.5386.3578.0380.99
24083.2766.4394.1482.4684.0667.4488.8184.5083.3381.60
25084.3468.9093.4182.8981.1665.1289.1785.9886.7481.97
26083.2767.1493.4186.4080.4366.0592.7886.7287.8882.68
27086.4865.3794.5184.2180.8068.3789.5385.9887.8882.57
28086.4866.4394.8784.2181.5262.3389.8985.9887.8882.18
29083.6365.0294.5183.3381.1664.1990.2586.7287.5081.81
210085.7764.6694.5183.7780.8067.4487.7387.8286.7482.14
31080.0772.7990.4871.0567.3958.1489.1781.9274.6276.18
32084.7068.5593.7779.8272.1063.7290.9783.0373.1178.86
33087.1965.7294.8783.7780.8069.3091.7085.2479.9282.06
34088.6166.0894.5187.2879.3568.3791.3484.8784.8582.81
35086.1267.4993.7783.3383.7066.9889.8987.4585.9882.75
36083.9966.4393.4180.7081.5265.5889.5386.3587.1281.63
37087.9068.9094.5182.0281.8868.3789.5388.5689.0283.41
38082.2167.1491.9481.5882.2563.2689.8986.3587.1281.30
39086.8365.7293.7782.4678.9968.3783.0387.4589.3981.78
310085.4162.1993.0482.8978.6266.0588.8186.7287.5081.25

Appendix C.2. Experiment EEG-TCNTransformer with Different Parameters of Chebyshev Type 2 Filter

Table A6 shows the accuracy of 9 subjects that train EEG-TCNTransformer with different parameters N , r s in the bandpass filter.
Table A6. Accuracy of EEG-TCNTransformer with different bandpass filter parameters N , r s .
Table A6. Accuracy of EEG-TCNTransformer with different bandpass filter parameters N , r s .
TkS1S2S3S4S5S6S7S8S9Average Accuracy (%)
11079.7253.7190.4876.3268.8454.4281.5978.9786.7474.53
21083.6363.2593.4179.3976.4561.8691.3485.9887.1280.27
31079.7254.4287.9182.0274.2855.3585.5680.0783.7175.89
41081.8566.4393.4171.9378.6263.2690.2583.3986.3679.50
51077.9459.0192.3178.5177.1761.8687.7383.7685.6178.21
61080.0763.2593.7775.0077.1763.2687.3682.2987.1278.81
71078.2962.1991.5877.1977.9063.2689.8983.3984.8578.73
81078.2961.1393.7780.2675.0064.1989.1783.3987.5079.19
91080.0761.8491.2179.3979.7163.7289.8983.7686.7479.59
101079.0062.9093.4180.7071.7462.3389.1783.3985.6178.69
12078.6556.8990.1166.2366.3059.0774.0177.8687.8873.00
22079.0056.5493.4178.5173.5564.6589.5381.9286.7478.21
32078.6552.3089.3875.4457.2552.0980.1479.7086.3672.37
42077.5854.7789.0173.2567.0353.0287.3680.4486.3674.31
52080.0754.4285.7177.1968.1250.7083.0379.3484.8573.71
62081.1454.4289.3870.6169.5753.0286.6480.4486.7474.66
72080.0753.7186.4575.0063.7751.1683.3981.5585.2373.37
82080.4353.0088.6475.8869.9351.1684.1280.4486.7474.48
92079.0053.0087.5574.1265.2253.9584.4881.1886.7473.92
102080.0753.7189.0175.4467.0348.3782.6781.1886.3673.76
13078.2954.4290.4851.7563.0456.2874.0178.9788.2670.61
23076.1654.4290.8476.3272.4668.3785.9279.7087.1276.81
33078.6554.4290.8476.3251.0953.0275.0979.3486.7471.72
43079.7253.7189.7478.5155.4353.0285.5679.3486.7473.53
53077.5850.5390.8475.8852.9051.1681.5979.3486.3671.80
63079.7250.8890.4876.3251.4546.9884.1279.7085.6171.69
73079.0050.8887.1877.6356.5246.0579.7879.7085.6171.37
83079.7251.2487.1872.8152.5446.9886.2880.0785.6171.38
93079.7250.8886.0879.3956.1647.4483.3980.0785.9872.12
103079.7249.1287.1871.0553.2649.7783.7580.0786.3671.14

References

  1. Zhang, X.; Zhang, T.; Jiang, Y.; Zhang, W.; Lu, Z.; Wang, Y.; Tao, Q. A novel brain-controlled prosthetic hand method integrating AR-SSVEP augmentation, asynchronous control, and machine vision assistance. Heliyon 2024, 10, e26521. [Google Scholar] [CrossRef] [PubMed]
  2. Chai, R.; Ling, S.H.; Hunter, G.P.; Tran, Y.; Nguyen, H.T. Brain-Computer Interface Classifier for Wheelchair Commands Using Neural Network with Fuzzy Particle Swarm Optimization. IEEE J. Biomed. Health Inform. 2014, 18, 1614–1624. [Google Scholar] [CrossRef] [PubMed]
  3. Ferrero, L.; Soriano-Segura, P.; Navarro, J.; Jones, O.; Ortiz, M.; Iáñez, E.; Azorín, J.M.; Contreras-Vidal, J.L. Brain–machine interface based on deep learning to control asynchronously a lower-limb robotic exoskeleton: A case-of-study. J. Neuroeng. Rehabil. 2024, 21, 48. [Google Scholar] [CrossRef]
  4. Armour, B.S.; Courtney-Long, E.A.; Fox, M.H.; Fredine, H.; Cahill, A. Prevalence and causes of paralysis—United States, 2013. Am. J. Public Health 2016, 106, 1855–1857. [Google Scholar] [CrossRef] [PubMed]
  5. Berger, H. Über das Elektrenkephalogramm des Menschen. Arch. Psychiatr. Nervenkrankh. 1929, 87, 527–570. [Google Scholar] [CrossRef]
  6. Hicks, R.J. Principles and Practice of Positron Emission Tomography. J. Nucl. Med. 2004, 45, 1973–1974. [Google Scholar]
  7. Mellinger, J.; Schalk, G.; Braun, C.; Preissl, H.; Rosenstiel, W.; Birbaumer, N.; Kübler, A. An MEG-based brain-computer interface (BCI). NeuroImage 2007, 36, 581–593. [Google Scholar] [CrossRef]
  8. Naseer, N.; Hong, K.S. fNIRS-based brain-computer interfaces: A review. Front. Hum. Neurosci. 2015, 9, 3. [Google Scholar] [CrossRef]
  9. Sorger, B.; Reithler, J.; Dahmen, B.; Goebel, R. A Real-Time fMRI-Based Spelling Device Immediately Enabling Robust Motor-Independent Communication. Curr. Biol. 2012, 22, 1333–1338. [Google Scholar] [CrossRef]
  10. Ramoser, H.; Muller-Gerking, J.; Pfurtscheller, G. Optimal spatial filtering of single trial EEG during imagined hand movement. IEEE Trans. Rehabil. Eng. 2000, 8, 441–446. [Google Scholar] [CrossRef]
  11. Ang, K.K.; Chin, Z.Y.; Zhang, H.; Guan, C. Filter Bank Common Spatial Pattern (FBCSP) in Brain-Computer Interface. In Proceedings of the 2008 IEEE International Joint Conference on Neural Networks (IEEE World Congress on Computational Intelligence), Hong Kong, China, 1–8 June 2008; pp. 2390–2397. [Google Scholar] [CrossRef]
  12. Tabar, Y.R.; Halici, U. A novel deep learning approach for classification of EEG motor imagery signals. J. Neural Eng. 2017, 14, 016003. [Google Scholar] [CrossRef] [PubMed]
  13. Ieracitano, C.; Mammone, N.; Hussain, A.; Morabito, F.C. A novel multi-modal machine learning based approach for automatic classification of EEG recordings in dementia. Neural Netw. 2020, 123, 176–190. [Google Scholar] [CrossRef] [PubMed]
  14. Kousarrizi, M.R.N.; Ghanbari, A.A.; Teshnehlab, M.; Shorehdeli, M.A.; Gharaviri, A. Feature Extraction and Classification of EEG Signals Using Wavelet Transform, SVM and Artificial Neural Networks for Brain Computer Interfaces. In Proceedings of the 2009 International Joint Conference on Bioinformatics, Systems Biology and Intelligent Computing, Shanghai, China, 3–5 August 2009; pp. 352–355. [Google Scholar] [CrossRef]
  15. Chen, C.Y.; Wu, C.W.; Lin, C.T.; Chen, S.A. A novel classification method for motor imagery based on Brain-Computer Interface. In Proceedings of the 2014 International Joint Conference on Neural Networks (IJCNN), Beijing, China, 6–11 July 2014; pp. 4099–4102. [Google Scholar] [CrossRef]
  16. Lawhern, V.J.; Solon, A.J.; Waytowich, N.R.; Gordon, S.M.; Hung, C.P.; Lance, B.J. EEGNet: A compact convolutional neural network for EEG-based brain-computer interfaces. J. Neural Eng. 2018, 15, 056013. [Google Scholar] [CrossRef] [PubMed]
  17. Schirrmeister, R.T.; Springenberg, J.T.; Fiederer, L.D.J.; Glasstetter, M.; Eggensperger, K.; Tangermann, M.; Hutter, F.; Burgard, W.; Ball, T. Deep learning with convolutional neural networks for EEG decoding and visualization. Hum. Brain Mapp. 2017, 38, 5391–5420. [Google Scholar] [CrossRef]
  18. Ingolfsson, T.M.; Hersche, M.; Wang, X.; Kobayashi, N.; Cavigelli, L.; Benini, L. EEG-TCNet: An Accurate Temporal Convolutional Network for Embedded Motor-Imagery Brain-Machine Interfaces; Institute of Electrical and Electronics Engineers Inc.: New York, NY, USA, 2020; pp. 2958–2965. [Google Scholar] [CrossRef]
  19. Bai, S.; Kolter, J.Z.; Koltun, V. An Empirical Evaluation of Generic Convolutional and Recurrent Networks for Sequence Modeling. arXiv 2018, arXiv:1803.01271. [Google Scholar]
  20. Yu, F.; Koltun, V. Multi-Scale Context Aggregation by Dilated Convolutions. arXiv 2015, arXiv:1511.07122. [Google Scholar]
  21. Umirzakova, S.; Whangbo, T.K. Detailed feature extraction network-based fine-grained face segmentation. Knowl.-Based Syst. 2022, 250, 109036. [Google Scholar] [CrossRef]
  22. Altaheri, H.; Muhammad, G.; Alsulaiman, M.; Amin, S.U.; Altuwaijri, G.A.; Abdul, W.; Bencherif, M.A.; Faisal, M. Deep learning techniques for classification of electroencephalogram (EEG) motor imagery (MI) signals: A review. Neural Comput. Appl. 2023, 35, 14681–14722. [Google Scholar] [CrossRef]
  23. Pfeffer, M.A.; Ling, S.S.H.; Wong, J.K.W. Exploring the frontier: Transformer-based models in EEG signal analysis for brain-computer interfaces. Comput. Biol. Med. 2024, 178, 108705. [Google Scholar] [CrossRef]
  24. Liu, H.; Liu, Y.; Wang, Y.; Liu, B.; Bao, X. EEG Classification Algorithm of Motor Imagery Based on CNN-Transformer Fusion Network; Institute of Electrical and Electronics Engineers Inc.: New York, NY, USA, 2022; pp. 1302–1309. [Google Scholar] [CrossRef]
  25. Ma, Y.; Song, Y.; Gao, F. A Novel Hybrid CNN-Transformer Model for EEG Motor Imagery Classification; Institute of Electrical and Electronics Engineers Inc.: New York, NY, USA, 2022. [Google Scholar] [CrossRef]
  26. Song, Y.; Zheng, Q.; Liu, B.; Gao, X. EEG Conformer: Convolutional Transformer for EEG Decoding and Visualization. IEEE Trans. Neural Syst. Rehabil. Eng. 2023, 31, 710–719. [Google Scholar] [CrossRef]
  27. Brunner, C.; Leeb, R.; Müller-Putz, G. BCI Competition 2008–Graz Data Set A; Institute for Knowledge Discovery, Graz University of Technology: Graz, Austria, 2024. [Google Scholar] [CrossRef]
  28. Wriessnegger, S.C.; Brunner, C.; Müller-Putz, G.R. Frequency specific cortical dynamics during motor imagery are influenced by prior physical activity. Front. Psychol. 2018, 9, 1976. [Google Scholar] [CrossRef] [PubMed]
  29. Ouadfeul, S.A.; Aliouane, L. Wave-Number Filtering; Springer International Publishing: Cham, Switzerland, 2020; pp. 1–6. [Google Scholar] [CrossRef]
  30. Lotte, F. Signal processing approaches to minimize or suppress calibration time in oscillatory activity-based brain-computer interfaces. Proc. IEEE 2015, 103, 871–890. [Google Scholar] [CrossRef]
Figure 1. Time scheme of data record [27].
Figure 1. Time scheme of data record [27].
Signals 05 00034 g001
Figure 2. EEG signals visualised in EEG-LAB.
Figure 2. EEG signals visualised in EEG-LAB.
Signals 05 00034 g002
Figure 3. Transfer function of the Chebyshev filter (type 2) [29].
Figure 3. Transfer function of the Chebyshev filter (type 2) [29].
Signals 05 00034 g003
Figure 4. Segmentation and reconstruction (R&S) augmentation in time domain [30]. Trial 1 cut into A1, B1, and C1 and trial 2 cut into A2, B2, and C2. In the recombination stage, each output trial randomly combines 3 segments of A1, B1, C1, A2, B2, and C2. Artificial trial 1 combines A1, B2, and C1.
Figure 4. Segmentation and reconstruction (R&S) augmentation in time domain [30]. Trial 1 cut into A1, B1, and C1 and trial 2 cut into A2, B2, and C2. In the recombination stage, each output trial randomly combines 3 segments of A1, B1, C1, A2, B2, and C2. Artificial trial 1 combines A1, B2, and C1.
Signals 05 00034 g004
Figure 5. Architecture elements in a TCN. (a) Stacking of two residual blocks with dilated causal convolution with dilation factors d = 1, 2 and kernel size k = 3. (b) Detailed layers in TCN residual block [19].
Figure 5. Architecture elements in a TCN. (a) Stacking of two residual blocks with dilated causal convolution with dilation factors d = 1, 2 and kernel size k = 3. (b) Detailed layers in TCN residual block [19].
Signals 05 00034 g005
Figure 6. Architecture of EEG-TCNet [18].
Figure 6. Architecture of EEG-TCNet [18].
Signals 05 00034 g006
Figure 7. Architecture of EEG-Conformer [26].
Figure 7. Architecture of EEG-Conformer [26].
Signals 05 00034 g007
Figure 8. Architecture of EEG-TCNTransformer.
Figure 8. Architecture of EEG-TCNTransformer.
Signals 05 00034 g008
Figure 9. The column chart shows the accuracy between the EEG-TCNet baseline model, fixed model, and variable model.
Figure 9. The column chart shows the accuracy between the EEG-TCNet baseline model, fixed model, and variable model.
Signals 05 00034 g009
Figure 10. The column chart shows the accuracies of baseline EEG-TCNet, EEG-TCNet with a fixed bandpass filter, and EEG-TCNet with a variable bandpass filter.
Figure 10. The column chart shows the accuracies of baseline EEG-TCNet, EEG-TCNet with a fixed bandpass filter, and EEG-TCNet with a variable bandpass filter.
Signals 05 00034 g010
Figure 11. The column chart shows the accuracy between the EEG-Conformer baseline model, fixed model, and variable.
Figure 11. The column chart shows the accuracy between the EEG-Conformer baseline model, fixed model, and variable.
Signals 05 00034 g011
Figure 12. The column chart shows the accuracies of baseline EEG-Conformer, EEG-Conformer with a fixed bandpass filter, and EEG-Conformer with a variable bandpass filter.
Figure 12. The column chart shows the accuracies of baseline EEG-Conformer, EEG-Conformer with a fixed bandpass filter, and EEG-Conformer with a variable bandpass filter.
Signals 05 00034 g012
Figure 13. Confusion Matrix of EEG-TCNTransformer model for 9 subjects.
Figure 13. Confusion Matrix of EEG-TCNTransformer model for 9 subjects.
Signals 05 00034 g013
Table 1. EEG-TCNet architecture [18].
Table 1. EEG-TCNet architecture [18].
LayerTypeFilterKernelOutput
ϕ 1 Input (1, C, T)
Conv2D F 1 (1, K E )( F 1 , C, T)
BatchNorm
ϕ 2 DepthwiseConv2D F 1 · 2 (C, 1)( 2 · F 1 , 1, T)
BatchNorm
EluAct
AveragePool2D ( 2 · F 1 , 1, T//8)
Dropout
ϕ 3 SeparableConv2D F 2 (1, 16)( F 2 , 1, T//8)
BatchNorm
EluAct
AveragePool2D ( F 2 , 1, T//64)
Dropout
ϕ 4 TCN F T K T F T
ϕ 5 Dense 4
SoftMaxAct
C—number of EEG channels, T—number of time points, F 1 —number of temporal filters, F 2 ( = 2 · F 1 ) —number of spatial filters, F T —number of filters in TCN module, K E —kernel size in first convolution, K T —kernel size in TCN module.
Table 2. Experiment EEG-TCNet with different hyperparameters.
Table 2. Experiment EEG-TCNet with different hyperparameters.
EEGNet module F 1 6, 8, 10
K E 16, 32, 48
TCN module F T 10, 12, 14
K T 4, 6, 8
Table 3. Comparison of different numbers of filters and kernel sizes in the EEGNet module and the TCN module in average accuracy.
Table 3. Comparison of different numbers of filters and kernel sizes in the EEGNet module and the TCN module in average accuracy.
F 1 K E F T K E Average Accuracy (%)
6 75.38
83212476.55
10 78.04
16 76.66
83212476.55
48 77.05
10 77.99
83212476.55
14 78.58
476.55
83212679.96
878.59
Table 4. Variable hyperparameters of EEG-TCNet.
Table 4. Variable hyperparameters of EEG-TCNet.
S1S2S3S4S5S6S7S8S9
F 1 6106681010108
K E 484832323248164832
F T 121214141012121414
K T 666688464
Table 5. Accuracy of the EEG-TCNet baseline model, fixed model, and variable models (%).
Table 5. Accuracy of the EEG-TCNet baseline model, fixed model, and variable models (%).
SubjectBaselineFixed ModelVariable Model
S182.9286.1288.26
S261.1371.0272.79
S391.5894.8797.07
S464.9180.2680.26
S576.4576.8184.06
S659.5369.3069.30
S791.3487.0094.58
S881.9281.1887.82
S979.1785.2387.12
Average76.5581.3184.59
Table 6. Experiment EEG-TCNet with different parameters of Chebyshev type 2 filter.
Table 6. Experiment EEG-TCNet with different parameters of Chebyshev type 2 filter.
N4, 5, 6, 7, 8
r s 20, 30, 40, 50, 60. 70, 80, 90, 100
N—the order of the filter; r s —the minimum attenuation required in the stop band.
Table 7. Variable bandpass filter of EEG-TCNet.
Table 7. Variable bandpass filter of EEG-TCNet.
S1S2S3S4S5S6S7S8S9
N565776648
r s 8020100404090206080
Table 8. Accuracy of baseline EEG-TCNet and EEG-TCNet with fixed bandpass filter and with variable bandpass filter (%).
Table 8. Accuracy of baseline EEG-TCNet and EEG-TCNet with fixed bandpass filter and with variable bandpass filter (%).
SubjectBaselineFixed Bandpass FilterVariable Bandpass Filter
S182.9279.0082.21
S261.1351.9456.18
S391.5890.4894.51
S464.9172.3772.37
S576.4556.8856.88
S659.5351.1654.88
S791.3482.6784.84
S881.9282.2985.24
S979.1778.7984.85
Average76.5571.7374.66
Table 9. The architecture of the convolution module in EEG-Conformer [26].
Table 9. The architecture of the convolution module in EEG-Conformer [26].
LayerInOutKernelStride
Temporal Conv1k(1, 25)(1, 1)
Spatial Convkk( c h , 1)(1, 1)
Avg Poolingkk(1, 75)(1, 15)
Rearrange(k, 1, m) → (m, k)
k—number of temporal filters in the convolution module; c h —number of channels in EEG data.
Table 10. Experiment EEG-Conformer with different hyperparameters.
Table 10. Experiment EEG-Conformer with different hyperparameters.
k20, 30, 40, 50, 60
N6, 7, 8, 9, 10
Table 11. Comparison of different numbers of filters k and numbers of self-attention blocks N in EEG-Conformer in average accuracy.
Table 11. Comparison of different numbers of filters k and numbers of self-attention blocks N in EEG-Conformer in average accuracy.
kNAverage Accuracy (%)
20 78.66
30 78.02
40679.64
50 77.86
60 77.74
679.64
778.27
40878.50
978.58
1078.65
Table 12. Variable hyperparameters of EEG-Conformer.
Table 12. Variable hyperparameters of EEG-Conformer.
S1S2S3S4S5S6S7S8S9
k202030404020304030
N6861010910710
Table 13. Accuracies of the EEG-Conformer baseline model, fixed model, and variable models.
Table 13. Accuracies of the EEG-Conformer baseline model, fixed model, and variable models.
SubjectBaselineFixed ModelVariable Model
S183.9987.5488.26
S257.9560.4261.48
S394.5191.9495.24
S478.0775.8878.51
S578.6277.9079.35
S663.7264.1965.58
S788.8188.0992.42
S888.5688.5689.30
S982.5882.9584.09
Average79.6479.7281.58
Table 14. Experiment EEG-Conformer with different parameters of Chebyshev type 2 filter.
Table 14. Experiment EEG-Conformer with different parameters of Chebyshev type 2 filter.
N4, 5, 6, 7, 8
r s 20, 30, 40, 50, 60, 70, 80, 90, 100
Table 15. Variable bandpass filter of EEG-Conformer.
Table 15. Variable bandpass filter of EEG-Conformer.
S1S2S3S4S5S6S7S8S9
N545545665
r s 302040202020209090
Table 16. Accuracy of baseline EEG-Conformer, EEG-Conformer with a fixed bandpass filter, and EEG-Conformer with a variable bandpass filter (%).
Table 16. Accuracy of baseline EEG-Conformer, EEG-Conformer with a fixed bandpass filter, and EEG-Conformer with a variable bandpass filter (%).
SubjectBaselineFixed Bandpass FilterVariable Bandpass Filter
S183.9990.0491.81
S257.9563.9663.96
S394.5192.6794.14
S478.0781.5886.40
S578.6279.7179.71
S663.7266.9871.16
S788.8194.9596.39
S888.5688.5689.30
S982.5888.2688.64
Average79.6482.9784.61
Table 17. The average accuracy of different numbers of filters k and the number of TCN blocks T.
Table 17. The average accuracy of different numbers of filters k and the number of TCN blocks T.
k T
123
1075.8576.5276.16
2076.7879.0478.86
3080.5780.9982.06
4080.4081.6082.81
5079.3281.9682.75
6081.4482.6881.63
7081.1282.5783.41
8081.2882.1881.30
9080.9681.8181.78
10080.4982.1381.25
Table 18. Comparisons in the accuracy EEG-TCNet baseline, EEG-Conformer baseline, and EEG-TCNTransformer.
Table 18. Comparisons in the accuracy EEG-TCNet baseline, EEG-Conformer baseline, and EEG-TCNTransformer.
SubjectEEG-TCNetEEG-ConformerEEG-TCNTransformer
(Confidence Interval (%))
S182.9283.9987.90 (95.48)
S261.1357.9568.90 (93.59)
S391.5894.5194.51 (98.36)
S464.9178.0782.02 (94.64)
S576.4578.6281.88 (93.59)
S659.5363.7268.37 (93.04)
S791.3488.8189.53 (95.87)
S881.9288.5688.56 (96.59)
S979.1782.5889.02 (95.68)
Average76.5579.6483.41 (95.20)
Table 19. Comparisons in the precision of baseline EEG-TCNet, baseline EEG-Conformer, and EEG-TCNTransformer.
Table 19. Comparisons in the precision of baseline EEG-TCNet, baseline EEG-Conformer, and EEG-TCNTransformer.
EEG-TCNetEEG-ConformerEEG-TCNTransformer
S184.6083.9287.90
S266.5758.0069.16
S391.9894.4794.50
S469.9578.0381.75
S579.2178.6781.88
S664.3663.7468.33
S791.9788.9089.65
S882.3688.5788.64
S980.6282.6089.02
Average79.0779.6683.43
Table 20. Comparisons in the recall of baseline EEG-TCNet, baseline EEG-Conformer, and EEG-TCNTransformer.
Table 20. Comparisons in the recall of baseline EEG-TCNet, baseline EEG-Conformer, and EEG-TCNTransformer.
EEG-TCNetEEG-ConformerEEG-TCNTransformer
S182.9484.6987.84
S261.3158.6671.28
S391.5594.5494.78
S464.3078.1482.46
S576.5378.8881.95
S659.7463.9870.47
S791.4488.2789.90
S881.9889.5188.64
S979.2383.8189.09
Average76.5680.1684.05
Table 21. Comparisons of the F1 scores of baseline EEG-TCNet, baseline EEG-Conformer, and EEG-TCNTransformer.
Table 21. Comparisons of the F1 scores of baseline EEG-TCNet, baseline EEG-Conformer, and EEG-TCNTransformer.
EEG-TCNetEEG-ConformerEEG-TCNTransformer
S182.9083.9687.85
S261.5157.9568.18
S391.4594.4894.48
S461.6278.0681.73
S575.0578.6081.80
S658.7863.7568.19
S791.4388.8089.51
S882.0888.8488.53
S979.3882.1489.00
Average76.0279.6283.25
Table 22. The average accuracy of EEG-TCNTransformer with different bandpass filter parameters.
Table 22. The average accuracy of EEG-TCNTransformer with different bandpass filter parameters.
N rs
102030
174.5373.0070.61
280.2778.2176.81
375.8972.3771.72
479.5074.3173.53
578.2173.7171.80
678.8174.6671.69
778.7373.3771.37
879.1974.4871.38
979.5973.9272.12
1078.6973.7671.14
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Nguyen, A.H.P.; Oyefisayo, O.; Pfeffer, M.A.; Ling, S.H. EEG-TCNTransformer: A Temporal Convolutional Transformer for Motor Imagery Brain–Computer Interfaces. Signals 2024, 5, 605-632. https://doi.org/10.3390/signals5030034

AMA Style

Nguyen AHP, Oyefisayo O, Pfeffer MA, Ling SH. EEG-TCNTransformer: A Temporal Convolutional Transformer for Motor Imagery Brain–Computer Interfaces. Signals. 2024; 5(3):605-632. https://doi.org/10.3390/signals5030034

Chicago/Turabian Style

Nguyen, Anh Hoang Phuc, Oluwabunmi Oyefisayo, Maximilian Achim Pfeffer, and Sai Ho Ling. 2024. "EEG-TCNTransformer: A Temporal Convolutional Transformer for Motor Imagery Brain–Computer Interfaces" Signals 5, no. 3: 605-632. https://doi.org/10.3390/signals5030034

Article Metrics

Back to TopTop