Electroencephalography (EEG) classification plays a key role in brain-computer interface (BCI) systems, yet it remains challenging due to the low signal-to-noise ratio, temporal variability of neural responses, and limited data availability. In this paper, we present a comparative study of deep learning architectures for classifying event-related potentials (ERPs) in EEG signals. The preprocessing pipeline includes bandpass filtering, spatial filtering, and normalization. We design and compare three main pipelines: a 2D convolutional neural network (CNN) using Common Spatial Pattern (CSP), a second 2D CNN trained directly on raw data for a fair comparison, and a 3D CNN that jointly models spatiotemporal representations. To address ERP latency variations, we introduce a temporal shift augmentation strategy during training. At inference time, we employ a confidence-based test-time voting mechanism to improve prediction stability across shifted trials. An experimental evaluation on a stratified five-fold cross-validation protocol demonstrates that while CSP provides a benefit to the 2D architecture, the proposed 3D CNN significantly outperforms both 2D variants in terms of AUC and balanced accuracy. These findings highlight the effectiveness of temporal-aware architectures and augmentation strategies for robust EEG signal classification.
Figures & tables
Figure 1: Images of targets (top) and non-target (bottom).
F7
F3
Fz
F4
F8
FC5
FC1
-
FC2
FC6
T7
C3
Cz
C4
T8
CP5
CP1
-
CP2
CP6
P7
P3
Pz
P4
P8
-
PO3
-
PO4
-
-
O1
Oz
O2
-
Table 1: 2D sensor layout.
Layer
Filter/Units
Output Shape
Remarks
Input
–
C×T×1
CSP/Non-CSP input
Conv2D
1×10 , F=8
C×T′×8
Temporal
ReLU + BN
–
same
–
Conv2D
C×1 , F=16
1×T′×16
Spatial
ReLU + BN
–
same
–
Conv2D
1×10 , F=32
1×T′′×32
Full 2D
Table 2: Baseline 2D CNN (ReLU + Cross-Entropy)
Layer
Filter/Units
Output Shape
Remarks
Input
–
C×T×1
CSP/Non-CSP input
Conv2D
1×10 , F=8
C×T′×8
Temporal
GELU + BN
–
same
–
Conv2D
C×1 , F=16
1×T′×16
Spatial
GELU + BN
–
same
–
Conv2D
1×10 , F=32
1×T′′×32
Full 2D
Table 3: Improved 2D CNN (GELU + Focal Loss)
Layer
Filter/Units
Output Shape
Remarks
Input
–
C×T×1
CSP/Non-CSP input
Conv2D
1×10 , F=8
C×T′×8
Temporal
GELU + BN
–
same
–
Conv2D
C×1 , F=16
1×T′×16
Spatial
GELU + BN
–
same
–
Conv2D
1×10 , F=32
1×T′′×32
Full 2D
Table 4: 2D CNN with Global Average Pooling
Layer
Details
Output Shape
Remarks
Input
–
C×T×1
CSP/Non-CSP input matrix
Conv2D
1×10 , F=8
C×T′×8
Temporal filtering
GELU + BN
–
same
Nonlinear activation and normalization
Conv2D
C×1 , F=16
1×T′×16
Spatial filtering
GELU + BN
–
same
–
Conv2D
1×10 , F=32
1×T′′×32
Full feature integration
Table 5: 2D CNN with Squeeze-and-Excitation (SE) Block
Layer
Filter/Units
Output Shape
Remarks
Input
–
C×T×1
CSP/Non-CSP input
Conv2D
1×10 , F=8
C×T′×8
Temporal
Swish + BN
–
same
–
Conv2D
C×1 , F=16
1×T′×16
Spatial
Swish + BN
–
same
–
Conv2D
1×10 , F=32
1×T′′×32
Full 2D
Table 6: 2D CNN with Swish Activation
Layer
Filter/Units
Output Shape
Remarks
Same as GELU model
–
same
Only loss function changed
Loss
WCE
–
Uses inverse class frequency
Table 7: 2D CNN with Weighted Cross-Entropy Loss
Layer
Filter Size / Units
Output Shape
Remarks
Input
–
32×64×5×1
Raw EEG tensor with shift augmentation
Conv3D
1×7×3 , F=16
same
Temporal filtering across T and D
GELU + BN
–
same
Non-linearity + normalization
Conv3D
32×1×1 , F=32
1×64×5×32
Spatial filter across channels
GELU + BN
–
same
–
Dropout
p=0.3
same
Regularization
Table 8: Baseline 3D CNN Architecture
Layer
Filter Size / Units
Output Shape
Remarks
Input
–
32×64×5×1
Augmented EEG input
Conv3D
1×7×3 , F=16
same
Temporal convolution
GELU + BN
–
same
–
Conv3D
32×1×1 , F=32
1×64×5×32
Spatial filtering
GELU + BN
–
same
–
Dropout
p=0.3
same
Regularization
Table 9: Deep 3D CNN with Additional Convolution
Layer
Filter Size / Units
Output Shape
Remarks
Input
–
32×64×5×1
Augmented EEG input
Conv3D
1×7×3 , F=16
same
Temporal filtering
GELU + BN
–
same
–
Conv3D
32×1×1 , F=32
1×64×5×32
Spatial filtering
GELU + BN
–
same
–
Dropout
p=0.3
same
–
Table 10: Best Performing 3D CNN (with GAP)
Participant
Baseline
WCE
Swish
GELU
GAP
SE Block (Best)
s1
0.529
0.612
0.709
0.845
0.855
0.868
s2
0.516
0.595
0.691
0.829
0.839
0.861
s3
0.523
0.604
0.700
0.836
0.846
0.835
s4
0.533
0.617
0.714
0.851
0.861
0.837
s5
0.519
0.598
0.695
0.832
0.842
0.874
s6
0.527
0.609
0.706
0.843
0.853
0.849
Table 11: Mean AUC for All 2D CNN Architectures (Without CSP Preprocessing)
Participant
Baseline
WCE
Swish
GELU
GAP
SE Block
s1
0.531
0.615
0.713
0.868
0.870
0.873
s2
0.518
0.598
0.695
0.853
0.855
0.858
s3
0.525
0.607
0.704
0.850
0.860
0.862
s4
0.535
0.619
0.718
0.869
0.872
0.875
s5
0.521
0.601
0.699
0.857
0.859
0.861
s6
0.529
0.612
0.710
0.861
0.863
0.866
Table 12: Mean AUC for All 2D CNN Architectures (With CSP Preprocessing)
Participant
Baseline
Deep Stack
Best Model (GAP)
s1
0.761
0.935
0.995
s2
0.730
0.918
0.991
s3
0.775
0.941
0.999
s4
0.748
0.929
0.993
s5
0.781
0.945
0.994
s6
0.735
0.921
0.992
Table 13: Comparative Per-Participant Mean AUC for All 3D CNN Architectures
Classification of EEG signals using shallow Convolutional Neural Networks (CNNs) is a prevalent and successful approach across a variety of fields. Most of these models use independent one-dimensional (1D) convolutional layers along the spatial and temporal dimensions, which are concatenated without a non-linear activation layer between. In this paper, we investigate an alternative encoding that operates a bi-dimensional (2D) spatiotemporal convolution. While 2D convolutions are numerically identical to two concatenated 1D convolutions along the two dimensions, the impact on learning is still uncertain. We test 1D and 2D CNNs and a CNN+transformer hybrid model in a low-dimensional (3-channel) and a high-dimensional (22-channel) BCI motor imagery classification task. We observe that 2D convolutions significantly reduce training time in high-dimensional tasks while maintaining performance. We investigate the root of this improvement and find no difference in spectral feature importance. However, a clear pattern emerges in representational similarity across models: 1D and 2D models yield vastly different representational geometries. Overall, we suggest an improved model with a 2D convolutional layer for faster training and inference. We also highlight the importance of architecturally-driven encoding when processing complex multivariate signals, as reflected in internal representations rather than purely in performance metrics.
Reliable detection of event-related potentials (ERPs) at the single-trial level remains a major challenge due to the low signal-to-noise ratio EEG recordings. In this work, we investigate whether incorporating prior knowledge about ERP templates into deep learning models can improve detection performance. We employ the Deep-Match framework for ERP detection using multi-channel EEG signals. The model is trained in two stages. First, an encoder-decoder architecture is trained to reconstruct input EEG signals, enabling the network to learn compact signal representations. In the second stage, the decoder is replaced with a detection module, and the network is fine-tuned for ERP identification. Two model variants are evaluated: a standard model with randomly initialized filters and a Deep-MF model in which input kernels are initialized using ERP templates. Model performance is assessed on a single-trial ERP detection task using leave-one-subject-out validation. The proposed Deep-MF model slightly outperforms the detector with standard kernel initialization for most held-out subjects. Despite substantial inter-subject variability, Deep-MF achieves a higher average F1-score (0.37) compared to the standard network (0.34), indicating improved robustness to cross-subject differences. The best performance obtained by Deep-MF reaches an F1-score of 0.71, exceeding the maximum score achieved by the standard model (0.59). These results demonstrate that ERP-informed kernel initialization can provide consistent improvements in subject-independent single-trial ERP detection. Overall, the findings highlight the potential of integrating domain knowledge with deep learning architectures for EEG analysis. The proposed approach represents a step toward practical wearable EEG and passive brain-computer interface systems capable of real-time monitoring of cognitive processes.
Marek Zylinski, Bartosz Tomasz Smigielski, Gerard Cybulski
Institute of Metrology and Biomedical Engineering, Faculty of Mechatronics, Warsaw University of Technology, Warsaw, Poland
Electroencephalography (EEG) is a widely adopted technique for monitoring brain activity, offering valuable insights into neurological states due to its high temporal resolution and cost-effectiveness. To enhance the analysis of complex EEG data, we propose EEG-TransNet, an architecture designed to capture temporal, regional, and synchronous features of EEG signals. EEG-TransNet introduces three key modules: 1) a preprocessing and feature extraction module leveraging ResNet and wavelet-based denoising, 2) a Local Self-Attention Block for regional feature learning, and 3) a Fuzzy-Attention Synchronous Transformer (FAST) to model spatiotemporal dependencies. Through extensive experiments on three EEG datasets (BETA, SEED, and DepEEG), the proposed model consistently outperforms other methods in terms of classification accuracy and robustness across varying signal lengths. Ablation studies confirm the contribution of the Local Self-Attention Block in improving performance, and the inclusion of depthwise separable convolutions in the decoder reduces computational complexity while maintaining high accuracy. EEG-TransNet's ability to generalize across subjects with minimal performance variation highlights its potential as a robust tool for EEG-based brain activity classification and emotion recognition tasks.
Xinglong Cui, Dian Gu
Beijing Neurodeep Technology Co., Ltd, Beijing, 100176, China · University of Pennsylvania, Seattle, 98121, USA