Introduction

Heart diseases including valve disorders are still one of main leading causes of death. The cardiac auscultation can be used for early detection of abnormal function of the heart before recommending other diagnosis modalities. It is the technique of interpreting heart sounds, which result from electromechanical activity of the cardiac muscle during each heartbeat such as the atrioventricular (AV) valves closure and opening events [1].

Heart valves produce low frequency transient signals in case of normal heart sounds. For pathological cardiac sounds or murmurs [2], they result of turbulence in blood flow through stenosis or regurgitation through the cardiac valves. High-frequency noise-like sounds present heart murmurs [3]. In this study, we investigated normal heart sounds and three different cases of the heart abnormalities; namely the aortic valve stenosis (AS), aortic insufficient (AI), and ventricular septum defect (VSD).

Stethoscopes are the standard aid to acquire and hear the heart sounds [2]. However, the cardiologist needs extensive training and practical experience with good hearing ability to perform the auscultation technique successfully. Although electronic stethoscopes have been developed to overcome the drawbacks of traditional stethoscopes, but they sometimes need a professional adjustment to make clearly all portions of the heart signal audible. To avoid these complications of using stethoscopes, the phonocardiography is alternatively used for displaying the sounds produced by the heart in a graphical form similar to the electrocardiograms [4]. Therefore, the heart diseases can be visually appeared in the corresponding phonocardiogram (PCG) signals.

Non-stationary property and large variations of PCG signals make visual accurate diagnosis of the heart status a difficult task [5]. Hence, employing digital signal processing methods to automatically analyze PCG signals can ease and assist the diagnosis procedure of the heart status. Features extraction and classification are two major steps of PCG recognition algorithms [6]. In previous studies, characterized features of the PCG signals could be extracted based on signal transformation methods either in frequency or time-frequency domains such as Fourier transform, short time Fourier transform (STFT) [7], and wavelet transform [8].

The wavelet transform provides time-varying monitoring window of adjustable sizes for slow frequencies and narrow enough for tracking rapidly changing ranges. Various intelligent systems have been developed to classify heart sound abnormalities for symptom detection and computer-aided diagnosis, such that the wavelet transforms were applied for segmentation and feature extraction with supervised neural networks for classification of the PCG signals [6, 8]. But the coefficients of wavelet transform as representation of heart signal features are still limited, because they don’t provide information about the underlying nonlinear signal dynamics [9]. In this study, Lyapunov exponents of chaotic bio-signal time series [10] are integrated with discrete wavelet transform (DWT), in order to determine dynamical measures of PCG signals as useful parameters for clinically recognizing heart murmurs.

Multilayer perceptron (MLP) Neural networks and support vector machines (SVMs) have been widely used in many previous studies for classifying PCG signals [3, 5, 11]. These classifiers must be initially trained well by all possible heart sounds and murmurs data to give correct classification results. Practically, it is not available to have a standard data collection of PCG signals; consequently, supervised classifiers suffer from the lack of sufficient training PCG datasets, affecting the classification accuracy. On the other hand, advanced hardware resources with long time, e.g. several days, may be needed to perform the successful training initialization of supervised classifiers.

In order to avoid the drawbacks of classifier training phase, this study presents a rule-based classification tree (RCT) for unsupervised classification of PCG signals into normal, AS, AI, and VSD based on both the experts’ rules and PCG features extracted from Lyapunov exponents. The RCT model provides “if-then” rules which can easily read and interpret similar to the personal diagnosis procedure by physicians in medical applications [12].

Materials and methods

Datasets

Twenty-two sets of heart sounds and murmurs data have been used in this study. The datasets are taken from a public database produced by the CliniSurf, Faculty of Medicine, University of Bern, Switzerland. They include 3 sets for normal healthy heart and 19 sets represent three cases of heart abnormalities, which divided into 4, 10, and 5 datasets for AS, AI, and VSD, respectively. Each dataset contains about 15 heartbeat cycles with a sample rate of 44.1 kHz.

Segmentation of heartbeat cycles

Automatic segmentation of one heartbeat cycle is the first step of the heart sound signals analysis and diagnosis procedure. Some previous studies used the electro-cardiogram (ECG) recordings to assist in segmenting the heart sounds [1]. However, the corresponding synchronized ECGs are not available all the time with the PCG collections data as presented in this study.

