William Jongwon Han,Diana Gomez,Avi Alok,Chaojing Duan,Michael A. Rosenberg,Douglas Weber,Emerson Liu,Ding Zhao。
官方代碼“通過文本表示對心臟內電圖的解釋”,由2024年健康,推理和學習會議接受(CHIL)。
如果您遇到任何錯誤或有任何疑問,請在wjhan {at} andrew {dot} cmu {dot} edu上提交問題或聯繫人。
我們感謝Allegheny總醫院的Mario Lemieux心律護理中心支持這項工作。
注意:我們僅在Ubuntu 20.04.5 Lts上進行了測試。
conda create -n envname python=3.8
conda activate envname
git clone https://github.com/willxxy/ekg-af.git
cd ekg-af
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
注意:請確保您使用的PIP來自Conda環境
測試是否通過執行python gpu.py與當前的GPU兼容。目前,我們僅在A5000(24 GB)和A6000(48 GB)NVIDIA GPU上進行了測試。
pip install -r requirements.txt
儘管我們策劃的數據尚未公開可用,但我們確實在外部數據集上有實驗結果(主要結果在表2中),即Physionet上可用的“心臟內房顫數據庫”。
要設置此數據,請將cd降為preprocess文件夾。
請執行以下命令以下載數據。
wget https://physionet.org/static/published-projects/iafdb/intracardiac-atrial-fibrillation-database-1.0.0.zip
unzip intracardiac-atrial-fibrillation-database-1.0.0
sh preprocess.sh
.npy的數據文件夾,以供培訓,驗證和測試。 從預處理文件夾cd ../返回到主目錄。
現在,您可以直接使用train.sh文件開始培訓。
sh inference.sh 。確保指定檢查點路徑。 所有可視化將保存在其各自的檢查點文件夾中。請在可視化之前cd visualize 。在visualize文件夾下,請查看以下腳本:
stitch.sh可視化重建和預測的信號。
viz_tokens.sh可視化信號的令牌化表示。
viz_attentions.sh可視化模型的注意力圖。
viz_int_grad.sh可視化模型的歸因分數。
如果您發現此存儲庫或對自己的工作有幫助,請引用以下Bibtex。
@misc{han2024interpretation,
title={Interpretation of Intracardiac Electrograms Through Textual Representations},
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},
year={2024},
eprint={2402.01115},
archivePrefix={arXiv},
primaryClass={cs.CL}
}