Stress Classification From ECG Signals Using Vision Transformer

February 2, 2026·
Zeeshan Ahmad
Naimul Khan
Naimul Khan
· 0 min read
Abstract
Vision transformers have shown tremendous success in numerous computer vision applications; however, they have not been exploited for stress assessment using physiological signals such as electrocardiogram (ECG). In this article, we transform raw ECG data into 2-D spectrograms using short-time Fourier transform, which are divided into patches for feeding to the transformer encoder. We perform leave-one-subject-out cross validation experiments on the WESAD and RML datasets. Our method addresses intersubject variability and achieves 71.01% and 76.7% accuracy for three-class classification on the RML and WESAD datasets respectively, and 88.3% for binary classification on WESAD — outperforming all previous state-of-the-art methods. The proposed method is end-to-end, requires no handcrafted features, and learns robust representations.
Type
Publication
IEEE Journal of Selected Areas in Sensors
publications
Naimul Khan
Authors
Associate Professor & Lab Director
Associate Professor and Director of the Multimedia Research Laboratory at Toronto Metropolitan University. Research spans multimedia signal processing, machine learning, and AR/VR with applications in healthcare and mental health.