Giter Site home page Giter Site logo

peikalunci / ecgan Goto Github PK

View Code? Open in Web Editor NEW

This project forked from emundo/ecgan

0.0 0.0 0.0 7.2 MB

ECGAN is a research project for ECG data generation and abnormalty detection (morphologies as well as arrhythmias).

License: Apache License 2.0

Python 99.83% Makefile 0.17%

ecgan's Introduction

ECGAN

ECGAN is a modular repository to train ML algorithms - and especially Generative Adversarial Networks (GANs) - on electrocardiographic data, even though the setup is generally suitable for arbitrary time series. While ECGAN also supports other tasks, such as classification using simple RNNs/CNNs, the focus lies on the generation of data using GANs. The GANs are trained on only the ''normal'' (for ECGs: healthy) class to learn the underlying representation of this class. The resulting GAN can be used to generate new healthy data or detect anomalies by comparing the synthetic data with the test data. ECGAN follows modular setup allows easy modifications to the different parts of this project, allowing researchers to simply download and preprocess various ECG datasets, train a variety models to generate realistic time series and apply a variety of anomaly detection mechanisms. ECGAN is built to be reproducible and easily expandable to allow fast prototyping and foster comparability and open source implementations by reducing the time required to implement models or preprocessing scenarios.

Parts of the implementation are still in an experimental state.

Installation

Unix

Make sure to have installed python3.8 and git.

  1. Clone the repository (using git clone)
  2. Setup the virtual environment (e.g.make env which executes virtualenv --python=/usr/bin/python3.8 .venv and activate the environment source .venv/bin/activate)
  3. Run make setup_dev in root if you want to develop. Run make setup if you only want to execute experiments.
  4. During Step 2, ecgan and all requirements will be installed.

Windows

If you want to use ecgan on Windows, you cannot use make without additional tools. You can either use chocolatey or similar tools to install make and use it. Otherwise, you can manually recreate the steps: Install virtualenv (pip install virtualenv), create the environment virtualenv --python=python3.8 .venv and activate the env (.venv\Scripts\activate) and install the packages (pip install -U -r requirements.txt)

How to use

The package comes with a convenient CLI and configuration over YAML-Files. By calling ecgan-init -d DATASET -m MODULE -o FILE_NAME.yml ENTITY PROJECT EXPERIMENT_NAME a configuration file is generated. This can be manually updated and contains most relevant hyperparameters. After possibly applying changes to the config file (lets say FILE_NAME) you can start the preprocessing of the chosen dataset using ecgan-preprocess FILE_NAME.yml before training the model by invoking ecgan-train FILE_NAME.yml. To perform anomaly detection, the -a model_reference flag is used (see docs for more information).

Data

We support several datasets will be used for evaluation: MIT-BIH (small amount of patients, long recordings, often used), the PTB ECG dataset as well as the Shaoxing dataset (many patients, smaller recordings, published recently).

Some of the datasets require setting up kaggle credentials or downloading it manually (see docs)

About

Project

ECGAN is an initiative of eMundo GmbH and the LMU Munich research group data mining in medicine supported by the Bavarian Research Foundation. The purpose of this initiative is to investigate anomaly detection in time series data, focusing on electrocardiogram data. Do not hesitate to reach out if you have any questions.

ecgan's People

Contributors

fietel 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.