Skip to content
/ ECG Public

A library for assisting in diagnostics of heart conditions from ECG

License

Notifications You must be signed in to change notification settings

aimclub/ECG

Repository files navigation

logo

ECG Recognition Library

This repository contains ECG Recognition Library - an open-source library for assisting in diagnostics of heart conditions from ECG. This library provides functionality of heart condition detection, differential diagnostics, and risk markers evaluation. The library handles ECGs in both formats, as signal or as a photo.

Project Description

ECG Features

ECG Recognition Library provides tools for diagnosistcs of several conditions:

  • MI (Myocardial Infarction)
  • BER (Benign Early Repolarisation)
  • HYP (Hypertrophy)
  • STTC (ST/T Change)
  • CD (Conduction Disturbance)

Main features implemented in the library

  1. Recognition of ECG signal from a photo of printed ECG
  2. Detection of ST-elevation
  3. MI risk markers evaluation
  4. MI/BER differential diagnosis
  5. Health check for MI, HYP, STTC, CD

Thus compared to other frameworks, ECG Recognition Library:

  • Handles ECGs provised as a signal as well as an image
  • Provides a range of functionality useful for MI diagnostics
  • Provides health checks for several conditions

project_structure_signal project_structure_ddx

Details of implemented methods.

Data Requirement

  • Required ECG frequency: 500 Hz
  • Required length: ≥ 5s

Additional image requirement:

  • Image should contain only ECG
    • no background
    • no foreign objects
  • Each image should contain only one lead

Installation

Requirements: Python 3.7

  1. [optional] create Python environment, e.g.
    $ conda create -n ECG python=3.7
    $ conda activate ECG
    
  2. install requirements from requirements.txt
    $ pip install -r requirements.txt
    
  3. install the library as a package
    $ python -m pip install git+ssh://[email protected]/aimclub/ECG
    

Development

Environment

Requirements: Python 3.7

  1. [optional] create Python environment, e.g.
    $ conda create -n ECG python=3.7
    $ conda activate ECG
    
  2. clone repository and install all requirements
    $ git clone [email protected]:aimclub/ECG.git
    $ cd ECG
    $ pip install -r requirements.txt
    
  3. run tests
    $ pytest tests/unit_tests.py
    $ pytest tests/integration_tests.py
    
  4. fix code style to match PEP8 automatically with autopep8
    $ pip install autopep8==1.6.0
    $ autopep8 --max-line-length=90 -i -r ECG
    $ autopep8 --max-line-length=90 -i -r tests
    
  5. check that code style matches PEP8
    $ pip install pycodestyle==2.8.0
    $ pycodestyle --max-line-length=90 --ignore=E266 ECG
    $ pycodestyle --max-line-length=90 --ignore=E266 tests
    
  6. build a PyPi package locally
    $ python3 -m pip install --upgrade build
    $ python3 -m build
    

Documentation

The general description is available here.

ECG Recognition Library API is available here

Examples & Tutorials

We provide a tutorial demonstrating suggested usage pipeline

Contribution Guide

The contribution guide is available in the repository.

Publications about ECG Recognition Library

In Russian:

  • Ватьян А.С., Гусарова Н.Ф., Змиевский Д.А., Кабышев М.А., Передреев Д.А., Полевая Т.А., Татаринова А.А., Томилов И.В.Автоматизированная оценка параметров ЭКГ в условиях пандемии COVID-19. Scientific and Technical Journal of Information Technologies, Mechanics and Optics, 2022, vol. 22, no. 5, in press
  • Пчелкин А.Ю., Гусарова Н.Ф. Кроссплатформенная разработка на базе вебтехнологий для поддержки решений в проблемно-ориентированных системах управления // Экономика. Право. Инновации. 2022. № 1. С. 41–47. http://dx.doi.org/10.17586/2713-1874-2022-1-41-47.

Acknowledgments

Affiliation

itmo_logo

The library was developed in ITMO University.

Developers

  • A. Vatyan - team leader
  • N. Gusarova - chief scientific advisor
  • T. Polevaya
  • D. Zmievsky
  • D. Peredreev
  • M. Kabyshev

Contacts

About

A library for assisting in diagnostics of heart conditions from ECG

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages