{"id":13703467,"url":"https://github.com/analysiscenter/cardio","last_synced_at":"2026-01-21T02:38:54.634Z","repository":{"id":98860550,"uuid":"109618565","full_name":"analysiscenter/cardio","owner":"analysiscenter","description":"CardIO is a library for data science research of heart signals","archived":false,"fork":false,"pushed_at":"2024-06-17T22:38:29.000Z","size":9929,"stargazers_count":253,"open_issues_count":1,"forks_count":79,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-05-05T07:40:32.457Z","etag":null,"topics":["data-science","deep-learning","deep-neural-networks","healthcare","machine-learning","python"],"latest_commit_sha":null,"homepage":"https://analysiscenter.github.io/cardio/","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/analysiscenter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-05T21:37:17.000Z","updated_at":"2025-04-13T18:05:58.000Z","dependencies_parsed_at":"2024-11-13T10:41:38.934Z","dependency_job_id":null,"html_url":"https://github.com/analysiscenter/cardio","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/analysiscenter/cardio","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analysiscenter%2Fcardio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analysiscenter%2Fcardio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analysiscenter%2Fcardio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analysiscenter%2Fcardio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/analysiscenter","download_url":"https://codeload.github.com/analysiscenter/cardio/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analysiscenter%2Fcardio/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28623737,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T23:49:58.628Z","status":"online","status_checked_at":"2026-01-21T02:00:08.227Z","response_time":86,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-science","deep-learning","deep-neural-networks","healthcare","machine-learning","python"],"created_at":"2024-08-02T21:00:55.265Z","updated_at":"2026-01-21T02:38:54.615Z","avatar_url":"https://github.com/analysiscenter.png","language":"Jupyter Notebook","funding_links":[],"categories":["Cardiology","Jupyter Notebook"],"sub_categories":["Packages"],"readme":"# CardIO\n\n`CardIO` is designed to build end-to-end machine learning models for deep research of electrocardiograms.\n\nMain features:\n\n* load and save signals in various formats: WFDB, DICOM, EDF, XML (Schiller), etc.\n* resample, crop, flip and filter signals\n* detect PQ, QT, QRS segments\n* calculate heart rate and other ECG characteristics\n* perform complex processing like fourier and wavelet transformations\n* apply custom functions to the data\n* recognize heart diseases (e.g. atrial fibrillation)\n* efficiently work with large datasets that do not even fit into memory\n* perform end-to-end ECG processing\n* build, train and test neural networks and other machine learning models\n\nFor more details see [the documentation and tutorials](https://analysiscenter.github.io/cardio/).\n\n\n## About CardIO\n\n\u003e CardIO is based on [BatchFlow](https://github.com/analysiscenter/batchflow). You might benefit from reading [its documentation](https://analysiscenter.github.io/batchflow).\nHowever, it is not required, especially at the beginning.\n\n\nCardIO has three modules: [``core``](https://analysiscenter.github.io/cardio/modules/core.html),\n[``models``](https://analysiscenter.github.io/cardio/modules/models.html) and\n[``pipelines``](https://analysiscenter.github.io/cardio/modules/pipelines.html).\n\n\n``core`` module contains ``EcgBatch`` and ``EcgDataset`` classes.\n``EcgBatch`` defines how ECGs are stored and includes actions for ECG processing. These actions might be used to build multi-staged workflows that can also involve machine learning models. ``EcgDataset`` is a class that stores indices of ECGs and generates batches of type ``EcgBatch``.\n\n``models`` module provides several ready to use models for important problems in ECG analysis:\n\n* how to detect specific features of ECG like R-peaks, P-wave, T-wave, etc\n* how to recognize heart diseases from ECG, for example, atrial fibrillation\n\n``pipelines`` module contains predefined workflows to\n\n* train a model and perform an inference to detect PQ, QT, QRS segments and calculate heart rate\n* train a model and perform an inference to find probabilities of heart diseases, in particular, atrial fibrillation\n\n\n## Basic usage\n\nHere is an example of a pipeline that loads ECG signals, makes preprocessing and trains a model for 50 epochs:\n```python\ntrain_pipeline = (\n  ds.Pipeline()\n    .init_model(\"dynamic\", DirichletModel, name=\"dirichlet\", config=model_config)\n    .init_variable(\"loss_history\", init_on_each_run=list)\n    .load(components=[\"signal\", \"meta\"], fmt=\"wfdb\")\n    .load(components=\"target\", fmt=\"csv\", src=LABELS_PATH)\n    .drop_labels([\"~\"])\n    .rename_labels({\"N\": \"NO\", \"O\": \"NO\"})\n    .flip_signals()\n    .random_resample_signals(\"normal\", loc=300, scale=10)\n    .random_split_signals(2048, {\"A\": 9, \"NO\": 3})\n    .binarize_labels()\n    .train_model(\"dirichlet\", make_data=concatenate_ecg_batch, fetches=\"loss\", save_to=V(\"loss_history\"), mode=\"a\")\n    .run(batch_size=100, shuffle=True, drop_last=True, n_epochs=50)\n)\n```\n\n\n## Installation\n\n\u003e `CardIO` module is in the beta stage. Your suggestions and improvements are very welcome.\n\n\u003e `CardIO` supports python 3.5 or higher.\n\n\n### Installation as a python package\n\nWith [pipenv](https://docs.pipenv.org/):\n\n    pipenv install git+https://github.com/analysiscenter/cardio.git#egg=cardio\n\nWith [pip](https://pip.pypa.io/en/stable/):\n\n    pip3 install git+https://github.com/analysiscenter/cardio.git\n\nAfter that just import `cardio`:\n```python\nimport cardio\n```\n\n\n### Installation as a project repository\n\nWhen cloning repo from GitHub use flag ``--recursive`` to make sure that ``batchflow`` submodule is also cloned.\n\n    git clone --recursive https://github.com/analysiscenter/cardio.git\n\n\n## Citing CardIO\n\nPlease cite CardIO in your publications if it helps your research.\n\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1156085.svg)](https://doi.org/10.5281/zenodo.1156085)\n\n    Khudorozhkov R., Illarionov E., Kuvaev A., Podvyaznikov D. CardIO library for deep research of heart signals. 2017.\n\n```\n@misc{cardio_2017_1156085,\n  author       = {R. Khudorozhkov and E. Illarionov and A. Kuvaev and D. Podvyaznikov},\n  title        = {CardIO library for deep research of heart signals},\n  year         = 2017,\n  doi          = {10.5281/zenodo.1156085},\n  url          = {https://doi.org/10.5281/zenodo.1156085}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanalysiscenter%2Fcardio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanalysiscenter%2Fcardio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanalysiscenter%2Fcardio/lists"}