arXiv:2611.01853cs.LGNov 2026

Manuscript Offprint

arXiv:2611.01853

Privacy-Preserving ECG-HRV Emotion Classification for Mood Swing Detection using Federated Learning on Constrained Edge Devices

Chidike Vincent, Muhammad Aslam Jarwar, Najam Ul Hasan, Laurence Hirsch, Jonathan Zasada-James, Hem Raj Dadra

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Chidike Vincent, Muhammad Aslam Jarwar, Najam UI Hasan

Laurence Hirsch, Jonathan Zasada-James, Hem Raj Dadral

School of Computing and Digital Technologies, Sheffield Hallam University, Sheffield, United Kingdom

{v.vincent, a.jarwar, n.ul-hasan, l.hirsch j.zasada-james, hemraj.r.dadral}@shu.ac.uk

Abstract—This paper presents a privacy-preserving mood monitoring framework that classifies emotional states from ECG-derived heart rate variability (HRV) features. The proposed framework is evaluated on three datasets comprising 74 participants and validated on an unseen individual using a wearable in a pilot study. Leave-One-Participant-Out cross-validation LOPO-CV, which evaluates the model on each participant without exposing their data during training, serves as the primary generalization benchmark. A multi-phase experimental design examines how temporal windowing, HRV feature selection, and class equalisation affects four-class valence-arousal and binary valence classification. Class imbalance is identified as the dominant suppressor of low-valence; and equalisation improves minority class recall by 48.5 % on the DREAMER dataset. Binary valence classification achieves 53.17% LOPO-CV accuracy using standard HRV features. Under identical conditions, Logistic Regression outperforms the other five classifiers and exceeding comparable HRV-based baselines. Pilot validation using a Polar H10 wearable achieves 75% binary valence accuracy on an unseen individual without calibrations, including 100% precision for negative valence predictions. Despite being limited to a single participant, the finding demonstrates the framework's feasibility for validation on a larger cohort. Finally, the proposed framework is deployed on a six-node Raspberry Pi federated learning cluster to evaluate the privacy-preserving distributed training. The results show that federated Logistic Regression achieves accuracy comparable to centralized Logistic Regression across all three datasets, without sharing raw physiological data, thereby preserving user privacy. These findings establish the proposed framework as an interpretable, and privacy preserving solution for continuous mood monitoring in real-world clinical and community settings.

Index Terms—Federated Learning, Emotion Classification, HRV Analysis, ECG Signals, Privacy Preservation

I. INTRODUCTION

Mood disorders in young people often go undetected due to reliance on self-reporting and scheduled assessments. Millions of young people experience symptoms of depression, anxiety, and mood disorders without a diagnosis. Because individuals rarely present to a clinic that fits traditional diagnostic frameworks, the average delay between symptom onset and treatment stretches to eight to twelve years [1]. This gap is not because effective treatments are unavailable, but because tools for detecting mood changes early enough to intervene are still largely absent from everyday life. Depression is the leading global cause of disability, affecting an estimated 322 million people, with particularly high prevalence among adolescents and young adults [2].

The human body does not wait for a clinical appointment to signal distress. The autonomic nervous system responds to emotional states continuously, and those responses are measurable through the heart. Heart rate variability (HRV), defined as the variation in time intervals between successive R-peaks in the electrocardiogram (ECG), reflects the dynamic balance between the sympathetic and parasympathetic nervous systems. Emotions can be described along two dimensions: valence, which captures whether a feeling is positive or negative, and arousal, which captures how activated or calm a person feels [3]. A person feeling joyful scores high on both; someone feeling sad scores low on valence and low on arousal; someone anxious scores high on arousal but low on valence. HRV is an established physiological correlate of both dimensions [4], [5]. Wearable devices such as chest straps and smartwatches are now widely available and capable of recording cardiac electrical activity with sufficient fidelity to extract meaningful physiological information. This research evaluates whether these signals, processed through intelligent privacy-preserving frameworks, can serve as reliable longitudinal markers of an individual's emotional state.

Despite an increased volume of research applying machine learning to ECG-HRV signals, three limitations hinder clinical translation. First, the majority of existing models rely on within-participant (WP) training protocols, which inflate accuracy and do not generalise to unseen individuals [6], [7]. Second, high-accuracy models rely on laboratory equipment or computationally intensive feature extraction methods incompatible with resource-constrained edge devices [8]–[10]. Third, centralising continuous physiological data raises privacy concerns. The proposed system functions as a personal awareness tool rather than a definitive clinical diagnostic instrument. A cross-participant (XP) accuracy of approximately 53% at inception is sufficient to detect mood trends and support personalisation over time, and the federated architecture preserves individual privacy by ensuring personal data remains local while improving performance progressively through continuous on-device learning. This paper addresses all three limitations through a unified, systematic experimental framework. The main contributions are as follows:

  • A multi-phase windowed HRV classification approach is evaluated across three public affective datasets, DREAMER [7], AMIGOS [11], and EmoWear [12], using Leave-One-Participant-Out cross-validation as the primary generalisation benchmark.

  • Class imbalance is identified and characterised as the primary suppressor of low-arousal low-valence detection, a finding with direct clinical relevance as this quadrant corresponds most closely to depressive mood states.

  • The approach is validated on an unseen participant using a Polar H10 consumer chest strap, demonstrating real-world deployability on hardware accessible to end users without laboratory infrastructure.

  • A privacy-preserving federated learning architecture is implemented and deployed on a six-node Raspberry Pi cluster, showing that distributed training on partitioned physiological data consistently match centralised training while keeping all raw signals local to each device.

The remainder of this paper is organised as follows. Section II reviews related work. Section III presents the methodology. Section IV reports experimental results. Section V describes real-world deployment and live validation. Section VI evaluates performance. Section VII discusses findings and limitations. Section VIII concludes the paper.

References (19)