Attention-Driven Emotion Recognition in EEG: A Transformer-Based Approach With Cross-Dataset Fine-Tuning
Ghulam Ghous, Shaheryar Najam, Mohammed Alshehri, Abdulmonem Alshahrani, Yahya AIQahtani, Ahmad Jalal, Hui Liu
Abstract
Emotion recognition from EEG (electroencephalogram) signals is crucial in mental health diagnostics and human-computer interaction but is often hindered by high dimensionality, noise, and complex temporal dependencies in the data. This paper presents a novel approach that integrates transformer models, attention mechanisms, and transfer learning to enhance emotion recognition accuracy from EEG signals. The proposed methodology consists of two phases: Attention Enhanced Base Model Development (AE-BMD) and Cross-Dataset Fine Tuning Adaptation (CD-FTA). In the AE-BMD phase, the base model is developed and trained on the SEED-IV dataset (15 participants, 62 EEG channels), achieving an accuracy of 84%, with an average precision of 84.75%, recall of 84% and F1-score of 84%. This phase employs optimized feature extraction from key EEG frequency bands (Delta, Theta, Alpha, Beta, Gamma) using techniques such as MFCC, GFCC, power spectral density, and Hjorth parameters. A transformer encoder with integrated spectral and temporal attention mechanisms captures intricate patterns and long-range dependencies within the EEG signals. In the CD-FTA phase, the model undergoes fine-tuning on the SEED-V dataset (20 participants, 62 channels) leading to an improved accuracy of 90%, with an average precision of 90.6%, recall of 90.6%, and F1-score of 90.6%. The model’s generalization is further validated on the MPED dataset (23 participants, 62 channels, seven emotion classes), achieving 79%, with an average precision of 79.3%, recall of 79.3% and F1-score of 79.1% across diverse emotional states. This cross-dataset adaptation leverages transfer learning to enhance the model’s generalization across different emotional states and EEG datasets. Experimental results show that the proposed approach outperforms traditional methods, achieving superior accuracy and robustness in emotion recognition tasks. This work advances emotion recognition systems by addressing challenges in EEG signal processing, feature extraction, and model generalization, positioning it as a promising tool for applications in healthcare, affective computing, and emotional state analysis.