{"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-chat-a-large-ecg-language-model-for","title":"ECG-Chat: A Large ECG-Language Model for Cardiac Disease Diagnosis","arxiv_id":"2408.08849","date":"2024-08-16","proceeding":null,"authors":["Yubao Zhao","Jiaju Kang","Tian Zhang","Puyu Han","Tong Chen"],"abstract":"The success of Multimodal Large Language Models (MLLMs) in the medical auxiliary field shows great potential, allowing patients to engage in conversations using physiological signal data. However, general MLLMs perform poorly in cardiac disease diagnosis, particularly in the integration of ECG data analysis and medical report generation, mainly due to the complexity of ECG data analysis and the gap between text and ECG signal modalities. To address these issues, we propose ECG-Chat, a multitask MLLMs focused on ECG medical report generation, providing multimodal conversational capabilities based on cardiology knowledge. We propose a contrastive learning approach that integrates ECG waveform data with text reports, aligning ECG features with reports in a fine-grained manner. This method also results in an ECG encoder that excels in zero-shot report retrieval tasks. Additionally, expanding existing datasets, we constructed a 19k ECG diagnosis dataset and a 25k multi-turn dialogue dataset for training and fine-tuning ECG-Chat, which provides professional diagnostic and conversational capabilities. Furthermore, ECG-Chat can generate comprehensive ECG analysis reports through an automated LaTeX generation pipeline. We established a benchmark for the ECG report generation task and tested our model on multiple baselines. ECG-Chat achieved the best performance in classification, retrieval, and medical report generation tasks. Our code is available at https://github.com/YubaoZhao/ECG-Chat.","url_abs":"https://arxiv.org/abs/2408.08849v2","url_pdf":"https://arxiv.org/pdf/2408.08849v2.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-chat-a-large-ecg-language-model-for","repo_url":"https://github.com/YubaoZhao/ECG-Chat","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"contrastive-learning","task_name":"Contrastive Learning"},{"task_slug":"diagnostic","task_name":"Diagnostic"},{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"medical-report-generation","task_name":"Medical Report Generation"},{"task_slug":"retrieval","task_name":"Retrieval"},{"task_slug":"text-generation","task_name":"Text Generation"}],"methods":[{"method_slug":"contrastive-learning","method_name":"Contrastive Learning"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2408.08849","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2408.08849"}},"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/YubaoZhao/ECG-Chat","reach":{"status":"ok"}}],"summary":{"ran_violates":1,"ran_draft_wrong":2,"ran":2,"unverified":9},"by_repo_kind":{"official":{"samples":14,"ran":5,"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":"f19962ebb134b3d7","entry":"convert_to_custom_text_state_dict","repo":"YubaoZhao/ECG-Chat","repo_kind":"official","path":"open_clip/open_clip/model.py","file_url":"https://github.com/YubaoZhao/ECG-Chat/blob/HEAD/open_clip/open_clip/model.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f19962ebb134b3d7"}},{"code_sha256_prefix":"dcd422d66b0581d8","entry":"get_cast_dtype","repo":"YubaoZhao/ECG-Chat","repo_kind":"official","path":"open_clip/open_clip/model.py","file_url":"https://github.com/YubaoZhao/ECG-Chat/blob/HEAD/open_clip/open_clip/model.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"dcd422d66b0581d8"}},{"code_sha256_prefix":"b476c8cfbf0f1f47","entry":"get_input_dtype","repo":"YubaoZhao/ECG-Chat","repo_kind":"official","path":"open_clip/open_clip/model.py","file_url":"https://github.com/YubaoZhao/ECG-Chat/blob/HEAD/open_clip/open_clip/model.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b476c8cfbf0f1f47"}},{"code_sha256_prefix":"c3ee9d07c900dd55","entry":"load_image_from_base64","repo":"YubaoZhao/ECG-Chat","repo_kind":"official","path":"llava/llava/mm_utils.py","file_url":"https://github.com/YubaoZhao/ECG-Chat/blob/HEAD/llava/llava/mm_utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c3ee9d07c900dd55"}},{"code_sha256_prefix":"82c3cd0a861f967a","entry":"prepare_inputs_for_generation","repo":"YubaoZhao/ECG-Chat","repo_kind":"official","path":"open_clip/open_clip/coca_model.py","file_url":"https://github.com/YubaoZhao/ECG-Chat/blob/HEAD/open_clip/open_clip/coca_model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"82c3cd0a861f967a"}},{"code_sha256_prefix":"57299f471f530fdc","entry":"ecg_transform","repo":"YubaoZhao/ECG-Chat","repo_kind":"official","path":"open_clip/open_clip/ecg_transform.py","file_url":"https://github.com/YubaoZhao/ECG-Chat/blob/HEAD/open_clip/open_clip/ecg_transform.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"57299f471f530fdc"}},{"code_sha256_prefix":"e3d14dccb8dfdb3d","entry":"gather_features","repo":"YubaoZhao/ECG-Chat","repo_kind":"official","path":"open_clip/open_clip/loss.py","file_url":"https://github.com/YubaoZhao/ECG-Chat/blob/HEAD/open_clip/open_clip/loss.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e3d14dccb8dfdb3d"}},{"code_sha256_prefix":"fe18e00416933036","entry":"get_anyres_image_grid_shape","repo":"YubaoZhao/ECG-Chat","repo_kind":"official","path":"llava/llava/mm_utils.py","file_url":"https://github.com/YubaoZhao/ECG-Chat/blob/HEAD/llava/llava/mm_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"fe18e00416933036"}},{"code_sha256_prefix":"1a9aca74478a4cdf","entry":"merge_preprocess_dict","repo":"YubaoZhao/ECG-Chat","repo_kind":"official","path":"open_clip/open_clip/ecg_transform.py","file_url":"https://github.com/YubaoZhao/ECG-Chat/blob/HEAD/open_clip/open_clip/ecg_transform.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1a9aca74478a4cdf"}},{"code_sha256_prefix":"d4f0eacd30c75582","entry":"merge_preprocess_kwargs","repo":"YubaoZhao/ECG-Chat","repo_kind":"official","path":"open_clip/open_clip/ecg_transform.py","file_url":"https://github.com/YubaoZhao/ECG-Chat/blob/HEAD/open_clip/open_clip/ecg_transform.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d4f0eacd30c75582"}},{"code_sha256_prefix":"e332856e3c2fc814","entry":"neighbour_exchange","repo":"YubaoZhao/ECG-Chat","repo_kind":"official","path":"open_clip/open_clip/loss.py","file_url":"https://github.com/YubaoZhao/ECG-Chat/blob/HEAD/open_clip/open_clip/loss.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e332856e3c2fc814"}},{"code_sha256_prefix":"5b1fd364afcf3c05","entry":"neighbour_exchange_bidir","repo":"YubaoZhao/ECG-Chat","repo_kind":"official","path":"open_clip/open_clip/loss.py","file_url":"https://github.com/YubaoZhao/ECG-Chat/blob/HEAD/open_clip/open_clip/loss.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"5b1fd364afcf3c05"}},{"code_sha256_prefix":"980ca0620504653b","entry":"process_anyres_image","repo":"YubaoZhao/ECG-Chat","repo_kind":"official","path":"llava/llava/mm_utils.py","file_url":"https://github.com/YubaoZhao/ECG-Chat/blob/HEAD/llava/llava/mm_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"980ca0620504653b"}},{"code_sha256_prefix":"2a377da4a76a2d44","entry":"register_pooler","repo":"YubaoZhao/ECG-Chat","repo_kind":"official","path":"open_clip/open_clip/hf_model.py","file_url":"https://github.com/YubaoZhao/ECG-Chat/blob/HEAD/open_clip/open_clip/hf_model.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2a377da4a76a2d44"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}