SPIE 4325-61
Using statistical distances to detect changes in the normal behavior of ECG-Holter signals. a
Júlio C. B. de Figueiredo*a, Sérgio S. Furuiea Heart Institute (InCor), University of São Paulo Medical School, Brazil. ABSTRACT
One of the main problems in the study of complex systems is to define a good metric that can distinguish between different dynamical behaviors in a nonlinear system. In this work we describe a method to detect different types of behaviors in a long term ECG-Holter using short portions of the Holter signal. This method is based on the calculation of the statistical distance between two distributions in a phase-space of a dynamical system. A short portion of an ECG-Holter signal with normal behavior is used to reconstruct the trajectory of an attractor in a low dimensional phase-space. The points in this trajectory are interpreted as statistical distributions in the phase-space and assumed to represent the normal dynamical behavior of the ECG recording in this space. A fast algorithm is then used to compute the statistical distance between this attractor and all others attractors that are built using a sliding temporal window over the signal. For normal cases the distance stayed almost constant and below a threshold. For cases with abnormal transients, on the abnormal portion of ECG, the distance increased consistently with morphological changes. Keywords: ECG, Holter, statistical distances.
1. INTRODUCTION In the last years, with the development of nonlinear dynamics, many new analytical and numerical methods have been used to study the characteristics of ECG signals [1-6]. Measures like Correlation Dimension - D2, Lyapunov Exponents, Kolmogorov Entropy and others have been providing new insights and techniques to the understanding of these complex systems. They are more powerful than traditional linear signal processing methods in determining the state of nonlinear systems and distinguishing different behaviors. Many of those methods are based in studies where it is assumed that a discrete time evolution of a ECG variable (obtained by monitoring) can be described by a differential dynamic system in a phase-space. At first the dimension of this phase-space is infinite, however some works showed that a low dimension phase space can be used to capture the most important characteristics of the underlying system [6]. The time evolution of a deterministic dynamic system in a phase-space generate a distribution of states, called attractor, that can be interpreted as a statistical distribution (or a probability distribution) in this space. The time evolution in the phase space generates information that can be quantified by the use of entropy or information measures like the Shannon entropy or Tsallis' entropy [7]. These information measures can be used to quantify the information in a system, to calculate the exchange of information between two systems and to calculate the difference, or the distance, between two systems [8]. In this paper, we present an analysis of ECG-Holter signals in normal and pathological subjects using an approach of Diambra [8] based in Kulback-Leibler [9] formalism for the calculation of statistical distances between two statistical distributions. We start from a short portion of a discrete long duration ECG-Holter signal. This portion of signal is chosen to represent the supposed normal behavior of this signal. A time embedding procedure is then used to generate the attractor of this signal in a low dimension phase space. The points in the trajectory of the attractor are interpreted as the statistical distribution in the phase-space that represents the normal dynamic behavior of the ECG-Holter. A fast algorithm is then used to compute the statistical distance between this attractor and all others attractors that are built using a sliding temporal window over the signal. We will show that for normal cases the distance stayed almost constant and below a threshold. For cases with abnormal transients, on the abnormal portion of ECG, the distance increased consistently with morphological changes. *
[email protected]; Av. Dr. Enéas Carvalho de Aguiar 44 - São Paulo - SP - Brazil - 05403/000; fax: 5 11 3069-5548
SPIE 4325-61
2. ECG PHASE-SPACE RECONSTRUCTION Reconstruction of m-dimensional phase-space of observable measurements is a standard procedure to study the dynamic behavior of a system. This observable can be an ECG signal. A kind of phase-space reconstruction for ECG signals is the so-called Vectocardiogram. The Vectocardiogram reconstructs a phase space from multi-lead ECGs, where the electrodes are placed in different locations, thus providing a spatial embedding. Since the ECG represents a wave propagation phenomenon, where spatial displacement is equivalent to temporal displacement, the resulting phase-space plot is similar to the other embedding techniques. Starting from the knowledge of the time evolution of a ECG (obtained by monitoring of a scalar signal for a finite time and with finite precision) we can apply a embedding technique assuming that such evolution can be described by a differential dynamic system in a phase-space of possibly infinite dimensions. Using a time delay embedding technique is possible to reconstruct a state-space representation of the signal that is topologically equivalent to the original phase-space [10]. Embedding, especially time-delay embedding, can be considered a well-established method in nonlinear signal analysis and has been extensively used for ECG analysis. Consider x(t) as a single scalar component of a m-dimensional process of unknown dimension. The embedding procedure can be used to generate a vector time series. This is achieved by choosing an integer m (the embedding dimension) and a time delay t, thus forming the vector:
ξ (t ) = {x(t ), x (t + τ ), x(t + 2τ ),..., x (t + ( m − 1)τ )}
(1)
Taken's theorem [10] provides conditions for this to be an embedding preserving invariant system like Correlation Dimension, Information Entropy and Lyapunov Exponents. So we can reconstruct part of the phase-space from the time series without even knowing the state-space itself. The choice of t is of considerable practical importance in trying to reconstruct the attractor that represents the dynamical system that generated the data.
Figure 1: A normal ECG signal (a) and phase space reconstructions for b) t=4ms, c) t=12ms and d) t=24ms.
While the theory [11] permits the use of any t to reconstruct a topologically equivalent phase-space, in practice, special care must be taken when choosing this value. A number of methods for finding a good value for t have been proposed
2
SPIE 4325-61
[11], but the practical method most used is to visually inspect the attractors and look for a t that "unfolds" the reconstructed attractor but does not cause a "folding back". In the Figure 1 there is a normalized ECG-Holter signal (Figure 1-a) and three graphs of two-dimensional (2D) phase spaces reconstructed by taking different values of t: t=4ms (Figure 1-b), t=12ms (Figure 1-c) and t=24ms (Figure 1-d). If t is too small, x(t) is close to x(t+t) and the attractor is compressed to the vicinity of the diagonal in phase-space (Figure 1-b) so it cannot be completely extended. If t is too large, the attractor will fold and the phase graph deforms (Figure 1-d). For the signal of the Figure 1-a (and for the other that we used in this paper) the optimal t was t = 12ms. This value for t generate a completely extended attractor (Figure 1-c). Starting from the constructed attractors we can calculate some important invariants from the underlying dynamic system. One of the most important of these invariants are the Correlation Dimension. Consider an attractor with N points reconstructed through time delay embbeding. If we cover this attractor with B boxes of size r the probability Pi of a point of the attractor to fall inside the i-th box will be given by Pi =limNÆ• Ni /N where Ni is the number the points that fall inside the ith box. The generalized dimensions of q-order are defined as
∑
B(r )
q
log i =1 Pi 1 . Dq = lim q − 1 r →0 log r
(2)
The parameter q is the called dimension degree. The most important dimensions used in non-linear studies of dynamic systems are D0 (the Fractal Dimension) and D2 (the Correlation Dimension) [12]. D2 has particular importance due an important result of Grassberger & Procaccia [13]. Grassberger & Procaccia showed that D2 can be writen as
D2 = lim
log
r →0
∑
B(r ) i =1
Pi
2
lim r →0
log r
log C ( m, r ) , log r
(3)
where the function C(m,r) is the Correlation Integral.
C ( m, r ) = lim r →0
1 N2
∑Θ r−ξ N
i , j =1 i≠ j
(m) i
− ξ (j m ) .
(4)
The function Q is the Heaviside function that is 1 if the argument is larger or equal to zero and 0 otherwise, m is the dimension of the reconstructed phase-space and xi the m-dimensional vectors of the attractor. The Correlation Integral belongs to a class of statistical functions called functions of cumulative distances. The Correlation Integral represents the fraction of all distances between different points on the trajectory of the attractor that do not exceed a certain distance r. An important aspect is that different attractors (of distinct dynamical systems) will generate different Correlation Integrals so this integral could be used to measure the difference among different attractors. However, the calculation of the Correlation Integral, in practical situations, cannot be fast. In the next section, we will introduce other measure (fast to be calculated) to quantify the difference between two reconstructed attractors obtained from different observable (or from the same observable but in different time instants). This measure is the q-order statistical distance between different distributions.
3. q-ORDER STATISTICAL DISTANCES One of the important contributions of information theory is yielding a recipe for measuring the amount of information that an observer possesses concerning a given phenomenon when only a probability distribution is known. Shannon entropy and Tsallis' entropies of q-order are two that share the principal properties: positivity, concavity, etc.. However, Tsallis' entropy is the one that better describes certain physical systems with q-values that are different from unity [7]. For example, one important invariant of deterministic dynamic systems is the Correlation Dimension that is a 2-order dimension (D2).
3
SPIE 4325-61
Associated with the Tsallis' entropy we have the divergence or distance between two probability distribution p and g. This distance is called Kulback-Leibler distance [9]. The concept of statistical distance between probability distributions is certainly a very important one in information theory; whose main tenet asserts that to any probability distribution one can associate an information measure [14]. Assume we have an estimation g of how the pertinent probability distribution should look. We are provided now with a probability distribution p that is the one that reflects what we know now about the system of interest. d(p:g) will be the measure of the amount of information associated to p relative to that contained in g, that is, d(p:g) is a measure of relative information. Diambra in his work [8] take Tsallis' ideas and show how the Kullback-Leibler distance or relative entropy can be used to distinguish different systems. For a continuum probability distribution p(x), with ∫ p ( x ) dx = 1 , the entropies are defined by the functional form
S f ( p ( x )) = − ∫ f ( p( x))dx ,
(5)
where f is a convex function. In this way, the Shannon functional entropy is defined by f ( p ) = p ln p . The q-entropies or entropy generalized of Tsallis' correspond when the functional operators is given by the form f q ( p ) = (q − 1)−1 ( p q − p ) . Using this functional we can write the Tsallis' entropy in the usual form
(
)
(6)
S q ( p ( x )) = (q − 1) −1 1 − ∫ p q ( x)dx .
Now we focus our attention in the derivation of q-order distances (or q-divergence). The q-divergence associated to the f-entropy is given by the Kullback-Leibler distance [9]
⌠ ⌡
d f ( p : g) = f
p ( x) g ( x )dx , g ( x )
(7)
where we impose in general the condition f(1) = 0, which guarantee d f ( p : p) = 0 . If we replace f in (7) by the functional operator corresponding to Tsallis' entropy, f q ( p) = (q − 1) −1 ( p q − p) , we obtain the Kullback-Leibler q-order distance (now parameterized with q):
d q ( p : g ) = (q − 1) −1
( ∫ p ( x) g q
1− q
)
( x)dx − 1 .
(8)
This result can be written for discrete probability distributions. Let two probability distributions {gi } and {pi } with i = 1,..., N be two normalized to unity. The q-distance is then given by
d q ( p : g ) = (q − 1)−1
∑p g N
i =1
q i
1− q i
− 1 ,
(9)
where we assume that whenever gi = 0, the corresponding pi is also zero.
4. DETECTING CHANGES IN ECG SIGNALS In Figure 2 there are two attractors reconstructed from the same ECG signal using different portions of this signal (in different time instants). In spite of the attractors belong to the same ECG signal they represent different dynamic behaviors. We are interested in detecting situations where this happens in ECG-Holter signals, that is, we are interested in detecting changes in the dynamics of the time evolution of the signal. For this we use the 2-order statistical distances to calculate
4
SPIE 4325-61
differences among the attractors obtained from different portions of the signal. We will consider only the 2-order distances because this order is related to the Correlation Dimension - D2 - and to the Correlation Integral that are important in nonlinear dynamic systems characterization.
Figure 2: Attractors reconstructed from the same ECG signal using different portions of the signal.
Once the dimension of the reconstructed attractors in this work will be equal 2, the statistical distributions in equation (9) will be 2D distributions: {gi,j} and {pi,j}. The order of the calculated distances we also be equal 2 (q=2). So considering these observations and defining d2(p:g) as dpg we obtain
∑∑
2
B ( r ) B ( r ) ( pi , j ) −1 , g 1 1 i j = = , i j
dpg =
(10)
where B(r) is the number of boxes of size r necessary to cover the reconstructed attractor (from the ECG time series). Note that the distributions {gi,j} and {pi,j} are obtained by the discretization of the phase space of the attractor in B boxes of size r. Each element gi,j and pi,j is given by the number of points of the attractor that fall inside the (i,j)-box (Figure 3).
Figure 3: Statistical distribution {gi,j} obtained from the attractor of the Figure 1-b.
5
SPIE 4325-61
The parameter r (the box size) is a critical parameter. High values of r yield the dpg calculation to take into account just great changes in the behavior of the attractor dynamics; however small values of r can make the result strongly influenced by noise. In this work we analyzed two discrete signals of the MIT public database of the Physionet [15]: sel16795 (MIT Normal Sinus Rhythm) and sele872 (MIT Supraventricular Arrhythmia). These two signals, which correspond to 15min of ECG-Holter signals, are normalized (amplitude) to unity. A value of r = 1/500 was adopted for the study, it implicates a matrix of 500¥500 boxes of size r for the phase space discretization of the normalized signal B(r)=500. Other values of r were tested, though for these two signals the best results were obtained for r around 1/500. The Nref = 5000 first initial points of each signal (20s) were chosen to reconstruct, using a time delay embedding (equation (1)) with m=2 and t=12ms, a reference attractor corresponding to distribution {gi,j}. Note that we do not concern if this initial part of the signal is normal from the pathological point of view. The concern was to choose a part of the signal that approximately represents the most representative behavior in the whole Holter signal. In both cases, the initial 20s satisfied that requirement. Using windows of N=3000 points (12s) separated by n=750 points (3s) we run the signal reconstructing, for each window, the attractors corresponding to distributions {pi,j} and calculating the distances dpg (equation (10)).
Figure 4: Scheme for the signal analysis using statistical distances described in this work: Nref is the number of points of the reference attractor corresponding to distribution {gi,j}, N is the number of points of each sliding window used to reconstruct the attractors corresponding to distributions {pi,j} and n is the number of points separating each sliding window.
The calculated values of dpg are attributed to the time instant referent to the middle of each sliding window. Figure 5 shows the results for the signal 0 of the ECG-Holter sel16795 from the MIT Normal Sinus Rhythm database.
Figure 5: Signal 0 of ECG-Holter sel16795 from MIT database: a) ECG signal, b) dpg analysis.
6
SPIE 4325-61
In the Figure 5 the distance dpg between each one of the reconstructed attractors (from the sliding windows) and the reference attractor oscillated around dpg=1 (the mean of dpg in this case was approximately 1.03) and being always below a maximum value of dpg=1.66. The absence of pronounced picks denote that no changes in the dynamical behavior of the system could be detected by the use of the statistical distances (at least for the values of the used parameters and for the reference attractor chosen). The values that statistical distances can assume are intimately linked to the value of the principal parameters used in the calculation process: m, t (embedding) and r (phase-space discretization). The dpg values can vary a lot in agreement with the choice of these parameters and a good amount of experimentation is still necessary to choose them. The other studied case was the signal 0 of the of the ECG-Holter sel872 of the MIT Supraventricular Arrhythmia database. Figure 6 shows the results.
Figure 6: Signal 0 of ECG-Holter sel872 from MIT database: a) ECG signal, b) dpg analysis.
Unlike the behavior that is seen in the Figure 5 the graph of the statistical distance of the Figure 6 presents a region with pronounced picks that goes from approximately the instant t=5:30 to approximately the instant t=8:00 of the ECGHolter signal. The values of the dpg oscillates (as well as in the Figure 5) around dpg=1 (the mean of dpg was 1.07 in this case). However the maximum value of the signal, reached in the instant t=08:09, have the value dpg=2.10. The behavior of the dpg graph indicate that the ECG presents an accentuated change in the dynamic behavior in the interval where occur the picks. Though we cannot identify exactly the kind of change occurred in that instants. For that we need to reconstruct the attractors and to compare to the reference attractor. In the Figure 6 we selected three time instants, two of them corresponding to the most high picks in the dpg graph (indicating great changes in dynamical behavior of the signal). These instants are the instants t=05:27 and t=08.09. We also chose another instant (t=09:57) where the distance dpg, from the reference attractor, presents a low value. All these instants are indicated by doted lines in the Figure 6. For each one of these instants we took the 12s of the window used for obtaining the dpg value and use it to reconstruct the 2D corresponding attractors. The results are showed in the Figure 7. We can visually notice the dynamics in the instants t=05:27 (Figure 7-b) and t=08:09 (Figure 7-c) presents high differences in relation to the dynamical behavior used as reference for the signal (the reference attractor in Figure 7-d). The attractor of Figure 7-b presents significant morphological changes in some QRS segments and the attractor of the Figure 7-c seemingly presents fluctuations in the segments P and T (that be can be caused by noise). In the Figure 7 we can also see that, in concordance with the dpg graph, the attractor of the Figure 7-d have a dynamical behavior close to the dynamical behavior of the reference attractor. Therefore, in all cases the dpg graph had success in detecting the changes of behavior of the ECG signal.
7
SPIE 4325-61
Figure 7: Attractors corresponding to the time instants indicated in the doted lines in the Figure 6.
4. CONCLUSIONS In this work, we showed that the statistical distances (dpg) can be used for detection of changes in the normal behavior of an ECG-Holter signal when we know the normal (or standard) behavior of the signal. The simple form of the equation (10) can be easily implemented in a program. It produces results more quickly than other numerical methods used to obtain measures for dynamic comparison like the Integral of Correlation. In this work, we have presented the analysis of only two ECG signals, however others signals were analyzed and the results obtained were also good, though further studies are necessary to solve problems such as the appropriate choice of the parameters and the use of the distances when comparing different signals. The next stage will be comparing normal and pathological signals in the attempt of establishing the existence or no of defined distances between different reference attractors. Other methods for calculation of the discrete statistical distributions based in the phase-space discretization (Figure 3) also need to be investigated. The use of adaptative algorithms in phase-space blocking is also being considered, that is, the division of the phase-space would be adjustable in agreement with the local density of points of the attractor. Finally, the robustness of this method should also be investigated regarding to the existence of noise in the signals or when the signals have low temporal resolution.
8
SPIE 4325-61
REFERENCES 1. L. Glass, M.C. Mackey, From Clocks to Chaos: the Rhythms of Life. Princeton: University Press (1988). 2. L. Glass, M. R. Guevara, A. Shrier, Universal bifurcations and the classification of cardiac arrhythmias. Ann NY Acad Sci 504:168-78 (1987) 3. A. L. Goldberger, D.R. Rigney, Nonlinear dynamics at the bedside. In: L. Glass, P. Hunter, McCulloch A. eds. Theory of Heart. New York: Springer, 583-605 (1991). 4. A. L. Goldberger, V. Bhargava, B. J. West, A. J. Mandel,. Some observations on the question: Is ventricular fibrillation "chaos?" Physica D; 19:282-9 (1986). 5. Z. Wang, X. Ning, Y. Zhang, G. Du, Nonlinear dynamic characteristics analysis of synchronous 12-Lead ECG signals, IEEE Engineering in Medicine and Biology; September/October; 110-115 (2000). 6. Sugihara G. Allan W, Sobel D, Alan KD. Nonlinear control of heart rate variability in human infants. Proc Natl Acad Sci USA; 93:2608-13 (1996). 7. C. Tsallis, Possible Generalization of Boltzmann-Gibbs Statistics, J. Stat. Phys.; 52, 479 (1988) 8. . L. Diambra, Statistical Distance of q-order, Proceeding of VI Latin-American Workshop on Nonlinear Phenomena (1999). 9. S. Kullback, Information Theory and Statistics, J. Wiley, New York, (1959). 10. F. Takens, Detecting strange attractors in turbulence, Lecture Notes in Mathematics vol 898, Springer-Verlag, New York, Heidelberg e Berlin, 366-381 (1981). 11. H. D. I. Abarbanel, Analysis of observed chaotic data in physical systems, Rev. Mod. Phys.; 65, 1331-1392 (1993). 12. J. M. Thompson, H. B. Stewart, Nonlinear dynamics and chaos, John Wiley ed., Chichester, New York, Brisbane, Toronto e Singapure, (1986). 13. P. Grassberger, I. Procaccia, Measuring the strangeness of strange attractors, Physica D; 9, 189-208 (1983). 14. E. T. Jaymes, in Maximum Entropy and Bayesian Methods in Science and Engineering vol. 1: Fundations, Kluwer Dordrecht, 24-35 (1988) 15. A. L. Goldberger, L. A. N. Amaral, L. Glass, J. M. Hausdorff, PCh 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(23):e215-e220 (2000).
9