EEG-Based Mental Stress Detection: A Comparative and Explainable Study Across Tasks and Subjects
摘要
In this work, we investigate the problem of recognizing mental stress using electroencephalography (EEG) and machine learning, with the explicit objective of developing an interpretable and effective model across different task conditions. To this end, we implement a supervised learning pipeline on two publicly available EEG datasets, SAM40 and WAUC, the latter of which involves controlled tasks with varying cognitive and physical demands. Following standard preprocessing, we extract a broad range of well-established EEG-derived features -including spectral power, entropy-based complexity measures, and hemispheric asymmetries- and train an XGBoost classifier to distinguish between stress levels. To interpret the model’s decision process, we employ SHAP (SHapley Additive exPlanations), which quantifies the contribution of each feature to the model’s predictions at both individual and population levels. Our results reveal that a restricted subset of features, particularly gamma-band asymmetries and entropy measures, consistently dominates the decision process across subjects. Moreover, the set of important features varies systematically with changes in physical load, suggesting the existence of condition-specific EEG patterns associated with stress.