Keywords

1 Introduction

Atrial fibrillation (AF), a rapid and irregular fibrillation from the atrium, is a very important type of arrhythmia. According to statistics, the disease of AF affects approximately 1.5–2% of the world’s total population, and this figure is likely to increase in the next 50 years [1, 2]. The prevalence of AF increases with age, from <0.5% at 40–50 years to 5–15% at 80 years [3]. In addition, AF can lead to stroke, heart failure, and sudden death, with a high morbidity and mortality [4, 5]. Therefore, the early detection and auxiliary diagnosis of AF have important clinical and social significance for improving patients’ treatment strategies and the quality of treatment, reducing the incidence of critical illness and mortality.

The surface electrocardiogram (ECG) signal contained the high potential diagnostic information, and its characteristics directly reflect the nature of pathophysiologic events occurring in both the cardiac chambers. In addition, it is painless to record a surface ECG for the patient. Long-term surface ECG recordings can be performed with minimal risk compared to other invasive diagnostic techniques [6]. Therefore, ECG is a powerful tool to reveal initiation, maintenance, and termination of AF.

Recently, the fast-developing wearable and Internet of things (IoT) technologies significantly promote the progress in ambulatory electrocardiogram (ECG) monitoring, which is an essentially useful tool for the early detection of AF. However, when performed on the relatively noisy wearable ECGs, poor generalization capabilities are inevitable due to the individual waveform variability and external noises. Wearable electronic devices for ECG monitoring are usually highly sensitive to motion artifacts and susceptible to noise interference [7]. This is a challenge to develop AF detection that can be robust in noisy ECGs.

Our work describes physiological concepts behind the development of an AF detection algorithm and some of the most recent signal processing techniques to reveal atrial fibrillation. AF detectors can commonly follow ECG analysis to reveal the arrhythmia. The chapter is dedicated to an overview of some different algorithms to detect AF.

2 Physiological Concepts for Development of Detection Algorithms

During AF, ECG has obvious features: P-wave disappears, f-waves (a series of continuous and irregular atrial excitation waves) appear [8], and RR interval is absolutely irregular [9]. Figure 1 shows the AF episode and normal rhythm episode. In literature, AF detectors can be separated into two major classes: methods based on P-wave features and RR interval features.

Fig. 1
figure 1

(a, b) Atrial fibrillation episode and normal rhythm episode

Many scholars analyzed the morphology of P-wave to achieve AF detection. Andrikopoulos et al. [10] presented that increased variance of P-wave duration on the electrocardiogram distinguishes patients with idiopathic paroxysmal atrial fibrillation (PAF). Prerfellner et al. [11] used P-wave evidence as a method for improving algorithm to detect AF. Alcaraz et al. [12] proposed a new approach to predict termination of AF: wavelet sample entropy. Alcaraz et al. [13] applied wavelet entropy to AF prediction. Garcia et al. [14] presented application of the relative wavelet energy to heart rate independent detection of AF. However, P-waves or f-waves in atrial activity have small amplitude, which are extremely susceptible to noise interference. This situation can be worse in the dynamic ECG monitoring, where many complicated interferences from the daily activities occur, and is difficult to obtain stable, high-quality signals in real-time long-term recordings.

There are many AF detection algorithms based on RR interval features, including variability analysis, complexity estimation, statistical method, and entropy estimation. The R peak is the most prominent feature of an ECG and the least confounded by muscle noise. Indeed, methods based on RR irregularity should be preferred for external devices. These methods need a high accurate QRS detector, since extra and missed beats would affect algorithms’ performance [15]. For the wearable ECG detection, poor generalization capabilities are inevitable due to the individual waveform variability and external noises. This is a challenge to develop AF detection that can be robust in the wearable ECG. This chapter introduces some RR interval features for atrial fibrillation detection algorithm and provides guidance for the identification of wearable ECG signals.

It is worth noting that AF detector combining of several of the above single features with machine learning algorithms could enhance its performance. Couceiro et al. [16] combined the P-wave disappearance, irregular heart rhythm, atrial activity, and other ECG characteristics and developed a neural network model on the MIT-BIH AF database, achieving a sensitivity of 93.8% and a specificity of 96.1%. Babaeizadeh et al. [17] presented a AF detector using decision tree classifier and RR interval, PR interval variability, and a P-wave morphology similarity measure, reporting a sensitivity of 92% and a positive predictivity of 97%. The 2017 PhysioNet/CinC Challenge [18] aims to classify normal sinus rhythm, AF, an alternative rhythm, or noisy ECGs. Many contestants have developed AF detectors based on RR interval features and analysis of the absence of P-waves or f-waves present in TQ interval. Shreyasi Datta et al. [19] used morphological features, frequency features, heart rate variability (HRV) features, statistical features, and other abnormality features with a multilayer cascaded binary classification approach in the PhysioNet/Computing in Cardiology (CinC) Challenge 2017 and won shared 1st places.

3 AF Features in Dynamic Signals: Description and Comparison

This section summarizes the state of the art in AF detection based on RR interval features, that is because pulse beats of ventricles are less likely to be influenced by baseline wandering and noise. In addition, since we cannot predict when the paroxysm of AF will come about, it will be useful to make a real-time portable monitoring electrocardiograph. Some AF features based on RR interval are introduced, and the underlying principle to reveal atrial fibrillation is briefly discussed.

3.1 Lorenz Plot

The characteristics of the Lorentz scatter plot can calculate atrial fibrillation [20]. The RR interval of atrial fibrillation signal is irregular, and the distribution of scatter plots is significantly different from that of normal people. Figure 2 shows Lorenz plot of ΔRR intervals for normal signal and AF signal from the recording of 04936 from the MIT-BIH AF database. x axis is ΔRR interval, and y axis is ΔRR(i − 1) interval.

$$ \Delta \mathrm{RR}=\mathrm{RR}(i)-\mathrm{RR}\left(i-1\right) $$
$$ \Delta \mathrm{RR}\left(i-1\right)=\mathrm{RR}\left(i-1\right)-\mathrm{RR}\left(i-2\right) $$
Fig. 2
figure 2

(a, b) Lorentz plot of ΔRR interval for AF signal and normal signal

Since the continuous RR interval difference of the normal signal is small, it can be seen that the points of the normal signal are gathered around the starting point, and the atrial fibrillation signal is sparsely distributed due to the irregular RR interval from Fig. 2.

If we consider the digital representation of the Lorentz plot, such as a two-dimensional histogram, it is divided into 13 discrete segments, shown in Fig. 3. For each signal’s rhythm, its points have a higher probability of positioning in a particular subdivision. For a normal signal, the point is almost concentrated near the origin.

Fig. 3
figure 3

The two-dimensional histogram, numeric representation of a Lorenz plot

Therefore, the origin of the histogram, represented by “O,” will contain a large number of points, while the boxes in other sections are almost empty. Conversely, for atrial fibrillation signals, the points will spread across the histogram, filling a larger number of intervals from “I” to “VII.”

AFEvidence, which accounts for points positioning within the plot, is a test indicator, used to quantify the possibility of atrial fibrillation. IrregularityEvidence is used to measure the sparsity of a high-value distribution of atrial fibrillation signals. BinCountn (BCn) is the number of nonempty bins contained in the nth segment of Fig. 3. PACEv is used to measure the low value of the normal signal, which is corresponding to the number of all the dots filled in the “O” segment in Fig. 3.

$$ \mathrm{IrregularityEvidence}=\sum \limits_1^{12}{\mathrm{BinCount}}_n $$
(1)
$$ \mathrm{AFEvidence}=\mathrm{IrrEv}-\mathrm{OriginCount}-2\ast \mathrm{PACEv} $$
(2)
$$ \mathrm{PACEv}=\sum \limits_{n=1}^4\left({\mathrm{PC}}_n-{\mathrm{BC}}_n\right)+\sum \limits_{n=5,6,10}\left({\mathrm{PC}}_n-{\mathrm{BC}}_n\right)+\sum \limits_{n=7,8,12}\left({\mathrm{PC}}_n-{\mathrm{BC}}_n\right) $$
(3)

