{"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/diffusion-based-conditional-ecg-generation","title":"Diffusion-based Conditional ECG Generation with Structured State Space Models","arxiv_id":"2301.08227","date":"2023-01-19","proceeding":null,"authors":["Juan Miguel Lopez Alcaraz","Nils Strodthoff"],"abstract":"Synthetic data generation is a promising solution to address privacy issues with the distribution of sensitive health data. Recently, diffusion models have set new standards for generative models for different data modalities. Also very recently, structured state space models emerged as a powerful modeling paradigm to capture long-term dependencies in time series. We put forward SSSD-ECG, as the combination of these two technologies, for the generation of synthetic 12-lead electrocardiograms conditioned on more than 70 ECG statements. Due to a lack of reliable baselines, we also propose conditional variants of two state-of-the-art unconditional generative models. We thoroughly evaluate the quality of the generated samples, by evaluating pretrained classifiers on the generated data and by evaluating the performance of a classifier trained only on synthetic data, where SSSD-ECG clearly outperforms its GAN-based competitors. We demonstrate the soundness of our approach through further experiments, including conditional class interpolation and a clinical Turing test demonstrating the high quality of the SSSD-ECG samples across a wide range of conditions.","url_abs":"https://arxiv.org/abs/2301.08227v2","url_pdf":"https://arxiv.org/pdf/2301.08227v2.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":"diffusion-based-conditional-ecg-generation","repo_url":"https://github.com/ai4healthuol/sssd-ecg","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"state-space-models","task_name":"State Space Models"},{"task_slug":"synthetic-data-generation","task_name":"Synthetic Data Generation"},{"task_slug":"time-series-1","task_name":"Time Series"},{"task_slug":"time-series","task_name":"Time Series Analysis"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"},{"method_slug":"test","method_name":"Test"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2301.08227","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2301.08227"}},"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/ai4healthuol/sssd-ecg","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":6,"ran":3,"unverified":5},"by_repo_kind":{"official":{"samples":14,"ran":9,"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":"0f786c407fb1ee4c","entry":"swish","repo":"ai4healthuol/sssd-ecg","repo_kind":"official","path":"src/sssd/models/SSSD_ECG.py","file_url":"https://github.com/ai4healthuol/sssd-ecg/blob/HEAD/src/sssd/models/SSSD_ECG.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":2,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0f786c407fb1ee4c"}},{"code_sha256_prefix":"89b10a8b26bbb7ed","entry":"Activation","repo":"ai4healthuol/sssd-ecg","repo_kind":"official","path":"src/sssd/models/S4Model.py","file_url":"https://github.com/ai4healthuol/sssd-ecg/blob/HEAD/src/sssd/models/S4Model.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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"89b10a8b26bbb7ed"}},{"code_sha256_prefix":"745f173f5a730552","entry":"find_max_epoch","repo":"ai4healthuol/sssd-ecg","repo_kind":"official","path":"src/sssd/utils/util.py","file_url":"https://github.com/ai4healthuol/sssd-ecg/blob/HEAD/src/sssd/utils/util.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"745f173f5a730552"}},{"code_sha256_prefix":"c711b513a9afe00d","entry":"flatten","repo":"ai4healthuol/sssd-ecg","repo_kind":"official","path":"src/sssd/utils/util.py","file_url":"https://github.com/ai4healthuol/sssd-ecg/blob/HEAD/src/sssd/utils/util.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c711b513a9afe00d"}},{"code_sha256_prefix":"49d9214ec79a8edb","entry":"get_initializer","repo":"ai4healthuol/sssd-ecg","repo_kind":"official","path":"src/sssd/models/S4Model.py","file_url":"https://github.com/ai4healthuol/sssd-ecg/blob/HEAD/src/sssd/models/S4Model.py","link_basis":"harvester_set","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":"49d9214ec79a8edb"}},{"code_sha256_prefix":"61139ec62260b411","entry":"get_logger","repo":"ai4healthuol/sssd-ecg","repo_kind":"official","path":"src/sssd/models/S4Model.py","file_url":"https://github.com/ai4healthuol/sssd-ecg/blob/HEAD/src/sssd/models/S4Model.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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"61139ec62260b411"}},{"code_sha256_prefix":"d3d2b2f127241f47","entry":"std_normal","repo":"ai4healthuol/sssd-ecg","repo_kind":"official","path":"src/sssd/utils/util.py","file_url":"https://github.com/ai4healthuol/sssd-ecg/blob/HEAD/src/sssd/utils/util.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d3d2b2f127241f47"}},{"code_sha256_prefix":"3a626a74af8a198b","entry":"stratified_subsets","repo":"ai4healthuol/sssd-ecg","repo_kind":"official","path":"src/ptb_xl/clinical_ts/stratify.py","file_url":"https://github.com/ai4healthuol/sssd-ecg/blob/HEAD/src/ptb_xl/clinical_ts/stratify.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3a626a74af8a198b"}},{"code_sha256_prefix":"9405c50464b7385f","entry":"stratify_batched","repo":"ai4healthuol/sssd-ecg","repo_kind":"official","path":"src/ptb_xl/clinical_ts/stratify.py","file_url":"https://github.com/ai4healthuol/sssd-ecg/blob/HEAD/src/ptb_xl/clinical_ts/stratify.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9405c50464b7385f"}},{"code_sha256_prefix":"08bc532c558ef11c","entry":"calc_gradient_penalty","repo":"ai4healthuol/sssd-ecg","repo_kind":"official","path":"src/baselines/utils/utils.py","file_url":"https://github.com/ai4healthuol/sssd-ecg/blob/HEAD/src/baselines/utils/utils.py","link_basis":"harvester_set","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":"08bc532c558ef11c"}},{"code_sha256_prefix":"7b4d8ff01c1c340c","entry":"generate_four_leads","repo":"ai4healthuol/sssd-ecg","repo_kind":"official","path":"src/sssd/inference.py","file_url":"https://github.com/ai4healthuol/sssd-ecg/blob/HEAD/src/sssd/inference.py","link_basis":"harvester_set","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":"7b4d8ff01c1c340c"}},{"code_sha256_prefix":"e0e92b77185b9c56","entry":"get_available_channels","repo":"ai4healthuol/sssd-ecg","repo_kind":"official","path":"src/ptb_xl/clinical_ts/ecg_utils.py","file_url":"https://github.com/ai4healthuol/sssd-ecg/blob/HEAD/src/ptb_xl/clinical_ts/ecg_utils.py","link_basis":"harvester_set","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":"e0e92b77185b9c56"}},{"code_sha256_prefix":"2bb5c59ccfefe256","entry":"get_filename_out","repo":"ai4healthuol/sssd-ecg","repo_kind":"official","path":"src/ptb_xl/clinical_ts/ecg_utils.py","file_url":"https://github.com/ai4healthuol/sssd-ecg/blob/HEAD/src/ptb_xl/clinical_ts/ecg_utils.py","link_basis":"harvester_set","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":"2bb5c59ccfefe256"}},{"code_sha256_prefix":"e740a0f4139a1c0f","entry":"split_stratified","repo":"ai4healthuol/sssd-ecg","repo_kind":"official","path":"src/ptb_xl/clinical_ts/stratify.py","file_url":"https://github.com/ai4healthuol/sssd-ecg/blob/HEAD/src/ptb_xl/clinical_ts/stratify.py","link_basis":"harvester_set","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":"e740a0f4139a1c0f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}