Submitted:
19 November 2025
Posted:
20 November 2025
You are already at the latest version
Abstract
Keywords:
I. Introduction
II. Methods
A. Participants
- Number & demographics: For single-participant / participant-level analyses I report results per subject. Similar to Sun et. al. and Wandelt et. al., few participants were used (n=2) (due to focus on single participant decoding) and most models were trained on both datasets independently (evaluation metrics were averaged) (.
- Note: Cross participant evaluations were not tested yet this should be an area of future research. From a practical standpoint however, these models can be easily trained and fine-tuned to individual participants.
B. Hardware & Acquisition
- EEG hardware: OpenBCI Ganglion (and an OpenBCI flat & comb electrodes). Four active channels were used and optimized for semantic decoding (schematic provided in Figure 1). For both tasks, electrodes were placed at TP7, TP8, F7, and F8 in accordance with the universal 10-20 system (see Figure 1) (Maskeliunas R, Damasevicius R, Martisius I, Vasiljevas M. Consumer-grade EEG devices: are they usable for control tasks?). For sampling, LSL (lab streaming layer) was used to stream data from the OpenBCI GUI.
- Sampling rate: Sampling rate was 200 Hz over 5-second epochs (1000 points/sample), with both time-series and FFT data (60 bins, 250 snapshots) collected per trial.”
C. Impedance & Quality Control: Channels Checked Before Each Session; Trials with High Impedance Levels Were Ignored
D. Stimulus Presentation: Words Displayed Centrally on a Monitor with a Fixation Cross Between Trials. Timing: Stimulus Duration = 5 s, Inter-Stimulus Interval ~ 1-2 s.
E. Stimuli & Experimental Design
- Word lists: Two primary semantic tasks: emotional valence (words labeled negative / neutral / positive) and part-of-speech (noun vs. verb). Experiments described in the introduction used sets of 50 unique words (each).
- Trial structure: Each word was presented for each trial; participants were asked to ponder the word (in addition to passive viewing). Each word had 0 repetitions
- Total trials & augmentation rationale: For the FFT-based method I treated every other FFT “window” or “snapshot” from a single epoch as separate training samples (see Feature Extraction). For example, 50 words × 125 FFT samples per word → 6250 FFT samples; with 100 words → 12500 FFT samples.
F. EEG Preprocessing
- Bandpass filtering: 0.5–100 Hz
- Line-noise removal: notch filter at 50/60 Hz
- Normalization: Percentile-based scaling: for each channel, values were normalized using the 5th–95th percentile range to reduce the influence of extreme values. This approach improves strength across sessions/participants and is used prior to data entrance into the model.
G. Feature Extraction & FFT Sampling
-
Raw time-series
- The epoch time-series (shape: channels, timepoints) after preprocessing was used directly as input to time-domain CNN architectures. For the EEGNet-style baseline the input tensor shape was (channels, timepoints, 1). Note: An extra dimension was added for compatibility with the EEGNet inspired architecture.
-
FFT-based frequency-domain sampling (data amplification trick; see Appendix B: Flowchart 2)
- Rationale: FFT representations can expose certain features (delta/theta/alpha/beta/gamma bands). Because 250 “snapshots” of this FFT data occurred over a different time interval (~2 seconds) I can treat each FFT “plot” as its own sample. In this case, every other snapshot was treated as a unique training sample with the same label as the parent sample (leaving 125 unique samples per trial). Important: It was ensured that trial-level splits were implemented to prevent data-leakage.
-
Parameters used:
- Frequency bins: 1–60 Hz
- Number of snapshots per sample: 125
- Normalization: Each FFT snapshot was normalized using the same percentile scaling as for the time-series.
- Representation: For CNNs I formatted each FFT snapshot as a 2D “shape” (channels × frequency bins) so that depthwise/separable convolutions could learn spatial-frequency filters.
H. Model Architectures & Development Pipeline (see Appendix A for Detailed Architectures)
-
EEGNet-style baseline
- Based on the EEGNet design1 (compact model with multiple filters)
- Key layers: Depthwise spatial filter (per-channel) and separable convolution (to capture temporal patterns).
-
Explainability & LIME-guided channel reweighting
- After training EEGNet-style models, I extracted early-layer filter weights and used LIME (Local Interpretable Model-agnostic Explanations) to estimate channel contributions to predictions (and to discern artifacts/noise)
- Channels were then weighted accordingly via multiplicative channel scaling in the input
-
Fused multi-head model (fine-tuning fusion)
- Individual single-task models (emotion, POS) were trained together to demonstrate the efficacy of a fusion model. Early convolutional weights were extracted and concatenated into a fused encoder, and task-specific heads were attached.
- Embedding-Constrained EEG Architecture (primary proposed model)
- Generate word embeddings using OpenAI’s text-embedding-3-small for the full stimulus set (n = 100 words) (He T, Boudewyn MA, Kiat JE, Sagae K, Luck SJ. Neural correlates of word representation vectors in natural language processing models…)
- Cluster embeddings into K semantic archetypes (K manually chosen; in the experiments K = 2). Archetypes include groups like emotional, concrete/sensory, abstract, noun/verb etc
- Clustering group categories are determined by evaluating embeddings for words closest to the centroid (and then used as representations for the cluster as a whole)
- For each grouping I created a specialized processing branch with convolutional filters tuned to frequency bands expected for that archetype (neuroscience-informed choices: emotion → emphasis on delta/theta/alpha; noun/verb → include beta/gamma etc) (Pulvermuller F, Preissl H, Lutzenberger W, Birbaumer N. Brain rhythms of language: nouns versus verbs),(Gkintoni E, Aroutzidis A, Antonopoulou H, Halkiopoulos C. From Neural Networks to Emotional Networks: A Systematic Review of EEG...). Specifically, temporal convolution sizes and filter sizes are then utilized that bias each branch to the target frequency bands (see Table A1, A2, A3 for detailed architecture).
-
Each branch processes FFT input (channels × frequency bins). Branch outputs are concatenated and passed to shared dense layers, and then to task-specific heads.
- Key property: embeddings are used only for architecture construction, not at inference. In this way, the model is forced to learn EEG related patterns and not over-rely on embedding information (it was demonstrated that the model often prioritizes the embeddings over the noisy EEG data when embeddings were involved in training).
- 5.
-
Embedding-as-regularizer (alternative strategy)
- Includes an auxiliary loss (extra loss function) forcing learned EEG embeddings to correlate with word embeddings (i.e, cosine similarity). The goal was to create a joint-embedding space that represented both EEG data and word embeddings. I found this strategy often caused optimization conflicts, over-reliance on the embeddings and poorer performance. Nevertheless, it was implemented for comparison and to explore alternate uses of word embeddings.
I. Loss Functions & Optimization
-
Primary loss: Categorical cross-entropy with focal loss (gamma=1.5, alpha=0.25) for imbalanced emotion classes (20 pos/15 neu/15 neg); POS was balanced.
- For FFT data, trial level split was implemented to ensure integrity.
- Optimizer: Adam with initial learning rate = 1e−3 for training from scratch; 1e−4 for fine-tuning fused models.
- Regularization: Dropout in dense layers (e.g., 0.4).
- Batch size: (example) 32 for FFT snapshots, and smaller (16) for time-series
- Epochs & early stopping: maximum epochs = 100 with early stopping based on validation loss/patience = 20 epochs.
J. Training & Evaluation Protocol
- Data splits: Performing train/validation/test splits, Stratified Shuffle Split was utilized: n_splits = 1, random state = 42, test size = 0.2
- Within-participant fine-tuning: For fused and embedding-constrained experiments, I report both (a) models trained from scratch per participant and (b) models built via transfer/fine-tuning from other participants’ weights (to simulate realistic use where a pretrained model is personalized).
K. Evaluation Metrics & Statistical Tests
- Primary metric: classification accuracy. Baseline chance levels: emotion (3-class) = 33.3%, POS (2-class) = 50%.
- Secondary metrics: confusion matrices, LIME analysis, and convolutional weight visualizations where applicable.
- Evaluations: Model accuracies were evaluated by, after training the model, shuffling the validation/testing set, randomly sampling 40-80%, evaluating the accuracy and repeating 100 times. The accuracies were then averaged to ensure it represented the models true performance. Classification accuracies are reported with 95% Wilson binomial confidence intervals, computed relative to the number of test trials.
L. Explainability & Weight Analysis
- Weight visualization: plot early convolution (depthwise & separable) filters and their spatial maps to inspect learned spatial & temporal patterns.
- LIME: applied to trained EEGNet-style models to estimate per-channel/frequency contributions to single-sample predictions. LIME outputs guided channel reweighting: channels consistently identified as artifactual or noisy were downweighted (by a multiplicative scalar) and models fine-tuned. Results of reweighting are reported.
- Other studies: evaluating performance after removing reweighting, removing/adding noise, etc.
M. Reproducibility & Code/Data Availability
- Code: all preprocessing, model definitions, training scripts, and analysis notebooks are available in the project repository (to be provided). Versions of libraries (TensorFlow, NumPy, etc.) will be included.
- Data: raw EEG data will be shared via the same repository in a pkl file. FFT snapshots and model weights will not be provided explicitly but the code to extract such weights will be available.
III. Results
A. Data Quantity, Preprocessing, and Effective Sample Amplification
B. Preprocessing Outcomes and Channel Quality
C. Representation Comparison: Time-Series vs FFT Snapshots
D. Explainability, Channel Reweighting, and Single-Participant Fine-Tuning
E. Fused Multi-Head Model (Fine-Tuning Fusion)
F. Embedding-Constrained EEG Architecture (Proposed Model; see Appendix B: Flowchart 2)
G. Embedding-as-Regularizer Strategy (Alternative)
H. Summary of Mean Test Accuracies over 100 Shuffled Evaluations (Accuracies Are Reported with 95% Wilson Binomial Confidence Intervals; Note: For Time-Series Models, CI Will Be Large Due to Small Testing Sizes but This Is Mitigated Through Shuffling and Averaging for Confidence (see Methods)
| Model / Representation | Emotion acc (%) mean | POS acc (%) mean | Combined, mean acc (%) | Task Count |
| Time-series EEGNet | 87.50% 95% CI: 46.48 – 98.26 |
89.74% 95% Cl: 48.9 - 98.83 |
88.62% | Single-task |
| FFT-EEGNet | 95.77% 95% CI: 94.94 – 96.43 |
93.94% 95% CI: 92.57 – 95.06 |
94.86% | Single-task |
| Time Series + LIME reweight | 90.12% 95% CI: 61.74 – 98.05 |
- | 90.12% | Single-task |
| Fused multi-head (with best weights) | 74.70% 95% CI: 73.59 – 75.72 |
80.6% 95% CI: 79.23 – 81.8 |
77.65% | Multi-task |
| Embedding-constrained | 94.12% 95% CI: 93.42 – 94.96 |
93.04% 95% CI: 92.16 – 93.83 |
93.58% | Multi-task |
| Embedding-regularizer | 64.95% 95% CI: 63.21 – 66.35 |
73.82% 95% CI: 72.53 – 75.42 |
69.39% | Multi-task |
IV. Discussion
V. Conclusions
Funding
Appendix A: Model Architectures
| Component | Layer Type | Purpose |
| Input Layer | Input | EEG signals (4 channels, 60 time points) |
| Specialized Processing Branches | ||
| Emotion Branch | Conv2D | Low-frequency emotional patterns |
| Conv2D | Delta/theta/alpha band focus | |
| MaxPooling2D | Reduce size | |
| BatchNormalization | Normalize | |
| Noun Branch | Conv2D | Capture representation patterns |
| Conv2D | Temporal object processing | |
| MaxPooling2D | Spatial-temporal reduction | |
| BatchNormalization | Normalize | |
| Verb Branch | Conv2D | Motor-action network activation |
| Conv2D | Action planning patterns | |
| MaxPooling2D | Feature compression | |
| BatchNormalization | Normalize | |
| Feature Fusion | ||
| Flatten | Branch output flattening | |
| Concatenate | Multi-branch feature fusion | |
| Dense | Share representation | |
| Shared Processing | ||
| Dense | Feature extraction | |
| BatchNormalization | Training stabilization | |
| Dropout | Overfitting prevention | |
| Dense | Share representation | |
| BatchNormalization | Training stabilization | |
| Dropout | Regularization | |
| Output Heads | ||
| Emotion Classification | Dense | Negative/Neutral/Positive |
| POS Classification | Dense | Noun/Verb |
| Parameter | Value | Description |
| Input Shape | (4, 60, 1) | 4 EEG channels, 60 time points, 1 feature |
| Optimizer | Adam | learning_rate=1e-5 |
| Loss Function | Balanced Focal Loss | α=0.25, γ=1.5 for both tasks |
| Loss Weights | [1.2, 1.0] | Emotion task: 1.2, POS task: 1.0 |
| Batch Size | 32 | Batch |
| Epochs | 100 | Maximum training iterations |
| Validation Split | 20% | Stratified shuffle split |
| Early Stopping | 15 epochs patience | Monitor validation loss |
| Learning Rate Reduction | Factor=0.5, patience=8 | Adaptive learning rate |
| Data Normalization | Robust percentile | 5th-95th percentile inclusion |
| Design Principle | Implementation | Neuroscientific Rationale |
| Frequency-Specific Processing | Different kernel sizes per branch | E.g: Emotion: low-freq patterns, Noun: sustained patterns, Verb: dynamic patterns |
| Spatial Attention | Varying spatial filter | Noun: temporal areas, Verb: motor-frontal activation |
| Multi-Task Learning | Shared features but separate heads | Learns from all branches |
| Embedding-Informed Design | Cluster analysis architecture | Word semantics guide neural processing |
| EEG-Only Inference | No text input or embedding input required | Deployable and practical for real-time BCI applications |
| Layer | Type | Purpose |
| Input | Input | Raw EEG or FFT input |
| Temporal Convolution Block | ||
| Conv2D_1 | Conv2D | Temporal filtering across time |
| BN_1 | BatchNormalization | Normalize activations |
| Block 2: Spatial Convolution | ||
| DepthwiseConv2D | DepthwiseConv2D | Spatial filtering across channels |
| BN_2 | BatchNormalization | Normalize activations |
| Activation_1 | ELU | Non-linear activation |
| Pool_1 | AveragePooling2D | Downsample |
| Dropout_1 | Dropout | Regularization |
| Separable Convolution Block | ||
| SeparableConv2D | SeparableConv2D | Efficient feature extraction |
| BN_3 | BatchNormalization | Normalize activations |
| Activation_2 | ELU | Non-linear activation |
| Pool_2 | AveragePooling2D | Further downsampling |
| Dropout_2 | Dropout | Regularization |
| Classification Head | ||
| Flatten | Flatten | Convert to 1D |
| Dense | Dense | Classification output (either emotion or POS) |
| Layer | Type | Purpose |
| Input | Input | EEG (FFT) input |
| Feature Extraction | ||
| Emotion_Extractor | Frozen EEGNet | Extract emotion features |
| POS_Extractor | Frozen EEGNet | Extract POS features |
| Emotion_Flatten | Flatten | Flatten emotion features |
| POS_Flatten | Flatten | Flatten POS features |
| Attention Fusion Block | ||
| Emotion_Proj | Dense | Project emotion features |
| POS_Proj | Dense | Project POS features |
| Emotion_Att | Dense | Emotion attention weights |
| POS_Att | Dense | POS attention weights |
| Emotion_weighted | Lambda | Apply attention to emotion |
| POS_weighted | Lambda | Apply attention to POS |
| Fused | Concatenate | Combine weighted features |
| Fusion Processing | ||
| Fusion_Dense1 | Dense | First fusion layer |
| Fusion_BN1 | BatchNormalization | Normalize activations |
| Fusion_Dropout1 | Dropout | Stability |
| Fusion_Dense2 | Dense | Second fusion layer |
| Fusion_BN2 | BatchNormalization | Normalize activations |
| Fusion_Dropout2 | Dropout | Stability |
| Output Heads | ||
| Emotion_Output | Dense | Emotion classification |
| POS_Output | Dense | POS classification |
Appendix B: Extended Results, Graphs, & Confusion Matrices





Informed Consent Statement
Data Availability Statement
References
- Lawhern, V. J., Solon, A. J., Waytowich, N. R., Gordon, S. M., Hung, C. P., & Lance, B. J. (2018). EEGNet: A compact convolutional neural network for EEG-based brain-computer interfaces. Journal of Neural Engineering, 15(5), 056013. [CrossRef]
- Pulvermuller F, Preissl H, Lutzenberger W, Birbaumer N. Brain rhythms of language: nouns versus verbs. Eur J Neurosci. 1996 May;8(5):937-41. [CrossRef] [PubMed]
- Gkintoni E, Aroutzidis A, Antonopoulou H, Halkiopoulos C. From Neural Networks to Emotional Networks: A Systematic Review of EEG-Based Emotion Recognition in Cognitive Neuroscience and Real-World Applications. Brain Sci. 2025 Feb 20;15(3):220. [CrossRef] [PubMed] [PubMed Central]
- Aquino-Brítez D, Ortiz A, Ortega J, León J, Formoso M, Gan JQ, Escobar JJ. Optimization of Deep Architectures for EEG Signal Classification: An AutoML Approach Using Evolutionary Algorithms. Sensors (Basel). 2021 Mar 17;21(6):2096. [CrossRef] [PubMed] [PubMed Central]
- He T, Boudewyn MA, Kiat JE, Sagae K, Luck SJ. Neural correlates of word representation vectors in natural language processing models: Evidence from representational similarity analysis of event-related brain potentials. Psychophysiology. 2022 Mar;59(3):e13976. Epub 2021 Nov 24. [CrossRef] [PubMed] [PubMed Central]
- Maskeliunas R, Damasevicius R, Martisius I, Vasiljevas M. Consumer-grade EEG devices: are they usable for control tasks? PeerJ. 2016 Mar 22;4:e1746. [CrossRef] [PubMed] [PubMed Central]
- Hollenstein N, Renggli C, Glaus B, Barrett M, Troendle M, Langer N, Zhang C. Decoding EEG Brain Activity for Multi-Modal Natural Language Processing. Front Hum Neurosci. 2021 Jul 13;15:659410. [CrossRef] [PubMed] [PubMed Central]
- Sun P, Anumanchipalli GK, Chang EF. Brain2Char: A deep architecture for decoding text from brain recordings. J Neural Eng. 2020 Dec 15;17(6):066021. [CrossRef] [PubMed] [PubMed Central]
- Wandelt, S.K., Bjånes, D.A., Pejsa, K. et al. Representation of internal speech by single neurons in human supramarginal gyrus. Nat Hum Behav 8, 1136–1149 (2024). [CrossRef]












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. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).