ecg-quality


Nameecg-quality JSON
Version 0.2.0 PyPI version JSON
download
home_pagehttps://github.com/koledjoz/ecg_quality
SummaryLibrary that classifies quality of ECG signal using deep learning methods
upload_time2023-05-20 19:55:05
maintainer
docs_urlNone
authorJozef Koleda
requires_python
licensegpl-3.0
keywords ecg quality classification deep learning
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Library description
================

This library is meant to be used to check quality of ECG signal. Recordings of any length can be processed, memory is the only limit. The library work with three basic levels of quality:

 - Quality 1 : All important segment of ECG can be detected in the signal
 - Quality 2 : Noise is present, but the QRS complex can still be detected
 - Quality 3 : Noise is too large, not even QRS complex can be detected

Each model works with a sliding window. At each step, the window is evaluated using one of 4 models and one score from range 0 to 1 is returned. The length of sliding windows for individual models can be found in their names. The 4 supported models are:

- cnn2s
- cnn5s
- lstm2s
- oscnn2s

The stride of the sliding window can be specified. The class limits so this value is at least 1 second and is a divisor of the length of the sliding window. 

There are currently 4 return modes supported:
 

 - score : The model returns the score between 0 and 1. 0 is meant to represent quality 1, 0.5 to represent quality 2 and 1 to represent quality 3. This is however not given and the score distributions of different qualities can differ between models.
 - three_value : Three qualities are given using thresholds.
 - bin_clean : Signal is either marked as quality 1 or as quality 2/3
 - bin_qrs: Signal is either marked as quality 1/2 or as quality 3

The thresholds used in each of these modes, except of score, can be specified by the user. However, there are default thresholds, that aim to prioritize precision with the better classes. When using three_value, the returned values are one of 1, 2 and 3, depending on the quality of the signal. When using either of the binary modes, the returned values are either 1 or 2. 1 is for the better quality signal and 2 is for the worse quality.

In terms of length of output, there are two return_types supported:

 -  intervals : value is returned for each window of the size stride, since the value of the quality ill not change in these
 - full : value is returned for each value in the input

Models were trained on cleaned data. These data were cleaned using default NeuroKit2 ecg_clean method. The class can clean signal it is meant to process using ecg_clean. Currently only default version of ecg_clean us supported. It can be specified not to do this. However, it is advised to either use this option, or to pass cleaned signal to the method. We give no guarantee about the quality of the signal if uncleaned signal is processed and no cleaning is done..  

Signal processed must have frequency of 250 Hz. Signal of other frequencies is not supported as the models are not trained on such a signal.

Full explanation of all the modes can be found inside the source code documentation.

Installation
-------------

The library can be easily installed through the pip utility.

    pip install ecg-quality

Usage
-------
The library offers a high-level interface. The simplest example using all the default settings:

	from ecg_quality.ECGQualityChecker import ECGQualityChecker  
  
	checker = ECGQualityChecker()  
	 
	signal = ...	 
  
	output = checker.process_signal(signal)  
  


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/koledjoz/ecg_quality",
    "name": "ecg-quality",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "ECG,quality,classification,deep learning",
    "author": "Jozef Koleda",
    "author_email": "koledjoz@cvut.cz",
    "download_url": "https://files.pythonhosted.org/packages/e2/b0/24c8ef3c9e750e702a353af3c82c5d0caab42bfef043b996238f9f90a7ed/ecg_quality-0.2.0.tar.gz",
    "platform": null,
    "description": "Library description\r\n================\r\n\r\nThis library is meant to be used to check quality of ECG signal. Recordings of any length can be processed, memory is the only limit. The library work with three basic levels of quality:\r\n\r\n - Quality 1 : All important segment of ECG can be detected in the signal\r\n - Quality 2 : Noise is present, but the QRS complex can still be detected\r\n - Quality 3 : Noise is too large, not even QRS complex can be detected\r\n\r\nEach model works with a sliding window. At each step, the window is evaluated using one of 4 models and one score from range 0 to 1 is returned. The length of sliding windows for individual models can be found in their names. The 4 supported models are:\r\n\r\n- cnn2s\r\n- cnn5s\r\n- lstm2s\r\n- oscnn2s\r\n\r\nThe stride of the sliding window can be specified. The class limits so this value is at least 1 second and is a divisor of the length of the sliding window. \r\n\r\nThere are currently 4 return modes supported:\r\n \r\n\r\n - score : The model returns the score between 0 and 1. 0 is meant to represent quality 1, 0.5 to represent quality 2 and 1 to represent quality 3. This is however not given and the score distributions of different qualities can differ between models.\r\n - three_value : Three qualities are given using thresholds.\r\n - bin_clean : Signal is either marked as quality 1 or as quality 2/3\r\n - bin_qrs: Signal is either marked as quality 1/2 or as quality 3\r\n\r\nThe thresholds used in each of these modes, except of score, can be specified by the user. However, there are default thresholds, that aim to prioritize precision with the better classes. When using three_value, the returned values are one of 1, 2 and 3, depending on the quality of the signal. When using either of the binary modes, the returned values are either 1 or 2. 1 is for the better quality signal and 2 is for the worse quality.\r\n\r\nIn terms of length of output, there are two return_types supported:\r\n\r\n -  intervals : value is returned for each window of the size stride, since the value of the quality ill not change in these\r\n - full : value is returned for each value in the input\r\n\r\nModels were trained on cleaned data. These data were cleaned using default NeuroKit2 ecg_clean method. The class can clean signal it is meant to process using ecg_clean. Currently only default version of ecg_clean us supported. It can be specified not to do this. However, it is advised to either use this option, or to pass cleaned signal to the method. We give no guarantee about the quality of the signal if uncleaned signal is processed and no cleaning is done..  \r\n\r\nSignal processed must have frequency of 250 Hz. Signal of other frequencies is not supported as the models are not trained on such a signal.\r\n\r\nFull explanation of all the modes can be found inside the source code documentation.\r\n\r\nInstallation\r\n-------------\r\n\r\nThe library can be easily installed through the pip utility.\r\n\r\n    pip install ecg-quality\r\n\r\nUsage\r\n-------\r\nThe library offers a high-level interface. The simplest example using all the default settings:\r\n\r\n\tfrom ecg_quality.ECGQualityChecker import ECGQualityChecker  \r\n  \r\n\tchecker = ECGQualityChecker()  \r\n\t \r\n\tsignal = ...\t \r\n  \r\n\toutput = checker.process_signal(signal)  \r\n  \r\n\r\n",
    "bugtrack_url": null,
    "license": "gpl-3.0",
    "summary": "Library that classifies quality of ECG signal using deep learning methods",
    "version": "0.2.0",
    "project_urls": {
        "Download": "https://github.com/koledjoz/ecg_quality/releases/tag/v0.2.0",
        "Homepage": "https://github.com/koledjoz/ecg_quality"
    },
    "split_keywords": [
        "ecg",
        "quality",
        "classification",
        "deep learning"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ac81c41b48cdb30df30ca33a3c9695fd981afe760073a59b988ad89598673762",
                "md5": "fb176a8938a2cf875493eb4d85f30cda",
                "sha256": "bc9713b2ccc4ee65137f47f2293f83bb2ab2f8a848e016b0329c453264e38bba"
            },
            "downloads": -1,
            "filename": "ecg_quality-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fb176a8938a2cf875493eb4d85f30cda",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 8300126,
            "upload_time": "2023-05-20T19:55:02",
            "upload_time_iso_8601": "2023-05-20T19:55:02.083465Z",
            "url": "https://files.pythonhosted.org/packages/ac/81/c41b48cdb30df30ca33a3c9695fd981afe760073a59b988ad89598673762/ecg_quality-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e2b024c8ef3c9e750e702a353af3c82c5d0caab42bfef043b996238f9f90a7ed",
                "md5": "f7c9b020a77b6905727e27fe40dcff6f",
                "sha256": "4d6fc839204367d727675ec4d2ab8425663990e9b05849b66b8511c5f7bb43d5"
            },
            "downloads": -1,
            "filename": "ecg_quality-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "f7c9b020a77b6905727e27fe40dcff6f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 8299407,
            "upload_time": "2023-05-20T19:55:05",
            "upload_time_iso_8601": "2023-05-20T19:55:05.547946Z",
            "url": "https://files.pythonhosted.org/packages/e2/b0/24c8ef3c9e750e702a353af3c82c5d0caab42bfef043b996238f9f90a7ed/ecg_quality-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-20 19:55:05",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "koledjoz",
    "github_project": "ecg_quality",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "ecg-quality"
}
        
Elapsed time: 0.06922s