Next Article in Journal
Zero-Free Intervals of Chromatic Polynomials of Mixed Hypergraphs
Next Article in Special Issue
Exploring HIV Dynamics and an Optimal Control Strategy
Previous Article in Journal
A Rich Vehicle Routing Problem for a City Logistics Problem
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Signal Folding for Efficient Classification of Near-Cyclostationary Biological Signals

ZJU-UIUC Institute (Zhejiang University-University of Illinois at Urbana-Champaign Institute), Haining 314400, China
*
Author to whom correspondence should be addressed.
Mathematics 2022, 10(2), 192; https://doi.org/10.3390/math10020192
Submission received: 10 December 2021 / Revised: 2 January 2022 / Accepted: 6 January 2022 / Published: 8 January 2022

Abstract

:
The classification of biological signals is important in detecting abnormal conditions in observed biological subjects. The classifiers are trained on feature vectors, which often constitute the parameters of the observed time series data models. Since the feature extraction is usually the most time-consuming step in training a classifier, in this paper, signal folding and the associated folding operator are introduced to reduce the variability in near-cyclostationary biological signals so that these signals can be represented by models that have a lower order. This leads to a substantial reduction in computational complexity, so the classifier can be learned an order of magnitude faster and still maintain its decision accuracy. The performance of different classifiers involving signal folding as a pre-processing step is studied for sleep apnea detection in one-lead ECG signals assuming ARIMA modeling of the time series data. It is shown that the R-peak-based folding of ECG segments has superior performance to other more general, similarity based signal folding methods. The folding order can be optimized for the best classification accuracy. However, signal folding requires precise scaling and alignment of the created signal fragments.

1. Introduction

Biological signals can be gathered from a wide range of physiological sensors which are frequently used in different diagnostic and experimental settings. The digitized sensor outputs are time series data encoding information about the underlying biological processes and phenomena. It is, therefore, of interest to develop robust signal and data processing methods for the automatic extraction of relevant information from the collected data. In addition to various methods of classical statistical and causal inference, the regression and classification of time series data require their representation as feature vectors, such as the parameters of time series data models.
Time series data are often modeled as an autoregressive integrated moving average (ARIMA). A comprehensive overview of ARIMA modeling can be found in [1]. The ARIMA-based clustering and classification of time series data is investigated, for example, in [2,3]. The order of ARIMA models can be determined by the Akaike information criterion (AIC) [4,5]. In this paper, we develop a new strategy for reducing the order of ARIMA models by introducing a novel technique referred to as signal folding. It should not be confused with other techniques referred to by the same term, which sometime appear in the literature, and which may refer, respectively, to frequency folding in signal sampling, simple time reversal of a signal, or to a technique for reducing the required number of elements in digital circuits. The signal folding method proposed in this paper partitions the signal into multiple fragments which are then linearly combined so that the signal variability is reduced. The fragment combining, including ordinary arithmetic averaging, requires the proper scaling and alignment of fragments to avoid the information aliasing. The proposed signal folding crucially exploits a cyclostationary property [6] inherently present in many biological signals. The signal folding preserves the signal mean, whereas the signal variance is substantially reduced. More importantly, the folding of labeled signals for training machine learning models can greatly simplify the feature extraction since the required order of the underlying data models can be considerably reduced. It then leads to an order of magnitude speed-up in training the machine learning models.
The benefits of signal folding in this paper are demonstrated for a case of sleep apnea detection in a single-lead ECG signal. Sleep apnea is potentially a serious health condition marked by abnormal breathing activity in sleep, sleep fragmentation, intermittent hypoxia, systemic inflammation imbalance, and other serious health problems [7,8]. Sleep apnea in suspected patients can be detected by monitoring changes in their ECG patterns, although most patients remain undiagnosed. The ECG-based detection of sleep apnea can be administered outside specialized medical clinics, and it is often used prior to more complex but more indicative multi-channel ECG and EEG polysomnography. However, these methods require the overnight monitoring of patients, which hinders their widespread use. Sleep apnea detection from a single lead ECG signal can, therefore, become a viable alternative to polysomnography [9].
Different features for detecting sleep apnea in ECG signals were investigated in [10]. The R-peaks and the distances between R-peaks were found to be the most discriminating. The study of [11] evaluated the accuracy of detecting sleep apnea in the ECG signal over different signal durations. It was found that there is an optimal ECG segment length, providing the most reliable apnea detection. The detection of arrhythmic conditions in ECG signals was studied in [12]. The signal noise was suppressed in a frequency domain using the fast Fourier transform (FFT). The R-peaks and other waveforms of ECG signal were detected, and modeled as polynomials. The polynomial coefficients were then used as feature vectors for the random forest classifier. A singular value decomposition (SVD), empirical mode decomposition, and the FFT were used in [13] to extract the features for ECG signal classification. The discrete wavelet transform following signal de-noising was studied in [14] to identify the P, Q, R and S peaks, allowing to classify the ECG signals. The robustness of ECG classification to a sampling jitter was investigated in [15] assuming the R-peak intervals, and other signal morphology and higher-order statistical features. The features for ECG signal classification in [16] were defined by fitting mathematical expressions to the QRS waveforms. The R-peak intervals as well as amplitudes were exploited in [9] to detect sleep apnea in a single lead ECG signal. In addition, it was shown in [9] that assuming previous classification decisions can improve the per-segment classification accuracy from 80% to 86%.
The ARIMA model for low-frequency and high-frequency components of the ECG signal was used in [17] to extrapolate future signal values. It was suggested to use smoothing of the ECG signal prior to further processing. A moving average filtering for the noise removal in ECG signals was analyzed in [18]. A non-stationary ARIMA model of ECG signals with maximum-likelihood estimation of the model parameters was considered in [19]. The ARIMA coefficients were then used to detect sleep apnea using different classifiers, including support vector machine (SVM), artificial neural network (ANN), quadratic and linear discriminant analysis, and the K-nearest neighbor (K-NN) classifier.
The detection of sleep apnea in ECG signal had 90% accuracy in [10,11]. Ref. [19] reported an accuracy of 81% for an ARIMA model with 8 coefficients. The binary classification of arrhythmic conditions in the ECG signals reached 91% accuracy in [12]. The R-peak based signal folding investigated in our numerical experiments can achieve 90% accuracy, but with significantly reduced complexity. In particular, this accuracy was achieved for an ARIMA model having only 3 coefficients enabled by the signal folding pre-processing. It leads to substantial, order-of-magnitude time savings in training the sleep apnea classifiers.
The rest of this paper is organized as follows. Signal folding and the associated folding operator are formally introduced, and their properties are analyzed in Section 2. Section 3 describes the classification procedure involving signal folding and the corresponding algorithms in more detail. The performance and sensitivity of signal folding for sleep apnea detection in a one-lead ECG signal are evaluated in Section 4. The properties of signal folding are discussed in Section 5 in light of other state-of-the-art methods used for ECG signal classification. The paper is concluded in Section 6.

2. Mathematical Background

