EEG-based stress detection using a hybrid CNN-transformer with multi-domain feature fusion
摘要
Mental stress is a significant public health concern, with chronic exposure linked to cardiovascular disorders, immune dysfunction, and cognitive decline. Since affected individuals frequently cannot accurately self-assess their stress levels, objective and automated monitoring systems are increasingly needed. Electroencephalography (EEG) is well-suited for this purpose, offering non-invasive, millisecond-resolution measurement of stress-related cortical activity. This paper presents a hybrid CNN-Transformer framework for EEG-based binary stress detection, evaluated on the SAM40 benchmark (40 subjects, 32 channels, three cognitive stress paradigms). The model integrates time-domain (256-dim), frequency-domain (512-dim), and time-frequency STFT-based (1,600-dim) features into a unified 2,368-dimensional representation, processed through a three-layer CNN encoder and a four-layer Transformer with eight multi-head self-attention heads. The primary contribution is a leakage-aware, multi-level evaluation framework combining a stratified held-out split (68/12/20), 40-fold Leave-One-Subject-Out (LOSO) cross-validation, and cross-dataset validation on the independent STEW benchmark (48 subjects, 14 channels). Under the held-out protocol, the model achieves 82.19% accuracy, 82.67% sensitivity, 81.72% specificity, F1 = 0.8228, and AUC = 0.9000 with 2.28 million parameters and a CPU inference latency of 4.2 ms. LOSO cross-validation yields 66.12% (±10.24%), and subject-independent evaluation on STEW yields 71.67%, compared to 93.33% under a random split. These results suggest that evaluation protocol choice accounts for a 13–20 percentage point difference in reported performance, highlighting the importance of rigorous benchmarking in EEG stress detection research.