Joint Spatial-Temporal Modeling and Contrastive Learning for Self-supervised Heart Rate Measurement

Wei Qian, Qi Li, Kun Li, Xinke Wang, Xiao Sun, Meng Wang, Dan Guo

Abstract

Remote photoplethysmography (rPPG) enables non-contact heart rate (HR) monitoring by detecting subtle facial color changes. However, supervised rPPG models are often limited by the scarcity of synchronized video and medical-grade ground truth data. This paper presents a hybrid self-supervised framework that combines a non-end-to-end Spatial-Temporal Transformer with an end-to-end contrastive learning-based 3DCNN. By utilizing unlabeled facial videos and a novel suite of self-supervised losses, the framework effectively captures the periodic nature of blood flow. The approach secured 2nd place in the 3rd RePSS Challenge at IJCAI 2024, demonstrating the potential for physiological sensing foundation models.

Introduction

Remote heart rate measurement is a critical technology for telehealth and non-invasive monitoring. Traditional supervised methods face a "label bottleneck," as collecting synchronized video and PPG sensor data is labor-intensive and often fails to generalize across diverse environmental conditions. To address this, we propose a self-supervised ensemble strategy that learns heart rate rhythms directly from raw, unlabeled video data.

Methodology

The proposed framework consists of two complementary solutions designed to capture different aspects of the physiological signal.

Solution 1: Spatial-Temporal Transformer

This non-end-to-end approach begins by converting video into Multi-scale Spatial-Temporal maps (MSTmaps), which aggregate color information across various facial regions over time. These maps are processed by a Transformer-based model featuring alternating spatial and temporal encoders to capture long-range dependencies.

Architecture of the Spatial-Temporal Transformer framework (Solution 1), featuring MSTmap preprocessing and self-supervised loss constraints.

The core innovation lies in the self-supervised loss functions used to constrain the model:

  • Bandwidth Loss: Restricts the signal to the physiological range of 40–180 bpm.
  • Sparsity Loss: Encourages a sharp peak in the frequency domain.
  • Variance Loss: Prevents the model from collapsing into a single frequency output.
  • Periodicity Loss: A novel constraint ensuring that different temporal segments of the same clip maintain consistent frequency characteristics.

Solution 2: Contrastive Learning

The second solution employs an end-to-end 3DCNN (PhysNet) architecture. This method utilizes a contrastive loss to pull together rPPG signals extracted from the same video while pushing away signals from different videos, thereby learning discriminative physiological representations without explicit labels.

The two-stage contrastive learning framework (Solution 2) utilizing a 3DCNN for end-to-end feature extraction.

Ensemble Strategy

To maximize robustness, the final heart rate estimate is produced by averaging the predictions from both the Transformer-based and 3DCNN-based models. This ensemble leverages the global spatial-temporal context of the Transformer alongside the discriminative features of the 3DCNN.

Experiments and Results

The models were pre-trained on several unlabeled datasets (UBFC-rPPG, PURE, MMSE-HR, and DISFA) and fine-tuned on the VIPL-V2 dataset. Evaluation was conducted on the 3rd RePSS Challenge test set.

  • Performance: The ensemble achieved a Root Mean Squared Error (RMSE) of 8.85277 bpm, securing 2nd place in the competition.
  • Ablation Study: The introduction of the Periodicity Loss was pivotal, reducing the RMSE from 10.36 to 9.93 bpm in the Transformer model, confirming that temporal consistency is a vital cue for self-supervised rPPG.

Discussion and Conclusion

This work highlights the power of periodicity as a self-supervised signal for physiological monitoring. By forcing the model to find consistent rhythms across temporal segments, we can significantly improve accuracy without massive labeled datasets. Future work will explore video motion magnification to amplify subtle pulses and aim for "zero-shot" inference to eliminate the need for fine-tuning entirely.

Summary updated

BibTeX
@inproceedings{qian2024joint,
  author = {Wei Qian and Qi Li and Kun Li and Xinke Wang and Xiao Sun and Meng Wang and Dan Guo},
  title = {{Joint Spatial-Temporal Modeling and Contrastive Learning for Self-supervised Heart Rate Measurement}},
  booktitle = {RePSS @ IJCAI},
  year = {2024},
  url = {https://openreview.net/forum?id=cssSTMTmZm},
}
Figure