Skip to content

Add ECGMultiLabelCardiologyTask#1052

Open
jgong817 wants to merge 1 commit intosunlabuiuc:masterfrom
jgong817:master
Open

Add ECGMultiLabelCardiologyTask#1052
jgong817 wants to merge 1 commit intosunlabuiuc:masterfrom
jgong817:master

Conversation

@jgong817
Copy link
Copy Markdown

@jgong817 jgong817 commented Apr 21, 2026

Contributor: Jonathan Gong (jgong11@illinois.edu), Misael Lazaro (misaell2@illinois.edu), Sydney Robeson (sel9@illinois.edu)

Contribution Type: New Task

Description: ECGMultiLabelCardiologyTask is a standalone PyHealth task for multi-label ECG
classification. It is designed to operate on CardiologyDataset-style records
that reference paired PhysioNet-format waveform (.mat) and header (.hea) files. This task is based off of the work done by Nonaka and Seita (2021): https://proceedings.mlr.press/v149/nonaka21a/nonaka21a.pdf

For each visit record, the task:

  1. Loads a 12-lead ECG signal from the waveform file.
  2. Parses diagnosis codes and basic demographics (sex and age) from the
    corresponding header file.
  3. Converts the configured diagnosis label set into a multi-hot target vector.
  4. Segments the ECG into fixed-length sliding windows using the specified epoch
    length, shift, and sampling rate.
  5. Produces model-ready samples containing the signal window, multilabel target,
    and associated visit/patient metadata.

This makes the task suitable for training and testing existing PyHealth models
on synthetic or dataset-backed ECG classification workflows.

Files to Review:

  • pyhealth/tasks/ecg_classification.py - Main task implementation
  • docs/api/tasks/pyhealth.tasks.ecg_classification.rst - Documentation file
  • docs/api/tasks.rst - Updated task index
  • tests/core/test_ecg_classification_task.py - Test cases with synthetic data
  • pyhealth/examples/ecg_multilabel_mlp.py - Task ablation study

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.

1 participant