1. Introduction
Atrial fibrillation (AF) is the most common sustained arrhythmia associated with a high risk of an ischemic stroke [
1]. For this reason, timely diagnosis of arrhythmia is of crucial importance. The diagnosis of AF can be difficult since patients may be asymptomatic, particularly in cases of intermittent AF episodes that end spontaneously (paroxysmal atrial fibrillation, PAF). Given the significant risk of mortality and morbidity, and the fact that asymptomatic AF is not detected unless specifically looked for, there is a strong impetus for ambulatory monitoring. With the greater need for ambulatory monitoring, accurate and automated detection of asymptomatic AF becomes a relevant task. AF is usually diagnosed by inspection of the electrocardiogram (ECG) where it becomes apparent in the dysregulation of ECG signal properties. AF is characterized in the ECG by loss of the normal atrial depolarization waves (P waves), rapid and irregular atrial fibrillatory waves with an undulating baseline and typically irregular RR intervals (time between two consecutive ventricular beats) [
2].
In this paper, we propose to use a symbolic recurrence approach to detect AF. Symbolic Recurrence Quantification Analysis (SRQA) [
3] offers a powerful framework to investigate complexity in dynamical systems from their time series, without knowledge of their underlying governing equations. It is especially useful when the dynamical system is non-stationary, as may be commonly encountered in ECG signals, and is additionally advantageous in requiring the generation of a minimal descriptive feature set that allows the implementation of robust and simple predictive algorithms. Specifically, we construct a logistic regression algorithm that employs SRQA over RR interval time series to detect AF. Moreover, to show the robustness of this approach we perform a K-fold cross-validation procedure that provides excellent results in terms of model coefficients, sensitivity, specificity and accuracy. To the best of our knowledge, the proposed model is the first to incorporate symbolic analysis for AF beat detection.
The rest of the paper is organized as follows. In
Section 2, we introduce the basic definitions and notation for the development of symbolic recurrence measures and propose a logistic model for AF classification. In
Section 3, we estimate the logistic model and study the classification power of the model in terms of sensitivity, specificity, and accuracy. Moreover, we report the results of a K-fold cross validation procedure for the estimated model. These results are summarized and discussed in
Section 4. Finally,
Section 5 concludes.
2. Materials and Methods
2.1. Symbolization
In general, given a real-valued time-series , the phase space vectors can be reconstructed through for an embedding dimension . Let us denote by the symmetric group of order , that is the group formed by all the permutations of length . Let . We will call an element in the symmetric group a symbol. Notice that is a vectorial time series of length . Each is called an history.
We say that
is of
type if and only if
is the unique symbol (permutation) in the group
satisfying the two following conditions:
Condition
guarantees uniqueness of the symbol
. Therefore, we have defined the symbolization map
given by
if and only if
is of
type. Note that the symbolization map
transforms the vectorial time series of
-histories in a sequence of symbols that correspond to the ordinal patterns of each consecutive
values of the time series. Moreover, each element of
is mapped to a symbol of
providing a partition of
of size
, called the symbolic partition of
. The greater the parameter
is the more capacity of the symbolization map to gather more complex dynamic structure of the RR interval time series; but, on the other hand, the set of symbols grows dramatically with
. For
we have 6 symbols; for
there are 24 symbols; for
the number of symbols is 120; and so on. For the symbolization procedure to be efficient the set of symbols should satisfy the following two conditions: (i) the number of symbols has to be smaller than the length of the time series to be symbolized and (ii) expected frequencies of symbols under independence should be ≥5 in order for the symbols to be statistically distinguishable with the
distribution. Thus, in general the size of the window of RR interval data to be symbolized, namely
, has to satisfy that
, which for windows of length
admits a maximum value of
. Since the purpose of this paper is to detect AF on small windows of RR interval data (
and
data points) we will fix
, that is 6 symbols.
We illustrate the symbolization procedure on the time series shown in
Figure 1, whose seven values are
For an embedding dimension
, we have six symbols forming the symmetric group, that is,
Each one of the -histories generated from the time series given by (1) can be uniquely mapped into a symbol in . For instance, for , we have that , which implies that is of -type.
2.2. Symbolic Recurrence Analysis
We will say that two states
and
are symbolic recurrent states if and only if
. Therefore, we can define the following indicator function
that always takes the value
when the ordinal patterns of the
-histories
and
are of the same type (symbolic recurrent). To distinguish recurrences among different symbols, for each symbol
we define
that takes the value
when the ordinal patterns of the
-histories
and
are both of
-type (symbolic recurrent to
).
2.3. Symbolic Recurrence Plots of RR Interval Time Series
The indicator functions
and
define symbolic recurrence
-matrices (
and
respectively). Notice that
. These matrices can be represented in a Symbolic Recurrence Plot (
), and Symbolic Recurrence Plot to a symbol
(
) respectively. Symbolic recurrence plots illustrate when two
-histories belong to the same set of the symbolic partition and therefore have the same ordinal pattern. Thus, if a dynamic change occurs in the time series then the distribution of ordinal patterns will change, producing in turn a change in the symbolic recurrences of the
-histories and therefore, in the symbolic recurrence plot (see [
3] for examples).
Recall that in a symbolic recurrence plot (SRP) each colored dot represents recurrence to its corresponding symbol, with the coordinate axes reflecting the temporal interval between recurrences.
Figure 2 illustrates two SRPs corresponding to a 50
interval data with embedding dimension
(that is
symbols) of a patient classified as normal sinus (N) and a patient with atrial fibrillation (AF). The utility of the SRP is in visualizing both the preponderance of a given symbol type, reflecting the temporal distribution of that dynamic, but also in revealing the temporal organization of these dynamics. These structural dynamics, particularly the organization of diagonal lines, reflecting cyclical dynamics, and vertical/horizontal structures, indicative of periods of persistent symbolic dynamics, provide the basis for subsequent quantitative analyses to characterize the prevalence, duration, and complexity of symbolic dynamics in the ECG signal.
The relevance of symbol distribution and organization in the SRP is apparent in comparing the SRP of the AF signal and N signal, as shown in
Figure 3. Note, in particular, that the distribution of the colored points that conforms each SRP is different among normal sinus and atrial fibrillation patients which suggests a different complex dynamic behavior of the signal for each type of patient.
The dominant color in the patient with normal sinus is black corresponding to the increasing symbol
followed by the red color that corresponds to the decreasing symbol
. Moreover, the recurrences to the increasing symbol reveal a strong pattern shaping rectangles of larger area than the area of the rectangles formed by any other symbol. This does not happen for patients with AF. For the case of the patient with AF, we do not observe any regular pattern in the plot and the symbols seem to be randomly distributed. In
Figure 3, we show the symbolic recurrence plots to the increasing and decreasing symbols for N and AF patients.
2.4. Symbolic Recurrence Measures
Based on the previous symbolic recurrence plots, we define the following symbolic recurrence measures, which quantify both the distribution (type and number of recurrence symbols) and organization (structural properties, e.g., diagonal or vertical lines) of the SRP. The global symbolic recurrence rate is defined as
and the symbolic recurrence rate to each symbol
as
While the global captures the rate at which symbolic dynamics repeats within a given signal, the symbol-specific focuses this metric specifically to a given symbol type. The remaining symbolic recurrence measures used as covariates in the logistic model are based on two types of structures in the SRP, namely, diagonal and vertical (or equivalently horizontal, for symmetry) lines. Specifically, we define the distributions and of diagonal and vertical lines of length at least 2, where and are the number of diagonal and vertical lines of length and , respectively. It should be noted that vertical lines only appear with the increasing and decreasing symbols, since the remaining symbols can not appear two consecutive times. Also, when examining the diagonal lines, we neglect the main diagonal that is always composed of all ones.
Structures in SRPs provide useful evidence about the dynamic behavior of the system. Diagonal lines of length
between
and
identify a sequence of symbols whose phase space vectors
,
, …,
belong to the same set in the partition of the phase space, consistent with a periodic trajectory. Such a set could potentially vary along the sequence, whereby the two phase vectors could visit multiple subsets of the partition. In other words, diagonal lines represent two equal sequences of symbols of length
, one starting at time
and one at time
. Therefore, diagonal lines reveal some form of predictability of the system, with long diagonals indicating long repeated sequences of symbols. From the distribution of the diagonal lines, we can compute the percentage of recurrence points which form diagonal lines as
where, once again, we have neglected the main diagonal. This indicator is equivalent to the so-called determinism, scaled by the
.
Another important type of structure observed in SRPs is vertical lines, which correspond to a sequence of phase space vectors , , …, that have the same ordinal pattern. Similar to classical recurrence plots, the length of the vertical lines quantifies the number of time instants in the time-series where the phase space vectors are constrained in the same set of the symbolic partition. We define the trapping time as the average vertical length .
All these symbolic recurrence measures together with the entropy of the distributions of vertical and diagonal lines, can be used to analyze and characterize the dynamic behavior of the time series given by the RR interval according to the heart health state of the individual. For the case of the example depicted in
Figure 2 and
Figure 3,
Table A1 (see
Appendix A) specifies symbolic recurrence measures. These measures might become an efficient and powerful tool to discriminate between AF and N patients.
2.5. A logistic Model to Clasify AF Patients
In this section we propose a logistic model to estimate the probability of a patient to be classified as AF. Moreover, based on receiver operating characteristic curve analysis, a probability threshold is given so that a patient with an estimated probability above the threshold is classified as AF.
The covariates used for the estimation of the logistic model are derived from SRQA analysis and the distribution of the RR interval and are divided into two groups. The first group is formed by symbolic recurrence measures
,
,
,
,
, with
or
,
and
. The second group consist of two central tendency measures, the mean
and the median
, and two dispersion measures, Pearson coefficient of variation denoted by
(standard deviation divided by the mean), and the coefficient of variation of the median which is computed as
Both and are homogeneity measures that account for the variability of the RR interval time series.
2.6. Data
Each RR interval time series is obtained from the ECG signals taken from PhysioNet MIT-BIH Atrial Fibrillation Database [
4]. This data base consists of a total of 25 patients with 149.06 h NS, 93.77 h AF and 6.6 h of other arrhythmias (such as atrial flutter and AV junctional rhythm). Each record is divided into consecutive windows containing 30, 60, 120, or 200 RR intervals. Predictive models were built using covariates calculated for each window, and classification results were compared to annotations. A window was labelled true AF if more than 1/2 of cycles in the window were annotated as AF and non-AF otherwise.
3. Results
3.1. Model Estimation
We found that covariates , , , , for all , and were always significant for all windows sizes, with a -value . Covariates and were not significant for the smallest windows of size , is not significant for the smaller and greater windows sizes respectively, and finally and are not significant for any window size. These findings indicate that the most reliable discriminative factors in classifying AF signals are related to either global measures of central tendency (e.g., , , , ), or to the distribution of specific symbol recurrence rates. Measures of structural organization, such as determinism and entropy, were also reliable indicators of AF, but the utility of these measures was dependent on a longer sampling window (). Interestingly, the organization of vertical structures in the SRPs, indicative of periods of persistent symbolic dynamics, were not useful predictors of AF. These findings indicate that the separation of AF signals from NS signals is driven by diverging sequential dynamics and symbolic diversity rather than differences in persistent stable states.
Table A2 (see
Appendix A) specifies the coefficients of the logistic model for each window size (
). Coefficient with a superimposed
and
are significant at 5% and 1% respectively, while those without asterisk mark are considered non-significant.
3.2. Classification Power of the Model
In order to show the classification power of the model we computed its specificity, sensitivity, and accuracy with respect to predicting AF status. To this end we define
is the number of true positive classified by the model.
is the number of true negative classified by the model.
is the number of false negative classified by the model.
is the number of false positive classified by the model.
is the true positive rate computed as , also known as sensitivity.
is the false positive rate computed as . Specificity is known as which measures the proportion of actual negatives that are correctly identified by the model as such.
determines the model accuracy.
To calculate the threshold for model classification, namely
, such that a patient with an estimated probability above
is considered AF we rely on ROC (Receiver Operating Characteristics) curves. More concretely, for each threshold
from 0 to 1 at steps of 0.001 we compute the points
that form the ROC curve. The optimal case is the one in which
, that is, zero false positives and zero false negatives. Then, the threshold is taken as the one that minimizes the distance between the points
and
,
The values of
for each window size together with sensitivity, specificity, and accuracy are given in
Table 1.
As expected, the sensitivity, specificity, and accuracy of the model increase with the size of the window. Sensitivity always remains above 96%, reaching 97.9% for windows of size 200. Regarding specificity, the power performance of the algorithm is slightly lower although still with very good performance with values from 94.8% for the smallest window size and reaching 97.6% for windows of size 200. Finally, the predictive power of the model (accuracy) is also very high, ranging from 95.4% to 97.7% depending on the window size.
3.3. Model Validation
In order to show the robustness and consistency of symbolic recurrence measures as predictor of AF in a logistic model we have performed a -fold cross-validation procedure. This procedure has only one parameter and consists of splitting the data set into subsets. Then for each unique subset we take the subset as a hold out or test data set and the remaining subsets as a training data set. We fit the logistic model on the training set and evaluate it on the test set. Afterward we retain the evaluation score (Se, Sp, and ACC) and discard the model. We have chosen , a value that has been found through experimentation to generally result in a model skill estimate with low bias and modest variance.
Table 2 shows the median (Me) and percentiles 25th and 75th (P
25 and P
75 respectively) values of the threshold, Sensitivity, Specificity, and Accuracy of the
-fold cross-validation procedure for each window size.
As shown in
Table 2, the classification power of the logistic model does not depend on the robustness of the training data.
4. Discussion
Here, we characterized the use of symbolic recurrence quantification analysis (SRQA) [
3] to generate a predictive algorithm for the detection of cardiac atrial fibrillation (AF). This approach requires minimal preprocessing, utilizing only the RR interval from the ECG waveform, and is robust against signal processing challenges that are likely to be common in an ambulatory signal detection setting, including noisy, non-stationary signals. We demonstrate the robust predictive performance of this model utilizing simple predictive algorithms that utilize relatively few features, and are therefore likely to generalize well and be minimally vulnerable to over-fitting, and validate this approach via a cross-validation paradigm.
There are many different algorithms to detect AF in the specialized literature, typically based on the analysis of ECG data. These include methods based on the analysis of P-waves via temporal or frequency domain methods, as in [
5,
6,
7,
8,
9,
10,
11]; and, more recently, the application of machine learning and deep learning methods are increasingly popular due to their ability to automatically learn features at multiple levels of abstraction (i.e., layers). Andreotti et al., 2017 [
12], for example, proposed the use of a convolutional neural network utilizing 169 features in a supervised learning strategy for AF detection. Similarly, a convolutional recurrent neural network was employed for AF detection by Liman and Precioso [
13], while a decision tree ensemble was implemented by Bin et al. [
14]. Though the predictive algorithms utilized in these approaches varied, a commonality in these approaches is in the use of a wide array of features for model training, and the use of 12-lead ECG records for signal acquisition during ambulatory detection. In contrast, the methodology introduced here focuses solely on the analysis of RR interval, which can be extracted with simpler sampling methods.
Alternative strategies have also been devised to detect AF based on just the RR interval. For example, Lian et al. [
15] proposed a new AF detection moving window algorithm based on a map that plots RR intervals versus change of RR intervals. The map is divided by a grid with 25-ms resolution in two axes and nonempty cells are counted to classify AF and non-AF episodes. For each window size, and based on receiver operating characteristic curve analysis, a threshold is calculated for classification purposes, obtaining a high power performance of the algorithm. Similarly, in [
16] authors used the coefficient of variation of standard density histograms of RR and ΔRR = RR
i − RR
i−1 time series to detect atrial fibrillation. Further, density histograms of RR or ΔRR intervals in test data are compared with standard density histograms using the Kolmogorov-Smirnov test. If there is no significant difference between two given histograms, the rhythm is labeled as AF, obtaining high values of sensitivity and specificity. Another alternative strategy, introduced in [
17], is based on the generally accepted characteristic of AF as a random sequence of heart beat intervals with markedly increased beat-to-beat variability and complexity. In order to exploit these characteristics, the authors developed an algorithm combining (i) the Root Mean Square of Successive RR Differences to quantify variability, (ii) the Turning Points Ratio to test for randomness of the time series, and (iii) Shannon entropy to characterize its complexity. Results of the method show high sensitivity and specificity.
Nevertheless, the main drawbacks of these algorithms are that they depend on the robustness of the training data, require preliminary filtering in an initial preprocessing step, rely upon a complex array of features which may be computationally expensive to extract, and remain vulnerable to the estimation of false positive predictions. As well, the available literature where these procedures have been validated does not include extensive use of cross-validation procedures to show that the accuracy of AF detection is not compromised by the training set. These controls, however, are essential for the development of robust ambulatory monitoring algorithms.
In sum, our findings emphasize the robust utility of SRQA in the implementation of highly accurate predictive algorithms for the detection of AF from ECG signals. In contrast to classical signal processing methods that have been applied to the analysis of ECG signals for predicting AF, SRQA is an ordinal approach focused on symbolic dynamics. This yields an insensitivity to extreme values and non-stationary processes, while also yielding a relatively small set of features that can be easily interpreted for descriptive, explanatory, or predictive purposes. Although this approach additionally minimizes preliminary analytical steps that might be needed in classical waveform analyses, e.g., subsequent spectral or power band analyses, SRQA as applied here nonetheless requires an initial pre-processing step of measuring RR intervals. This initial step is however easily automated, validated, and interpreted. Also, SRQA requires the selection of the free parameter m, named embedding dimension. The rule for choosing this parameter is given in
Section 2.1.
5. Conclusions
The implementation of SRQA in this context will primarily be of interest in two broad applications: first, the symbolic dynamics measured in this procedure provide a novel tool to characterize dynamics in the cardiac system, and may also provide an effective tool for researchers to investigate biological factors related to AF. Accordingly, future studies should focus on the basic physiological implications of ECG signal dynamics identified via SRQA, such as associations with age, sex, and other biological parameters, as well as comorbid clinical conditions. Second, the computational efficiency, robust generalizability, and predictive accuracy of the algorithms characterized provide a promising framework that could easily be adapted to mobile software paired with a simple sensing device, as are commonly available in modern smartphones. In conjunction with ongoing medical care, mobile monitoring and detection of AF events could be used to complement clinical diagnoses and provide patients with more sensitive indicators of changing cardiac dynamics. Future studies should therefore also work to further develop the clinical utility of this method by extending this approach to a larger set of AF patients to provide a more complete validation of the model.