{"id":23398376,"url":"https://github.com/willxxy/text-egm","last_synced_at":"2025-04-11T17:23:01.572Z","repository":{"id":231753498,"uuid":"782629300","full_name":"willxxy/Text-EGM","owner":"willxxy","description":" [CHIL 2024] Interpretation of Intracardiac Electrograms Through Textual Representations ","archived":false,"fork":false,"pushed_at":"2024-09-04T16:08:25.000Z","size":52,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-25T13:21:04.728Z","etag":null,"topics":["cardiology","deep-learning","electrophysiology","healthcare","interpretability","language-model","machine-learning","masked-language-models","physiological-signals","physiology","representation-learning"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/2402.01115","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/willxxy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-05T17:28:50.000Z","updated_at":"2025-02-09T14:43:56.000Z","dependencies_parsed_at":"2024-04-06T19:28:34.920Z","dependency_job_id":"34543026-648d-4664-9ca5-68c4413acf37","html_url":"https://github.com/willxxy/Text-EGM","commit_stats":null,"previous_names":["willxxy/text-egm"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willxxy%2FText-EGM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willxxy%2FText-EGM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willxxy%2FText-EGM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willxxy%2FText-EGM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willxxy","download_url":"https://codeload.github.com/willxxy/Text-EGM/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248448093,"owners_count":21105231,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cardiology","deep-learning","electrophysiology","healthcare","interpretability","language-model","machine-learning","masked-language-models","physiological-signals","physiology","representation-learning"],"created_at":"2024-12-22T09:45:49.335Z","updated_at":"2025-04-11T17:23:01.543Z","avatar_url":"https://github.com/willxxy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Interpretation of Intracardiac Electrograms Through Textual Representations\n\nWilliam Jongwon Han, Diana Gomez, Avi Alok, Chaojing Duan, Michael A. Rosenberg, Douglas Weber, Emerson Liu, Ding Zhao.\n\nOfficial code for \"[Interpretation of Intracardiac Electrograms Through Textual Representations](https://arxiv.org/abs/2402.01115)\" accepted by 2024 Conference on Health, Inference, and Learning (CHIL).\n\nIf you experience any bugs or have any questions, please submit an issue or contact at wjhan{at}andrew{dot}cmu{dot}edu.\n\nWe thank the Mario Lemieux Center for Heart Rhythm Care at Allegheny General Hospital for supporting this work.\n\n## Set Up Environment\n\nNote: We have only tested on Ubuntu 20.04.5 LTS. \n\n1. `conda create -n envname python=3.8`\n\n2. `conda activate envname`\n\n3. `git clone https://github.com/willxxy/ekg-af.git`\n\n4. `cd ekg-af`\n\n5. `pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cu113`\n\nNote: Please ensure that the pip you are using is from the conda environment\n\n6. Test if pytorch version is compatible with current, available gpus by executing `python gpu.py`. Currently, we have only tested on A5000 (24 GB) and A6000 (48 GB) NVIDIA GPUs.\n\n7. `pip install -r requirements.txt`\n\n## Set Up Data\n\n1. Although the data we curated is not publicly available, we do have experimental results on an external dataset (main results are in Table 2 in the paper), namely the \"Intracardiac Atrial Fibrillation Database\" available on PhysioNet.\n\n2. To set up this data, `cd` into the `preprocess` folder.\n\n3. Please execute the following command to download the data.\n\n```\nwget https://physionet.org/static/published-projects/iafdb/intracardiac-atrial-fibrillation-database-1.0.0.zip\n```\n\n4. Unzip the file by executing\n\n```\nunzip intracardiac-atrial-fibrillation-database-1.0.0\n```\n\n5. Now execute the folllowing command to preprocess the data.\n\n```\nsh preprocess.sh\n```\n\n6. This should create a data folder with several `.npy` for training, validation, and test.\n\n\n## Start Training\n\n1. From the preprocess folder `cd ../` back to the main directory.\n\n2. You can now directly use `train.sh` files to start training.\n\n## Inference\n\n1. Please execute `sh inference.sh` after training. Make sure to specify the checkpoint path.\n\n## Visualizations\n\nAll visualizations will be saved under their respective checkpoint folder.\nPlease `cd visualize` before visualizing. \nUnder the `visualize` folder, please view the following scripts:\n\n\n1. `stitch.sh` - Visualizes the reconstructed and forecasted signals. \n\n2. `viz_tokens.sh` - Visualizes the tokenized representation of the signal. \n\n3. `viz_attentions.sh` - Visualizes the attention map of the model. \n\n4. `viz_int_grad.sh` - Visualizes the attribution scores of the model.\n\n## Citation\n\nIf you found this repository or work helpful to your own, please cite the following bibtex.\n\n```\n@misc{han2024interpretation,\n      title={Interpretation of Intracardiac Electrograms Through Textual Representations}, \n      author={William Jongwon Han and Diana Gomez and Avi Alok and Chaojing Duan and Michael A. Rosenberg and Douglas Weber and Emerson Liu and Ding Zhao},\n      year={2024},\n      eprint={2402.01115},\n      archivePrefix={arXiv},\n      primaryClass={cs.CL}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillxxy%2Ftext-egm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillxxy%2Ftext-egm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillxxy%2Ftext-egm/lists"}