Self-supervised ECG Representation Learning for Emotion Recognition

Pritam Sarkar, Ali Etemad · DOI

Abstract

Emotion recognition using electrocardiogram (ECG) signals is a critical component of affective computing, yet it is often hindered by the scarcity of large-scale annotated datasets. This paper presents a novel self-supervised multi-task learning framework designed to learn robust physiological representations from unlabelled ECG data. By pre-training a convolutional neural network (CNN) to identify artificial signal transformations, the model develops foundational features that generalize effectively to downstream emotion classification tasks. Experimental results across four benchmark datasets—AMIGOS, DREAMER, WESAD, and SWELL—demonstrate that this approach significantly outperforms fully-supervised baselines, setting new state-of-the-art performance levels for arousal, valence, and stress detection.

Introduction

Affective computing seeks to interpret human emotional states through physiological signals. The electrocardiogram (ECG) is particularly valuable due to its direct link to the autonomic nervous system. However, traditional deep learning approaches for ECG-based emotion recognition rely heavily on supervised learning, which requires extensive human-annotated data. Such data is difficult to obtain, leading to models that often overfit or fail to generalize across different populations and tasks.

To address these challenges, we propose a self-supervised learning paradigm. By generating labels automatically from unlabelled data through signal transformations, the model can learn reusable spatiotemporal features of ECG signals without the need for manual annotation. This allows for the aggregation of disparate datasets, creating a more robust and generalized feature extractor.

Methods

The proposed framework operates in two distinct stages: a self-supervised pretext task for representation learning and a downstream task for emotion recognition.

Proposed two-stage framework: self-supervised pre-training and downstream emotion classification.

Self-Supervised Pretext Task

In the first stage, the model is trained on unlabelled ECG segments. Six distinct transformations are applied to the raw signals: noise addition, scaling, negation, temporal inversion (flipping), permutation, and time-warping. A multi-task CNN is then tasked with predicting which transformation was applied to a given input. This process forces the network to learn intrinsic characteristics of the ECG signal to distinguish between original and perturbed versions.

Examples of the six signal transformations used for the self-supervised pretext task.

Downstream Emotion Recognition

Once pre-trained, the shared convolutional layers of the network are frozen to act as a fixed feature extractor. The final task-specific layers are replaced with new fully-connected layers, which are then trained using a small amount of labelled data for specific emotion classification tasks, such as arousal, valence, or stress levels.

Datasets

The framework was evaluated using four major affective computing datasets:

  • AMIGOS: 40 participants, classifying arousal and valence (9 classes).
  • DREAMER: 23 participants, classifying arousal and valence (5 classes).
  • WESAD: 17 participants, classifying 4 affective states (neutral, stressed, amused, meditated).
  • SWELL: 25 participants, classifying stress (3 classes), arousal, and valence (9 classes).

Results and Discussion

The self-supervised approach consistently outperformed fully-supervised CNN baselines and established new state-of-the-art results across all four datasets. Notable improvements were observed in the DREAMER dataset, where accuracy for arousal and valence jumped from approximately 62% in previous works to over 85%. In the WESAD dataset, affective state classification reached 96.9% accuracy.

Key Insights

  • Transformation Difficulty: The effectiveness of the pretext task depends on the "Goldilocks" zone of transformation difficulty; tasks that are too easy or too hard do not yield useful representations.
  • Multi-Task Advantage: Simultaneously learning multiple transformations produces more generalized features than single-task learning.
  • Layer Depth: High-level abstract features from deeper convolutional blocks (e.g., Conv Block 3) were found to be significantly more effective for emotion recognition than low-level features.

Conclusion

This work demonstrates that self-supervised learning can effectively overcome the data scarcity bottleneck in physiological signal processing. By leveraging unlabelled data to learn robust ECG representations, the proposed framework achieves state-of-the-art results in emotion recognition. Future work will focus on improving subject-independent classification and extending the framework to multi-modal signals such as EEG.

Summary updated

BibTeX
@article{sarkar2020self,
  author = {Pritam Sarkar and Ali Etemad},
  title = {{Self-supervised ECG Representation Learning for Emotion Recognition}},
  journal = {IEEE Trans. Affect. Comput.},
  year = {2020},
  doi = {10.1109/taffc.2020.3014842},
}
Figure