Add PTB-XL dataset and MI classification task#950
Draft
zaidalkhatib wants to merge 4 commits intosunlabuiuc:masterfrom
Draft
Add PTB-XL dataset and MI classification task#950zaidalkhatib wants to merge 4 commits intosunlabuiuc:masterfrom
zaidalkhatib wants to merge 4 commits intosunlabuiuc:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contributors: Zaid Alkhatib (zaida3@illinois.edu), Anila Narapusetty (anilan2@illinois.edu)
Contribution Type: Dataset + Task
Paper: Data Augmentation for Electrocardiograms
Paper Link: https://arxiv.org/abs/2204.04360
Overview
This PR adds support for the PTB-XL ECG dataset and implements a binary myocardial infarction (MI) classification task as a partial reproduction of the paper Data Augmentation for Electrocardiograms.
The contribution focuses on the dataset and task components of the pipeline within PyHealth, rather than reproducing the full model and training procedure.
What was implemented
Dataset
PTBXLDatasetinpyhealth/datasets/ptbxl.pyBaseDatasetptbxl_database.csvrecords100/(100 Hz, default)records500/(500 Hz, optional)record_pathfor downstream waveform loadingdev=Truefor fast iterationTask
PTBXLMIClassificationTaskinpyhealth/tasks/ptbxl_mi_classification.py1→ Myocardial Infarction (MI)0→ Non-MIscp_statements.csvto map SCP codes to the MI diagnostic class(channels, time)signal:"tensor"label:"binary"Tests
tests/core/test_ptbxl_dataset.pytests/core/test_ptbxl_mi_classification.pyDocs
docs/api/datasets/pyhealth.datasets.ptbxl.rstdocs/api/tasks/pyhealth.tasks.ptbxl_mi_classification.rstdocs/api/datasets.rstdocs/api/tasks.rstExample
examples/ptbxl_mi_classification_cnn.pyDemonstrates:
Files to Review
Core implementation
pyhealth/datasets/ptbxl.pypyhealth/tasks/ptbxl_mi_classification.pyRegistration
pyhealth/datasets/__init__.pypyhealth/tasks/__init__.pyTests
tests/core/test_ptbxl_dataset.pytests/core/test_ptbxl_mi_classification.pyDocumentation
docs/api/datasets/pyhealth.datasets.ptbxl.rstdocs/api/tasks/pyhealth.tasks.ptbxl_mi_classification.rstdocs/api/datasets.rstdocs/api/tasks.rstExample
examples/ptbxl_mi_classification_cnn.pyNotes