DT4ECG: A Dual-Task Learning Framework for ECG-Based Human Identity Recognition and Human Activity Detection

Siyu You, Boyuan Gu, Yanhui Yang, Shiyu Yu, Shisheng GuoarXiv 2025 · DOI

TL;DR

DT4ECG is a multi-task learning framework that uses a single ECG signal to simultaneously identify a person and detect their current physical activity. By combining a novel Sequence Channel Attention (SCA) mechanism with GradNorm for balanced training, the model achieves 99.12% accuracy in identity recognition and 90.11% in activity detection.

What Problem Does This Paper Address?

Electrocardiogram (ECG) signals are increasingly used for two distinct purposes: biometric identity recognition (because everyone's heart rhythm is unique) and human activity recognition (HAR) (because heart rate and patterns change based on physical exertion).

However, these two tasks are usually treated in isolation. This is problematic because physical activity significantly alters the "signature" of an ECG signal, which can degrade the performance of identity systems. Conversely, individual physiological differences can act as noise for activity detection. The authors address this by proposing a Multi-Task Learning (MTL) framework that learns a shared representation of the ECG signal, allowing the model to understand who the person is while accounting for what they are doing.

Methods

The DT4ECG framework is built on a 1D-Convolutional Neural Network (1D-CNN) backbone with residual blocks. The core innovations include:

  1. Sequence Channel Attention (SCA): Standard CNNs can struggle to capture long-range temporal dependencies in sequential data. The SCA module applies two types of attention:
  2. Channel Attention: Identifies which feature maps (channels) are most relevant.
  3. Sequence Attention: Identifies which specific time steps in the 3-second ECG window contain the most informative data.
  4. GradNorm Integration: In multi-task learning, one task is often "easier" than the other. Here, identity recognition converges much faster than activity detection. Without intervention, the "easy" task dominates the gradient updates, leading to poor performance on the "hard" task. GradNorm dynamically adjusts the loss weights during training to balance the gradient magnitudes, ensuring both tasks learn effectively.
  5. Architecture: The model processes 3-second ECG segments (300 data points), passes them through residual blocks and the SCA module, and finally splits into two task-specific heads for classification.

Datasets

The authors found that popular open-source ECG datasets (like MIT-BIH) lacked the diverse physical activity data needed for this study. Consequently, they built a custom dataset:

  • Subjects: 15 healthy volunteers (9 male, 6 female), aged 20–29.
  • Conditions: Data was collected under three states: resting, post-exercise (running at 9 km/h), and deep breathing.
  • Hardware: Signals were captured at 100 Hz using a three-lead electrode configuration and a BIOPAC MP 160 system.

Key Insights and Ideas

  • The "Aha" Moment on Gradient Imbalance: The researchers observed that without GradNorm, identity recognition reached peak accuracy in just 10 epochs, while activity detection lagged significantly, taking 40+ epochs to converge. GradNorm acted as a "pacer," accelerating the learning of the activity detection task to match the identity task.
  • Attention Synergy: By combining channel and sequence attention, the model doesn't just look at the "shape" of the heartbeat; it learns to ignore noise and focus on the specific physiological markers that remain consistent for an individual across different heart rates.
  • Shared Representations: The success of the MTL approach suggests that the features required to identify a person and the features required to identify an activity are not mutually exclusive; they provide useful context for one another.

Key Results

The proposed DT4ECG model outperformed several baselines (including LSTM, MLP, and standard 1D-CNNs):

  • Identity Recognition (15 classes): 99.12% accuracy, 99.14% precision.
  • Human Activity Recognition (3 classes): 90.11% accuracy, 90.25% precision.
  • Ablation Success: The SCA module consistently improved performance across different backbones (MobileNet, EfficientNet, ResNet), showing its robustness. Specifically, in the 1D-ResNet backbone, SCA improved activity detection by over 6% compared to the baseline.

Limitations and Future Work

  • Dataset Scale: The study was limited to 15 subjects. While the accuracy is high, biometric systems typically need to prove they can scale to hundreds or thousands of individuals.
  • Subject Diversity: The participants were all young (20–29) and healthy. The model’s performance on older populations or individuals with cardiac arrhythmias remains an open question.
  • Activity Granularity: The study only categorized three broad states. Future work could explore more complex activities like walking, climbing stairs, or different intensities of exercise to see if the ECG signal alone provides enough resolution for finer classification.

Summary updated

BibTeX
@misc{you2025dt,
  author = {Siyu You and Boyuan Gu and Yanhui Yang and Shiyu Yu and Shisheng Guo},
  title = {{DT4ECG: A Dual-Task Learning Framework for ECG-Based Human Identity Recognition and Human Activity Detection}},
  year = {2025},
  eprint = {2502.11023},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.11023},
}
Figure