Code Monkey home page Code Monkey logo

ecg-diffusion's Introduction

ECG Diffusion Model

Diffusion model for creating synthetic ECG signals. Data source: https://physionet.org/content/ltafdb/1.0.0/

Processed dataset is available here: https://huggingface.co/datasets/roszcz/ecg-segmentation-ltafdb or you can run preprocessing yourself using python prepare_dataset.py after downloading dataset.

Examples outputs (model trained for 1 epoch)

Generation

Synthetic signals

Denoising data

Denoised val samples

Samples from validation set were diffused with timestep 63, which doesn't destroy original data completely and then denoised using unet to check if model is able to generalize to different samples.

Training

To run training:

python train.py --config-name <config>

--config-name flag is used to specify config name, it needs to be in configs directory

Testing

If you wish to test model you can run sample test scripts located tests directory.

python tests/test_sampling.py

Checkpoints are available here: https://huggingface.co/JasiekKaczmarczyk/ecg-diffusion

Code Style

This repository uses pre-commit hooks with forced python formatting (black, flake8, and isort):

pip install pre-commit
pre-commit install

Whenever you execute git commit the files altered / added within the commit will be checked and corrected. black and isort can modify files locally - if that happens you have to git add them again. You might also be prompted to introduce some fixes manually.

To run the hooks against all files without running git commit:

pre-commit run --all-files

ecg-diffusion's People

Contributors

jasiekkaczmarczyk avatar

Stargazers

 avatar  avatar  avatar

Watchers

Tomek Roszczynialski avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.