{"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/towards-quantitative-precision-for-ecg","title":"Towards quantitative precision for ECG analysis: Leveraging state space models, self-supervision and patient metadata","arxiv_id":"2308.15291","date":"2023-08-29","proceeding":null,"authors":["Temesgen Mehari","Nils Strodthoff"],"abstract":"Deep learning has emerged as the preferred modeling approach for automatic ECG analysis. In this study, we investigate three elements aimed at improving the quantitative accuracy of such systems. These components consistently enhance performance beyond the existing state-of-the-art, which is predominantly based on convolutional models. Firstly, we explore more expressive architectures by exploiting structured state space models (SSMs). These models have shown promise in capturing long-term dependencies in time series data. By incorporating SSMs into our approach, we not only achieve better performance, but also gain insights into long-standing questions in the field. Specifically, for standard diagnostic tasks, we find no advantage in using higher sampling rates such as 500Hz compared to 100Hz. Similarly, extending the input size of the model beyond 3 seconds does not lead to significant improvements. Secondly, we demonstrate that self-supervised learning using contrastive predictive coding can further improve the performance of SSMs. By leveraging self-supervision, we enable the model to learn more robust and representative features, leading to improved analysis accuracy. Lastly, we depart from synthetic benchmarking scenarios and incorporate basic demographic metadata alongside the ECG signal as input. This inclusion of patient metadata departs from the conventional practice of relying solely on the signal itself. Remarkably, this addition consistently yields positive effects on predictive performance. We firmly believe that all three components should be considered when developing next-generation ECG analysis algorithms.","url_abs":"https://arxiv.org/abs/2308.15291v1","url_pdf":"https://arxiv.org/pdf/2308.15291v1.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":"towards-quantitative-precision-for-ecg","repo_url":"https://github.com/tmehari/ssm_ecg","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"benchmarking","task_name":"Benchmarking"},{"task_slug":"diagnostic","task_name":"Diagnostic"},{"task_slug":"self-supervised-learning","task_name":"Self-Supervised Learning"},{"task_slug":"state-space-models","task_name":"State Space Models"}],"methods":[{"method_slug":"contrastive-predictive-coding","method_name":"Contrastive Predictive Coding"},{"method_slug":"infonce","method_name":"InfoNCE"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2308.15291","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2308.15291"}},"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/tmehari/ssm_ecg","reach":null}],"summary":{"ran_honours":3,"ran_draft_wrong":2,"unverified":2},"by_repo_kind":{"official":{"samples":7,"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":0,"samples":[{"code_sha256_prefix":"f49db14836b035d6","entry":"cat","repo":"tmehari/ssm_ecg","repo_kind":"official","path":"code/train_ecg_model.py","file_url":"https://github.com/tmehari/ssm_ecg/blob/HEAD/code/train_ecg_model.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f49db14836b035d6"}},{"code_sha256_prefix":"7dcebcf902c5c695","entry":"configure_optimizer","repo":"tmehari/ssm_ecg","repo_kind":"official","path":"code/finetuning.py","file_url":"https://github.com/tmehari/ssm_ecg/blob/HEAD/code/finetuning.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7dcebcf902c5c695"}},{"code_sha256_prefix":"af782b24118dedfb","entry":"get_loss_from_output","repo":"tmehari/ssm_ecg","repo_kind":"official","path":"code/train_ecg_model.py","file_url":"https://github.com/tmehari/ssm_ecg/blob/HEAD/code/train_ecg_model.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"af782b24118dedfb"}},{"code_sha256_prefix":"482685ef2356a018","entry":"get_new_state_dict","repo":"tmehari/ssm_ecg","repo_kind":"official","path":"code/finetuning.py","file_url":"https://github.com/tmehari/ssm_ecg/blob/HEAD/code/finetuning.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"482685ef2356a018"}},{"code_sha256_prefix":"76ec45b4b876760c","entry":"mean","repo":"tmehari/ssm_ecg","repo_kind":"official","path":"code/train_ecg_model.py","file_url":"https://github.com/tmehari/ssm_ecg/blob/HEAD/code/train_ecg_model.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"76ec45b4b876760c"}},{"code_sha256_prefix":"38759ed71f26ef44","entry":"add_model_specific_args","repo":"tmehari/ssm_ecg","repo_kind":"official","path":"code/pretraining.py","file_url":"https://github.com/tmehari/ssm_ecg/blob/HEAD/code/pretraining.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"38759ed71f26ef44"}},{"code_sha256_prefix":"a610f4fbc9fdf111","entry":"adjust","repo":"tmehari/ssm_ecg","repo_kind":"official","path":"code/finetuning.py","file_url":"https://github.com/tmehari/ssm_ecg/blob/HEAD/code/finetuning.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a610f4fbc9fdf111"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}