Repository navigation
Conversation
georgia_ecg.py file for processing and loading data for project
added padding to vids shorter in length the way paper has done it
Test CoverageTotal: 88.27% (58343 / 66093 lines)
|
Collaborator
|
Why this PR has
To make it eligible: remove the notebook (a short example script under |
This branch has not been deployed
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
Contribution type
Model and task contribution using the existing
CardiologyDataset.Paper
In-depth Benchmarking of Deep Neural Network Architectures for ECG Diagnosis
What we added
We added resnet1d-18 and a task for predicting 30 diagnosis labels from Georgia ecg recordings.
The preprocessing reads 12 lead signals at 500 Hz in mv. It pads shorter recordings with zeros on the left to reach 5k samples, then normalizes each lead using training-set statistics.
Training uses random 1250 sample windows. Evaluation uses overlapping windows and combines their predictions using max, mean, or top-two mean aggregation. The loader matches recordings to the saved splits by recording ID and keeps the same diagnosis label order throughout.
Files to review
pyhealth/models/resnet1d_18.pypyhealth/models/__init__.pypyhealth/tasks/georgia_ecg.pydocs/api/models/pyhealth.models.ResNet1D18.rstdocs/api/tasks/pyhealth.tasks.georgia_ecg.rstdocs/api/models.rstdocs/api/tasks.rsttests/core/test_resnet1d_18.pytests/core/test_georgia_ecg.pyexamples/georgia_ecg_classification_resnet1d18.pyYou can run the example with
--syntheticwithout downloading georgia data.Tests
After rebasing onto upstream master, all six model tests passed in 0.065 seconds and all twelve task tests passed in 0.016 seconds.
The model tests check initialization, output shapes, probabilities, loss, inference without labels, gradients, and invalid input channels.
The task tests check normalization, padding, training and evaluation windows, label ordering, dataset wrappers, and invalid inputs.
We also ran the synthetic example successfully before the rebase. Its scores demonstrate that the example runs. They are not georgia benchmark results.
Results
We completed a separate Colab run using the gain 1000 Georgia data and verified that the pooled normalized training signals had mean 0 and standard deviation 1 per lead.
We used seed 1 with 8260 training, 1038 validation, and 1046 test recordings.
Validation selected the epoch 45 checkpoint with max agg macro roc auc of 0.895902. Training stopped at epochs 70.
Mean performed best in this run, but one seed does not establish statistical significance.
Data and experiment notes
To run with real data, install
wfdband provide the georgia recordings and these preprocessing files:label_order.jsonsplit_seed1.npznormalization_seed1.npzThe synthetic example runs without downloading the Georgia dataset. The corrected gain 1000 experiment and aggregation results are summarized above.