# CardIO
`CardIO` is designed to build end-to-end machine learning models for deep research of electrocardiograms.
Main features:
* load and save signals in various formats: WFDB, DICOM, EDF, XML (Schiller), etc.
* resample, crop, flip and filter signals
* detect PQ, QT, QRS segments
* calculate heart rate and other ECG characteristics
* perform complex processing like fourier and wavelet transformations
* apply custom functions to the data
* recognize heart diseases (e.g. atrial fibrillation)
* efficiently work with large datasets that do not even fit into memory
* perform end-to-end ECG processing
* build, train and test neural networks and other machine learning models
For more details see [the documentation and tutorials](https://analysiscenter.github.io/cardio/).
## About CardIO
> CardIO is based on [BatchFlow](https://github.com/analysiscenter/batchflow). You might benefit from reading [its documentation](https://analysiscenter.github.io/batchflow).
However, it is not required, especially at the beginning.
CardIO has three modules: [``core``](https://analysiscenter.github.io/cardio/modules/core.html),
[``models``](https://analysiscenter.github.io/cardio/modules/models.html) and
[``pipelines``](https://analysiscenter.github.io/cardio/modules/pipelines.html).
``core`` module contains ``EcgBatch`` and ``EcgDataset`` classes.
``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``.
``models`` module provides several ready to use models for important problems in ECG analysis:
* how to detect specific features of ECG like R-peaks, P-wave, T-wave, etc
* how to recognize heart diseases from ECG, for example, atrial fibrillation
``pipelines`` module contains predefined workflows to
* train a model and perform an inference to detect PQ, QT, QRS segments and calculate heart rate
* train a model and perform an inference to find probabilities of heart diseases, in particular, atrial fibrillation
## Basic usage
Here is an example of a pipeline that loads ECG signals, makes preprocessing and trains a model for 50 epochs:
```python
train_pipeline = (
ds.Pipeline()
.init_model("dynamic", DirichletModel, name="dirichlet", config=model_config)
.init_variable("loss_history", init_on_each_run=list)
.load(components=["signal", "meta"], fmt="wfdb")
.load(components="target", fmt="csv", src=LABELS_PATH)
.drop_labels(["~"])
.rename_labels({"N": "NO", "O": "NO"})
.flip_signals()
.random_resample_signals("normal", loc=300, scale=10)
.random_split_signals(2048, {"A": 9, "NO": 3})
.binarize_labels()
.train_model("dirichlet", make_data=concatenate_ecg_batch, fetches="loss", save_to=V("loss_history"), mode="a")
.run(batch_size=100, shuffle=True, drop_last=True, n_epochs=50)
)
```
## Installation
> `CardIO` module is in the beta stage. Your suggestions and improvements are very welcome.
> `CardIO` supports python 3.5 or higher.
### Installation as a python package
With [pipenv](https://docs.pipenv.org/):
pipenv install git+https://github.com/analysiscenter/cardio.git#egg=cardio
With [pip](https://pip.pypa.io/en/stable/):
pip3 install git+https://github.com/analysiscenter/cardio.git
After that just import `cardio`:
```python
import cardio
```
### Installation as a project repository
When cloning repo from GitHub use flag ``--recursive`` to make sure that ``batchflow`` submodule is also cloned.
git clone --recursive https://github.com/analysiscenter/cardio.git
## Citing CardIO
Please cite CardIO in your publications if it helps your research.
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1156085.svg)](https://doi.org/10.5281/zenodo.1156085)
Khudorozhkov R., Illarionov E., Kuvaev A., Podvyaznikov D. CardIO library for deep research of heart signals. 2017.
```
@misc{cardio_2017_1156085,
author = {R. Khudorozhkov and E. Illarionov and A. Kuvaev and D. Podvyaznikov},
title = {CardIO library for deep research of heart signals},
year = 2017,
doi = {10.5281/zenodo.1156085},
url = {https://doi.org/10.5281/zenodo.1156085}
}
```
没有合适的资源?快使用搜索试试~ 我知道了~
CardIO是一个用于心脏信号数据科学研究的图书馆__Jupyter Notebook_下载.zip
共81个文件
py:23个
rst:10个
ipynb:9个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 73 浏览量
2023-04-27
10:55:14
上传
评论
收藏 2.82MB ZIP 举报
温馨提示
CardIO是一个用于心脏信号数据科学研究的图书馆__Jupyter Notebook_下载.zip
资源推荐
资源详情
资源评论
收起资源包目录
CardIO是一个用于心脏信号数据科学研究的图书馆__Jupyter Notebook_下载.zip (81个子文件)
cardio-master
RELEASE.md 2KB
setup.py 2KB
.gitattributes 184B
pylintrc 488B
LICENSE 11KB
cardio
__init__.py 162B
pipelines
__init__.py 91B
pipelines.py 12KB
batchflow
tests
data
sel100.dat 659KB
sample.xml 285KB
A00013.hea 80B
sample.dcm 143KB
A00002.mat 18KB
A00013.mat 18KB
A00005.mat 35KB
sample.wav 352KB
A00004.mat 18KB
sel100.pu1 36KB
REFERENCE.csv 54B
A00001.mat 18KB
A00004.hea 82B
A00001.hea 83B
sel100.hea 214B
sel100.atr 2KB
A00002.hea 82B
A00008.mat 35KB
sample.edf 24KB
A00008.hea 84B
A00005.hea 84B
test_ecgbatch.py 17KB
core
utils.py 3KB
__init__.py 132B
ecg_dataset.py 1KB
ecg_batch_tools.py 24KB
kernels.py 1KB
ecg_batch.py 54KB
models
__init__.py 251B
metrics.py 7KB
hmm
__init__.py 87B
hmmodel_training.ipynb 166KB
hmm.py 5KB
keras_custom_objects.py 6KB
layers.py 3KB
fft_model
__init__.py 65B
fft_model.py 2KB
fft_model_training.ipynb 33KB
dirichlet_model
__init__.py 106B
dirichlet_model.py 9KB
dirichlet_model_training.ipynb 154KB
requirements-shippable.txt 16B
CONTRIBUTING.md 4KB
examples
Load_XML.ipynb 549KB
Getting_started.ipynb 91KB
docs
index.rst 4KB
make.bat 768B
tutorials.rst 1KB
Makefile 607B
modules
hmmodel.png 56KB
models.rst 6KB
fft_model.PNG 27KB
modules.rst 87B
dirichlet_model.png 24KB
core.rst 2KB
pipelines.rst 3KB
api
models.rst 704B
core.rst 2KB
api.rst 73B
pipelines.rst 572B
conf.py 5KB
shippable.yml 748B
.gitmodules 109B
requirements.txt 16B
MANIFEST.in 323B
.gitignore 60B
README.md 4KB
tutorials
I.CardIO.ipynb 993KB
II.Pipelines.ipynb 345KB
conv_block.PNG 16KB
IV.Research.ipynb 21KB
III.Models.ipynb 257KB
pn2017_data_to_wfdb_format.py 2KB
共 81 条
- 1
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9154
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 3层独栋别墅图纸编号D055-三层-26.00&20.50米- 施工图.dwg
- 三层别墅图纸编号D054-三层-17.70&15.00米-施工图.DWG
- 三层别墅图纸编号D053-三层-16.59&19.58米-施工图.dwg
- 三层别墅图纸编号D052-三层-13.40&17.77米- 施工图.dwg
- 某日温度曲线以及日负荷曲线数据
- 全新STC12C5A60S2单片机+LCD19264大屏万年历农历生肖节气节日显示+闹钟+温湿度+台灯.rar
- 流水灯(库函数)三个灯依次亮灭
- 3层独栋别墅图纸编号D051-三层-10.14&17.04米- 施工图.dwg
- 常用的MIME TYPE类型枚举类Enum整理 静态方法直接检索使用
- Python网络爬虫实际例子代码
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功