CMHFE-DAN: A Transformer-Based Feature Extractor with Domain Adaptation for EEG-Based Emotion Recognition
Abstract
1. Introduction
- (1)
- A novel end-to-end convolutional multi-head attention feature extractor with DA Network CMHFE-DAN, for a complete pipeline, with little to no human interference, to bring the idea of real-world application closer.
- (2)
- A transformer-based convolutional feature extractor, automating the feature extraction phase.
- (3)
- Testing the model’s generalisation on multiple datasets with different signal acquisition methods, designs, and labelling, namely DEAP, SEED, and DREAMER datasets, to prove our CMHFE-DAN’s adaptability and generalisability.
- (4)
- Adding a DAN module to the feature extractor and applying it to the DEAP and DREAMER datasets for cross-subject validation, all while maintaining computational efficiency for BCI applications.
2. State of the Art
3. Proposed Model and Method
3.1. Proposed Model
3.2. Datasets
3.2.1. DEAP Dataset
3.2.2. SEED Dataset
3.2.3. DREAMER Dataset
3.3. Methods and Hyperparameters
4. Results and Discussion
4.1. Within-Subject Analysis
4.1.1. Results
4.1.2. Discussion
4.2. Cross-Subject Generalisation
4.2.1. Results
4.2.2. Discussion
4.3. Comparison with SOTA
Results and Discussion
5. Conclusions and Future Work
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Craik, A.; He, Y.; Contreras-Vidal, J.L. Deep Learning for Electroencephalogram (EEG) Classification Tasks: A Review. J. Neural Eng. 2019, 16, 031001. [Google Scholar] [CrossRef] [PubMed]
- Mridula, D.T.; Ahmed Ferdaus, A.; Pias, T.S. Exploring Emotions in EEG: Deep Learning Approach with Feature Fusion. In Proceedings of the 2023 26th International Conference on Computer and Information Technology (ICCIT), Cox’s Bazar, Bangladesh, 13–15 December 2023; pp. 1–6. [Google Scholar]
- Ari, B.; Siddique, K.; Alçin, Ö.F.; Aslan, M.; Şengür, A.; Mehmood, R.M. Wavelet ELM-AE Based Data Augmentation and Deep Learning for Efficient Emotion Recognition Using EEG Recordings. IEEE Access 2022, 10, 72171–72181. [Google Scholar] [CrossRef]
- Fahimi, F.; Zhang, Z.; Goh, W.B.; Lee, T.-S.; Ang, K.K.; Guan, C. Inter-Subject Transfer Learning with an End-to-End Deep Convolutional Neural Network for EEG-Based BCI. J. Neural Eng. 2019, 16, 026007. [Google Scholar] [CrossRef] [PubMed]
- Huang, Z.; Ma, Y.; Wang, R.; Li, W.; Dai, Y. A Model for EEG-Based Emotion Recognition: CNN-Bi-LSTM with Attention Mechanism. Electronics 2023, 12, 3188. [Google Scholar] [CrossRef]
- Chen, Z.; Yang, R.; Huang, M.; Li, F.; Lu, G.; Wang, Z. EEGProgress: A Fast and Lightweight Progressive Convolution Architecture for EEG Classification. Comput. Biol. Med. 2024, 169, 107901. [Google Scholar] [CrossRef]
- Song, T.; Zheng, W.; Liu, S.; Zong, Y.; Cui, Z.; Li, Y. Graph-Embedded Convolutional Neural Network for Image-Based EEG Emotion Recognition. IEEE Trans. Emerg. Top. Comput. 2022, 10, 1399–1413. [Google Scholar] [CrossRef]
- Tao, W.; Li, C.; Song, R.; Cheng, J.; Liu, Y.; Wan, F.; Chen, X. EEG-Based Emotion Recognition via Channel-Wise Attention and Self Attention. IEEE Trans. Affect. Comput. 2023, 14, 382–393. [Google Scholar] [CrossRef]
- Liu, R.; Chao, Y.; Ma, X.; Sha, X.; Sun, L.; Li, S.; Chang, S. ERTNet: An Interpretable Transformer-Based Framework for EEG Emotion Recognition. Front. Neurosci. 2024, 18, 1320645. [Google Scholar] [CrossRef]
- Zheng, W.; Pan, B. A Spatiotemporal Symmetrical Transformer Structure for EEG Emotion Recognition. Biomed. Signal Process. Control. 2024, 87, 105487. [Google Scholar] [CrossRef]
- Tang, J.; Ma, Z.; Gan, K.; Zhang, J.; Yin, Z. Hierarchical Multimodal-Fusion of Physiological Signals for Emotion Recognition with Scenario Adaption and Contrastive Alignment. Inf. Fusion 2024, 103, 102129. [Google Scholar] [CrossRef]
- Alameer, H.R.A.; Salehpour, P.; Hadi Aghdasi, S.; Feizi-Derakhshi, M.-R. Cross-Subject EEG-Based Emotion Recognition Using Deep Metric Learning and Adversarial Training. IEEE Access 2024, 12, 130241–130252. [Google Scholar] [CrossRef]
- Arjun; Rajpoot, A.S.; Panicker, M.R. Subject Independent Emotion Recognition Using EEG Signals Employing Attention Driven Neural Networks. Biomed. Signal Process. Control. 2022, 75, 103547. [Google Scholar] [CrossRef]
- Bethge, D.; Hallgarten, P.; Grosse-Puppendahl, T.; Kari, M.; Mikut, R.; Schmidt, A.; Özdenizci, O. Domain-Invariant Representation Learning from EEG with Private Encoders. In Proceedings of the ICASSP 2022—2022 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Singapore, 7–13 May 2022; pp. 1236–1240. [Google Scholar]
- Chen, J.X.; Zhang, P.W.; Mao, Z.J.; Huang, Y.F.; Jiang, D.M.; Zhang, Y.N. Accurate EEG-Based Emotion Recognition on Combined Features Using Deep Convolutional Neural Networks. IEEE Access 2019, 7, 44317–44328. [Google Scholar] [CrossRef]
- Chen, J.; Liu, Y.; Xue, W.; Hu, K.; Lin, W. Multimodal EEG Emotion Recognition Based on the Attention Recurrent Graph Convolutional Network. Information 2022, 13, 550. [Google Scholar] [CrossRef]
- Guo, W.; Xu, G.; Wang, Y. Multi-Source Domain Adaptation with Spatio-Temporal Feature Extractor for EEG Emotion Recognition. Biomed. Signal Process. Control. 2023, 84, 104998. [Google Scholar] [CrossRef]
- Li, J.; Hua, H.; Xu, Z.; Shu, L.; Xu, X.; Kuang, F.; Wu, S. Cross-Subject EEG Emotion Recognition Combined with Connectivity Features and Meta-Transfer Learning. Comput. Biol. Med. 2022, 145, 105519. [Google Scholar] [CrossRef]
- Priyasad, D.; Fernando, T.; Denman, S.; Sridharan, S.; Fookes, C. Affect Recognition from Scalp-EEG Using Channel-Wise Encoder Networks Coupled with Geometric Deep Learning and Multi-Channel Feature Fusion. Knowl. Based Syst. 2022, 250, 109038. [Google Scholar] [CrossRef]
- Li, J.; Pan, W.; Huang, H.; Pan, J.; Wang, F. STGATE: Spatial-Temporal Graph Attention Network with a Transformer Encoder for EEG-Based Emotion Recognition. Front. Hum. Neurosci. 2023, 17, 1169949. [Google Scholar] [CrossRef]
- Emsawas, T.; Morita, T.; Kimura, T.; Fukui, K.; Numao, M. Multi-Kernel Temporal and Spatial Convolution for EEG-Based Emotion Classification. Sensors 2022, 22, 8250. [Google Scholar] [CrossRef]
- Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, L.; Polosukhin, I. Attention Is All You Need. arXiv 2023, arXiv:1706.03762. [Google Scholar]
- Ganin, Y.; Lempitsky, V. Unsupervised Domain Adaptation by Backpropagation. arXiv 2015, arXiv:1409.7495. [Google Scholar]
- Osumi, K.; Yamashita, T.; Fujiyoshi, H. Domain Adaptation Using a Gradient Reversal Layer with Instance Weighting. In Proceedings of the 2019 16th International Conference on Machine Vision Applications (MVA), Tokyo, Japan, 27–31 May 2019; pp. 1–5. [Google Scholar]
- Scherer, K.R. What Are Emotions? And How Can They Be Measured? Soc. Sci. Inf. 2005, 44, 695–729. [Google Scholar] [CrossRef]
- Koelstra, S.; Muhl, C.; Soleymani, M.; Jong-Seok, L.; Yazdani, A.; Ebrahimi, T.; Pun, T.; Nijholt, A.; Patras, I. DEAP: A Database for Emotion Analysis; Using Physiological Signals. IEEE Trans. Affect. Comput. 2012, 3, 18–31. [Google Scholar] [CrossRef]
- Zheng, W.-L.; Lu, B.-L. Investigating Critical Frequency Bands and Channels for EEG-Based Emotion Recognition with Deep Neural Networks. IEEE Trans. Auton. Ment. Dev. 2015, 7, 162–175. [Google Scholar] [CrossRef]
- Duan, R.-N.; Zhu, J.-Y.; Lu, B.-L. Differential Entropy Feature for EEG-Based Emotion Classification. In Proceedings of the 2013 6th International IEEE/EMBS Conference on Neural Engineering (NER), San Diego, CA, USA, 6–8 November 2013; pp. 81–84. [Google Scholar]
- Katsigiannis, S.; Ramzan, N. DREAMER: A Database for Emotion Recognition Through EEG and ECG Signals From Wireless Low-Cost Off-the-Shelf Devices. IEEE J. Biomed. Health Inform. 2018, 22, 98–107. [Google Scholar] [CrossRef]
- NVIDIA H100 for AI & ML Workloads|Cloud GPU Platform|Paperspace. Available online: https://www.paperspace.com/ (accessed on 19 May 2025).
- 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]
- Lu, L.; Wu, D.; Chen, C. Visualization Method of Emotional EEG Features Based on Convolutional Neural Networks. In Proceedings of the 2024 IEEE 25th China Conference on System Simulation Technology and its Application (CCSSTA), Tianjin, China, 21–23 July 2024; pp. 188–193. [Google Scholar]
- Ludwig, S.; Bakas, S.; Adamos, D.A.; Laskaris, N.; Panagakis, Y.; Zafeiriou, S. EEGminer: Discovering Interpretable Features of Brain Activity with Learnable Filters. J. Neural Eng. 2024, 21, 036010. [Google Scholar] [CrossRef]
- Kim, S.; Kim, T.-S.; Lee, W.H. Accelerating 3D Convolutional Neural Network with Channel Bottleneck Module for EEG-Based Emotion Recognition. Sensors 2022, 22, 6813. [Google Scholar] [CrossRef]
Cited Reference/Year | Features | Model | Dataset | Accuracy | Validation Approaches |
---|---|---|---|---|---|
[12]/2024 | Differential entropy (DE) | Self-organised graph neural network (SOGNN) | SEED, SEED-GER, and DEAP | 91.70 (SEED) 67.15 (DEAP) | LOSO-CV |
[15]/2019 | Frequency bands/power spectral density | Deep convolution neural network | DEAP | 100 (All features) 61.76 (normalised raw data) | SD-analysis |
[13]/2022 | Raw EEG | LSTM 1 with channel-attention autoencoder/CNN 2 with attention | DEAP, SEED, and CHB-MIT | 65.9 ± 9.5 69.5 ± 9.7 (DEAP) 76.7 ± 8.5 (SEED) | LOSO-CV |
[21]/2022 | Raw EEG | Multi-kernel temporal and spatial convolution network | DEAP, SEED | SD [79.9;86] SI [52.05;54.6] | SD 5-fold CV SI LOSO-CV |
[9]/2024 | Raw EEG | Hybrid CNN and transformer | DEAP and SEED-V | SD [77.15;-] SI [61.75;-] | SD 10-fold CV |
[17]/2023 | Raw EEG | Multi-source domain adaptation | SEED, SEED-IV, and DEAP | [91.65;73.92;69.68] | LOSO CV |
[18]/2022 | Frequency bands and connectivity features: PCC, PLV, and PLI, | Multi-scale residual network (CNN) | DEAP and SEED | [71.60;87.05%] | LOSO CV |
[19]/2022 | Raw EEG | SincNet-encoders/MHA 3-graph convolution networks | DEAP and DREAMER | SD [66.6;88] SI [79.72;64.98] | SD 5-fold CV SI LOSO-CV |
[16]/2022 | Temporal features, and frequency-domain feature DE | Attention recurrent graph convolutional network | DEAP | SD 92.5 SI 73.80 | SD 5-fold CV SI LOSO-CV |
[11]/2024 | 8 features | Hierarchical multimodal network | DEAP, SEED-IV and -V | SD [69.39;56.82;50.24] SI [58.19;42.38;32.96] | SD 5-fold CV SI LOSO-CV |
[20]/2023 | Frequency bands | Transformer learning block and spatial-temporal graph attention | SEED, SEED-IV, and DREAMER | [90.37;76.43;77.44] | LOSO CV |
DEAP | DREAMER | SEED | |
---|---|---|---|
Subjects (S) | 32 | 23 | 15 |
EEG Channels (C) | 32 | 14 | 62 |
Trials (T) | 40 | 18 | 15 (3 sessions) |
Sampling Rate | 128 | 128 | 200 |
Total Trials (T × S) | 1280 | 414 | 675 |
Total Signals (T × S × C) | 40,960 | 5796 | 41,805 |
Parameters | DEAP SD | DREAMER SD | SEED SD | DEAP SI | DREAMER SI |
---|---|---|---|---|---|
epoch number | 200 | 200 | 100 | 100 | 100 |
learning rate | 0.001 | 0.0001 | 0.001 | 0.0001 | 0.0001 |
batch size | 32 | 16 | 16 | 32 | 32 |
optimiser | Adam | Adam | Adam | Adam | Adam |
loss function | BCE 1 | BCE | SCCE 2 | BCE | BCE |
random seed | 42 | 42 | 42 | 42 | 42 |
lambda | - | - | - | 0.5 | 0.4 |
Accuracy | ||
---|---|---|
Model | Valence | Arousal |
DEAP | 82.66 ± 8.68 | 82.29 ± 9.3 |
DREAMER | 80.89 ± 9.8 | 87.12 ± 8 |
SEED | 82.81 |
SD DEAP | Accuracy | |
Architecture | Valence | Arousal |
MultiT-S ConvNet | 77.6 ± 5.8 | 82.2 ± 6.5 |
ERTNet | 73.31 | 80.99 |
EEG-Peri | 74.17 ± 5.34 | 73.34 ± 7.94 |
CMHFE (Ours) | 82.29 ± 7.03 | 82.66 ± 7.55 |
SI DEAP | Accuracy | |
EEG-DML | 67.15 | - |
CVCNN | 65.51 | 61.76 |
AE-LSTM-ATT-CNN | 65.9 ± 9.5 | 69.5 ± 9.7 |
MultiT-S ConvNet | 52.6 ± 8.8 | 51.5 ± 10.4 |
ERTNet | 59.60 | 63.90 |
MSDA-SFE | 69.26 | 70.10 |
MTL-MSRN | 71.29 ± 7.67 | 71.92 ± 6.79 |
DCNN + GAT-MHA | 69.43 | 69.72 |
Mul-AT-RGCN-DAN | 74.13 | 73.47 |
CMHFE-DAN (Ours) | 78.20 | 79.91 |
SI DEAP | AUC | |
CVNN | 65.51 | 61.76 |
CMHFE-DAN (Ours) | 86.35 | 85.95 |
SI DREAMER | Accuracy | |
DCNN + GAT-MHA | 64.98 | 63.71 |
STGATE | 77.44 | 75.26 |
CMHFE-DAN (Ours) | 64.73 | 79.91 |
Model | Size | Accuracy |
---|---|---|
DCNN + GAT-MHA | 7 M | 69.57 |
MTL-MSRN | 1 M | 71.7 |
AE-LSTM-ATT-CNN | 3 M | 67.7 |
MultiT-S ConvNet | 30 K | 52.05 |
CMHFE-DAN (Ours) | 450 K | 79.05 |
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 (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Hilali, M.; Ezzati, A.; Ben Alla, S. CMHFE-DAN: A Transformer-Based Feature Extractor with Domain Adaptation for EEG-Based Emotion Recognition. Information 2025, 16, 560. https://doi.org/10.3390/info16070560
Hilali M, Ezzati A, Ben Alla S. CMHFE-DAN: A Transformer-Based Feature Extractor with Domain Adaptation for EEG-Based Emotion Recognition. Information. 2025; 16(7):560. https://doi.org/10.3390/info16070560
Chicago/Turabian StyleHilali, Manal, Abdellah Ezzati, and Said Ben Alla. 2025. "CMHFE-DAN: A Transformer-Based Feature Extractor with Domain Adaptation for EEG-Based Emotion Recognition" Information 16, no. 7: 560. https://doi.org/10.3390/info16070560
APA StyleHilali, M., Ezzati, A., & Ben Alla, S. (2025). CMHFE-DAN: A Transformer-Based Feature Extractor with Domain Adaptation for EEG-Based Emotion Recognition. Information, 16(7), 560. https://doi.org/10.3390/info16070560