Git Product home page Git Product logo

jmx-ecg-benchmark's Introduction

JMX Benchmark Analysis for heartbeat detectors

A benchmarking analysis method that generates an overall benchmark for ECG detector algorithms, based on measurements of temporal jitter (J), missed beats (M) and extra detections (X), as these are the three ways errors show up independent of the source of the error. The Glasgow University GUDB ECG recordings database (Howell and Porr, 2018) is used for testing as it has annotated R-peaks for reference. The detector algorithms are tested using recordings for all subjects, all exercises, and Einthoven II and chest strap leads (Einthoven I and Einthoven III can additionally be used if desired).

The benchmark gives a score between 0-100 where 100 is defined as the ideal detector. The ideal detector has no extra beats, no missed beats, and a mean absolute deviation (MAD) of zero for temporal jitter when using our interval analysis method. The benchmark is independent of application-specific performance to truly represent an overall score that can be compared across applications encompassing all the ways errors show up in ECG heartbeat detection.

Prerequisites

Install py-ecg-detectors (Howell and Porr, 2019).

Linux / Mac:

pip3 install py-ecg-detectors [--user]

Windows:

pip install py-ecg-detectors [--user]

From source:

python3 setup.py install [--user]

Use the option --user if you don't have system-wise write permission.


Install ecg_gudb_database (Howell and Porr, 2018) via the package manager pip or pip3 which is a version of the pip installer for Python3.

pip install ecg_gudb_database
pip3 install ecg_gudb_database

Usage

jmx_analysis.py

JMX analysis of interval variation, missed beat and extra detection positions:

evaluate(det_posn, anno_R, fs, nSamples, trim=True)

Arguments:

- det_posn: the timestamps of the detector in sample positions
- anno_R: the ground truth in samples
- fs: sampling rate of the ECG file
- nSamples: number of samples in the ECG file
- trim: trims 2 detections from start/end of det_posn/anno_R

Returns:

- jmx[key_jitter]   : jitter in s
- jmx[key_tp]       : true positive beats
- jmx[key_tn]       : true negative beats
- jmx[key_fp]       : false positive beats
- jmx[key_fn]       : false negative beats
- jmx[key_accuracy] : accuracy
- jmx[key_jmx]      : JMX Score

jmx_evaluate_all_detectors.py

The code evaluates all ECG detectors with all subjects, all leads, and all experiments. It outputs separate json files for every detector and stores them in the results directory.

jmx_stats_plots.py

The overall JMX Benchmark values for Einthoven II and chest strap results are shown together on a bar graph for comparison for sitting and jogging.

alt tag

Traditional sensitivity analysis

For a sensitivity analysis on an fs/10 samples temporal window run:

python sensitivity_evaluate_all_detectors.py
python sensitivity_stats_plots.py

alt tag

Note that a pure sensitivity analysis on a wide temporal window yields mostly 99-100% sensitivity.

Credit

jmx-ecg-benchmark's People

Contributors

berndporr avatar eleanorforsyth avatar

Watchers

James Cloos 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.