# A Transformer Architecture for Stress Detection from ECG

arXiv: https://arxiv.org/abs/2108.09737 · HTML: https://mlsanity.com/paper/2108.09737/

## Key facts

- Cited by 27 papers in the map (data through 14 Oct 2026).
- Builds on 5 of its 25 references that are in the map.
- First posted on arXiv 22 Aug 2021.

## Builds on (most cited first, 5 of 5)

- [Attention Is All You Need](https://mlsanity.com/paper/1706.03762/) (2017)
- [BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding](https://mlsanity.com/paper/1810.04805/) (2018)
- [Transformers in Vision: A Survey](https://mlsanity.com/paper/2101.01169/) (2021)
- [Self-supervised ECG Representation Learning for Emotion Recognition](https://mlsanity.com/paper/2002.03898/) (2020)
- [Self-supervised Learning for ECG-based Emotion Recognition](https://mlsanity.com/paper/1910.07497/) (2019)

## Built on by (most cited first, 27 of 27)

- [ECG Semantic Integrator (ESI): A Foundation ECG Model Pretrained with LLM-Enhanced Cardiological Text](https://mlsanity.com/paper/2405.19366/) (2024)
- [Transfer Knowledge from Natural Language to Electrocardiography: Can We Detect Cardiovascular Disease Through Language Models?](https://mlsanity.com/paper/2301.09017/) (2023)
- [Region-Disentangled Diffusion Model for High-Fidelity PPG-to-ECG Translation](https://mlsanity.com/paper/2308.13568/) (2023)
- [Low-Rank Adaptation of Time Series Foundational Models for Out-of-Domain Modality Forecasting](https://mlsanity.com/paper/2405.10216/) (2024)
- [Transformers in Healthcare: A Survey](https://mlsanity.com/paper/2307.00067/) (2023)
- [Transformer-Based Self-Supervised Learning for Emotion Recognition](https://mlsanity.com/paper/2204.05103/) (2022)
- [Beyond LoRA: Exploring Efficient Fine-Tuning Techniques for Time Series Foundational Models](https://mlsanity.com/paper/2409.11302/) (2024)
- [GeoECG: Data Augmentation via Wasserstein Geodesic Perturbation for Robust Electrocardiogram Prediction](https://mlsanity.com/paper/2208.01220/) (2022)
- [CLARE: Cognitive Load Assessment in REaltime with Multimodal Data](https://mlsanity.com/paper/2404.17098/) (2024)
- [On the Generalizability of ECG-based Stress Detection Models](https://mlsanity.com/paper/2210.06225/) (2022)
- [A Comparison of Personalized and Generalized Approaches to Emotion Recognition Using Consumer Wearable Devices: Machine Learning Study](https://mlsanity.com/paper/2308.14245/) (2023)
- [Scaling Representation Learning from Ubiquitous ECG with State-Space Models](https://mlsanity.com/paper/2309.15292/) (2023)
- [AttX: Attentive Cross-Connections for Fusion of Wearable Signals in Emotion Recognition](https://mlsanity.com/paper/2206.04625/) (2022)
- [EEG-based Cognitive Load Classification using Feature Masked Autoencoding and Emotion Transfer Learning](https://mlsanity.com/paper/2308.00246/) (2023)
- [Context-aware Pedestrian Trajectory Prediction with Multimodal Transformer](https://mlsanity.com/paper/2307.03786/) (2023)
- [Vital Sign Forecasting for Sepsis Patients in ICUs](https://mlsanity.com/paper/2311.04770/) (2023)
- [Cardiac Disease Diagnosis on Imbalanced Electrocardiography Data Through Optimal Transport Augmentation](https://mlsanity.com/paper/2202.00567/) (2022)
- [Automated Cardiovascular Record Retrieval by Multimodal Learning between Electrocardiogram and Clinical Report](https://mlsanity.com/paper/2304.06286/) (2023)
- [Stress Classification from ECG Signals Using Vision Transformer](https://mlsanity.com/paper/2603.26721/) (2026)
- [Deep Temporal Modeling and Ensemble Fusion for Multimodal Emotion Recognition from Physiological Signals](https://mlsanity.com/paper/2606.15026/) (2026)
- [Retrieval-Augmented Personalization with Foundation Models for Wearable Stress Detection](https://mlsanity.com/paper/2606.24985/) (2026)
- [Interpretable Vital Sign Forecasting with Model Agnostic Attention Maps](https://mlsanity.com/paper/2405.01714/) (2024)
- [NapTune: Efficient Model Tuning for Mood Classification using Previous Night's Sleep Measures along with Wearable Time-series](https://mlsanity.com/paper/2409.04723/) (2024)
- [Stress Detection from Photoplethysmography in a Virtual Reality Environment](https://mlsanity.com/paper/2409.17427/) (2024)
- [PULSE: Privileged Knowledge Transfer from Rich to Deployable Sensors for Embodied Multi-Sensory Learning](https://mlsanity.com/paper/2510.24058/) (2025)
- [Efficient-Husformer: Efficient Multimodal Transformer Hyperparameter Optimization for Stress and Cognitive Loads](https://mlsanity.com/paper/2511.22362/) (2025)
- [From Stress to Affect: Multimodal Deep Learning for Physiological Emotion Recognition Across Wearable Sensor Modalities](https://mlsanity.com/paper/2609.20991/) (2026)

## Abstract (arXiv)

Electrocardiogram (ECG) has been widely used for emotion recognition. This paper presents a deep neural network based on convolutional layers and a transformer mechanism to detect stress using ECG signals. We perform leave-one-subject-out experiments on two publicly available datasets, WESAD and SWELL-KW, to evaluate our method. Our experiments show that the proposed model achieves strong results, comparable or better than the state-of-the-art models for ECG-based stress detection on these two datasets. Moreover, our method is end-to-end, does not require handcrafted features, and can learn robust representations with only a few convolutional blocks and the transformer component.