where PCn is the number of points contained in the nth segment of Fig. 3.

The method was evaluated on the MIT-BIH AF database, showing sensitivity of 97.5% and positive predictive value of 99%. In the large number of atrial tachycardia (AT) presence, detector performance is worsened. This condition needs to design a supplemental detector to distinguish AT with regular ventricular response from AF. Through clinical testing, this algorithm is eligible for a further implementation on phone by clinical truth. The optimal window size is 2 min at least, and minimum percentage of AF in AF ECG episode is currently 60%.

3.2 Poincare Plot

Poincare plot [21] from non-AF data showed some pattern, while the plot from AF data showed irregular shape. Figure 4 shows Poincare plot of RR interval for AF signal and normal signal. In case of non-AF data, the definite pattern in the plot manifested itself with some limited number of clusters or closely packed one cluster. In case of AF data, the number of clusters in the plot was too many. Making a Poincare plot using the inter-beat intervals, the author extracted three-feature measures characterizing AF and non-AF: the number of clusters, mean stepping increment of inter-beat intervals, and dispersion of the points around a diagonal line in the plot. The author divided distribution of the number of clusters into two and calculated mean value of the lower part by k-means clustering method and classified data whose number of clusters is more than one and less than this mean value as non-AF data. In the other case, the author tried to discriminate AF from non-AF using support vector machine with the other feature measures: the mean stepping increment and dispersion of the points in the Poincare plot.

Fig. 4
figure 4

(a, b) Poincare plot of RR interval for AF signal and normal signal

The study [21] evaluated the accuracy using leave-one-out cross-validation on Computers in Cardiology Challenge 2001 and 2004. Mean sensitivity and mean specificity were 91.4% and 92.9%, respectively. It could be installed in a portable heart monitoring system. This AF detector was designed as automated algorithm, which did not require any human intervention and any specific threshold and could be installed in a portable AF monitoring system.

3.3 RR Interval Variance

This AF detector is simply based on RR interval variance and is designed to provide an automatic, robust detection of AF [22]. Evaluated by the authors on the MIT-BIH AF database, it showed sensitivity of 87.30% and specificity of 90.31% with an optimal window size of 120 s. This AF detector has been conceived for ambulatory monitoring situations, where arbitrary lead placements, muscle artifact, and potentially changing morphology of the signal can represent a challenge for an AF detector.

3.4 The Median of the Variation in the Absolute Standard Deviation from Mean of Heart Rate in Three Adjacent Segments of the RR Interval Series (MAD)

MAD, defined as the median of the variation in the absolute standard deviation from mean of heart rate in three adjacent segments of the RR interval series, reveals the irregular nature of AF [23]. It was developed for long-term monitoring of AF on a portable monitoring device. In the comparative study [24], this method showed the highest sensitivity and the smallest window length (10 s), which can help in detecting additional AF cases, such as paroxysmal events, whose onset is often unexpected and of short duration and is developed to be easy-to-implement, simple, and to have low-memory requirements.

3.5 Density Histogram of Delta RR Intervals

Huang et al. proposed a novel method for detection of the transition between AF and sinus rhythm based on RR intervals [25]. First, we obtained the delta RR interval distribution difference curve from the density histogram of delta RR intervals and then detected its peaks, which represented the AF events. Once an AF event was detected, four successive steps were used to classify its type, and thus to determine the boundary of AF: (1) histogram analysis, (2) standard deviation analysis, (3) numbering aberrant rhythms recognition, and (4) Kolmogorov–Smirnov (K-S) test.

A dataset of 24-h Holter ECG recordings (n = 433) and two MIT-BIH databases (MIT-BIH AF database and MIT-BIH normal sinus rhythm (NSR) database) were used for development and evaluation. Using the receiver operating characteristic curves for determining the threshold of the K-S test, the authors have achieved the highest performance of sensitivity and specificity (Sp) (96.1% and 98.1%, respectively) for the MIT-BIH AF database, compared with other previously published algorithms. The Sp was 97.9% for the MIT-BIH NSR database. The algorithm has been integrated into a Holter system for the automatic detection of AF, and it is also suitable for applying to the continuous AF monitoring situations.