This section mathematically defines signal folding, and the associated folding operator, and explores their fundamental properties. The main objective is to understand why signal folding can improve the efficiency of signal classification.
A good model for random observations of a periodically occurring biological phenomenon can have a general mathematical form:
x ( t ; { T K } k ) = k = X k t l = k 1 T l T k , t R
where X k ( t ) are random processes defined over a unit support interval, and ( 0 , 1 ) , and T k > 0 are random variables. The k-th summand in (1) has the support, ( l = k 1 T l , l = k T l ) , of length T k . Using the expectation operator, E , the mean process is defined as
x ¯ ( t ) = E x ( t ) = k = X ¯ k t l = k 1 T l T k , t R .
The variance of the random signal (1) depends on the cross-covariances [20],
cov X k ( t ) , X l ( t ) = var X k ( t ) k = l R k , l ( t , t + τ ) k l .
Thus, the random process (1) is generally non-stationary since both its mean and variance may be time dependent.
Provided that the parameters T k can be accurately estimated, the random process (1) can be folded as
x ˜ ( t ) = F x ( t ; { T k } k = lim K 1 1 + K k = K / 2 K / 2 X k ( t ) , t ( 0 , 1 ) .
In (4), we introduced the folding operator F · , so the folded process, x ˜ ( t ) , is an arithmetic average of the constituting random processes X k ( t ) . The operator F is deterministic, conditioned on T k . The parameters T k can be estimated by exploiting specific properties of the random signal (1), for example, by minimizing a distance metric between subsequent fragments X k 1 and X k , or between X k and all the previous fragments X k i , i = 1 , 2 , , .
The signal folding (4) is accomplished in two steps. The signal (1) is first sliced into time-shifted fragments, X k ( t / T k ) , which are then re-scaled by T k . The re-scaled fragments are then time-aligned before computing their arithmetic average. If the variance of T k is small, i.e., the probability, Pr | T k T ¯ | < ϵ 1 , for k , T ¯ = E T k , the fragments, X k ( t / T k ) , must still be optimally aligned, but they can be zero-padded to the same length instead of re-scaled; this is the case of near-cyclostationary signals, such as ECG or EEG.
Note also that the signal folding (4) is a form of low-pass filtering since the higher frequency components in waves X k are suppressed. It is different from classical low-pass signal filtering in which the signal samples are serially combined over time, whereas the signal folding proposed in this paper combines the samples in signal fragments in parallel. Consequently, we can assume and define the signal fragments to be cyclostationary, but mutually stationary [6].
In practice, the folding order K in (4) is finite. For instance, some fragments X k can be labeled and used as training data for learning a classifier in order to categorize other unseen fragments. Let ( K + 1 ) × L fragments, X l , k , be partitioned into L equal-size groups of ( K + 1 ) fragments each. The fragments in each group are folded, i.e., averaged as
x ˜ l ( t ) = 1 1 + K k = K / 2 K / 2 X l , k ( t ) , l = 1 , 2 , , L .
Assuming mutual stationarity in Definition 1, the folded fragments, x ˜ l ( t ) , have the following properties.
E x ˜ l ( t ) = 1 1 + K k = K / 2 K / 2 E X l , k ( t ) = X ¯ ( t )
var x ˜ l ( t ) var X l , k ( t ) 1 + K = σ X 2 ( t ) 1 + K
E | x ˜ l ( t ) | m | X ¯ ( t ) | m , m = 1 , 2 ,
Definition 1.
The fragments, X k ( t ) , t ( 0 , 1 ) , are (wide-sense) stationary, provided that the following conditions are satisfied:
(1)
The mean, E X k ( t ) = X ¯ ( t ) , for k .
(2)
The variance, var X k ( t ) = σ X 2 ( t ) , for k .
(3)
The cross-covariance, cov X k ( t ) , X l ( t + τ ) = cov X 0 ( t ) , X l k ( t + τ ) , for k , l .
The expression (6) shows that signal folding does not change the mean of signal fragments. The variance reduction in () was obtained assuming inequality, ( A B ) 2 0 . Note also that
x ˜ ¯ ( t ) = E F x ( t ) = F E x ( t ) = E x ˜ ( t ) = F x ¯ ( t ) .
For cyclostationary as well as generally non-stationary signals, the averaging (9) can be further combined with a linear time-average operator, Av [ x ( t ) ] = lim T T / 2 T / 2 x ( t ) d t . Finally, the general moments in () are bounded by the Jensen’s inequality. In addition, Jensen’s inequality for a 2D convex function ϕ can be written as
E ϕ ( x ˜ k ( t ) , x ˜ l ( t ) ) ϕ ( X ¯ ( t ) , X ¯ ( t ) ) .

2.1. ARIMA Modeling of Signal Fragments

The objective is to represent the folded average fragment, x ˜ ( t ) , by an ARIMA model. In its general form, the model, ARIMA ( p , d , q ) × ( P , D , Q ) S , is defined as a product of certain polynomials in a lag variable L , i.e., [1]
SAR ( L S ) AR ( L ) SDF ( L S ) DF ( L ) x ˜ ( t ) = SMA ( L S ) MA ( L ) w ( t ) .
The model (11) relates the error term (input noise), w ( t ) , to the output random process, x ˜ ( t ) . The polynomials in (11) are defined as follows [1]:
seasonal AR : SAR ( L S ) = 1 B 1 L S B P L S P non-seasonal AR : AR ( L ) = 1 b 1 L b p L p seasonal MA : SMA ( L S ) = 1 + A 1 L S + + A Q L S Q non-seasonal MA : MA ( L ) = 1 + a 1 L + + a q L q seasonal differencing : SDF ( L S ) = ( 1 L S ) D non-seasonal differencing : DF ( L ) = ( 1 L ) d .
Denote as θ ( N par ) the vector of N par = ( p + d + q + S P + S D + S Q ) ARIMA model parameters. The most likely parameter values θ ^ ( N par ) describing the observed fragments, X ¯ , maximize the likelihood, f X ( X ¯ | θ ( N par ) ) . However, the model should also avoid overfitting the observed data. The AIC metric for model selection combines the model goodness-of-fit to the data and penalizes the model order, i.e., [4,5],
AIC ( N par ) = 2 N par 2 log f X ( X ¯ | θ ^ ( N par ) ) .
The model order is then a trade-off between the number of degrees-of-freedom to fit the observed data, and their likelihood in order to minimize the AIC metric (13).
Assuming the property (), it is straightforward to show that signal folding reduces the variance of the model noise w ( t ) in (11). The reduced variance of w ( t ) increases the likelihood, f X ( X ¯ | θ ( N par ) ) , of the model parameters, θ ( N par ) , given the observations, X ¯ . Consequently, if the parameters likelihood is increased due to the reduced variance of the model noise, maintaining the same AIC value allows for a larger number of parameters, N par , to be assumed in the model. Consequently and equivalently, the number of parameters N par can be reduced while maintaining the same model accuracy, provided that the variance of w ( t ) is reduced. The reduced value of N par directly translates into a substantial reduction of the computational complexity since the data model must be identified for possibly a large number of signal fragments.

2.2. Classification of Signal Fragments with and without Folding

In the last subsection, it was shown that signal folding allows for the reduced order ARIMA modeling of signal fragments. This has a major positive impact on the computational complexity of obtaining the feature representation of signal fragments. The feature vectors as the ARIMA model coefficients were considered for classification of time series, for example, in [2,3,17,19].
The task is to decide whether the observed fragment, x ( t ) , indicates that a condition, C = 0 , or, C = 1 , has occurred. The optimum maximum a posteriori (MAP) rule is defined as [21]
f ( x | C = 0 ) f ( x | C = 1 ) Pr C = 0 Pr C = 1 1 .
If there is no prior information on C, both conditions can be assumed to be equally likely, i.e., Pr C = 0 = Pr C = 1 = 1 / 2 . The decision rule (14) represents a binary hypothesis testing problem to infer the condition, C, from the observation, x ( t ) .
Assume that groups of K time-aligned fragments under the same condition C are combined to create the average fragments,
x ˜ ( t ) = 1 K i = 1 K x i ( t ) .
The corresponding conditional distributions (likelihoods) are denoted as f ( 1 ) | 0 ( x ( t ) | C = 0 ) , f ( K ) | 0 ( x ˜ ( t ) | C = 0 ) , f ( 1 ) | 1 ( x ( t ) | C = 1 ) , and f ( K ) | 1 ( x ˜ ( t ) | C = 1 ) , where the first subscript indicates the number of averaged fragments. These distributions are sketched in Figure 1, assuming the support, x ( t ) R . The cross-over points, x ( 1 ) * and x ( K ) * , in Figure 1 partition the signal values into the regions where the likelihood of one condition is greater than the other. However, the actual decision threshold T α is normally determined to set the desired probabilities of Type I and Type II errors. Since averaging (15) reduces the variance whilst the mean is unaffected [cf. (6) and ()], both of these error probabilities are reduced, i.e.,
α ( K ) < α ( 1 ) a n d β ( K ) < β ( 1 ) .
Furthermore, averaging the groups of signal fragments reduces the required order of ARIMA models, but also the amount of available training samples. This greatly reduces the overall computational complexity of feature extraction; however, a smaller number of available training samples may also affect the classifier performance. In order to assess the effect of the smaller number of training samples having smaller variances due to averaging, let the total number of labeled signal fragments, N = K L , be divided into L groups. The K fragments within each group are then averaged as in (15). The fragments are generated under one of the conditions (classes), C. The mean fragment in each class C is denoted as x ˜ ¯ ( K ) | C ( t ) [cf. (9)]. The classifier performance can be assessed by comparing the probabilities that the average fragment x ˜ l ( t ) representing the l-th group, l = 1 , 2 , , L , is closer in some sense to the mean fragment, x ˜ ¯ ( K ) | 0 ( t ) , of class 0 than to the mean fragment, x ˜ ¯ ( K ) | 1 ( t ) , of class 1, i.e.,
P ( K ) = Pr x ˜ l ( t ) , x ˜ ¯ ( K ) | 0 ( t ) < x ˜ l ( t ) , x ˜ ¯ ( K ) | 1 ( t ) .
The actual norm · in (17) must be derived for the specific features and decision rule assumed [cf. (14)]. However, provided that the fragments are mutually independent and identically distributed (I.I.D.), and each fragment x l ( t ) is represented by a scalar feature V l 0 , we can compare the probabilities P NF and P F of correctly classifying all N fragments without folding and all L = N / K fragments with folding, respectively. In particular, denote V l to be a feature vector of K fragments in the fragment group l, so | V l | = K , for l = 1 , 2 , , L . The corresponding probabilities of correct decisions are
P NF = i = 1 N Pr V i < T thr = Pr max i V i < T thr = Pr V 1 , , V N / K < T thr P F = Pr 1 K i = 1 K V i < T thr N / K = Pr 1 K max l V l 1 < T thr
where · p denotes the l p -norm of a vector, and the threshold T thr is the average of the mean features in each class, i.e., T thr = V ¯ ( 0 ) / 2 + V ¯ ( 1 ) / 2 . Since for any vector V of N elements, the norms, V V 1 / N , it is straightforward to show that
max V 1 , , V N / K max 1 K V 1 1 , , 1 K V N / K 1 .
Consequently, the probability P F P NF , so signal folding can not only significantly reduce the computational complexity of feature extraction, but also improve the decision accuracy of classifiers, effectively compensating the reduced number of training samples.

3. Methodology

As shown in the previous section, signal folding exploits a cyclostationary property of signals in order to reduce their inherent variability and noise, but without completely removing important information embedded in the signals, which is crucial for their classification. An overall signal classification workflow involving signal folding as the first pre-processing step is shown in Figure 2. The folding operation consists of first partitioning the signal segments into multiple fragments. The fragments can be re-scaled, but they must always be time aligned before they are averaged. The closer the input signal is to be more exactly cyclostationary, the more likely it is that the re-scaling step can be omitted, and replaced by padding the fragments with zero samples. In the second step, a mathematical model of the averaged fragment is identified, and the model parameters are used as a feature vector for classifying the original signal segment.
In this paper, the effect of signal folding on signal classification is investigated for the case of detecting sleep apnea in a one-lead ECG signal. The ECG data were retrieved from PhysioNet, a public repository of medical research data [22,23]. The dataset consists of 35 CSV (comma-separated values) files containing the ECG signals for men and women between ages 27 and 63 years over a duration of 7 to 10 h. The ECG signals are manually annotated once per every minute to indicate whether sleep apnea has occurred or not. The annotation marks are used to partition the signal into one minute segments of 6000 samples each, with the marks being in the segment centers. The segments of this length are deemed to be sufficient to reliably detect sleep apnea by classifying the extracted segment features [11]. The R-waves in the ECG segments can be observed once per every 90 to 100 samples. In total, 6512 segments with sleep apnea and 10,483 normal segments, all having 6000 data points, are available in the dataset.
The feature extraction and subsequent classification can be made more robust by reducing the signal variations. It can be accomplished by a simple Butterworth or moving average filter in order to suppress high-frequency components in the signals [18]. In this paper, signal folding is proposed to smooth out the signal variations. The signal folding can be succinctly described as storing the original long signal row by row into a matrix, taking the average signal across the matrix rows, and then classifying these shorter average signals. Such a procedure requires to properly slice the ECG segments into multiple fragments of possibly unequal sizes, and then to precisely scale and align the fragments before their averaging. The alignment is necessary, even if the fragments are of an equal length in order to avoid the information aliasing effects, which may suppress important information or create spurious features in the signal.
The following three methods were considered to slice the long ECG segments into shorter fragments. In all these methods, the length L of all fragments is constrained to ensure that they have at least L min samples, but no more than L max samples. The design parameters L min and L max are determined, so all fragments contain exactly one R-wave with very high probability; a small fraction of fragments which eventually do not satisfy this condition is discarded.
The first segment partitioning method simply slices the ECG signal into the equal-sized fragments, having between L min and L max samples. The procedure is outlined in Algorithm 1. In particular, the optimal fragment length L * minimizes the cumulative squared Euclidean distance (ED) between all the pairs of fragments, s i and s j , having the equal length L samples, i.e.,
ED ( L ) = i , j s i s j 2
and
L * = argmin L [ L min , L max ] ED ( L ) .
Algorithm 1 The signal fragmentation yielding equal size fragments
1: functionCreate_Fragments_1( S , L min , L max ) # input signal and the fragments length limits
2:    for all  L { L min , , L max }  do
3:   partition S into disjoint segments of length L
4:    ED ( L ) i , j s i s j 2 # calculate the cumulative squared Euclidean
# distance between all pairs of segments
5:    end for
6:    return  L * argmin ED ( L ) # return the optimum segment length
7: end function
The second segment partitioning method allows for non-equal sized fragments. The process is outlined in Algorithm 2. It is a greedy strategy which cuts out the next fragment, so its Euclidean distance to the previous fragment is minimized under the length constraint. The created fragments can be disjoint, or they are allowed to overlap. The averaging of fragments with unequal sizes requires their alignment and scaling prior to their averaging. For discrete-time signals, the re-scaling corresponds to digital interpolation or extrapolation. Alternatively, padding the shorter fragments with zeros can be used for near-cyclostationary signals instead of re-scaling.
Algorithm 2 The signal fragmentation yielding non-equal size fragments
1: functionCreate_Fragments_2( S , L min , L max ) # input signal and the fragments length limits
2:     for all  L 0 { L min , , L max }  do
3:         get s prev ( L 0 ) # previous segment of length L 0
4:         for all  L 1 { L min , , L 0 }  do
5:            get s next ( L 1 ) s prev ( L 0 ) # next segment of length L 1
6:             ED ( L 1 ) s prev ( L 1 ) s next ( L 1 ) # calculate their Euclidean distance
7:         end for
8:          L 1 * argmin ED ( L 1 ) # select the best L 1
9:          L L L 1 * # and store it
10:     end for
11:     return  L # return the fragment lengths
12: end function
The third strategy for slicing the ECG signal into fragments relies on detecting the R-peaks. We adopted the R-peak recognition algorithm presented in [24]. This algorithm can be also used to estimate the inter-R-peak distances. The limits L min and L max can be then determined, so that most of the fragments contain exactly one R-peak. The histogram of the inter-R-peak distances, Δ RR , for one selected ECG segment of 6000 samples is shown in Figure 3. For this segment, there are 70 R-peaks, so 69 inter-R-peak distances are reported in Figure 3 with the mean value of about 87 samples. More importantly, the mid-points between the consecutive R-peaks can be assumed as the slicing points to create the fragments. This approach turned out to be more robust than the first two methods. This can be expected since Algorithms 1 and 2 are more general, and can be used for fragmenting any near-cyclostationary biological signals, whereas the fragmentation based on R-peak detection is specific to the ECG signals.
The histograms as the one in Figure 3 were obtained for 20 randomly selected ECG segments. The fragment length bounds L min = 85 and L max = 100 samples were inferred from the observed statistics of the inter-R-peak distances. The inferred bounds L min and L max can be used in Algorithms 1 and 2. The third fragmentation method can assume the fixed-length fragments of L ¯ = 90 samples with the fragment centers placed at the detected R-peaks. This causes some fragments to overlap whilst there may be gaps in between other fragments. However, it is guaranteed that each fragment contains exactly one R-peak. The presence of a single R-peak within the fragments also enables their robust alignment. A snipset of the ECG segment with automatically identified R-peaks is shown in Figure 4. Figure 5 illustrates the alignment of four fragments of different lengths at their R-peak values.
The fragment alignment for the other two methods can be achieved by finding the fragment shifts, minimizing the Euclidean distance between the fragments. Once the fragments are aligned, their averaging is straightforward, although the zero-padding samples should be discounted.

Sleep Apnea Detection in the ECG Signal

Automated classification of time series data by classical machine learning classifiers requires to manually define the features upon which the classification decisions are made. In this study, the ECG signal segments are fitted to ARIMA models, and the ARIMA model coefficients are then used as the feature vectors for subsequent ECG signal classification.
The order of ARIMA model can be estimated by the Akaike information criterion (AIC). However, finding the coefficients of the ARIMA model of a given order must be performed repeatedly many times for all ECG segments or fragments in order to obtain the labeled feature vectors for training the classifiers. Since fitting the model to data has an associated computational cost; these costs quickly accumulate for larger training datasets.
In order to assess the computational cost of extracting the feature vectors from the whole ECG dataset, we measured the time T 100 to fit the ARIMA model of a given order to 100 ECG fragments. Thus, the time T 100 is assumed as a proxy for inferring the actual computational complexity. Recall that our ECG dataset consists of 16,995 segments, and each segment can be further subdivided into 60 fragments on average. The estimated time for fitting the whole dataset is then equal to T ^ 16995 = 169.95 × T 100 (hours). The measured and estimated times T 100 and T ^ 16995 , respectively, are reported in Table 1. The ARMA model order ( 5 , 2 , 4 ) was assumed in [19], and the ARMA model order ( 5 , 1 , 1 ) was determined by minimizing the AIC values for fitting the whole ECG segments (see below).
Our numerical experiments indicate that the time required for fitting the ARIMA models to time series data is strongly dependent on the model order and much less dependent on the length of the data sequences. In general, the ECG signal requires higher order ARIMA models to maintain good classification accuracy, even though such models incur the significant time penalty as shown in Table 1. Moreover, fitting a single ARIMA model of a given order to the whole ECG segment can incur a substantial loss in the classifier accuracy in comparison when the same model order is used for the individual ECG fragments. More importantly, we observed that employing the segment folding to represent each ECG segment by an average fragment provides sufficient information for the classifier to maintain its good accuracy. Even though the segment fragmentation, alignment and averaging consume a certain amount of time, the average fragments can be represented by the lower order ARMA models. This yields a good trade-off between the time required for training the classifier and the achievable classifier accuracy. Specifically, the ECG segment folding reduces the time required for feature extraction by an order of magnitude while maintaining the same classifier accuracy as when the higher order ARMA models are fitted to all the available (16,995 × 60) ECG fragments.
The detection of sleep apnea in ECG segments was performed assuming the following eight classifiers: logistic regression, SVM, decision tree, random forest, naïve Bayes, K-NN, extreme gradient boosting (XGBoost), and ANN. The ANN has two fully connected layers with 16 neurons in each layer. One output neuron gives predicted values between 0 and 1, and the threshold 0.5 is assumed to make the final binary decisions. The random forest classifier is configured to contain 100 decision trees, and its performance is validated by a so-called out-of-bag score.
The 70% of labeled ECG fragments are used for the classifier training, and the remaining 30% of data are used for testing and evaluating the classifier performance. The training data are selected by stratified sampling in order to reflect the ratio of the available fragments with and without sleep apnea, respectively.
The performance of binary classifiers is normally evaluated by various metrics involving the true positive (TP), true negative (TN), false positive (FP) and false negative (FN) rates. Specifically, in this paper, the performance of classifiers is compared, assuming the accuracy, specificity and sensitivity. The accuracy reports the percentage of correctly identified segment types, i.e., it is the fraction, ( TP + TN ) / ( TP + TN + FP + FN ) . The specificity is determined as a percentage of correctly identified normal segments (without sleep apnea) among the segments that were identified as being normal, i.e., it is the fraction, TP / ( TP + FN ) . The sensitivity is the percentage of segments correctly identified as being affected by sleep apnea, i.e., it is the fraction, TN / ( TN + FP ) . The classifiers are also compared by the times required for their training. Note that we do not evaluate the goodness-of-fit of ARIMA models to ECG signal segments since the ultimate metric of interest is the classification performance.

4. Results

The segments extracted from the original ECG dataset were folded into fragments as described in Methods. There are 60 fragments on average in every ECG segment containing exactly one R-peak. The fragments were then aligned and averaged to yield the short ECG signals of about 100 samples each with much less variation than the original signals. The order of ARIMA models to represent the average ECG fragments was determined using the AIC. The AIC values were calculated for 1000 randomly selected fragments. The maximum order of both the AR and MA model parts was limited to 5 in order to limit the overall computation times required for determining the model order. It should be noted that without fragment averaging, the required order of ARIMA models would be at least doubled.
The results of the ARIMA model order selection using the AIC are given in Table 2. The seasonality was set to ( 0 , 0 , 0 ) 0 corresponding to an ordinary ARMA model, and to ( 2 , 1 , 0 ) 12 , respectively. Assuming the values in Table 2, the ARMA model ( 2 , 1 , 0 ) without seasonality was selected for all the subsequent numerical experiments since it provides the best trade-off between the model likelihood and the model complexity.
The ARIMA coefficients are used as feature vectors to classify the ECG fragments and indicate whether sleep apnea is present or absent. The performance of all eight classifiers is compared in Table 3 in terms of the accuracy, specificity, and sensitivity. The first accuracy values are given for the general fragmentation method described by Algorithm 2. The second accuracy values assume the R-peak-based ECG segment folding. The training times reported in Table 3 are the average times per one instance of training data. The performance reported in Table 3 is the maximum achievable values over 25 independent training runs to suppress the random effects observed in the classifier training and testing.
Overall, the results in Table 3 suggest that the best performing classifier is random forest. The R-peak-based segment folding outperforms the general segment folding method for decision trees, random forest, K-NN, ANN and XGBoost classifiers. The better performance is likely due to exploiting the specific structure of ECG signals containing distinct R-peaks, which can be reliably detected. It is interesting that this feature is implicitly exploited by some but not all classifier types. The unit training times of all classifiers are relatively small, except for the ANN, which requires a much longer time to learn the classification model from training data.

Sensitivity Analysis

It is desirable to gain an insight into how the key parameters of the proposed segment folding affect the classification performance. In particular, we carry out numerical experiments to evaluate the effect of the number of averaged fragments, and how the fragments are selected for averaging. We also evaluate the effect of fragment misalignment prior to their averaging. Finally, we investigate the consequences of performing the averaging of ECG segments prior to their fragmentation. The numerical results are obtained only for the random forest classifier since it has the best performance as shown in the last subsection. In this subsection, the general fragmentation method in Algorithm 2 is used for the segment folding.
Consider first the problem of choosing a limited number of available fragments from the ECG segment for averaging. The fragments are optimally aligned by their R-peaks. We compare two fragment selection strategies. The first strategy is to deterministically select the fragments consecutively, as they were created from the original ECG segment. For example, the first N avg fragments are chosen, and the remaining fragments in the ECG segment are discarded. The second strategy selects the same number of N avg fragments; however, now the fragments are selected from the ECG segments at random with an equal probability. The selected fragments are aligned, averaged, and then used for training and testing the classifier.
Assuming that N avg = { 10 , 20 , 30 , 40 , 50 } fragments are selected from the 60 fragments available in each ECG segment, the accuracy of the random forest classifier with the deterministic and the random fragment selection is compared in Figure 6. In order to eliminate randomness in training the classifier, a ten-fold cross-validation is assumed, and the classifier is trained five times on each training dataset. The best achieved accuracy is recorded for each value of N avg and for both fragment selection strategies.
The accuracy results in Figure 6 offer several interesting observations. A random selection of fragments is clearly inferior to the consecutive fragment selection, especially when only a small fraction of fragments is considered. However, whereas the accuracy of the random fragment selection monotonically and steadily increases with the number of selected fragments, the accuracy of the consecutive fragment selection reaches a maximum when about half of the fragments are chosen for averaging. The dependency of the classifier accuracy with the consecutive fragment selection on the actual number of fragments selected is also less pronounced. Furthermore, selecting only a subset of consecutive fragments for averaging appears to always outperform the case when all the fragments are averaged (denoted as the horizontal green line in Figure 6). This is a rather interesting outcome which may indicate that there are limits on how much information can be removed from the signal by the proposed signal folding.
Next, we investigate the robustness of the random forest classifier to the fragment misalignment prior to the fragment averaging. The misalignment may be less of an issue for the ECG signals due to the availability of the R-peaks in each ECG fragment, which allows for their accurate alignment. However, the alignment problem can, in general, be more severe for other types of biological signals. The misalignment error can be systematic, i.e., constant, or vary at random for different fragments. Since the systematic misalignment error is more likely to be identified and corrected, here, we only study the case when the misalignment error Δ i e (in samples) is chosen at random with an equal probability from the interval:
Δ i e [ Δ e , + Δ e ] , Δ e = { 1 , 5 , 10 , 20 } .
The procedure for evaluating the performance of the random forest classifier is the same as above. Thus, the classifier is trained independently five times on each training dataset, and the maximum accuracy among 25 runs is recorded. Both the consecutive and the random fragment selection strategies are considered.
Figure 7 and Figure 8 show the accuracy results from the same set of experiments. Figure 7 shows the achieved accuracy as the number of averaged fragments N avg for different misalignment limits Δ e . Figure 8 then shows the achieved accuracy as the maximum misalignment Δ e for the different number of averaged fragments N avg . Note that the value, N avg = 60 , corresponds to the case of averaging all the available fragments. We can observe from Figure 7 that the misalignment error has larger effect on the consecutive fragment selection than on the random fragment selection. For the consecutive selection with a larger misalignment of fragments, the accuracy becomes largely independent of the number of fragments being averaged. On the other hand, the classification accuracy improves with the number of fragments for the random selection, even if the fragment misalignment is large.
The last experiment assumes that the averaging is performed directly on the ECG segments prior to their fragmentation. In this case, the alignment must be done for the whole segments, which may be more problematic than for the individual fragments containing only a single R-peak. In order to have a fair comparison with the previous results, the ECG segments with the same label (sleep apnea or normal) are averaged in batches of 60. This allows to create 282 averaged ECG segments from the original pool of 16,995 segments. The averaged ECG segments are then sliced into equal-length fragments of 100 samples each. The fragments are used to train the random forest classifier using the coefficients of ARIMA models as the feature vectors. The best performance from 25 independent training runs is 85%, which is better than the segment folding method, using Algorithm 2, having only 78.6% accuracy, but worse then the R-peak-based segment folding, having 89.5% accuracy as shown in Table 3. For comparison, Ref. [19] reported the best accuracy of 83% for the SVM classifier assuming the ( 5 , 2 , 4 ) ARMA model with the time-varying variance of the error term fitted to the whole ECG segment.

5. Discussion

In the literature, the classification of ECG signals seems to be mainly concerned with detecting heart arrhythmia, although other diagnostic objectives are also considered such as detecting stages of myocardial infarction [25], stages of sleep [26], and changes in ECG due to hypertension [27]. The detection of abnormal conditions and their classification are usually performed assuming signal segments [13], their frequency sub-bands [27], and possibly multiple time scales [28]. The raw ECG signal normally contains additive measurement noise and power-line interference, but it may be also subject to other distortions, such as baseline wander, and muscle and electrode motion artifacts. The noise and other distortions can be suppressed by a wide range of techniques, including Fourier and wavelet transforms and other signal decompositions, machine learning autoenconders, and statistical filtering methods [29]. Consequently, the performance of classifiers is strongly dependent on the quality and quantity of the ECG data, i.e., the actual dataset being considered [30].
A brief survey of state-of-the-art techniques for classifying ECG signals is given in Table 4. It is clear that most of the recent papers focus on different types of neural network classifiers including convolutional (CNN), recurrent, and long short-term memory (LSTM) neural networks. The signal pre-processing aims to suppress the undesired distortions and inherent noises. This is usually achieved by a simple low-pass filtering [26,27,29]. The ECG signal can be transformed into other domains using SVD, discrete Fourier transform (DFT), and wavelet transform. The signal features can be learned by the NN classifier [25,31,32,33], or they can be defined explicitly [15,34,35]. Furthermore, as indicated in Table 4, typical classification accuracy of ECG signals reported in the literature is often close to perfect 100%. An exception is Ref. [33], reporting an accuracy which is in a good agreement with the values observed in our numerical experiments. The better performance of the NN classifiers is to be expected at the cost of much higher computational complexity and the required larger training datasets.
The main difference in ECG signal classification in this paper and the previous studies is the introduction of signal folding as the key pre-processing step for classifying near-cyclostationary biological signals. Signal folding reduces the signal variability, so the models with lower order can be assumed. Such models often have much lower computational complexity, and also the model overfitting is easier to detect. In the literature, the signal variability is normally reduced by smoothing the signal by low-pass filtering. However, signal folding requires to slice the signal into separate fragments, scale the fragments to the same length, and then align them, so they can be averaged. The fragment scaling and alignment can be combined into one step as a simple linear transformation, even though the parameters of the linear transformation must be determined individually for each fragment. For near-cyclostationary signals, the scaling can be replaced with padding the shorter fragments with zero samples as was assumed for the case of ECG signals in our numerical experiments. In addition, a simple averaging could be replaced with the weighted averaging in order to emphasize the signal fragments, which carry more important information, or are less noisy.
More importantly, even though signal folding removes some information by suppressing the signal variations, the classifier accuracy to detect sleep apnea in one-lead ECG segments was not affected. This is a rather surprising and unexpected finding. Moreover, as discussed in Methodology, there is a trade-off in reducing the number of training samples by their folding, and reducing the signal model order to learn the classifier more efficiently. A simple slicing of the signal into equal sizes fragments is easy to implement. However, the equal-sized fragments may be more difficult or even impossible to properly align. The scaling and alignment errors may create information aliasing, which can either obscure useful information, or create spurious information. Both phenomena have the detrimental effect on knowledge extraction and drawing valid conclusions from data. A better strategy for signal slicing is to create fragments that have good statistical similarity. The similarity between fragments can be evaluated, for example, by their Euclidean distance, or time warping [13]. In such a case, the segment slicing can be combined with the fragment scaling and alignment. Although this method is rather general, and it can be used for any cyclostationary time series data, the disadvantage may be the larger required numerical complexity. The third approach to signal slicing can exploit specific unique signal features. In the case of ECG signals, there are near-periodically occurring R-peaks. The mid-points between the detected consecutive R-peaks then define the fragment boundaries. Moreover, the R-peaks can be used to align the fragments, although, in our numerical experiments, the scaling was replaced with zero padding at both ends of the fragments to have the same length. The R-peak-based fragmentation provided more reliable feature representation, and more accurate subsequent classification.
Our numerical results demonstrated that signal folding can greatly reduce the computational complexity of feature extraction. The numerical savings come from the reduced modeling order required to faithfully describe the folded segments rather than from making the fragments shorter, since identifying the model parameters in the smaller number of dimensions is much faster. Moreover, it was shown that folded segments have smaller variability, whereas their means are preserved. The smaller variability of labeled fragments improves the quality of training samples for learning the classifier since unimportant variations are suppressed, whereas the important variations are preserved for making the correct classification decisions. This is also crucial as the number of training data is reduced in proportion to the folding order. In our numerical experiments, we observed that there is an optimal number of combined fragments to achieve the best classification performance. Moreover, combining consecutive fragments always outperforms the case when the fragments are selected at random, which may be expected as indicated in [9].
Mathematically, a new folding operator was introduced to succinctly describe the process of creating and averaging the signal fragments. The order of folding and expectation operations can be interchanged. The expectation is performed over the distribution of given random variables, whereas the signal folding requires defining the set of signal slicing points. The slicing points are used to split the signal into many fragments followed by their re-scaling, alignment, and arithmetic averaging. This allows creating multiple averaged fragments from signals of long duration. The folding order, i.e., how many fragments are averaged, is an important design parameter affecting the performance of subsequent data processing, and it deserves further investigation.
In our case of sleep apnea detection in ECG signals, the ECG data were already partitioned into one-minute segments. The ECG segments were completely folded, so there was exactly one R-peak contained in each fragment. Such folding exploits the cyclostationary property often present in many biological signals. The scaling and accurate alignment of the fragments is necessary to avoid information aliasing, which can otherwise be caused by an ordinary low-pass filtering. However, the low-pass pre-filtering can be combined with the signal folding, which is an interesting research problem to investigate.
The signal folding investigated in our numerical experiments appears to be robust since it exploits the unique patterns and cyclostationarity of the ECG signal. The more general greedy algorithm introduced in this paper relies on signal similarity, such as the Euclidean distance of the newly created fragment with all the previous fragments, but the subsequent classification has somewhat inferior (as much as 10% lower) performance compared to the R-peak-based signal fragmentation. One strategy for improving the signal folding robustness is to create the average fragments cumulatively, or to employ more rigorous methods of statistical inference to optimally estimate the key parameters of signal folding.
In summary, signal folding reduces the signal variability while preserving the important signal features. The feature extraction and signal classification can be then performed an order of magnitude faster assuming both linear and non-linear signal models. Signal folding can be readily combined with other signal processing techniques and incorporated into signal processing workflows. It can play a vital role in machine learning classification and regression. However, signal folding appears to be very sensitive to the selection of proper slicing instances and accurately scaling and aligning the created signal fragments in order to avoid information aliasing.

6. Conclusions

The paper investigated signal folding to greatly reduce the computational complexity of classifying near-cyclostationary biological time series data. A new signal folding operator was introduced to mathematically describe the process of creating signal fragments, which are then scaled, aligned and averaged. It was shown that the signal fragment averaging does not change their mean, whilst their variance is reduced proportionally to the number of averaged fragments. The averaged fragments can be described by data models of a lower order, which is the main source of computational savings in the classifier training. The achievable reduction in training times can be of the order of a magnitude. The ARIMA modeling of the ECG fragments was assumed, and the ARIMA coefficients were used as the feature vectors for classifying the ECG segments. The best performing classifier was random forest. The R-peak-based signal folding outperformed other more general signal folding strategies. In general, signal folding is sensitive to proper scaling and alignment of the signal fragments prior to their averaging. Several problems for possible future research were suggested in the Discussion section.

Author Contributions

Conceptualization, P.L.; methodology, T.Z. and P.L.; software, T.Z.; validation, T.Z. and P.L.; formal analysis, P.L.; investigation, T.Z. and P.L.; resources, T.Z. and P.L.; data curation, T.Z.; writing—original draft preparation, T.Z. and P.L.; writing—review and editing, P.L.; visualization, T.Z.; supervision, P.L.; project administration, P.L.; funding acquisition, P.L. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by a start-up research grant provided by Zhejiang University.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data analyzed in this paper can be downloaded from the PhysioNet Repository [22].

Conflicts of Interest

The author declares no conflict of interest.

References

  1. SAS Institute Inc. Chatper 7: The ARIMA Procedure; SAS OnlineDoc®, Version 8; SAS Institute Inc.: Cary, NC, USA, 1998. [Google Scholar]
  2. Kalpakis, K.; Gada, D.; Puttagunta, V. Distance Measures for Effective Clustering of ARIMA Time-Serie. In Proceedings of the IEEE International Conference on Data Mining, San Jose, CA, USA, 29 November–2 December 2001; pp. 273–280. [Google Scholar] [CrossRef] [Green Version]
  3. Wang, J.; Tang, S. Time series classification based on ARIMA and AdaBoost. In Proceedings of the 2019 International Conference on Computer Science Communication and Network Security (CSCNS 2019), Sanya, China, December 22–23 2019; Volume 309. [Google Scholar] [CrossRef] [Green Version]
  4. Ozaki, T. On the Order Determination of ARIMA Models. J. R. Stat. Soc. Ser. C (Appl. Stat.) 1977, 26, 290–301. [Google Scholar] [CrossRef]
  5. Stoica, P.; Selén, Y. A review of information criterion rules. IEEE Signal Process. Mag. 2004, 21, 36–47. [Google Scholar] [CrossRef]
  6. Gardner, W.A. Introduction to Random Processes with Applications, 2nd ed.; McGraw-Hill Inc.: New York, USA, 1990. [Google Scholar]
  7. Pace, A.; Iannella, G.; Rossetti, V.; Visconti, I.C.; Gulotta, G.; Cavaliere, C.; Vito, A.D.; Maniaci, A.; Cocuzza, S.; Magliulo, G.; et al. Diagnosis of Obstructive Sleep Apnea in Patients with Allergic and Non-Allergic Rhinitis. Medicina 2020, 56, 454. [Google Scholar] [CrossRef] [PubMed]
  8. Javaheri, S.; Barbe, F.; Campos-Rodriguez, F.; Dempsey, J.A.; Khayat, R.; Javaheri, S.; Malhotra, A.; Martinez-Garcia, M.A.; Mehra, R.; Pack, A.I.; et al. Sleep Apnea. Types, Mechanisms, and Clinical Cardiovascular Consequences. J. Am. Coll. Cardiol. 2017, 69, 841–858. [Google Scholar] [CrossRef] [PubMed]
  9. Wang, T.; Lu, C.; Shen, G. Detection of Sleep Apnea from Single-Lead ECG Signal Using a Time Window Artificial Neural Network. BioMed Res. Int. 2019, 2019, 9768072. [Google Scholar] [CrossRef]
  10. de Chazal, C.; Heneghan, E.; Sheridan, R.; Reilly, P.; Nolan, M.; O’Malley, P. Automatic classification of sleep apnea epochs using the electrocardiogram. In Proceedings of the Computers in Cardiology, Cambridge, MA, USA, 24–27 September 2000; Volume 27, pp. 745–748. [Google Scholar] [CrossRef]
  11. de Chazal, P.; Penzel, T.; Heneghan, C. Automated detection of obstructive sleep apnoea at different time scales using the electrocardiogram. Physiol. Meas. 2004, 25, 967–983. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  12. Celin, S.; Vasanth, K. A Novel Method for ECG Classification Using Polynomial Based Curve Fitting. In Proceedings of the 2019 IEEE International Conference on Electrical, Computer and Communication Technologies (ICECCT 2019), Coimbatore, India, 20–22 February 2019. [Google Scholar] [CrossRef]
  13. Sinha, N.; Das, A. Discrimination of Life-Threatening Arrhythmias Using Singular Value, Harmonic Phase Distribution, and Dynamic Time Warping of ECG Signals. IEEE Trans. Instrum. Meas. 2021, 70, 2504508. [Google Scholar] [CrossRef]
  14. Arumugam, M.; Sangaiah, A.K. Arrhythmia identification and classification using wavelet centered methodology in ECG signals. Concurr. Comput. Pract. Exp. 2020, 32, e5553. [Google Scholar] [CrossRef]
  15. Dias, F.M.; Monteiro, H.L.; Cabral, T.W.; Naji, R.; Kuehni, M.; Luz, E.J.D.S. Arrhythmia classification from single-lead ECG signals using the inter-patient paradigm. Comput. Methods Programs Biomed. 2021, 202, 105948. [Google Scholar] [CrossRef]
  16. do Vale Madeiro, J.P.; Marques, J.A.L.; Han, T.; Pedrosa, R.C. Evaluation of mathematical models for QRS feature extraction and QRS morphology classification in ECG signals. Measurement 2020, 156, 107580. [Google Scholar] [CrossRef]
  17. Huang, F.; Qin, T.; Wang, L.; Wan, H.; Ren, J. An ECG Signal Prediction Method Based on ARIMA Model and DWT. In Proceedings of the 2019 IEEE 4th Advanced Information Technology, Electronic and Automation Control Conference (IAEAC 2019), Chengdu, China, 20–22 December 2019; pp. 1298–1304. [Google Scholar] [CrossRef]
  18. Pandey, V.; Giri, V.K. High frequency noise removal from ECG using moving average filters. In Proceedings of the 2016 International Conference on Emerging Trends in Electrical Electronics & Sustainable Energy Systems (ICETEESES 2016), Sultanpur, India, 11–12 March 2016; pp. 191–195. [Google Scholar] [CrossRef]
  19. Faal, M.; Almasganj, F. Obstructive sleep apnea screening from unprocessed ECG signals using statistical modelling. Biomed. Signal Process. Control 2021, 68, 102685. [Google Scholar] [CrossRef]
  20. Loskot, P. Polynomial Representations of High-Dimensional Observations of Random Processes. Mathematics 2021, 9, 123. [Google Scholar] [CrossRef]
  21. Gelman, A.; Carlin, J.B.; Stern, H.S.; Dunson, D.B.; Vehtari, A.; Rubin, D.B. Bayesian Data Analysis, 3rd ed.; CRC Press: Boca Raton, FL, USA, 2014. [Google Scholar]
  22. MIT Laboratory for Computational Physiology. PhysioNet Repository. 2021. Available online: https://physionet.org/ (accessed on 15 October 2021).
  23. Penzel, T.; Moody, G.B.; Mark, R.G.; Goldberger, A.L.; Peter, J.H. The apnea-ECG database. In Proceedings of the Computers in Cardiology, Cambridge, MA, USA, 24–27 September 2000; Volume 27, pp. 255–258. [Google Scholar] [CrossRef]
  24. Makowski, D.; Pham, T.; Lau, Z.J.; Brammer, J.C.; Lespinasse, F.; Pham, H.; Schölzel, C.; Chen, S.H.A. NeuroKit2: A Python toolbox for neurophysiological signal processing. Behav. Res. Methods 2021, 53, 1689–1696. [Google Scholar] [CrossRef] [PubMed]
  25. Prabhakararao, E.; Dandapat, S. Myocardial Infarction Severity Stages Classification From ECG Signals Using Attentional Recurrent Neural Network. IEEE Sens. J. 2020, 20, 8711–8720. [Google Scholar] [CrossRef]
  26. Sharma, M.; Dhiman, H.S.; Acharya, U.R. Automatic identification of insomnia using optimal antisymmetric biorthogonal wavelet filter bank with ECG signals. Comput. Biol. Med. 2021, 131, 104246. [Google Scholar] [CrossRef] [PubMed]
  27. Rajput, J.S.; Sharma, M.; Tan, R.S.; Acharya, U.R. Automated detection of severity of hypertension ECG signals using an optimal bi-orthogonal wavelet filter bank. Comput. Biol. Med. 2020, 123, 103924. [Google Scholar] [CrossRef]
  28. Panda, R.; Jain, S.; Tripathy, R.; Acharya, U.R. Detection of shockable ventricular cardiac arrhythmias from ECG signals using FFREWT filter-bank and deep convolutional neural network. Comput. Biol. Med. 2020, 124, 103939. [Google Scholar] [CrossRef]
  29. Chatterjee, S.; Thakur, R.S.; Yadav, R.N.; Gupta, L.; Raghuvanshi, D.K. Review of noise removal techniques in ECG signals. IET Signal Process. 2020, 14, 569–590. [Google Scholar] [CrossRef]
  30. Hernandez-Matamoros, A.; Fujita, H.; Escamilla-Hernandez, E.; Perez-Meana, H.; Nakano-Miyatake, M. Recognition of ECG signals using wavelet based on atomic functions. Biocybern. Biomed. Eng. 2020, 40, 803–814. [Google Scholar] [CrossRef]
  31. Murat, F.; Yildirim, O.; Talo, M.; Baloglu, U.B.; Demir, Y.; Achary, U.R. Application of deep learning techniques for heartbeats detection using ECG signals-analysis and review. Comput. Biol. Med. 2020, 120, 103726. [Google Scholar] [CrossRef]
  32. Ganguly, B.; Ghosal, A.; Das, A.; Das, D.; Chatterjee, D.; Rakshit, D. Automated Detection and Classification of Arrhythmia From ECG Signals Using Feature-Induced Long Short-Term Memory Network. IEEE Sens. Lett. 2020, 4, 6001604. [Google Scholar] [CrossRef]
  33. Maweu, B.M.; Dakshit, S.; Shamsuddin, R.; Prabhakaran, B. CEFEs: A CNN Explainable Framework for ECG Signals. Artif. Intell. Med. 2021, 115, 102059. [Google Scholar] [CrossRef] [PubMed]
  34. Mazaheri, V.; Khodadadi, H. Heart Arrhythmia Diagnosis based on the Combination of Morphological, Frequency and Nonlinear Features of ECG Signals and Metaheuristic Feature Selection Algorithm. Expert Syst. Appl. 2020, 161, 113697. [Google Scholar] [CrossRef]
  35. Zeng, W.; Yuan, J.; Yuan, C.; Wang, Q.; Liu, F.; Wang, Y. A novel technique for the detection of myocardial dysfunction using ECG signals based on hybrid signal processing and neural networks. Soft Comput. 2021, 25, 4571–4595. [Google Scholar] [CrossRef]
  36. Çinar, A.; Tuncer, S.A. Classification of normal sinus rhythm, abnormal arrhythmia and congestive heart failure ECG signals using LSTM and hybrid CNN-SVM deep neural networks. Comput. Methods Biomech. Biomed. Eng. 2020, 24, 203–214. [Google Scholar] [CrossRef] [PubMed]
  37. Huang, J.; Chen, B.; Zeng, N.; Cao, X.; Li, Y. Accurate classification of ECG arrhythmia using MOWPT enhanced fast compression deep learning networks. J. Ambient. Intell. Humaniz. Comput. 2020. [CrossRef]
  38. Płlawiak, P.; Acharya, U.R. Novel deep genetic ensemble of classifiers for arrhythmia detection using ECG signals. Neural Comput. Appl. 2020, 32, 11137–11161. [Google Scholar] [CrossRef] [Green Version]
  39. Naz, M.; Shah, J.H.; Khan, M.A.; Sharif, M.; Raza, M.; Damaševičius, R. From ECG signals to images: A transformation based approach for deep learning. PeerJ Comput. Sci. 2021, 7, e386. [Google Scholar] [CrossRef] [PubMed]
Figure 1. The sampling distributions without (1) and with sample averaging (K) for the signal classes C = 0 and C = 1 , respectively. The filled areas are the probabilities of Type I error ( α ) and Type II error ( β ). The symbol x * indicates an equal likelihood, and T α is the decision threshold between the two classes.
Figure 1. The sampling distributions without (1) and with sample averaging (K) for the signal classes C = 0 and C = 1 , respectively. The filled areas are the probabilities of Type I error ( α ) and Type II error ( β ). The symbol x * indicates an equal likelihood, and T α is the decision threshold between the two classes.
Mathematics 10 00192 g001
Figure 2. A procedure for efficient classification of near-cyclostationary signal segments employing segment folding as the first pre-processing step.
Figure 2. A procedure for efficient classification of near-cyclostationary signal segments employing segment folding as the first pre-processing step.
Mathematics 10 00192 g002
Figure 3. The inter-R-peak distances of one ECG segment of 6000 points. The mean value (green-line) is approximately 87 samples.
Figure 3. The inter-R-peak distances of one ECG segment of 6000 points. The mean value (green-line) is approximately 87 samples.
Mathematics 10 00192 g003
Figure 4. The output of the R-peak recognition algorithm.
Figure 4. The output of the R-peak recognition algorithm.
Mathematics 10 00192 g004
Figure 5. The example alignment of four fragments, each containing exactly one R-peak.
Figure 5. The example alignment of four fragments, each containing exactly one R-peak.
Mathematics 10 00192 g005
Figure 6. The accuracy of the random forest classifier vs. the number of averaged fragments for two fragment selection strategies. The case of no-selection (green line) corresponds to averaging all the available fragments.
Figure 6. The accuracy of the random forest classifier vs. the number of averaged fragments for two fragment selection strategies. The case of no-selection (green line) corresponds to averaging all the available fragments.
Mathematics 10 00192 g006
Figure 7. The accuracy of the random forest classifier vs. the number of averaged fragments under different misalignment bounds Δ e . Solid line: consecutive segment selection; dashed-line: random segment selection.
Figure 7. The accuracy of the random forest classifier vs. the number of averaged fragments under different misalignment bounds Δ e . Solid line: consecutive segment selection; dashed-line: random segment selection.
Mathematics 10 00192 g007
Figure 8. The accuracy of the random forest classifier vs. the maximum misalignment Δ s for a different number of the averaged fragments N avg . Solid line: consecutive segment selection; dashed-line: random segment selection.
Figure 8. The accuracy of the random forest classifier vs. the maximum misalignment Δ s for a different number of the averaged fragments N avg . Solid line: consecutive segment selection; dashed-line: random segment selection.
Mathematics 10 00192 g008
Table 1. The measured and estimated times for fitting the ARIMA models of given orders to ECG data fragments.
Table 1. The measured and estimated times for fitting the ARIMA models of given orders to ECG data fragments.
Seasonal Order ( 0 , 0 , 0 ) 0 ( 2 , 1 , 0 ) 12
ARMA Order(2,1,0)(5,1,1)(5,2,4)(2,1,0)(5,1,1)(5,2,4)
T 100 (s)3.218.326.87.443.558.3
T ^ 16995 (h)9.151.875.921.0123.2165.1
Table 2. The AIC values and the times to obtain these values for different ARIMA models.
Table 2. The AIC values and the times to obtain these values for different ARIMA models.
Seasonal OrderARMA OrderAIC MeanAIC VarianceElaps. Time (s)
( 0 , 0 , 0 ) 0 (1, 1, 0)−219.179,769.919.4
(1, 1, 1)−278.176,214.458.8
(2, 1, 0)−291.975,900.434.0
(2, 1, 1)−312.876,190.978.7
(3, 1, 0)−300.377,535.747.7
( 2 , 1 , 0 ) 12 (1, 1, 0)−142.371,642.4278.5
(1, 1, 1)−197.166,087.4612.4
(2, 1, 0)−210.866,375.3435.6
(2, 1, 1)−229.565,934.3747.1
(3, 1, 0)−216.767,606.5504.8
Table 3. The performance comparison of different classifiers with general and R-peak-based folding of ECG segments. Except for training times, the larger values are better.
Table 3. The performance comparison of different classifiers with general and R-peak-based folding of ECG segments. Except for training times, the larger values are better.
Accuracy (%)Specificity (%)Sensitivity (%)Train. Time (s)
Logistic Regression63.4/63.692.5/92.018.5/18.20.0264
SVM64.2/64.595.0/93.716.2/16.70.2145
Decision Trees74.0/85.479.5/88.267.6/80.90.0557
Random Forest78.6/89.585.0/90.971.0/87.21.1171
Naive Bayes47.9/47.520.1/17.195.1/96.20.0141
K-NN76.4/88.182.2/89.068.4/86.60.1499
ANN77.8/85.186.1/88.779.4/79.25.8596
XGBoost76.3/82.786.1/88.062.3/74. 10.2427
Table 4. The state-of-the-art techniques for classifying ECG signals.
Table 4. The state-of-the-art techniques for classifying ECG signals.
MethodAcc. (%)Ref.
SVD, DFT and dynamic time warping with optimized segment length99[13]
wavelets with de-noising98[14]
R-R interval, signal morphology, and higher-order statistics features with linear discriminant classifier94–99[15]
recurrent NN with attention98[25]
bi-orthogonal wavelet filter bank followed by KNN, SVM, and ensemble bagged trees99[27]
fixed frequency range empirical wavelet transform with CNN98[28]
wavelet based on atomic functions with decision trees97–98[30]
deep NN99[31]
LSTM and bi-LSTM with multifractal factors94–97[32]
CNN with learned features including R-peak detection78–85[33]
KNN and several NNs with optimized combination of morpthology, frequency domain and non-linear features99[34]
features extracted via Q-factor wavelet transform, variational mode decomposition phase space reconstruction and NN classifier99[35]
LSTM and hybrid CNN-SVM91, 97[36]
fast compression residual CNN with maximal overlap wavelet transform99[37]
deep genetic ensemble of classifiers with Welch’s method and DFT99[38]
1D to 2D warping and normalization with deep NN and SVM98[39]
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Zheng, T.; Loskot, P. Signal Folding for Efficient Classification of Near-Cyclostationary Biological Signals. Mathematics 2022, 10, 192. https://doi.org/10.3390/math10020192

AMA Style

Zheng T, Loskot P. Signal Folding for Efficient Classification of Near-Cyclostationary Biological Signals. Mathematics. 2022; 10(2):192. https://doi.org/10.3390/math10020192

Chicago/Turabian Style

Zheng, Tianxiang, and Pavel Loskot. 2022. "Signal Folding for Efficient Classification of Near-Cyclostationary Biological Signals" Mathematics 10, no. 2: 192. https://doi.org/10.3390/math10020192

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop