DeepAttNet: deep neural network incorporating cross-attention mechanism for subject-independent mental stress detection in passive brain–computer interfaces using bilateral ear-EEG - Hyung, Wooseok; Kim, Minsu; Kim, Yesung; Im, Chang-Hwan (Frontiers in Human Neuroscience, 2025)
IntroductionElectroencephalography (EEG)-based mental stress detection has the potential to be applied in diverse real-world scenarios, including workplace safety, mental health monitoring, and human–computer interaction. However, most previous passive brain–computer interface (BCI) studies have employed EEG recorded during the performance of specific tasks, making the classification results susceptible to task engagement effects rather than reflecting stress alone. To address this limitation, we introduce a rest-versus-rest paradigm that compares resting EEG recorded immediately after exposure to a stressor with that recorded after meditation, thereby isolating mental stress from the task-related confounds. EEG recording setups were designed under the assumption of bilateral ear-EEG, a compact and discreet form factor suitable for real-world applications. Furthermore, we developed a novel subject-independent deep learning classifier tailored to model interhemispheric neural dynamics for enhanced mental stress detection performance.MethodsThirty-two adults participated in the experiment. To classify mental stress status in a subject-independent manner, we proposed DeepAttNet, a deep learning model based on cross-attention and pointwise temporal compression, specifically designed to effectively capture left and right hemispherical interactions. Classification performance was assessed using eight-fold subject-level cross-validation against conventional deep learning models, including EEGNet, ShallowConvNet, DeepConvNet, and TSception. Ablation studies evaluated the impact of the cross-attention and/or pointwise compression modules.ResultsDeepAttNet achieved the highest average accuracy and macro-F1 values, with performance declining when either the cross-attention or pointwise compression module was removed in the ablation studies. Explainability analyses indicated lower cross-attention entropy with stronger directional ear-to-ear asymmetry under stress, and temporal occlusion identified mid–late windows supporting stress decisions. Moreover, six of seven canonical scalp-EEG markers were FDR-significant for post-stressor vs. post-relaxation rest.ConclusionThe proposed rest-versus-rest paradigm and DeepAttNet enabled robust, subject-independent mental stress detection with a fairly high accuracy using only two-channel EEG recordings. This approach is expected to offer a practical solution for continuous stress monitoring, potentially advancing passive BCI applications outside laboratory settings.