Spectral analysis was successfully used to separate the heart sound signals into individual cycles, such that the original signal is down sampled by a factor of four to give the maximum power of the first and second heart sounds (S1 and S2) in each cycle using Daubechies four and five-coefficients (DUB4 and 5) wavelet, respectively [13]. Heart sounds were also segmented based on cycle frequency and dynamic clustering in time-frequency domains [14].

To avoid the complexity of segmenting PCG signals based on signal decomposition and reconstruction using time-frequency analysis, this study used a simple and effective algorithm to segment the heart sounds into cycles in time domain only [15, 16]. As one heart beat is characterized by four temporal states S1, systolic phase, S2, and diastolic phase; the dataset will be divided into segments each contains these four phases. From a previous study, it has been found that the maximum duration of S1 and S2 is within 150 ms [16], so a maximum value within 150 ms ranges is considered as a peak. Using the sampling frequency of the PCG datasets, that is equivalent to about 6000 samples. In addition, Shannon Energy technique [17] has been adopted where the energy of the heart sound signal has been calculated to attenuate the effect of low noise and maximize the S1 and S2 sounds.

The segmentation procedure can be summarized in the following steps:

  • Calculate and normalize Shannon Energy of the dataset using Eq. 1.

$$ Shannon\kern0.5em Energy=\kern0.5em -{x}^2\times \log {x}^2 $$
(1)
  • Detect all the peaks within a predefined threshold of the max value. In this paper, any threshold between 40% to 90% of the maximum value has been tested successfully.

  • Detect only the significant peaks of S1 and S2. A maximum value of an overshoot within 150 ms range is considered as a peak and its location was registered. Other peaks within this range are rejected.

  • Using the peak locations and the length of the whole dataset; determine the average cycle length and the number of cycles.

  • Divide the dataset into cycles using the determined average length.

The segmentation technique resulted in individual cycles that contain the four phases of the heartbeat. Moreover, the spectral characteristics of the resulted cycles were estimated using welch method and compared to that of the whole dataset to ensure the consistency of the segmentation procedure. No significant differences have been found between the spectrum of one heart sound cycle and that of the whole dataset.

Preprocessing of heart sounds using DWT

The DWT can be viewed as a constant filter bank with octave spacing between the centers of the filters such that the wavelet transform decomposes a discrete signal, x[n], into two sub-signals of half its length.

The DUB4 wavelet [18] is used here to preprocess the PCG recordings, because it is the most accurate type of wavelets to accomplish this task, as demonstrated by previous studies [1921]. The third level of approximation of the heart sounds was selected to represent the tested datasets without losing the main features of original signals. Moreover, this approximation of the heart signals is smooth and noise free because of the wavelet filtering.

Features generation using lyapunov exponents

Calculating the largest Lyapunov exponent is the common test for chaos in data time series if it has a positive value [9]. The Lyapunov exponent is a statistical measure of divergence between two orbits starting with slightly different initial conditions. Assuming d0 and dn are initial divergence between two trajectories and divergence between These orbits after n steps, respectively, the value of largest Lyapunov exponent, λ, can be calculated by

$$ \lambda =\underset{n\to \infty }{ \lim}\frac{1}{n} \ln \frac{d_0}{d_n} $$
(2)

In this study, ten largest Lyapunov exponents were calculated and normalized from the observed time series of PCG signals by dividing each preprocessed dataset into ten equal regions with d0 less than 10−5. A summary of the resulted Lyapunov exponents for all tested PCG dataset is illustrated in Table 1. The bold values of Lyapunov exponents indicate the distinguishable features of each category of all tested PCG datasets and used to construct the rules of the developed classification tree, as presented in the following section.

Table 1 Normalized Lyapunov exponents of all tested heart sounds datasets

Building the RCT model of the heart health status

Tree models such as classification and regression trees (CART) have been widely used for predictive modeling and data mining [22]. The basic idea of a classification tree is to construct a binary decision tree sequentially by using splitting if-then rules based on variables to partition the data in such a way to reduce the conditional variation in response to these variables. Many algorithms have been proposed in the literature to automate growing the classification tree with the training data, e.g. diagnosing heart sounds [23]. However, in this study we developed a non-learning static RCT model using the largest Lyapunov exponents to directly decide the health status of the heart. The position and value of each Lyapunov exponent (LPE) are used to derive the following splitting rules, in order to give the correct output of RCT if the heart has either normal healthy condition or a specific disease, as shown in Fig. 1:

  • Rule 1: If LPE #2 ≥ 0.6 then the heart disorder is AI, else

  • Rule 2: If LPE #2 & #3 & #4 & # 8 ≤ 0.5 then the heart is normal (N), else

  • Rule 3: If LPE #9 < 0.5 then the heart disorder is AS, else

  • Rule 4: If LPE #9 ≥ 0.5 then the heart disorder is VSD, else the heart disorder is undefined.

