Skip to content

Add LUDB dataset support and a per-lead ECG delineation task - #1593

Open
sidwanjara wants to merge 2 commits into
sunlabuiuc:masterfrom
shraysrivastava:ludb-ecg-delineation
Open

sidwanjara wants to merge 2 commits into
sunlabuiuc:masterfrom
shraysrivastava:ludb-ecg-delineation

Conversation

@sidwanjara

Copy link
Copy Markdown

Contributors: Shray Srivastava (ssriv5@illinois.edu), Sid Wanjara (swanj2@illinois.edu)

Contribution Type: New Dataset + New Task

Paper: J. Park et al., "Benchmarking ECG Delineation using Deep Neural Network-based
Semantic Segmentation Models," CHIL 2025, PMLR 287:63-88.
https://proceedings.mlr.press/v287/park25a.html

Description:
Adds the Lobachevsky University Electrocardiography Database (LUDB, PhysioNet, open access)
and an ECG delineation task that follows the paper's setup.

  • LUDBDataset indexes the 200 ten-second, 12-lead, 500 Hz records together with their
    metadata from ludb.csv (sex, age, rhythm, electric axis).
  • ECGDelineationLUDB makes one sample per lead, as the paper does. Each sample has a
    (1, 1, 5000) signal and a (1, 5000) mask (0 background, 1 P, 2 QRS, 3 T).
    • Points before the first and after the last annotated wave are set to 255 (ignore),
      since the cardiologists did not label them.
    • The paper's 0.05-150 Hz Butterworth band-pass is applied by default and can be
      turned off.
    • Optional seeded Gaussian noise (noise_snr_db) is added before filtering, for
      robustness tests.
  • The example trains PyHealth's existing UNet2D on the authors' own 160/20/20 record
    split and reports per-wave IoU and mIoU.
    • Clean test mIoU is 0.822 to 0.826 over 3 seeds, against 0.854 for the paper's UNet 3+.
    • Ablation (not in the paper): noise robustness with the filter on vs off. The filter
      has no effect on clean data but adds +0.09 mIoU at 0 dB SNR. Full results and
      findings are in the example's docstring.

No core PyHealth code is changed; the only edits outside the new files are the two
__init__.py imports and the doc/README index entries.

Files to Review:

  • pyhealth/datasets/ludb.py - dataset implementation
  • pyhealth/datasets/configs/ludb.yaml - dataset config
  • pyhealth/tasks/ecg_delineation_ludb.py - delineation task and annotations_to_mask
  • tests/core/test_ludb.py - tests on synthetic WFDB records (no real data)
  • examples/ludb_ecg_delineation_unet.py - training, evaluation and ablation; runs
    without data via --synthetic
  • docs/api/datasets/pyhealth.datasets.LUDBDataset.rst,
    docs/api/tasks/pyhealth.tasks.ECGDelineationLUDB.rst - API docs
  • docs/api/datasets.rst, docs/api/tasks.rst, examples/README.md - index entries
  • pyhealth/datasets/__init__.py, pyhealth/tasks/__init__.py - imports

@github-actions

Copy link
Copy Markdown

Test Coverage

Total: 86.26% (45526 / 52779 lines)

Modified file Coverage Lines
pyhealth/datasets/__init__.py 100.00% 81 / 81
pyhealth/datasets/ludb.py 98.28% 57 / 58
pyhealth/tasks/__init__.py 98.04% 100 / 102
pyhealth/tasks/ecg_delineation_ludb.py 93.14% 95 / 102

Workflow run · ab98846

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants