Skip to content

Implementation of the paper "Low-complexity detection of atrial fibrillation in continuous long-term monitoring"

License

Notifications You must be signed in to change notification settings

tabaraei/LTAF-detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Long-term Atrial Fibrillation Detection

Installation

  • This project was developed and tested on a Windows operating system. When trying to install the WFDB package on MacOS, some unexpected errors encountered and could not replicate the same results on MacOS. So, it is recommended to run the project on Windows.
  • Clone the project using git clone https://github.com/tabaraei/LTAF-detection.git, or directly download the zip file, and store the LTAF-detection codebase on desired directory in your local machine.

Important

In order to be able to run the code, make sure to:

  1. In MATLAB console, go to the current directory using cd <PATH-TO-LTAF-detection> where the main.m file exists.
  2. Download the WFDB package from here, unzip the folder, and put the contents of mcode folder into the project directory as <PATH-TO-LTAF-detection>/packages/WFDB.
  3. Download the LTAF dataset from here and put all the contents in <PATH-TO-LTAF-detection>/data/LTAF.

Dataset

The algorithm was developed and tested on the Long Term Atrial Fibrillation (LTAF) database 12, consisting of 84 ECG recordings from patients with paroxysmal or persistent AF, mostly with a 24-hour duration. The entire database comprises nearly 9 million beats, with 59% occurring during AF.

Paper

This project implements an atrial fibrillation (AF) detector based on the paper titled "Low-complexity detection of atrial fibrillation in continuous long-term monitoring" 3. There are 5 main stages to detect the AF episodes as propsed below:

  1. Preprocessing (forward_backward_averager): This function computes the forward-backward filtering to achieve a linear phase on a given series X, and it aims to compute the exponential average to better track the trend using 0<alpha<1 as the degree of smoothing. This procedure results in the estimation of the mean RR interval, which can be used as a feature in the AF detector.
  2. Preprocessing (median_filter): In order to reduce the effect of ectopic beats in the RR series, we may use a simple 3-point median filter as rm(n)=median{r(n-1),r(n),r(n+1)}. This filter is also useful to reject the outlier RR intervals.
  3. RR Irregularity Detection (irregularity_detector): In order to distinguish RR irregularities, we should use a sliding detection window of length N, located at time n, and compute the number of all pairwise RR interval combinations differing more than gamma seconds, and normalize them with their maximum value. To achieve this, first, we will introduce the heaviside function "H", where it simply denotes whether the pairwise difference of given RR intervals are below a certain threshold "gamma" or not. Then, for each RR interval "n", we will compute the count of pairwise RR interval combinations differing more than "gamma", and we will normalize this value w.r.t its maximum value. Lastly, We compute the ratio "I" between the smoothed version of M utilizing exponential averaging, and the RR interval trend stored in "rt".
  4. Bigeminy Supression (bigeminy_supressor): Bigeminy is a cardiac arrhythmia characterized by a pattern in which every normal heartbeat is followed by a premature beat, creating a regular pattern of two beats, which can be incorrectly interpreted as AF when the detection is RR-based.
  5. Signal Fusion and Detection (signal_fusion): The decision function O(n) is produced through a simple signal fusion, which is identical to "Bt" unless it exceeds a fixed threshold delta when, instead it becomes identical to "It".

Diagram

Experimental Results:

Below, you can see the effectiveness of the proposed algorithm which was run on the LTAF/data/00 file, and the corresponding generated plots for each code block. In most cases, it can effectively distinguish the Atrial Fibrillation episodes. However, it is not free of errors, and in some cases it is unable to detect the AF episodes. For more information, please refer to the generated results stored in the <PATH-TO-LTAF-detection>/other/evaluations.csv, which were generated by the algorithm according to the same order specified in dataset information.

ECG 1 ECG 2 RR Median Filter Averager M and I B O O zoom Results0 Results1 Results2 Results3 Results4

Overall Results:

Below, the overall performance of the proposed algorithm on all 84 ECG signals of LTAF database is summarized. It is evident that in general it effectively detects the AF episodes, while some minor errors can be seen in some cases. Note that the performance is dependent on the length of AF episodes as well> In some cases, there were too short AF epsisodes to discover, which resulted in poor sensitivity/specificity performance.

Evaluations1 Evaluations2 Evaluations3 Evaluations4

Footnotes

  1. S. Petrutiu, A.V. Sahakian, S. Swiryn, Abrupt changes in fibrillatory wave characteristics at the termination of paroxysmal atrial fibrillation in humans, Europace 9 (2007) 466–470

  2. A.L. Goldberger, L.A. Amaral, L. Glass, J.M. Hausdorff, P.C. Ivanov, R.G. Mark, J.E. Mietus, G.B. Moody, C.K. Peng, H.E. Stanley, PhysioBank, PhysioToolkit, and PhysioNet: components of a new research resource for complex physiologic signals, Circulation 101 (2000) E215–E220

  3. A. Petrėnas, V. Marozas, L. Sörnmo, Low-complexity detection of atrial fibrillation in continuous long-term monitoring, Computers in Biology and Medicine, 65, 184-191, 2015

About

Implementation of the paper "Low-complexity detection of atrial fibrillation in continuous long-term monitoring"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages