Recognition of biosignals with nonlinear properties by approximate entropy parameters

More and more attention is being paid to the development of methods for the objective analysis of biosignals for computer medical systems. The search for new non-standard methods is aimed at improving the reliability of diagnostics and expanding the areas of their practical application. In this paper, methods for recognizing biomedical signals by the degree of severity of their nonlinear components are considered. An approach based on the use of approximate entropy closely related to Kolmogorov entropy ( K -entropy) is used. Its parameters can be used to detect dynamic irregularities associated with nonlinear properties of signals. The algorithm for calculating this characteristic is considered in detail. Based on model experiments, its main properties are analyzed. It is shown that the entropy of a finite sequence, calculated in accordance with a multistep procedure, can give an erroneous estimate of the degree of regularity of the signal. A procedure for correcting the approximate entropy is proposed, which expands the area of analysis of this function for estimating nonlinearity. It has been established that the transition to adjusted entropy makes it possible to increase the reliability of the detection of chaotic components. A set of entropy parameters is proposed for constructing recognition procedures.


Introduction
Complex biomedical signals (EEG, ECG, heart rhythm, etc.) under certain conditions can be considered as the processes generated by the dynamic chaos mode.This representation makes it possible to diagnose using criteria based on the analysis of characteristics used in nonlinear dynamics.For example, in [1 -3], it was proposed to use approximate entropy (ApEn) which quantitatively determines the degree of signal complexity.Theoretical and experimental studies published in these papers have shown that the analysis of the ApEn entropy parameters makes it possible to assess the degree of regularity of the time series, as well as to detect the presence of a pronounced chaotic component in the signal.This is important for solving medical problems, where the sign of nonlinearity can be used to diagnose pathology, predict its development, as well as for operational monitoring of the patient's condition.
A number of interesting scientific papers are devoted to the application of approximate entropy in the problems of analyzing the dynamics of the cardiovascular system [4 -11].They investigate the applicability of entropy in-dicators for the analysis of heart rate variability (HRV) [4,5], and also propose solutions to practical problems.These include detection of cardiac arrhythmias (atrial fibrillation) [6], detection of signs of chronic heart failure [6,7] recognition of meditative states [8], neonatal screening [9], identification of autonomic disorders of the cardiovascular system [10], assessment of the level of functioning of the autonomic nervous system by HRV [11].In these publications, along with the discussion of the effectiveness of recognizing various states of an organism by biological time series, it is pointed out that the results obtained are highly dependent on the size of the analyzed data sample.In practice, this causes a significant shift in entropy estimates and leads to ambiguity in the diagnostic conclusions obtained.A transition to other entropy characteristics is proposed, for example, sample entropy [4] and multiscale entropy [5], which is a useful transformation of ApEn, but does not solve the problem entirely.
The results of many studies in the field of EEG signal analysis show the possibility of using an entropy approach to recognize states that differ in the level of brain activity.Among the most significant practical applica-tions are the measurement of the depth of anesthesia by EEG [12,13], the detection of epilepsy by short-term fragments of EEG [14 -16], recognition of various mental states [17], classification of sleep stages and assessment of the degree of complexity of brain activity [18], analysis of cognitive functions [19].The entropy parameters of the reconstructed EEG signal are proposed to be used to control the motor activity of disabled people [20], which is an important social task.The experimental results presented in these papers also indicate the need to improve the accuracy of computer medical diagnostics based on the entropy indicators used.
All this testifies to the importance of developing methods for recognizing biomedical signals based on entropy characteristics, especially taking into account the requirements of dynamic state analysis for short fragments of the analyzed biosignal.For a reasonable application of the approximate entropy in diagnostic and current control tasks, it is necessary to form a set of parameters that allow reliably detecting the properties of nonlinearity from short signal recordings.It is required to investigate the properties of entropy on model and real biomedical signals of varying complexity.This will allow us to assess its capabilities and limitations for use in various practical fields, including in medical research.
In this paper, based on the experimental results and the obtained entropy estimates of nonlinearity, methods and algorithms for detecting fragments of biomedical signals (ECG, EEG) differing in the degree of severity of chaotic and regular components are proposed.In particular, two tasks are considered: the detection of fragments of atrial fibrillation by the sequence of cardiointervals and the assessment of the depth of anesthesia by EEG.
The creation of new recognition algorithms using parameters of nonlinearity of biomedical signals is aimed at improving the quality of automatic diagnostics in medical monitoring systems.

Аpproximate estimation of Kolmogorov entropy
Approximate entropy is closely related to Kolmogorov entropy (K-entropy) [21,22], the most important characteristic of chaotic motion in a phase space of arbitrary dimension.K-entropy is defined as the average rate of information loss about the state of the dynamic system over time.It is zero for regular motion, infinite for random systems, and positive and constant for systems with deterministic chaos.By analyzing some signal that seems random, it is possible to distinguish the irregularity associated with the motion dynamics on the attractor from the white noise impact on the system [3].
In practice, the value of K-entropy is difficult to compute because one implementation of a complex process is analyzed.Although an attractor characterizing the properties of the system is embedded in the ddimensional phase space.However, according to the Takens' theorem [7], some properties of the attractor can be reconstructed by one process component.In this case, it is possible to find the lower bound of the K-entropy where C m (r) is the generalized correlation integral, m is the length of a sequence of points, and r is the threshold distance.
The correlation integral is calculated as follows where ) is a sequence consisting of m signal samples, () is the Heaviside function ((s) = 1, if s  0), and (s) = 0, if s < 0), and N is the data sample size.If the index is K 2 > 0, it denotes a sufficient condition for chaos.However, the requirement m  ∞, r  0, N  ∞ in (1), (2) makes it impossible to apply the K 2 criterion in practical problems of signal analysis on finite samples.Thus, it is necessary to find an approximate estimate of the Kolmogorov entropy in the form of ApEn.

Algorithm for calculating the ApEn function
Let there be a sample of the source data x (1), x (2),, x (N), where N is the sample length.First, let us set the values of two parameters: m is the length of the analyzed strings, and r is the threshold specifying the sizes of the cells of the phase space.(A) Let us generate the sequences X (1),, X (N -m +1) defined by the following expression: where N m (i) is the number of values of d (X (i), X ( j)) that satisfy the following condition С i and average its value over i: Increase the value of m to m+1.Repeat steps 1-4 and find the values of A high-speed algorithm for computing this ApEn estimate was proposed in [3].
The value of the ApEn depends on the parameters m and r.It is assumed [1] to set the value of m = 2 and r to (0.1, …, 0.25)  x , where  x is the standard deviation of the original data sample.However, a more complete idea about the properties of the investigated signal can be obtained by analyzing the change in the entropy index over time, i.e., under successive increase in the length of the strings m.All subsequent calculations of the ApEn were carried out for N = 300, m = 1, ..., 6, and r = 0.15 x .
The complexity of sequence ApEn(m), m = 1, 2, analysis on finite data samples is due to the fact that with an increase in m, a significant decrease in entropy values is observed.This leads to an erroneous assessment of the degree of regularity of the process.The number of phase space cells containing only one object increases with the growth of m.As a result, such single objects, the number of which is growing, give zero entropy increment.Even in the presence of a chaotic component, a sharp decrease in the curve of the function to zero can be observed.This distorts the general idea of the ratio of regular and chaotic components in the analyzed sequence and, in general, can lead to false conclusions.The shorter the length N of the time series, the more pronounced the effect of false regularity.
The correction estimate ApEn(m) can be used to exclude a false signal regularity estimate associated with the finite sample length N [23]: where N m +1 is the number of the analyzed strings with length (m+1), (1)   m N is the number of once encountered strings with length m, and ApEn(0) is the absolute entropy value.
In this case, the lower bound of the K-entropy can be approximate by the lower bound ApEn cor (m).The level of this estimation is different for deterministic, random and chaotic nonlinear processes.
In expression (3), single chains are given weights equal to absolute entropy, i.e. there is an artificial "noise" of the analyzed process.The introduction of weights for single objects was justified in [24], but it was used to calculate the conditional Shannon entropy.
The main difference between the ApEn and the conditional Shannon entropy is the method for generating elementary regions of the phase space.Hypercubes are generated by a rigid grid given by the number of quantization levels in the calculation of conditional entropy.The mechanism of adaptive generation of elementary regions by constructing hyperspheres with a radius r with the center specified by each point in which the object of the phase space is located is active in calculating ApEn(m).This leads to a different way of counting the number of single events and, accordingly, a different kind of adjusted entropy function.
A schematic depiction of the mechanisms of generation of elementary cells for a 2D space is shown in Fig. 1.

Analysis of properties and selection of parameters of ApEn
Model experiments aimed at studying the properties of approximate entropy were conducted in [3,25,26].
The following characteristics can be distinguished from the main properties.
1. Approximate entropy reflects the signal complexity degree, i.e., the higher its regularity, the less the value of ApEn(m).
2. Analysis of the corrected estimate ApEn(m) makes it possible to obtain a reliable estimate of chaotic degree of the signal by relatively short signal fragment.
3. Using entropy analysis, it is possible to distinguish nonlinear oscillations from chaotic changes associated with stochastic properties of the signal.4. Estimates ApEn(m) are resistant to short-term noise.
5. The threshold r, which sets the size of hyperspheres when calculating ApEn(m), can be used as a noise filter.6.The insensitivity of the approximate entropy to the frequency of the harmonic signal is observed.

a) b) Fig. 1. Illustration of the mechanism for the generation of phase space cells in the calculation of (a) conditional entropy and (b) ApEn
Experiments showed that it is possible to detect signals in which their chaotic properties are of a different nature.
Fig. 2 shows the result of analyzing the logistic mapping X (i +1) = a  X (i)  (1-X (i)), where a is an external parameter, as an example.This nonlinear difference equation for a = 3.5 is periodic (Fig. 2a), and for a = 3.8 it is chaotic (Fig. 2c).
There are differences in the obtained characteristics in the graphs, namely: for a = 3.5, ApEn (m) rapidly de-creases to zero with increasing m (Fig. 2b), which is typical for periodic signals, and the correction does not change the estimate ApEn cor (m) (the graphs of the dependences coincide).At the same time, the dependence ApEn(m) tends to a certain constant level with increasing m in the transition to the deterministic chaos mode (a = 3.8) (Fig. 2d).In this case, at the step m = 5, a correction is introduced.This is caused by an increase in the number of once encountered strings, detected during the analysis of elementary hyperspheres.The shape of the curves ApEn (m) and ApEn cor (m) changes abruptly in the analysis of a stochastic process.Fig. 3 shows the result of the analysis of the second-order autoregression where μ is the mathematical expectation of a random variable Z (i); Z(i), i = 1, 2, is the white noise with normal distribution law; a 1 =1.0, a 2 = -0.5.
As can be seen from Fig. 3b there is a pronounced minimum ApEn cor (m) in the graphs.The values of ApEn (m) tend to zero, while the function, to the value of the absolute entropy ApEn (0).The nature of the dependences ApEn (m) and ApEn cor (m) is similar to the laws found for the case of white noise.
The following parameters can be used to estimate the regularity degree of the changes observed in a discrete sequence of samples: -parameter ApEn (2) as the most significant for the analysis of chaotic properties of the signal

Atrial fibrillation recognition
These parameters were used to recognize atrial fibrillation by the sequence of cardiointervals].The analysis of the correlation dimension of rhythmograms in the case of atrial fibrillation showed [27] that the heart rhythm is chaotic, and, therefore, methods of nonlinear dynamics can be used in this problem.The studies were performed on the rhythmograms of real electrocardiogram records.All the realizations were previously verified and divided into three classes: normal rhythm (NR) including pronounced respiratory arrhythmia, atrial fibrillation (AF), and frequent premature heart beats (FPHB).The choice of these classes is associated with the possible erroneous recognition of AF strips for the alternative NR and FPHB groups which have a significant scatter in the rhythmogram readings.Then, the most characteristic realizations for this class (by 50 implementations with length 300 samples) were selected in each of the three groups, and training samples were generated.For these fragments, the values ApEn (m) and ApEn cor (m) were calculated for m = 1, …, 6, and also ME K .
Figure 4 shows examples of rhythmograms and the obtained dependences of ApEn (m) on the fragment lengths m for the classes AF (a, b), NR (c, d), and FPHB (e, f ) for r = r 0   x , r 0 = 0.15.As can be seen from the figure, the entropy dependences have different forms for different classes of rhythmograms.In the case of AF, which is characterized by a chaotic rhythmogram, there is a decrease and then a rapid return of the corrected entropy to the original level ApEn (0).As a consequence of this change in ApEn cor (m), the parameter ME K for AF takes the smallest value.

. Examples of estimates ApEn (m) (solid line) and ApEncor (m) (dashed line) for real signals of (a, b) atrial fibrillation, (c, d) normal rhythm, and (e, f ) frequent premature heart beats
Decision functions were constructed by estimates of approximate entropy using the theory of linear discriminant analysis [28].The AF recognition problem involves the detection of fragments of this arrhythmia against the background of alternative rhythm groups.Therefore, the discriminant analysis was carried out for a two-class problem: AF ( 1 class) and NR and FPHB ( 2 class).The classification was conducted using a different set of parameters ApEn (m) and ApEn cor (m).Informative features were selected by the Fisher's criterion J.It made it possible to limit the description of objects to the following set of features: ME K ; ApEn (m) for m = 1, 2, 3.In this case, the theoretical classification errors were minimal and amounted to less than 0.1 %.The effectiveness of the decision rule was verified using a control sample that includes 100 ECG realizations for each of the three types of rhythm.As shown by the results of calculations, this method has a high level of sensitivity (S e = 0.98) and specificity (S p = 0.985) in AF recognition.
The obtained data (the ApEn method) were compared with AF detection results using alternative recognition methods:  testing the Gaussian distribution law hypothesis ( 2 criterion);  estimation of the standard deviation of the rhythmogram (Dev);  autoregressive model prediction (AR-model);  estimation of the minimum of the refined conditional Shannon entropy (ME).
The results of the analysis of the effectiveness of these methods are given in Tab. 1.The table shows that the AF detection method based on the approximate entropy is the most reliable.

EEG-based anesthesia depth estimation
The considered entropy characteristics were also used for the analysis of the electroencephalogram (EEG signal) in different stages of anesthesia and recognition of the stage of deep anesthesia.In [29], it was proposed to use the index ApEn (2) to estimate the depth of anesthesia by EEG.
It is known that a change in the level of functional activity of the brain causes characteristic changes observed in the EEG signal [30].A high level of brain activity is accompanied by a complex chaotic EEG signal.The decrease in the degree of functional activity is reflected in the EEG by regular low-frequency oscillations of sufficiently large amplitude.
In Fig. 5, four fragments of the EEG signal recorded from one patient at different stages of anesthesia are shown as an example: (a) before anesthesia, (b) in the initial stage, and (c) during emergence from anesthesia, and also (d) in the final awakening stage.The sampling frequency of the EEG signal is 500 Hz.The fragment duration is 10 s. Figure 6 shows the result of calculating the approximate entropy for two consecutive 5-second fragments of these EEG signals with the value r = 0.2  x .
In the initial region of the change in parameter m the curves have obvious differences at different functional states of the brain, as can be seen from the graphs of dependences ApEn (m).In this case, the values of parameter ApEn (2) reduce by more than twice when transitioning from the active state (Fig. 6a) to the stage of deep anesthesia (Fig. 6b).The emergence from anesthesia (Fig. 6c) and the transition to the final awakening (Fig. 6d) are accompanied by a gradual increase in the values of ApEn (2).They are represented graphically as a scatter of points on vertical lines with coordinates i (1) before the anesthesia begins, (2) deep anesthesia, (3) emergence from anesthesia, and (4) final awakening.As can be seen from the figure, disjoint sets of objects are formed on lines 1 and 2. Obviously, it is possible to solve the problem of recognizing the stage of deep anesthesia for the data sample under consideration with a threshold of 47. Stages 3 and 4 form groups of points that occupy an intermediate position between states 1 and 2. This corresponds to the existing concept of the process of emergence from anesthesia.The Fisher's criterion J [28] was selected as an indicator of effectiveness of the use of the index ApEn (2) /ApEn (0) for recognition of the stages of anesthesia.It was calculated from the sets of values of the entropy parameter for two consecutive states (1 → 2; 2 → 3; 3 → 4).In total, electroencephalograms of 31 patients were analyzed during the experiment.The following values were obtained as a result of processing of 124 EEG realizations of 10 s each: J 1,2 = 3.07; J 2,3 = 0.78; J 3,4 = 0.47.Entropy parameters were estimated for short 5-second fragments of the EEG signal.
As follows from the analysis of the values of the J criterion, as well as the data shown in Fig. 7, the method for estimating the parameter ApEn (2) makes it possible to solve the problem of recognizing two states: wakefulness and deep anesthesia.This provides a basis for further research on the entropic approach when recognizing intermediate anesthesia stages.

Conclusion
The paper presents the results of research on the optimization of the parameters of the approximate entropy for use in problems of recognition of biomedical signals with chaotic properties.An algorithm for calculating entropy is given, and an analysis of its basic properties is given.A transition to an adjusted estimate of the approximate entropy is proposed, which expands the number of features used for finite data samples.This contributes to obtaining a more complete assessment of the degree of complexity (irregularity) of the signal and the severity of the nonlinear components.It is shown that the relative minimum of the adjusted entropy can be used as the lower bound of K-entropy.
Methods for solving two medical problems are proposed: the detection of fragments of atrial fibrillation by the sequence of ECG cardiointervals and the assessment of the depth of anesthesia by EEG.Using the parameters of the approximate entropy and its adjusted estimate, linear decision rules for the recognition of atrial fibrillation against the background of sinus arrhythmia and frequent extrasystole (ApEn method) were obtained.The experimental data sample shows that the ApEn method allows to obtain higher sensitivity and specificity indicators compared to other known methods.This is important to ensure reliable detection of atrial fibrillation fragments during continuous ECG monitoring.
The possibility of recognizing the stages of anesthesia by short 5 s EEG fragments was investigated.As the main feature, it is proposed to use the normalized entropy parameter ApEn (2), reduced by means of a nonlinear transformation to the scale generally accepted in anesthesiology.In the course of experiments on real EEG recordings obtained during surgical operations, the possibility of reliable recognition of two states was established: wakefulness and deep anesthesia.But further studies of entropy methods are required for the task of recognizing intermediate stages of anesthesia.
All the results obtained in the course of the study can be used in practical applications requiring analysis of the degree of complexity of the process or detection of signals with pronounced chaotic properties.The methods proposed in this paper can be used to create systems for monitoring the patient's condition using ECG and EEG signals.

2 .
Logistic mapping for a = 3.5 and a = 3.8: (a, c) the original signal and (b, d) dependences of ApEn(m) (solid line) and ApEncor (m) (dashed line) on m [1,26]; -the values of ApEn (m) for m = 1, 2, 3, where the contribution of single strings is negligible; -sequence ApEn cor (m), m = 1,, 6 for a more complete multiparameter description; -relative minimum lower bound of the K-entropy.a) b) Fig. 3. Second-order autoregressive process: (a) the original signal X(i) and (b) dependences of ApEn (m) (solid line) and ApEncor (m) (dashed line) on m

5 .
Fragments of the EEG signal in different stages of anesthesia: (a) before anesthesia, (b) deep anesthesia, (c) exit from anesthesia, (d) definitive awakeningWe used the normalization for the value of the absolute entropy ApEn (0) and experimentally selected the nonlinear scale of transition to final indices to bring the entropy index to the scale adopted in anesthesiology (0...100).In this case, entropy values close to 100 for the EEG signal recorded be-fore the anesthesia starts and at the stage of full awakening should be expected.In the case of deep anesthesia, it is obvious that the index ApEn (2) will have small values.

Figure 7
Figure7shows the results of calculating the normalized index ApEn (2) /ApEn (0) in the accepted measure-

6 .Fig. 7 .
Fig. 7. Mapping of entropy parameters along the directions i corresponding to the four stages of anesthesia