{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/ecg-semantic-integrator-esi-a-foundation-ecg","title":"ECG Semantic Integrator (ESI): A Foundation ECG Model Pretrained with LLM-Enhanced Cardiological Text","arxiv_id":"2405.19366","date":"2024-05-26","proceeding":null,"authors":["Han Yu","Peikun Guo","Akane Sano"],"abstract":"The utilization of deep learning on electrocardiogram (ECG) analysis has brought the advanced accuracy and efficiency of cardiac healthcare diagnostics. By leveraging the capabilities of deep learning in semantic understanding, especially in feature extraction and representation learning, this study introduces a new multimodal contrastive pretaining framework that aims to improve the quality and robustness of learned representations of 12-lead ECG signals. Our framework comprises two key components, including Cardio Query Assistant (CQA) and ECG Semantics Integrator(ESI). CQA integrates a retrieval-augmented generation (RAG) pipeline to leverage large language models (LLMs) and external medical knowledge to generate detailed textual descriptions of ECGs. The generated text is enriched with information about demographics and waveform patterns. ESI integrates both contrastive and captioning loss to pretrain ECG encoders for enhanced representations. We validate our approach through various downstream tasks, including arrhythmia detection and ECG-based subject identification. Our experimental results demonstrate substantial improvements over strong baselines in these tasks. These baselines encompass supervised and self-supervised learning methods, as well as prior multimodal pretraining approaches.","url_abs":"https://arxiv.org/abs/2405.19366v2","url_pdf":"https://arxiv.org/pdf/2405.19366v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"ecg-semantic-integrator-esi-a-foundation-ecg","repo_url":"https://github.com/comp-well-org/esi","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"GPL-3.0"}}],"tasks":[{"task_slug":"arrhythmia-detection","task_name":"Arrhythmia Detection"},{"task_slug":"rag","task_name":"RAG"},{"task_slug":"representation-learning","task_name":"Representation Learning"},{"task_slug":"retrieval-augmented-generation","task_name":"Retrieval-augmented Generation"},{"task_slug":"self-supervised-learning","task_name":"Self-Supervised Learning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2405.19366","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.19366"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/comp-well-org/esi","reach":{"status":"ok","spdx":"GPL-3.0"}}],"summary":{"ran":8,"ran_violates":2,"ran_draft_wrong":1,"unverified":3},"by_repo_kind":{"official":{"samples":14,"ran":11,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":14,"samples":[{"code_sha256_prefix":"280ac1abfe484cdc","entry":"BatchNorm","repo":"comp-well-org/esi","repo_kind":"official","path":"model/xresnet1d.py","file_url":"https://github.com/comp-well-org/esi/blob/HEAD/model/xresnet1d.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"280ac1abfe484cdc"}},{"code_sha256_prefix":"66b10df56ebb7482","entry":"cd_adaptiveconcatpool","repo":"comp-well-org/esi","repo_kind":"official","path":"model/basic_conv1d.py","file_url":"https://github.com/comp-well-org/esi/blob/HEAD/model/basic_conv1d.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"66b10df56ebb7482"}},{"code_sha256_prefix":"60fff7c3c400d7ff","entry":"default","repo":"comp-well-org/esi","repo_kind":"official","path":"model/esi.py","file_url":"https://github.com/comp-well-org/esi/blob/HEAD/model/esi.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"60fff7c3c400d7ff"}},{"code_sha256_prefix":"02e91c4ac4b8e2c8","entry":"delegates","repo":"comp-well-org/esi","repo_kind":"official","path":"model/xresnet1d.py","file_url":"https://github.com/comp-well-org/esi/blob/HEAD/model/xresnet1d.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"02e91c4ac4b8e2c8"}},{"code_sha256_prefix":"aa5486a3650902d8","entry":"exists","repo":"comp-well-org/esi","repo_kind":"official","path":"model/esi.py","file_url":"https://github.com/comp-well-org/esi/blob/HEAD/model/esi.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"aa5486a3650902d8"}},{"code_sha256_prefix":"0136c699450036f2","entry":"get_ecg_loader","repo":"comp-well-org/esi","repo_kind":"official","path":"utils/ecg_loader.py","file_url":"https://github.com/comp-well-org/esi/blob/HEAD/utils/ecg_loader.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"0136c699450036f2"}},{"code_sha256_prefix":"145e22d624bf52e9","entry":"init_default","repo":"comp-well-org/esi","repo_kind":"official","path":"model/xresnet1d.py","file_url":"https://github.com/comp-well-org/esi/blob/HEAD/model/xresnet1d.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"145e22d624bf52e9"}},{"code_sha256_prefix":"d3d5bf1b20109dcd","entry":"pad_dim_to","repo":"comp-well-org/esi","repo_kind":"official","path":"model/esi.py","file_url":"https://github.com/comp-well-org/esi/blob/HEAD/model/esi.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"d3d5bf1b20109dcd"}},{"code_sha256_prefix":"2f2f1bb1b354295f","entry":"process_arrhythmia","repo":"comp-well-org/esi","repo_kind":"official","path":"rag/rag_llamaindex.py","file_url":"https://github.com/comp-well-org/esi/blob/HEAD/rag/rag_llamaindex.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"2f2f1bb1b354295f"}},{"code_sha256_prefix":"d50f37a336cfbd4c","entry":"replace_linear","repo":"comp-well-org/esi","repo_kind":"official","path":"utils/utils.py","file_url":"https://github.com/comp-well-org/esi/blob/HEAD/utils/utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"d50f37a336cfbd4c"}},{"code_sha256_prefix":"42a5fef1553e9926","entry":"tokenize_collate_fn","repo":"comp-well-org/esi","repo_kind":"official","path":"utils/ecg_loader.py","file_url":"https://github.com/comp-well-org/esi/blob/HEAD/utils/ecg_loader.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"42a5fef1553e9926"}},{"code_sha256_prefix":"9149d2cbf1cf8d56","entry":"attrib_adaptiveconcatpool","repo":"comp-well-org/esi","repo_kind":"official","path":"model/basic_conv1d.py","file_url":"https://github.com/comp-well-org/esi/blob/HEAD/model/basic_conv1d.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"9149d2cbf1cf8d56"}},{"code_sha256_prefix":"9b5765523c6d17fd","entry":"freeze_batch_norm_2d","repo":"comp-well-org/esi","repo_kind":"official","path":"utils/utils.py","file_url":"https://github.com/comp-well-org/esi/blob/HEAD/utils/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"9b5765523c6d17fd"}},{"code_sha256_prefix":"068031704ecf4d57","entry":"perform_rag","repo":"comp-well-org/esi","repo_kind":"official","path":"rag/rag_llamaindex.py","file_url":"https://github.com/comp-well-org/esi/blob/HEAD/rag/rag_llamaindex.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"068031704ecf4d57"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}