Abstract
In this work, a parameter efficient attention module is developed for the task of emotion classification as well as improved model interpretability based on EEG source data. Inspired by the self-attention mechanism used in transformers, we propose a Monotonicity Constrained Attention Module (MCAM) that can help incorporate different priors easily on the monotonicity when converting Gram matrices from deep features into attention matrices for better feature refinement. In the subject-dependent classification task, MCAM achieves 95.0% mean prediction accuracy on four classification task with DEAP and 91.1% mean prediction accuracy on three classification task with SEED. On both datasets, MCAM is shown comparable to state-of-the-art attention modules in terms of boosting the backbone network’s predictive performance while requiring significantly fewer parameters. A thorough analysis is also performed on tracking the different effects inserted modules have on the backbone model’s behavior. For example, visualization and analysis techniques are presented to examine changes in spatial attention patterns reflected via kernel weights, change in prediction performance when different frequency information is filtered out, or changes that occur when different amplitude information is suppressed; as well as how different models change their predictions along linear morphisms between two samples belonging to different emotion categories. The results help to reveal what different modules learn and use during prediction, and can also provide guidance when applying them to specific applications.
Similar content being viewed by others
Data Availability
SEED dataset can be downloaded upon request at https://bcmi.sjtu.edu.cn/home/seed/DEAP dataset can be downloaded upon request at http://www.eecs.qmul.ac.uk/mmv/datasets/deap/
Notes
We choose a Gram matrix representation over the batch covariance matrix because of the fact that the batch mean fluctuates during stochastic training. These fluctuating means have the effect of causing feature vectors to be centered differently in each batch, causing the resulting attention matrix to have an unnecessary dependency (and thus potential sensitivity) to the fluctuating stochastic batch centers.
The shape of the weight matrix is 1 by C, where C is the number of EEG channels of input samples.
The +QKV case is not as pronounced in this regard as others around the P4 area.
We put a note here that more meaningful interpretations are likely to emerge from this method when the samples selected represent specific kinds of signal templates associated with clinically admissible subsets.
Though we only show this result on one subject, this is the case for all 14 other subjects from SEED as well.
References
Kuang D, Michoski C, Li W, Guo R (2022) A monotonicity constrained attention module for emotion classification with limited EEG data. In: Zamzmi G, Antani S, Bagci U, Linguraru MG, Rajaraman S, Xue Z (eds) Medical image learning with limited and noisy data, Springer, pp 218–228
Yamawaki S, Okada G, Okamoto Y, Liberzon I (2012) Mood dysregulation and stabilization: perspectives from emotional cognitive neuroscience. Int J Neuropsychopharmacol 15(5):681–694
Berridge KC (2004) Motivation concepts in behavioral neuroscience. Physiol Behav 81(2):179–209
DeYoung CG (2010) Personality neuroscience and the biology of traits. Soc Personal Psychol Compass 4(12):1165–1180
Dietrich A (2004) The cognitive neuroscience of creativity. Psychon Bull Rev 11(6):1011–1026
Immordino-Yang MH, Damasio A (2007) We feel, therefore we learn: the relevance of affective and social neuroscience to education. Mind Brain Educ 1(1):3–10
Reiss J, Sprenger J (2020) Scientific objectivity. In: Zalta EN (ed) The Stanford encyclopedia of philosophy, winter. 2020 edn. Metaphysics Research Lab, Stanford University. https://plato.stanford.edu/archives/win2020/entries/scientific-objectivity/
Lane RD, Nadel L (2002) Cognitive neuroscience of emotion. Oxford University Press
Durán JI, Reisenzein R, Fernández-Dols J-M (2017) Coherence between emotions and facial expressions. The Science of Facial Expression 107–129
Grimm M, Kroschel K, Mower E, Narayanan S (2007) Primitives-based evaluation and estimation of emotions in speech. Speech Comm 49(10-11):787–800
Chatterjee A, Gupta U, Chinnakotla MK, Srikanth R, Galley M, Agrawal P (2019) Understanding emotions in text using deep learning and big data. Comput Hum Behav 93:309–317
Gentile V, Milazzo F, Sorce S, Gentile A, Augello A, Pilato G (2017) Body gestures and spoken sentences: a novel approach for revealing user’s emotions. In: 2017 IEEE 11th international conference on semantic computing (ICSC), IEEE, pp 69–72
Kuang D, Michoski C (2020) Dual stream neural networks for brain signal classification. Journal of Neural Engineering
Ekman P (1992) An argument for basic emotions. Cognit Emot 6(3-4):169–200
Spinoza B (2006) The essential spinoza: ethics and related writings hackett publishing
Russell JA (1980) A circumplex model of affect. J Personal Soc Psychol 39(6):1161
Mehrabian A (1996) Pleasure-arousal-dominance: a general framework for describing and measuring individual differences in temperament. Curr Psychol 14:261–292
Subramanian R, Wache J, Abadi MK, Vieriu RL, Winkler S, Sebe N (2016) Ascertain: emotion and personality recognition using commercial sensors. IEEE Trans Affect Comput 9(2):147–160
Wang X-W, Nie D, Lu B-L (2014) Emotional state classification from EEG data using machine learning approach. Neurocomputing 129:94–106
Asghar MA, Khan MJ, Amin Y, Rizwan M, Rahman M, Badnava S, Mirjavadi SS et al (2019) EEG-based multi-modal emotion recognition using bag of deep features: an optimal feature selection approach. Sensors 19(23):5218
Subasi A, Tuncer T, Dogan S, Tanko D, Sakoglu U (2021) EEG-based emotion recognition using tunable q wavelet transform and rotation forest ensemble classifier. Biomed Sig Process Control 68:102648
Tuncer T, Dogan S, Subasi A (2021) A new fractal pattern feature generation function based emotion recognition method using EEG. Chaos, Solitons Fractals 144:110671
Tuncer T, Dogan S, Baygin M, Acharya UR (2022) Tetromino pattern based accurate EEG emotion classification model. Artif Intell Med 123:102210
Kılıç B, Aydın S (2022) Classification of contrasting discrete emotional states indicated by EEG based graph theoretical network measures. Neuroinformatics 1–15
Aydın S, Demirtaş S, Tunga MA, Ateş K (2018) Comparison of hemispheric asymmetry measurements for emotional recordings from controls. Neural Comput Appl 30(4):1341–1351
Gao J, Yang C, Liu F, Qi J (2021) Emotion prediction of EEG signals based on 1d convolutional neural network. J Neural Eng 2024
Liu S, Wang X, Zhao L, Li B, Hu W, Yu J, Zhang Y (2021) 3dcann: a spatio-temporal convolution attention neural network for EEG emotion recognition. IEEE Journal of Biomedical and Health Informatics
Aydın S (2019) Deep learning classification of neuro-emotional phase domain complexity levels induced by affective video film clips. IEEE J Biomed Health Inf 24(6):1695–1702
Zhang Y, Chen J, Tan JH, Chen Y, Chen Y, Li D, Yang L, Su J, Huang X, Che W (2020) An investigation of deep learning models for EEG-based emotion recognition. Front Neurosci 14:622759
Feng L, Cheng C, Zhao M, Deng H, Zhang Y (2022) EEG-Based emotion recognition using spatial-temporal graph convolutional lstm with attention mechanism. IEEE J Biomed Health Inf
Ahmed MZI, Sinha N (2021) EEG-Based emotion classification using lstm under new paradigm. J Neural Eng 7
Li G, Chen N, Jin J (2022) Semi-supervised EEG emotion recognition model based on enhanced graph fusion and gcn. J Neural Eng 19
Song T, Zheng W, Liu S, Zong Y, Cui Z, Li Y (2021) Graph-embedded convolutional neural network for image-based EEG emotion recognition. IEEE Transactions on Emerging Topics in Computing
Asadzadeh S, Yousefi Rezaii T, Beheshti S, Meshgini S (2022) Accurate emotion recognition using bayesian model based EEG sources as dynamic graph convolutional neural network nodes. Sci Rep 12 (1):1–14
Luo Y, Zhu L-Z, Wan Z-Y, Lu B-L (2020) Data augmentation for enhancing EEG-based emotion recognition with deep generative models. J Neural Eng 17
Zhang A, Su L, Zhang Y, Fu Y, Wu L, Liang S (2022) EEG data augmentation for emotion recognition with a multiple generator conditional wasserstein gan. Compl Intell Syst 8(4):3059–3071
Li X, Zhao Z, Song D, Zhang Y, Pan J, Wu L, Huo J, Niu C, Wang D (2020) Latent factor decoding of multi-channel eeg for emotion recognition through autoencoder-like neural networks. Front Neurosci 14:87
Salankar N, Mishra P, Garg L (2021) Emotion recognition from EEG signals using empirical mode decomposition and second-order difference plot. Biomed Sig Process Control 65:102389
Hu J, Shen L, Sun G (2018) Squeeze-and-excitation networks. In: Proceedings of the IEEE conference on computer vision and pattern recognition, pp 7132–7141
Woo S, Park J, Lee J-Y, Kweon IS (2018) CBAM: convolutional block attention module. In: Proceedings of the European conference on computer vision (ECCV), pp 3–19
Vaswani A, Shazeer N, Parmar N, Uszkoreit J, Jones L, Gomez AN, Kaiser Ł, Polosukhin I (2017) Attention is all you need. Advances in neural information processing systems 30
Dosovitskiy A, Beyer L, Kolesnikov A, Weissenborn D, Zhai X, Unterthiner T, Dehghani M, Minderer M, Heigold G, Gelly S, Uszkoreit J, Houlsby N (2021) An image is worth 16x16 words: transformers for image recognition at scale. In: International conference on learning representations. https://openreview.net/forum?id=YicbFdNTTy
Koelstra S, Muhl C, Soleymani M, Lee J-S, Yazdani A, Ebrahimi T, Pun T, Nijholt A, Patras I (2012) Deap: a database for emotion analysis ;using physiological signals. IEEE Trans Affect Comput 3(1):18–31. https://doi.org/10.1109/T-AFFC.2011.15
Duan R-N, Zhu J-Y, Lu B-L (2013) Differential entropy feature for EEG-based emotion classification. In: 6th international IEEE/EMBS conference on neural engineering (NER), IEEE, pp 81–84
Zheng W-L, Lu B-L (2015) Investigating critical frequency bands and channels for EEG-based emotion recognition with deep neural networks. IEEE Trans Auton Ment Dev 7:162–175
Lee J, Lee I, Kang J (2019) Self-attention graph pooling. In: International conference on machine learning, PMLR, pp 3734–3743
Sankar A, Wu Y, Gou L, Zhang W, Yang H (2020) Dysat: deep neural representation learning on dynamic graphs via self-attention networks. In: Proceedings of the 13th international conference on web search and data mining
Mittag G, Naderi B, Chehadi A, Möller S (2021) Nisqa: a deep cnn-self-attention model for multidimensional speech quality prediction with crowdsourced datasets. In: Interspeech
Koizumi Y, Yatabe K, Delcroix M, Masuyama Y, Takeuchi D (2020) Speech enhancement using self-adaptation and multi-head self-attention. In: ICASSP 2020 - 2020 IEEE International Conference on Acoustics Speech and Signal Processing (ICASSP), pp 181–185
Li Y, Fu B, Li F, Shi G, Zheng W (2021) A novel transferability attention neural network model for EEG emotion recognition. Neurocomputing 447:92–101. https://doi.org/10.1016/j.neucom.2021.02.048
Li D, Xie L, Chai B, Wang Z, Yang H (2022) Spatial-frequency convolutional self-attention network for EEG emotion recognition. Appl Soft Comput 122:108740
Rajpoot AS, Panicker MR, et al. (2022) Subject independent emotion recognition using EEG signals employing attention driven neural networks. Biomed Sig Process Control 75:103547
Xie J, Wang Z, Yu Z, Guo B (2022) Enabling timely medical intervention by exploring health-related multivariate time series with a hybrid attentive model. Sensors 22(16):6104
Sreeram V, Agathoklis P (1994) On the properties of gram matrix. IEEE Trans Circ Syst I: Fundam Theory Appl 41(3):234–237
Gilmer J, Schoenholz SS, Riley PF, Vinyals O, Dahl GE (2017) Neural message passing for quantum chemistry. In: International conference on machine learning, PMLR, pp 1263–1272
Lawhern VJ, Solon AJ, Waytowich NR, Gordon SM, Hung CP, Lance BJ (2018) Eegnet: a compact convolutional neural network for EEG-based brain–computer interfaces. J Neural Eng 15(5):056013
Chollet F (2017) Xception: deep learning with depthwise separable convolutions. In: Proceedings of the IEEE conference on computer vision and pattern recognition, pp 1251–1258
Ioffe S, Szegedy C (2015) Batch normalization: accelerating deep network training by reducing internal covariate shift. In: International conference on machine learning, PMLR, pp 448–456
Khateeb M, Anwar SM, Alnowami MR (2021) Multi-domain feature fusion for emotion classification using deap dataset. IEEE Access 9:12134–12142
Stajić T, Jovanović J, Jovanović N, Jankovic MM (2021) Emotion recognition based on deap database physiological signals. In: 2021 29th telecommunications forum (TELFOR), pp 1–4
Wang Z-M, Zhang J-W, He Y, Zhang J (2022) EEG Emotion recognition using multichannel weighted multiscale permutation entropy. Appl Intell 1–13
Li Y, Huang J, Zhou H, Zhong N (2017) Human emotion recognition with electroencephalographic multidimensional features by hybrid deep neural networks. Appl Sci 7(10):1060
Asghar MA, Khan MJ, Rizwan M, Shorfuzzaman M, Mehmood RM (2022) AI inspired EEG-based spatial feature selection method using multivariate empirical mode decomposition for emotion classification. Multimed Syst 28(4):1275–1288
Sharma R, Pachori RB, Sircar P (2020) Automated emotion recognition based on higher order statistics and deep learning algorithm. Biomed Sig Process Control 58:101867
Al Machot F, Elmachot A, Ali M, Al Machot E, Kyamakya K (2019) A deep-learning model for subject-independent human emotion recognition using electrodermal activity sensors. Sensors 19 (7):1659
Salama ES, El-Khoribi RA, Shoman ME, Shalaby MAW (2018) EEG-based emotion recognition using 3d convolutional neural networks. International Journal of Advanced Computer Science and Applications 9(8)
Wei Y, Liu Y, Li C, Cheng J, Song R, Chen X (2022) Tc-net: a transformer capsule network for EEG-based emotion recognition. Computers in Biology and Medicine 106463
Wu Y, Xia M, Nie L, Zhang Y, Fan A (2022) Simultaneously exploring multi-scale and asymmetric EEG features for emotion recognition. Comput Biol Med 149:106002
Zhong X, Gu Y, Luo Y, Zeng X, Liu G (2022) Bi-hemisphere asymmetric attention network: recognizing emotion from EEG signals based on the transformer. Appl Intell 1–17
Zhang T, Zheng W, Cui Z, Zong Y, Li Y (2018) Spatial–temporal recurrent neural network for emotion recognition. IEEE Trans Cybernet 49(3):839–847
Song T, Zheng W, Song P, Cui Z (2018) EEG emotion recognition using dynamical graph convolutional neural networks. IEEE Transactions on Affective Computing
Li Y, Zheng W, Cui Z, Zhang T, Zong Y (2018) A novel neural network model based on cerebral hemispheric asymmetry for EEG emotion recognition. In: IJCAI, pp 1561–1567
Li Y, Zheng W, Wang L, Zong Y, Cui Z (2019) From regional to global brain: a novel hierarchical spatial-temporal neural network model for EEG emotion recognition. IEEE Transactions on Affective Computing
Joshi VM, Ghongade RB (2021) EEG based emotion detection using fourth order spectral moment and deep learning. Biomed Sig Process Control 68:102755
Miao M, Zheng L, Xu B, Yang Z, Hu W (2023) A multiple frequency bands parallel spatial–temporal 3d deep residual learning framework for EEG-based emotion recognition. Biomed Sig Process Control 79:104141
Zheng W-L, Lu B-L (2015) Investigating critical frequency bands and channels for EEG-based emotion recognition with deep neural networks. IEEE Trans Auton Ment Dev 7(3):162–175
Kuang D, Michoski C (2022) KAM - A kernel attention module for emotion classification with EEG data. In: Reyes M, Henriques Abreu P, Cardoso J (eds) Interpretability of machine intelligence in medical image computing, Springer, pp 93–103
Acknowledgements
This work was supported in part by the Fundamental Research Funds for the Central Universities, Sun Yat-sen University, CHINA, under Grant 22qntd2901.
Author information
Authors and Affiliations
Contributions
Dongyang Kuang: Conceptualization, Methodology, Validation, Formal analysis, Writing – original draft, Writing – review & editing, Visualization. Craig Michoski: Formal analysis, Validation, Visualization, Writing – review & editing. Wenting Li: Data Curation, Visualization, Writing – original draft, Writing – review & editing. Rui Guo: Data Curation, Validation, Writing – review & editing
Corresponding author
Ethics declarations
Competing interests
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.
Additional information
Publisher’s note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
This submission is a reworked and thoroughly extended version of [1] presented in The Workshop on Medical Image Learning with Noisy and Limited Data at MICCAI 2022.
Rights and permissions
Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.
About this article
Cite this article
Kuang, D., Michoski, C., Li, W. et al. From gram to attention matrices: a monotonicity constrained method for eeg-based emotion classification. Appl Intell 53, 20690–20709 (2023). https://doi.org/10.1007/s10489-023-04561-0
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10489-023-04561-0