Deep Discriminative Feature Fusion of Convolutional and Attention-Based Recurrent Representations for Subject-Independent ECG Stress Recognition
Organizations: Master of Computer Science and Data Analytics, University of Niagara Falls, Ontario, Canada · Ted Rogers School of Information Technology Management, Toronto Metropolitan University, Ontario, Canada
Abstract
Stress has become a significant concern because of its negative impact on both physical and mental health and therefore drives the need for reliable automated systems to assess stress levels. Electrocardiogram (ECG) signals provide a non-invasive and objective measure of physiological stress responses and have emerged as a promising modality for continuous stress monitoring. While deep learning techniques have achieved encouraging results in ECG-based stress detection, many studies focus only on one type of feature representation, and therefore limit their ability to capture both the morphological patterns and temporal dynamics embedded in ECG signals. To address this limitation, in this paper, we propose three deep learning-based feature fusion frameworks for ECG-based stress classification. These are Residual Feature Fusion (RFF), Bidirectional Feature-Wise Cross-Attention Fusion (BFCAF), and a novel Cross-Attention Residual Fusion (CARF) framework that combines the strengths of residual learning and bidirectional cross-attention within a unified architecture. A 1D Convolutional Neural Network (1D-CNN) and a BiLSTM-Attention network are used to extract complementary morphological and temporal representations from ECG signals, respectively. The proposed fusion frameworks leverage these heterogeneous representations to improve feature interaction, information preservation, and stress discrimination. The proposed frameworks are evaluated using subject-independent Leave-One-Subject-Out Cross-Validation (LOSOCV) on the RML and WESAD datasets for three-class stress classification. Experimental results show that the proposed feature fusion methods consistently improve performance over individual CNN and BiLSTM models, with CARF achieving the highest accuracies of 83.1% and 77.91% on the RML and WESAD datasets, respectively.
Figures & tables
| Hyperparameter | Value |
| Optimizer | Adam |
| Learning Rate | 0.001 |
| Loss Function | Cross-Entropy Loss |
| LR Scheduler | ReduceLROnPlateau |
| LR Decay Factor | 0.5 |
| LR Scheduler Patience | 10 |
| Testing Sub | Accuracy | Precision | Recall | Score |
| 2 | 72.8 | 81.3 | 71.6 | 70.8 |
| 3 | 79.3 | 87 | 79.1 | 79.8 |
| 4 | 79.3 | 86.4.4 | 79.1 | 79.5 |
| 5 | 77.5 | 83.7 | 77.3 | 77.7 |
| 11 | 47.6 | 29.9 | 47.2 | 36.15 |
| 12 | 74.3 | 83.6 | 73 | 73.7 |
| Hyperparameter | Value |
| Loss Function | CrossEntropyLoss |
| Optimizer | Adam |
| Learning Rate | 0.0005 |
| Weight Decay | 0.0005 |
| Learning Rate Scheduler | ReduceLROnPlateau |
| Scheduler Mode | min |
| Testing Sub | Accuracy (%) | Precision (%) | Recall (%) | Score (%) |
| 2 | 71.9 | 79.3 | 70.6 | 69.7 |
| 3 | 75.3 | 77 | 75.2 | 75.4 |
| 4 | 72.7 | 78.6 | 72.6 | 71.3 |
| 5 | 67.9 | 72.8 | 67.4 | 64.7 |
| 11 | 44.1 | 52.1 | 41.3 | 34.3 |
| 12 | 72.5 | 80.6 | 71.2 | 71.5 |
| Testing Sub | Accuracy (%) | Precision (%) | Recall (%) | Score (%) |
| 2 | 79.7 | 87.6 | 79.4 | 80.2 |
| 3 | 84.4 | 86.1 | 84.1 | 84.4 |
| 4 | 85.9 | 90.1 | 85.7 | 86 |
| 5 | 85.9 | 87.5 | 85.9 | 85.6 |
| 11 | 73.1 | 82.3 | 71.7 | 73 |
| 12 | 75.9 | 82.8 | 74.3 | 74.3 |
| Testing Sub | Accuracy (%) | Precision (%) | Recall (%) | Score (%) |
| 2 | 75 | 80 | 74.8 | 75.7 |
| 3 | 85.9 | 87.9 | 85.6 | 85.9 |
| 4 | 91.5 | 92.9 | 91.3 | 91.2 |
| 5 | 87.2 | 88.2 | 87.1 | 87 |
| 11 | 75 | 85.4 | 73.4 | 74.9 |
| 12 | 79.3 | 84.7 | 77.5 | 77.2 |
| Testing Sub | Accuracy (%) | Precision (%) | Recall (%) | Score (%) |
| 2 | 75 | 80.6 | 74.8 | 75.7 |
| 3 | 84.4 | 85.1 | 84.2 | 84.5 |
| 4 | 92.9 | 94.2 | 92.7 | 92.8 |
| 5 | 91.5 | 92.5 | 91.4 | 91.5 |
| 11 | 67.3 | 71.5 | 67 | 67.5 |
| 12 | 81 | 86.5 | 79.2 | 78.7 |
| Testing Sub | Accuracy (%) | Precision (%) | Recall (%) | Score (%) |
| 2 | 75 | 80.2 | 74.8 | 75.7 |
| 3 | 82.8 | 85.1 | 82.6 | 83 |
| 4 | 93 | 94.2 | 92.7 | 92.5 |
| 5 | 90.1 | 90.7 | 90 | 90 |
| 11 | 69.2 | 73.3 | 68.8 | 69.2 |
| 12 | 82.7 | 87.4 | 80.8 | 80.1 |
| Testing Sub | Accuracy (%) | Precision (%) | Recall (%) | Score (%) |
| 2 | 78.1 | 87 | 77.7 | 78.6 |
| 3 | 82.8 | 83.9 | 82.6 | 82.9 |
| 4 | 83.1 | 88.9 | 82.8 | 83.3 |
| 5 | 87.3 | 88.6 | 87.3 | 87.1 |
| 11 | 75 | 86.4 | 73.4 | 74.9 |
| 12 | 75.9 | 82.8 | 74.3 | 74.3 |
| Testing Sub | Accuracy (%) | Precision (%) | Recall (%) | Score (%) |
| 2 | 76.6 | 84.2 | 76.2 | 77.1 |
| 3 | 87.6 | 87.8 | 87.6 | 87.7 |
| 4 | 92.9 | 94.9 | 92.7 | 92.8 |
| 5 | 90.1 | 90.7 | 90 | 90 |
| 11 | 75.1 | 80.3 | 73.7 | 72.1 |
| 12 | 82.7 | 88.1 | 80.8 | 80.3 |
| Testing Sub | Accuracy (%) | Precision (%) | Recall (%) | Score (%) |
| 2 | 67.30 | 76.03 | 67.30 | 64.50 |
| 3 | 64.52 | 69.61 | 64.52 | 61.60 |
| 4 | 59.18 | 61.97 | 59.18 | 56.37 |
| 5 | 68.28 | 65.98 | 68.28 | 65.17 |
| 6 | 53.93 | 50.44 | 53.93 | 47.09 |
| 7 | 63.12 | 59.39 | 63.12 | 57.06 |
| Testing Sub | Accuracy (%) | Precision (%) | Recall (%) | Score (%) |
| 2 | 46.11 | 40.31 | 46.11 | 36.62 |
| 3 | 59.71 | 61.28 | 59.71 | 59.74 |
| 4 | 53.87 | 61.84 | 53.87 | 52.33 |
| 5 | 66.17 | 68.71 | 66.17 | 66.40 |
| 6 | 50.65 | 52.48 | 50.65 | 49.71 |
| 7 | 73.24 | 74.49 | 73.24 | 71.95 |
| Testing Sub | Accuracy (%) | Precision (%) | Recall (%) | Score (%) |
| 2 | 77.42 | 79.74 | 77.40 | 77.30 |
| 3 | 76.69 | 80.04 | 76.69 | 77.00 |
| 4 | 78.36 | 80.36 | 78.36 | 78.62 |
| 5 | 85.15 | 85.83 | 85.15 | 85.35 |
| 6 | 73.85 | 74.56 | 73.85 | 73.24 |
| 7 | 74.25 | 77.10 | 74.25 | 75.01 |
| Previous Methods | Accuracy (%) | Score(%) |
| Ahmad et al. (2023) | 66.6 | 65.6 |
| Ahmad & Khan (2025) | 71.01 | 70.5 |
| Proposed Fusion Frameworks | ||
| BFCAF Framework | 79.6 | 79.7 |
| Residual Fusion Framework | 81.3 | 81.3 |
| Cross Attention Residual Fusion Framework | 83.1 | 82.7 |
| Previous Methods | Accuracy (%) | Score (%) |
| Schmidt et al. (2018) | 66.29 | 56.03 |
| Garg et al. (2021) | 67.56 | 65.73 |
| Ahmad et al. (2023) | 72.7 | 73.1 |
| Ahmad & Khan (2025) | 76.7 | 76.8 |
| Cross Attention Residual Fusion Framework | 77.91 | 78.01 |
Feature Fusion
Feature fusion combines complementary representations across modalities, scales, layers, or feature types to improve prediction and perception.
See all 128 papers