Results and validation

Successful segmentation of four different datasets of the PCG signals into single heartbeat cycles are shown in Fig. 2. The original heart signals, corresponding normalized energy and final segmented cycle of the heart sounds are depicted for each PCG dataset. Fig. 3 shows a comparison between detected and real heartbeat cycles of all tested datasets, in order to evaluate the accuracy of the segmentation algorithm. All tested datasets have about fifteen cycles (or peaks). An error occurred only in dataset of VSD #4, because the expected time length of one heartbeat was long to show two heart cycles of this special VSD case. The cycles in the rest of PCG datasets are however correctly detected, achieving a success rate of 95.5%.

Cross validation was used to evaluate the performance of the developed RCT of PCG signals. It results in a confusion matrix with four possible outcomes; namely true positive (TP), false negative (FN), true negative (TN), and false positive (FP) [11, 24]. Table 2 illustrates classification results of all tested PCG datasets using the developed RCT. The dataset of VSD #4 is only misclassified due to the overlapped rule of recognizing the AS heart disorder, as depicted above in Fig. 1. Therefore, the developed RCT has been manually adjusted to overcome this misclassification error by adding new splitting rule (dashed line) as shown in Fig. 4.

Table 2 Classification results of all tested PCG signals
Fig. 1
figure 1

Developed rule-based classification tree for automated diagnosis of phonocardiogram signals into normal (N), aortic stenosis (AS), ventricular septum defect (VSD), and aortic insufficient (AI)

Fig. 2
figure 2

Automatic segmentation results of PCG datasets: a Normal heart, b VSD, c AS, and d AI. The first row represents the original PCG dataset, the second row is the normalized energy of the heart signals, third row is the peak locations and last row is the segmented PCG cycle

Fig. 3
figure 3

Comparison between real and detected heart beat cycles for all tested PCG datasets, with an error in the dataset of VSD #4 only

Fig. 4
figure 4

Modification of the developed rule-based classification tree (dashed blue line) of phonocardiogram signals without misclassification for all tested datasets

Evaluation results of the developed PCG classification method is presented in Table 3. Measured classification performance of VSD and AI heart disorders showed accuracy of 95.45% because of one misclassified VSD dataset, but accurate results of 100% are validated for both tested normal and AS datasets.

Table 3 Evaluation results of the developed PCG classifier

Discussion

Validation of our developed method for automated diagnosis of PCG signals demonstrated the effectiveness and flexibility of both Lyapunov exponents to identify the important features of chaotic heart sounds and the unsupervised RCT to classify different heart disorders successfully.

Figure 3 shows the segmentation error of one heartbeat cycle in the dataset VSD #4, which has been manually corrected to continue the workflow of PCG classification method. However, automatic segmentation of PCG signals into heartbeat cycles was accurate for 21 of 22 tested datasets based on time-domain properties of the heart sounds, i.e. amplitude and distance thresholds.

The advantages of RCTs are exploited in this study to employ unsupervised classification of the PCG signals based on Lyapunov exponents. As illustrated in Tables 2 and 3, classification and evaluation results of the developed PCG classifier showed robust performance to assist the diagnosis procedure of the heart health status accurately. The misclassified error was only appeared in the dataset VSD #4, and it has been easily fixed by modifying the splitting rules, as depicted in Fig. 4.

Deriving if-then rules of the developed RCT presents the critical step to achieve correct classification results. It may require continuous updating because of increasing the total number of PCG datasets, or adding other heart diseases, or any unexpected error, as illustrated in Table 2. Therefore, automating this step using optimization methods can be investigated in the future work. Nevertheless, the performance of our developed classification method of PCG signals is still superior to the other classification methods, which depend mainly on the success of the training phase.

Conclusions

A new automated diagnosis method of PCG signals has been developed to classify different clinical cases of the heart health status. The developed diagnosis method is mainly based on normalized Lyapunov exponents and the RCT. Compared to the previous studies, our classification method is unsupervised, and can successfully cover large variations of twenty-two PCG datasets, without the need for any training data. Additionally, real-time application of automated heart sounds and murmurs diagnosis in the clinical field is an important prospect of this study.