Computational Analysis of EEG Responses to Anxiogenic Stimuli Using Machine Learning Algorithms
Abstract
1. Introduction
2. Materials and Methods
2.1. Machine Learning Algorithms for Classification
2.2. Methodology
- VarianceThreshold: Removed features with negligible variance, reducing noise and eliminating uninformative attributes.
- SelectKBest (k = 100): Selected the most discriminative features based on univariate statistical tests.
- Principal Component Analysis (PCA): Reduced dimensionality to 14 components, retaining the most informative variance while mitigating multicollinearity.
- MinMaxScaler: Normalized all features to a standard numerical range, ensuring compatibility with distance-based and gradient-based classifiers.
- -
- Logistic Regression: L2 penalty, regularization C = 0.01, class_weight = balanced
- -
- MLP: two hidden layers (50 and 25 neurons), ReLU activation, α = 0.005, momentum = 0.95, class_weight = balanced
- -
- KNN: k = 5, Euclidean distance, uniform weights
2.3. Statistical Procedures
3. Results
3.1. Model Performance
- Model comparison
- ROC curves
- Correlation with HAM-A clinical scores
3.2. Feature Importance Analysis
4. Discussion
4.1. Comparison with Related Work
4.2. Integration of Feature Importance Findings
4.3. Limitations and Future Work
- Targeted recruitment of severe-anxiety patients;
- Multi-site data collection using portable EEG systems;
- External validation across independent datasets;
- Exploration of hybrid classifiers (e.g., CNN + handcrafted features);
- Regression-based estimation of continuous anxiety severity;
- Temporal–dynamic modeling (RNN, LSTM, Temporal CNN).
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
Abbreviations
| EEG | Electroencephalography |
| MLP | Multilayer Perceptron |
| KNN | K-Nearest Neighbors |
| SVM | Support Vector Machines |
| HAM-A | Hamilton Anxiety Rating Scale |
| GAD-7 | Generalized Anxiety Disorder Scale |
| ML | Machine Learning |
| EOG | Electrooculography |
| EMG | Electromyography |
| ICA | Independent Component Analysis |
| SMOTE | Synthetic Minority Over-Sampling Technique |
| ROC | Receiver Operating Characteristic |
| AUC | Area Under The Curve |
| LR | Logistic Regression |
References
- Hettema, J.M.; Neale, M.C.; Kendler, K.S. A Review and Meta-Analysis of the Genetic Epidemiology of Anxiety Disorders. Am. J. Psychiatry 2001, 158, 1568–1578. [Google Scholar] [CrossRef] [Scilit]
- Wang, Y.; Chai, F.; Zhang, H.; Liu, X.; Xie, P.; Zheng, L.; Yang, L.; Li, L.; Fang, D. Cortical functional activity in patients with generalized anxiety disorder. BMC Psychiatry 2016, 16, 217. [Google Scholar] [CrossRef] [Scilit]
- Al-Ezzi, A.; Kamel, N.; Faye, I.; Gunaseli, E. Review of EEG, ERP, and Brain Connectivity Estimators as Predictive Biomarkers of Social Anxiety Disorder. Front. Psychol. 2020, 11, 730. [Google Scholar] [CrossRef] [Scilit] [PubMed] [PubMed Central]
- Byeon, J.; Moon, J.Y.; Je, S.R.; Park, S.H.; Kim, J.W. Quantitative electroencephalographic biomarker of pharmacological treatment response in patients with anxiety disorder: A retrospective study. Sci. Rep. 2023, 13, 3802. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Arsalan, A.; Majid, M. A Study on Multi-Class Anxiety Detection Using Wearable EEG Headband. J. Ambient Intell. Hum. Comput. 2021, 13, 5739–5749. [Google Scholar] [CrossRef] [Scilit]
- Muhammad, F.; Al-Ahmadi, S. Human State Anxiety Classification Framework Using EEG Signals in Response to Exposure Therapy. PLoS ONE 2022, 17, e0265679. [Google Scholar] [CrossRef] [Scilit]
- Pontifex, M.B.; Coffman, C.A. Validation of the g.tec Unicorn Hybrid Black wireless EEG system. Psychophysiology 2023, 60, e14320. [Google Scholar] [CrossRef] [Scilit]
- Baghdadi, A.; Aribi, Y.; Fourati, R.; Halouani, N.; Siarry, P.; Alimi, A.M. DASPS: A Database for Anxious States Based on a Psychological Stimulation. arXiv 2019. [Google Scholar] [CrossRef] [Scilit]
- Williams, N.S.; McArthur, G.M.; de Wit, B.; Ibrahim, G.; Badcock, N.A. A validation of Emotiv EPOC Flex saline for EEG and ERP research. Peer J. 2020, 8, e9713. [Google Scholar] [CrossRef] [Scilit]
- Jurcak, V.; Tsuzuki, D.; Dan, I. 10/20, 10/10, and 10/5 systems revisited: Their validity as relative head-surface-based positioning systems. NeuroImage 2007, 34, 1600–1611. [Google Scholar] [CrossRef] [Scilit]
- Alarcão, A.; Fonseca, M.J. Emotions recognition using EEG signals: A survey. IEEE Trans. Affect. Comput. 2019, 10, 374–393. [Google Scholar] [CrossRef] [Scilit]
- Tripathi, S.; Acharya, S.; Sharma, R.; Mittal, S. Using deep and convolutional neural networks for accurate emotion classification on DEAP dataset. In Proceedings of the AAAI, San Francisco, CA, USA, 4–9 February 2017. [Google Scholar]
- Jenke, H.; Peer, A.; Buss, M. Feature extraction and selection for emotion recognition from EEG. IEEE Trans. Affect. Comput. 2014, 5, 327–339. [Google Scholar] [CrossRef] [Scilit]
- World Medical Association. World Medical Association Declaration of Helsinki: Ethical Principles for Medical Research Involving Human Subjects. JAMA 2013, 310, 2191–2194. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Delorme, A.; Makeig, S. EEGLAB: An open source toolbox for analysis of single-trial EEG dynamics including independent component analysis. J. Neurosci. Methods 2004, 134, 9–21. [Google Scholar] [CrossRef] [Scilit]
- Gramfort, A.; Luessi, M.; Larson, E.; Engemann, D.A.; Strohmeier, D.; Brodbeck, C.; Parkkonen, L.; Hämäläinen, M.S. MNE software for processing MEG and EEG data. NeuroImage 2014, 86, 446–460. [Google Scholar] [CrossRef] [Scilit]
- Pion-Tonachini, L.; Kreutz-Delgado, K.; Makeig, S. ICLabel: An automated electroencephalographic independent component classifier for artifact removal and data standardization. NeuroImage 2019, 198, 181–197. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Gramfort, A.; Luessi, M.; Larson, E.; Engemann, D.A.; Strohmeier, D.; Brodbeck, C.; Goj, R.; Jas, M.; Brooks, T.; Parkkonen, L.; et al. MEG and EEG data analysis with MNE-Python. Front. Neurosci. 2013, 7, 267. [Google Scholar] [CrossRef] [Scilit]
- Oostenveld, R.; Praamstra, P. The five percent electrode system for high-resolution EEG and ERP measurements. Clin. Neurophysiol. 2001, 112, 713–719. [Google Scholar] [CrossRef] [Scilit]
- Delorme, A.; Mullen, T.; Kothe, C.; Acar, Z.A.; Bigdely-Shamlo, N.; Vankov, T.; Makeig, S. EEGLAB, SIFT, NFT, BCILAB, and ERICA: New tools for advanced EEG processing. Comput. Intell. Neurosci. 2011, 2011, 130714. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Welch, P. The use of fast Fourier transform for the estimation of power spectra: A method based on time averaging over short, modified periodograms. IEEE Trans. Audio Electroacoust. 1967, 15, 70–73. [Google Scholar] [CrossRef] [Scilit]
- Inouye, F.; Shinosaki, T.; Iyama, K. Quantification of EEG irregularity by use of the entropy of the power spectrum. Electroencephalogr. Clin. Neurophysiol. 1991, 79, 204–210. [Google Scholar] [CrossRef] [Scilit]
- Hjorth, B. EEG analysis based on time domain properties. Electroencephalogr. Clin. Neurophysiol. 1970, 29, 306–310. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Subasi, R. EEG signal classification using wavelet feature extraction and a mixture of expert models. Expert Syst. Appl. 2007, 32, 1084–1093. [Google Scholar] [CrossRef] [Scilit]
- Murugappan, M.; Rizon, M.; Nagarajan, R.; Yaacob, S.; Hazry, D.; Zunaidi, I. Time–frequency analysis of EEG signals for emotion classification using DWT. Med. Biol. Eng. Comput. 2013, 51, 573–581. [Google Scholar] [CrossRef] [Scilit]
- Liu, Y.; Sourina, Z.; Nguyen, M.K. Real-time EEG-based emotion recognition and visualization. In Proceedings of the 2010 International Conference on Cyberworlds, Singapore, 20–22 October 2010; pp. 262–269. [Google Scholar] [CrossRef] [Scilit]
- Hamilton, M. The assessment of anxiety states by rating. Br. J. Med. Psychol. 1959, 32, 50–55. [Google Scholar] [CrossRef] [Scilit]
- Drysdale, A.T.; Grosenick, L.; Downar, J.; Dunlop, K.; Mansouri, F.; Meng, Y.; Fetcho, R.N.; Zebley, B.; Oathes, D.J.; Etkin, A.; et al. Resting-state connectivity biomarkers define neurophysiological subtypes of depression. Nat. Med. 2017, 23, 28–38. [Google Scholar] [CrossRef] [Scilit]
- Chawla, N.V.; Bowyer, K.W.; Hall, L.O.; Kegelmeyer, W.P. SMOTE: Synthetic Minority Over-sampling Technique. J. Artif. Intell. Res. 2002, 16, 321–357. [Google Scholar] [CrossRef] [Scilit]
- Lemaître, G.; Nogueira, F.; Aridas, C.K. Imbalanced-learn: A Python Toolbox to Tackle the Curse of Imbalanced Datasets in Machine Learning. arXiv 2017, arXiv:1609.06570. [Google Scholar] [CrossRef] [Scilit]
- Hastie, T.; Tibshirani, R.; Friedman, J. The Elements of Statistical Learning; Springer: Berlin/Heidelberg, Germany, 2009. [Google Scholar] [CrossRef]
- Cunningham, P.; Delany, S.J. K-Nearest Neighbour Classifiers—A Tutorial. ACM Comput. Surv. 2021, 54, 128. [Google Scholar] [CrossRef] [Scilit]
- Tripathi, A.; Sharma, R.; Acharya, S. Using deep neural networks for accurate emotion classification on the DEAP dataset. Procedia Comput. Sci. 2018, 125, 404–412. [Google Scholar] [CrossRef] [Scilit]
- Craik, A.; He, Y.; Contreras-Vidal, J.L. Deep learning for electroencephalogram (EEG) classification tasks: A review. J. Neural Eng. 2019, 16, 051001. [Google Scholar] [CrossRef] [Scilit]
- Fawcett, T. An introduction to ROC analysis. Pattern Recognit. Lett. 2006, 27, 861–874. [Google Scholar] [CrossRef] [Scilit]
- Varma, M.; Simon, R. Bias in error estimation when using cross-validation for model selection. BMC Bioinform. 2006, 7, 91. [Google Scholar] [CrossRef] [Scilit]
- He, H.; Garcia, E.A. Learning from Imbalanced Data. IEEE Trans. Knowl. Data Eng. 2009, 21, 1263–1284. [Google Scholar] [CrossRef] [Scilit]
- Kohavi, R. A study of cross-validation and bootstrap for accuracy estimation and model selection. In Proceedings of the 1995 International Joint Conference on AI, Montreal, QC, Canada, 20–25 August 1995; pp. 1137–1145. [Google Scholar]
- Demšar, J. Statistical comparisons of classifiers over multiple data sets. J. Mach. Learn. Res. 2006, 7, 1–30. [Google Scholar]
- Dufera, A.G.; Liu, T.; Xu, J. Regression Models of Pearson Correlation Coefficient. Stat. Theory Relat. Fields 2023, 7, 97–106. [Google Scholar] [CrossRef] [Scilit]
- Zhu, Y.; Maikusa, N.; Radua, J.; Sämann, P.G.; Fusar-Poli, P.; Agartz, I.; Andreassen, O.A.; Bachman, P.; Baeza, I.; Chen, X.; et al. Using brain structural neuroimaging measures to predict psychosis onset for individuals at clinical high-risk. Mol. Psychiatry 2024, 29, 1465–1477. [Google Scholar] [CrossRef] [Scilit]
- Blagus, R.; Lusa, L. SMOTE for high-dimensional class-imbalanced data. BMC Bioinform. 2013, 14, 106. [Google Scholar] [CrossRef] [Scilit]
- Knyazev, G.G. Motivation, emotion, and their inhibitory control mirrored in brain oscillations. Neurosci. Biobehav. Rev. 2007, 31, 377–395. [Google Scholar] [CrossRef] [Scilit]
- Putman, P. Resting state EEG delta-beta coherence in relation to anxiety, behavioral inhibition, and selective attentional processing of threatening stimuli. Int. J. Psychophysiol. 2011, 80, 63–68. [Google Scholar] [CrossRef] [Scilit]
- Bazanova, O.M.; Vernon, D. Interpreting EEG alpha activity. Neurosci. Biobehav. Rev. 2014, 44, 94–110. [Google Scholar] [CrossRef] [Scilit] [PubMed]













| Model | r | p |
|---|---|---|
| Logistic Regression | 0.66 | 0.0057 |
| MLP | 0.66 | 0.0051 |
| KNN | 0.71 | 0.0022 |
| Study | Dataset/EEG System | Method | No. of Classes | Reported Performance | Notes |
|---|---|---|---|---|---|
| [5] | Wearable EEG headband (7 channels) | SVM, RF, KNN, NB | 3-class anxiety | Accuracy 82.1%, F1 ≈ 0.80 | Most comparable study; portable EEG |
| [6] | Clinical 32-channel EEG, anxiety induction | CNN + handcrafted features | 2-class anxiety (high vs. low) | Accuracy 93.7%, F1 ≈ 0.94 | Binary classification, high-density EEG, hospital-grade setup |
| [8] | DASPS public dataset | Traditional ML (SVM) | 2-class and 3-class anxiety | Accuracy 78–83% | Baseline reference dataset used in this work |
| [4] | Clinical QEEG | Logistic regression | Regression (not classification) | r ≈ 0.65–0.72 | Comparable with the present HAM-A correlations |
| Current work (MLP) | DASPS + Unicorn Hybrid Black (8ch) | MLP + spectral, entropy, Hjorth, DWT | 3-class anxiety | Accuracy 87.5%, F1 = 0.859 | Best 3-class performance in portable-EEG conditions; nested CV |
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. |
© 2026 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.
Share and Cite
Adochiei, F.-C.; Ioniță, A.; Adochiei, I.-R.; Stirbu, O.-I.; Petroiu, G.; Argatu, F.C. Computational Analysis of EEG Responses to Anxiogenic Stimuli Using Machine Learning Algorithms. Appl. Sci. 2026, 16, 1504. https://doi.org/10.3390/app16031504
Adochiei F-C, Ioniță A, Adochiei I-R, Stirbu O-I, Petroiu G, Argatu FC. Computational Analysis of EEG Responses to Anxiogenic Stimuli Using Machine Learning Algorithms. Applied Sciences. 2026; 16(3):1504. https://doi.org/10.3390/app16031504
Chicago/Turabian StyleAdochiei, Felix-Constantin, Anamaria Ioniță, Ioana-Raluca Adochiei, Oana-Isabela Stirbu, Gladiola Petroiu, and Florin Ciprian Argatu. 2026. "Computational Analysis of EEG Responses to Anxiogenic Stimuli Using Machine Learning Algorithms" Applied Sciences 16, no. 3: 1504. https://doi.org/10.3390/app16031504
APA StyleAdochiei, F.-C., Ioniță, A., Adochiei, I.-R., Stirbu, O.-I., Petroiu, G., & Argatu, F. C. (2026). Computational Analysis of EEG Responses to Anxiogenic Stimuli Using Machine Learning Algorithms. Applied Sciences, 16(3), 1504. https://doi.org/10.3390/app16031504

