Skip to content

Latest commit

 

History

History
127 lines (87 loc) · 4.54 KB

File metadata and controls

127 lines (87 loc) · 4.54 KB

SpectroTransNet: Contactless Radar HR/HRV Monitoring

This repository contains a research-project implementation for Contactless Radar Heart Rate and Variability Monitoring via a Spectro-Temporal Transformer with Curriculum Learning.

SpectroTransNet estimates frame-wise instantaneous heart rate (IHR) from FMCW radar time-frequency maps, then reconstructs beat timing with an IPFM-style procedure to compute heart-rate variability (HRV) metrics such as RMSSD, SDNN, and SD2.

Pipeline overview

Highlights

  • Contactless HR and HRV estimation from FMCW mmWave radar.
  • CWT-based radar spectrogram input aligned with ECG-derived IHR labels.
  • CNN local encoding plus Transformer temporal modeling for long-range rhythm consistency.
  • Curriculum objective that shifts training from coarse rhythm tracking to beat-level dynamics.
  • IPFM beat reconstruction for RR intervals and HRV metrics.

Method

The pipeline first extracts and filters radar phase signals, converts each 10-second window into a CWT time-frequency representation, and uses ECG R-peaks to construct frame-wise IHR labels. SpectroTransNet then maps each CWT window to an IHR trajectory. During inference, predicted IHR is integrated as instantaneous frequency; integer phase crossings define reconstructed beat times, from which RR intervals and HRV metrics are computed.

SpectroTransNet architecture

Results

This project evaluates subject-independent generalization on the public clinical radar vital-sign dataset from Schellenberger et al., using Resting and Valsalva maneuver recordings.

Condition HR MAE (bpm) RMSSD MAE (ms) SDNN MAE (ms) SD2 MAE (ms)
Resting 1.0261 10.6859 13.1819 17.6093
Valsalva 1.6790 12.1079 14.1657 18.5728

Overall comparison on pooled test segments:

Method HR MAE HR RMSE HR r RMSSD MAE RMSSD RMSE RMSSD r
CWT + Viterbi 3.33 4.71 0.73 37.86 53.08 0.37
ResNet-18 2.34 4.08 0.88 16.69 25.30 0.58
No-Curriculum 2.16 6.37 0.74 12.93 19.56 0.64
SpectroTransNet 1.44 4.68 0.84 11.58 19.01 0.65

Error histograms

Method comparison

Repository Layout

assets/                 Figures prepared for GitHub presentation
docs/report/            Technical report draft and project notes
src/hrv/                Reusable data, model, loss, metric, and baseline modules
scripts/                Dataset preparation, training, evaluation, and plotting entrypoints
archive/                Legacy signal-processing utilities and exploratory experiments
tests/                  Lightweight project-structure smoke checks

Setup

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Run scripts with the source package on PYTHONPATH:

export PYTHONPATH=src

Data Preparation

Download the public clinical radar vital-sign dataset and place the .mat recordings under a local directory, for example data_nature/.

PYTHONPATH=src python scripts/prepare_dataset.py \
  --mat-root data_nature \
  --out-dir results/nature_dataset_cleaned

The generated dataset contains compressed .npz windows with:

  • spectrogram: CWT radar time-frequency map, shape [64, 1200]
  • ihr_curve: ECG-derived IHR label, shape [1200]

Training

Train SpectroTransNet:

PYTHONPATH=src python scripts/train.py

Train comparison models:

PYTHONPATH=src python scripts/train_baseline_cnn.py
PYTHONPATH=src python scripts/train_no_curriculum.py

Evaluation

Evaluate the proposed model with IPFM HRV reconstruction:

PYTHONPATH=src python scripts/evaluate.py \
  --data-dir results/nature_dataset_cleaned \
  --checkpoint checkpoints_trans/best_model.pth \
  --output-file results/spectrotransnet_metrics_ipfm.csv

Evaluate baselines:

PYTHONPATH=src python scripts/evaluate_cnn.py
PYTHONPATH=src python scripts/evaluate_no_curriculum.py
PYTHONPATH=src python scripts/evaluate_viterbi.py

Generate report-style result figures from CSV outputs:

PYTHONPATH=src python scripts/make_figures.py --output-dir results/figures

Report Draft

The project report draft is included at docs/report/technical_report_draft.docx. It is an internal project document, not a published paper. The README figures are extracted from this draft and renamed for stable GitHub rendering.