3.6 Coefficient of Sample Entropy (CosEn)

The coefficient of sample entropy (CosEn) is used to distinguish AF and atrial flutter (AFL) from sinus rhythm and other arrhythmias, which is an optimized combination [26]. It includes sample entropy (SampEn) [27] and is able to encode the irregular nature of short RR interval segments during AF and mean heart beat interval (RR), which adds further independent information to the discrimination. Refer Appendix 6.1 for specific calculation process.

This method used a very small window length (only a 12-beat segment). It was validated on MIT-BIH database and achieved sensitivity of 91% and specificity of 94%. But, it had poor performance on Holter monitoring recordings from the University of Virginia (UVa), which is because of recordings with frequent, complex ventricular ectopy or electronic pacemakers which challenge AF identification.

3.7 Normalized Fuzzy Entropy (NFEn)

On the basis of SampEn, Liu et al. developed the FuzzyMEn method by using fuzzy function instead of 0–1 judgment rule [28]. Then, combined with CosEn and FuzzyMEn, normalized fuzzy entropy (NFEn), a novel entropy measure suitable for AF detection based on a short-term RR time series, was proposed again [29]. NFEn uses a fuzzy function to determine vector similarity, replaces a probability estimate with a density estimate for entropy approximation, utilizes a flexible distance threshold parameter, and adjusts for heart rate by subtracting the natural log of mean RR intervals.

NFEn was tested on the MIT-BIH AF, NSR, and arrhythmia databases, demonstrating that NFEn is an accurate measure for detecting AF. For classifying AF and non-AF rhythms, NFEn achieved the highest area under receiver operating characteristic curve (AUC) values of 92.72%, 95.27%, and 96.76% for 12-beat, 30-beat, and 60-beat window lengths, respectively.

3.8 Entropy_AF

Zhao et al. [30] proposed the Entropy_AF method to enhance the performance of entropy-based AF detectors. This algorithm combines the distance normalization function and the entropy-based AF detection concept and uses the flexible threshold parameters. Refer Appendix 6.2 for specific calculation process.

On the MIT-BIH AF database, Entropy_AF achieved the highest area under receiver operating characteristic curve (AUC) values of 98.15% when using a 30-beat time window, which was higher than CosEn with AUC of 91.86%. For classifying AF and non-AF rhythms in the clinical wearable AF database, Entropy_AF also generated the largest values of Youden index (77.94%), sensitivity (92.77%), specificity (85.17%), accuracy (87.10%), positive predictivity (68.09%), and negative predictivity (97.18%). Entropy_AF generated highest classification accuracy when using a 12-beat time window and the better discrimination ability for identifying AF when using Entropy_AF method, indicating that it would be useful for the practical clinical wearable AF scanning.

4 Atrial Fibrillation Detection in Dynamic Signals Based on RR Interval Characteristics

Detectors designed are based on the ventricular response analysis. Starting from the ECG, the RR interval series is derived. Seven AF features were extracted from the RR interval time series. AF features were input classifier to return AF diagnosis. The steps for AF detection are shown in Fig. 5.

Fig. 5
figure 5

Steps for AF detection

4.1 Database

The database is wearable ECG data. The wearable ECG database was collected using a wearable ECG device developed by Southeast University and Lenovo, as shown in Fig. 6 [31]. The patients were recruited from the First Affiliated Hospital of Nanjing Medical University and had been diagnosed as AF by ECG Holter. The study protocol was approved by the Ethics Committee of the First Affiliated Hospital of Nanjing Medical University, and the patient has signed the informed consent form. ECGs were sampled as 400 Hz. In our study, we selected ten normal and ten patients (randomly select 1000 ECG for each person) respectively to tenfold cross-validation. In addition, we selected eight persons (24-h ECG) as testing sets. Table 1 shows details of the dataset.

Fig. 6
figure 6

The wearable ECG device

Table 1 Details of data

4.2 QRS Detection

For the RR interval feature extraction, the most important thing is to identify the position of the R peak. In recent decades, QRS detection technology has developed relatively maturely. In this chapter, a fast QRS detection algorithm proposed by Paoletti et al. [15] was used to locate QRS complex waves. This algorithm has a certain anti-noise property and is suitable for the R-peak positioning of dynamic ECG signals [32]. The R-peak location of the 10-s dynamic signal labeled by this QRS detector is shown in Fig. 7.

Fig. 7
figure 7

The R-peak location of the 10-s dynamic signal

4.3 AF Features

The previous section reviews the technology in atrial fibrillation detection based on RR interval features, with particular emphasis on AF screening applications that can be implemented in dynamic signals. We chose seven AF features: Entropy_AF, sample entropy (SampEn), coefficient of sample entropy (CosEn), mean RR intervals of episode (mRR), minimum of heart rate of episode (minHR), maximum of heart rate of episode (maxHR), and median heart rate of episode (medHR) for further evaluation and comparison.

4.4 Support Vector Machine

LIBSVM with the Gaussian kernel function was used as the classifier in Matlab R2017b. Grid search method [33] was used for parameter optimization.

4.5 Evaluation Methods

To get reliable and stable model, we used tenfold cross-validation on 20 people’s data on the wearable ECG. In order to verify the generalization ability and practicability of the model, we used eight people’s data as the test data. For model evaluation, three widely used metrics, i.e., accuracy (Acc), sensitivity (Se), specificity (Sp), are used as evaluation indicators. According to the attribute of the label (positive or negative), the result can generate four basic indexes: true positive (TP), false positive (FP), true negative (TN), and false negative (FN). In this case, Acc is the radio of the number of correct predicted labels and total number of the labels, thus Acc = (TP + TN)/(TP + TN + FP + FN). Se is the true positive rate and is probability of incorrectly diagnosing into positive among all positive patients, Se = TP/(TP + FN). Sp is proportion of incorrectly diagnosing into negative among all negative patients, Sp = TN/(TN + FP).

4.6 Results

Table 2 shows the classification results from tenfold cross-validation on the wearable ECG database. The mean and standard deviation (SD) of the experimental results were selected to be evaluated. The result showed an Acc of 95.20% for 10-s episode (Se 93.98% and Sp 97.62%), an Acc of 97.47% for 30-s episode (Se 97.25% and Sp 98.07%), and an Acc of 98.41% for 60-s episode (Se 98.76% and Sp 98.38%).

Table 2 Classification results from tenfold cross-validation on the wearable ECG database

The combination of the second fold and the seventh fold is the atrial fibrillation signal and the ventricular premature. For 10-s episode, Se is relatively low, that is, the classifier classifies a part of ventricular premature signal into atrial fibrillation signal. But, for 30-s episode and 60-s episode, tenfold cross-validation results are better.

Twenty people’s data on the wearable ECG were as training sets, and eight individuals were tested. Table 3 shows the results on the eight wearable ECG data. Testing set2 is a patient with no atrial fibrillation and more atrial and ventricular premature. The test accuracy of 10-s episode and 30-s episode is very low (60.17% and 79.51%, respectively), and the Acc of 60-s episode is 84.56%. Testing set6 is a patient with no atrial fibrillation and atrial and ventricular premature. The testing accuracy of 10-s episode is lower (78.79%), but the Acc is 94.12% of 30-s episode and 97.50% of 60-s episode. For the other testing sets, Acc of 10-s ECG episode is over 90%, Acc of 30-s ECG episode is over 96%, and Acc of 60-s ECG episode is over 98%.

Table 3 The results on the eight wearable ECG data

In our purposed algorithm, Acc of 60-s window is the best, but Acc of 10-s window is low on patients with atrial and ventricular premature. In the following model training, the volume and diversity of training sets should be increased. Additional classification rules can be developed for the ECG signals of atrial and ventricular premature.

5 Conclusions

In this section, eight types of short-term features that can be used for dynamic AF signal detection are described. Particular emphasis is placed on AF screening applications that can be implemented in dynamic signals. Finally, seven AF features were selected to train AF/non-AF model, and the detection effect of the algorithm on the different window lengths of wearable ECG was evaluated. The testing results on wearable ECG show that this is a feasible method for AF detection in dynamic signals.