Full text
HMM-Based Multi-Heartbeat Phonocardiogram Classification Using Wavelet Cepstral Coefficients Touahria Rima1, Hacine Gharbi Abdenour1, Messaoudi Noureddine2, Ravier Philippe3, and Roubhi Hamza1 1LMSE Laboratory, University of Bordj Bou Arréridj, Elanasser, 34030 Bordj Bou Arréridj, Algeria 2LIST Laboratory, Faculty of Technology, University of Boumerdes, 35000 Boumerdes, Algeria 3PRISME Laboratory, University of Orleans, 12 rue de Blois, 45067 Orleans, France [email protected], [email protected], [email protected],, [email protected], [email protected] Abstract Heart sound classification systems often rely on analyzing a single heartbeat to classify phonocardiogram (PCG) signals. This study introduces a novel approach for classifying multi-heartbeat PCG signals as normal or abnormal, leveraging Wavelet Cepstral Coefficients (WCC) extracted from the Discrete Wavelet Transform (DWT). A Hidden Markov Model (HMM) classifier, associated with a Gaussian Mixture Model (GMM), is bases this system on the modeling of each class. The aim of this work is to develop an effective system for classification of multi-heartbeat PCG signals. The proposed system was evaluated on a subset of the PASCAL heart sounds classification challenge, using the Classification Rate (Acc_HTK) as the primary performance metric. The optimal configuration was obtained with an HMM model comprising 8 states, each associated with 3 Gaussians. A 20 ms analysis window was used. The WCC descriptor, computed using the db7 wavelet with a decomposition level of 6, further improved performance, achieving a classification rate of 97.73 %. These results highlight the effectiveness of WCC descriptors in PCG signal classification and demonstrate the potential of HMM-based multi-heartbeat classification for improved heart sound analysis. Keywords: Multi-heartbeat PCG signals, Feature extraction, Wavelet Cepstral Coefficients, Hidden Markov Model, Classification. 1 Introduction Auscultation is the process of listening to heart sounds using a stethoscope, and when recorded, it produces a phonocardiogram (PCG). This technique is crucial for diagnosing cardiovascular diseases (CVDs), which are among the leading causes of mortality worldwide [1].PCG analysis provides valuable insights into the location and morphology of heart sounds, aiding in early detection and diagnosis. In a healthy person, two primary sounds ”lub ... dub...” are heard during each cardiac cycle, corresponding to the first heart sound (S1) and the second heart sound (S2), respectively. It is evident that a Lub sound always appears between two Dub sounds, and vice versa. Additionally, the amplitude and duration of S1 are greater than those of S2. These characteristics, including the positioning and structure of heart sounds, provide valuable information and are therefore utilized for heart sound (beat) classification [2]. Doctors can detect additional or abnormal heart sounds by identifying irregular rhythms such as ”lublub... dub” or ”lub... dub-dub” through auscultation [3]. The classification phase usually consists of three fundamental steps: preprocessing, feature extraction and decision-making for classification. First, preprocessing is a crucial step in classification that involves preparing raw data for machine learning models. It involves noise removal using filtering techniques, segmentation to detect S1 and S2 sounds, and normalization for consistency. Secondly, features extraction is an essential step in which the classification system is built; it transforms each heartbeat sound signal into a sequence of vectors. Among them are discrete wavelet transform (DWT) coefficients, introduced by Mei et al. [4]. Kui et al. [5] combined MFSC to enhance heart sound classification, while Li et al. [6] used Short-Time Fourier Transform (STFT) features. Tschannen et al. [7] employed wavelet analysis for feature extraction. Meanwhile, Li F. et al. [8] extracted 497 time-series features to be used as inputs for convolutional neural network (CNN). Additionally, Er [9] proposed utilizing local binary pattern (LBP) and local ternary pattern (LTP) features as inputs for neural networks. Wu et al. [10], which focuses on applying an ensemble (CNN) model combined with a Savitzky–Golay filter for phonocardiogram (PCG) 237
signal classification. Wavelet cepstral coefficients proposed by [11], Ajit and Swanirbhar [12] explored the use of power spectral density (PSD) for feature extraction in heart sound classification. Zheng et al. [13] employed entropy-based features to analyze phonocardiogram (PCG) signals, utilizing entropy as a measure of signal complexity and irregularity. Touahria et al, [14] which investigates the classification of heart sounds using energy-based features. The final stage involves classification, where an appropriate classifier is selected to make accurate decisions based on the extracted features. In [15] sound classification, neural networks (NN) are commonly used. Milani et al. [16] deep learning techniques for this task, but challenges persist due to the lack of a comprehensive, publicly available heart sound dataset. To address this, Li et al. [17] proposed a novel approach that incorporates enhanced mel-frequency cepstral coefficient (MFCC) features and deep residual learning for improved classification performance. In many studies, Hidden Markov Models (HMMs) have been employed for PCG modeling and analysis. One such study was conducted by [18] proposed to combine HMM with MFCCs, achieving over 95% sensitivity and specificity but lacked a separate test set. Chauhan et al. [19] refined the approach, reporting 99.21% accuracy on 1381 heart cycles, though their method risked overfitting. Saracoglu et al. [20] applied HMM to frequency spectra, optimizing parameters and achieving 97.5% accuracy on a 60-recording test set. Touahria et al. [21] proposed to combine HMM with logarithmic wavelet energy (LWE), achieving an impressive classification rate of 93.68%. Touahria et al. [22] using wavelet transform techniques to extract features from phonocardiogram (PCG) signals for classification using Hidden Markov Models (HMMs) They reported an accuracy of 92.74% in the discrimination between abnormal and normal heartbeats. This study introduces a novel approach for classifying multi-heartbeat PCG signals as normal or abnormal, leveraging Wavelet Cepstral Coefficients (WCC) extracted from the Discrete Wavelet Transform (DWT). By utilizing a Hidden Markov Model (HMM) classifier combined with a Gaussian Mixture Model (GMM), this method aims to improve classification rate. The organization of the structure of this study is as follows. Section 2 will show the suggested approaches for multiheartbeat PCG signals classification. The experiment and its findings are presented in Section 3. Section 4 concludes the paper. 2 Classification of Multi-Heartbeat PCG Signals 2.1 Database To test our methods, we utilized the PASCAL Classifying Heart Sounds Challenge database [23]. This database includes two datasets: •Dataset A: Collected from the general public using the iStethoscope Pro iPhone app. •Dataset B: Obtained from clinical trials in hospitals using the digital stethoscope DigiScope. To evaluate this work, only 420 signals with different cardiac cycles including 196 pathological cardiac cycles were used. The extraction and recording process was performed using the PRAAT software [24], and each cycle was resampled to 16 kHz. The files were then split into two sub-databases: one for the training phase, consisting of 70% of the heart sound signals, and the other for the testing phase, comprising the remaining 30%. In addition, each sound file was paired with a labeling file that includes a transcription of the heart sound class. Each labeling file has the same name as the corresponding sound file but with a (with a .lab extension. These transcription files are used during the class modeling and system evaluation phases. 2.2 Feature Extraction Method Figure 1illustrates the block diagram of the proposed feature extraction method. As shown in this figure, this method incorporates three types of features: DWE (Discrete Wavelet Energy) is based on wavelet transform decomposition, where the signal is divided into multiple frequency sub-bands, and the energy of the wavelet coefficients at different levels is computed. which is evaluated as: 1. Discrete Wavelet Energy (DWE): Based on the wavelet transform decomposition, where the signal is divided into multiple frequency sub-bands and the energy of the wavelet coefficients at 238
Figure 1: Block diagram illustrating the calculation of the WCCs, LWEs, and DWEs features extraction [22]. different levels is computed. DWE[dj] = Nj−1 ∑ n=0 |dj[n]|2for j= 1, . . . , p (1) DWE[ap] = Np−1 ∑ n=0 |ap[n]|2(2) 2. Log Wavelet Energy (LWE): Applies a logarithmic transformation to the DWE values. LWE[dj] = log Nj−1 ∑ n=0 |dj[n]|2 for j= 1, . . . , p (3) LWE[ap] = log Np−1 ∑ n=0 |ap[n]|2 (4) 3. Wavelet Cepstral Coefficients (WCCs): Obtained by applying the inverse discrete cosine transform (DCT) on the logarithmic energy values. 2.3 Hidden Markov-based Classification System Generally, several classification methods have been proposed for PCG classification systems to enhance performance, either by reducing complexity or improving classification rate. In [22], the authors proposed a method for classifying heartbeat sounds into normal and abnormal classes. In this study, we propose the implementation of a classification system of multi-heartbeat PCG signal based on Hidden Markov Models (HMMs) [18], where each class (normal and abnormal) is modeled using an HMM [21]. This system consists of a training phase and a testing phase, both of which require an acoustic analysis step to extract relevant parameters for classification. The following figure illustrates the diagram of the classification system. In the training phase, each class namely, normal and abnormal heart sounds is modeled using a dedicated Hidden Markov Model (HMM) comprising Nstates. These states are designed to capture the temporal dynamics of the multi-heartbeat PCG signal. To enhance the modeling capability of each state, we associate it with a Gaussian Mixture Model (GMM), allowing the emission probabilities to flexibly represent the underlying statistical distribution of the extracted features. The model parameter including state transition probabilities, mixture weights, mean vectors, and covariance matrice are iteratively reestimated using the Baum-Welch algorithm, which performs Expectation-Maximization EM to maximize the likelihood of the observed training data. This procedure is implemented using the HErest tool from the Hidden Markov Model Toolkit (HTK) [25], which provides robust facilities for training HMMs on time-series data. In the testing phase, a new PCG signal undergoes the same preprocessing and feature extraction steps as in the training phase, resulting in a sequence of observation vectors. These vectors are then evaluated against the previously trained HMMs. The classification decision is made by computing the log-likelihood of the observation sequence under each class-specific HMM. The Viterbi algorithm is employed to find the most probable sequence of hidden states that best explains the observed data. The signal is classified into the class whose HMM yields the highest likelihood. This decoding and classification process is performed using the HVite command from the HTK toolkit [25], which supports efficient implementation of the Viterbi decoding for continuous HMMs. Figure 2shows the diagram of the proposed automatic classification system. 239
Figure 2: An automatic classification system of multiheartbeat PCG signal based on HMM models 2.4 Performance Evaluation The performance of the system is evaluated using the classification rate (AccHT K ) defined as: AccHT K =H N×100,(5) Where: - His the number of correctly recognized signals -Nis the total number of signals in the reference transcription [25]. 3 Experimental Results 3.1 Experimental The following section presents the experimental results and is divided into two parts. The first part compares the performance of the newly selected features with other feature sets. The second part discusses an experiment aimed at identifying the optimal mother wavelet and decomposition level for the best previously determined descriptor. The system is implemented utilizing the HTK library [25] with its classification performance evaluated based on the classification rate((AccHT K ) 3.2 Comparative Study Between Different Features Table 2shows the best classification results achieved with the optimal number of HMM states and Gaussians. The feature vector was generated using sliding Hamming windows of 20 ms with a 50% overlap [22]. MFCC (39 features) achieved an Acc_HTK of 89.77% using 2 Gaussians and 8 states. MFCC, a widely used method with 39 features, achieved the lowest accuracy (89.77%) with 2 Gaussians and 8 states. In contrast, DWE, LWE, and WCC, each with only 8 features, utilized 6 Gaussians, leading to improved recognition accuracy. DWE and LWE performed better than MFCC, achieving 93.18% and 90.91% accuracy, respectively. Notably, WCC outperformed all other methods with an accuracy of 97.73%, indicating its superior ability to extract discriminative features for classification. Despite using fewer features, WCC proved to be the most effective. 3.3 Optimal LWE Parameterization 3.4 Window Duration Table ?? presents the Acc_HTK variations corresponding to different window duration values. In this experiment, the classification system states were analyzed using db2 wavelets at level 7 [22]. The results 240
Table 1: Comparison of classification rate (Acc_HTK %) for different feature extraction descriptors using Daubechies (db2) at level 7 with the optimal HMM configuration [20]. Feature MFCC (39) DWE (8) LWE (8) WCC (8) HMM States 8 8 10 8 Gaussians 2 6 6 6 Accuracy (%) 89.77 93.18 90.91 97.73 indicate that the highest accuracy (Acc_HTK) in each column is achieved when the window size is set to 20 ms, with a peak accuracy of 97.73%. Consequently, a window duration of 20 ms is the optimal choice for this classification task. Table 2: Classification rate (Acc_HTK %) for different combinations of the hamming window sizes Wind. size 60ms 50ms 40ms 30ms 20ms AccHT K (%) 90.91 94.32 93.18 93.18 97.73 3.5 Wavelet Family and Decomposition Depth The influence of various wavelet families and decomposition levels on accuracy was examined. Table ?? summarizes the performance of different Daubechies orders and decomposition levels. (Note: The table below is a simplified representation based on the provided data.) This section analyzes the smoothness and impact of various wavelet families on AccHTK accuracy, aiming to identify the optimal mother wavelet and its most effective decomposition level. The study investigates three wavelet families: Daubechies (Db1–Db8), Coiflets (Coif1–Coif5), and Symlets (Sym1– Sym8). To ensure robust evaluation, the classification system employs the optimal descriptor identified in previous research, which utilizes a ten-state Hidden Markov Model (HMM) with three Gaussian mixtures. As shown in Table 4, the highest accuracy of 97.73% was achieved using the Daubechies wavelet of order 2 with a 7-level decomposition, demonstrating its superior performance in this classification task. Table ?? presents the detailed AccHTK results for the best-performing Daubechies wavelet family across various decomposition levels and wavelet orders. The results highlight a considerable range in AccHTK values—from a minimum of 84.09% to a peak of 97.73%—emphasizing the importance of selecting optimal wavelet parameters. Table 3: Comparison of Acc_HTK (%) of WCC for different Daubechies orders and decomposition levels. 1 2 3 4 5 6 7 8 db1 94.32 94.32 90.91 93.18 86.36 92.05 90.91 90.91 db2 86.36 86.36 86.36 94.32 95.45 93.18 97.73 94.32 db3 86.36 87.50 89.77 96.59 88.64 85.23 88.64 db4 86.36 84.09 93.18 90.91 93.18 92.05 87.50 db5 85.23 86.36 93.18 94.32 94.32 90.91 db6 86.36 87.50 93.18 92.05 93.18 96.59 db7 93.18 85.23 87.50 94.32 93.18 94.32 db8 92.05 90.91 87.50 85.23 95.45 94.32 Additionally, results were obtained using the Coiflets and Symlets wavelet families following the same experimental protocol. Within the Symlet family, order 1 at level 7 achieved the best performance, with a Acc_HTK of 90.91%. Similarly, within the Coiflets family, order 5 at level 5 demonstrated the highest performance, achieving a Acc_HTK of 94.32%. The results, presented in Table 4, show that the highest classification rate (Acc_HTK) of 97.73% was achieved using the Daubechies wavelet with order 2 and a decomposition level of 7. In conclusion, based on the conducted experiments, the WCC descriptors achieved the highest classification rates when derived using Daubechies order 2 with level 7 for Daubechies 241
Table 4: Comparative results between different kinds of wavelet families. The table shows the Acc_HTK values for the optimal decomposition level as well as the optimal order for each wavelet family. Wavelet Family Level Order Acc_HTK (%) Daubechies 7 2 97.73 Symlet 7 1 90.91 Coiflets 5 5 94.32 4 Discussion and Conclusions The experimental results indicate that the choice of wavelet family and decomposition level significantly impacts classification rate. The Daubechies wavelet of order 2 at level 7 demonstrated the highest Acc_HTK, confirming its suitability for multi-heartbeat PCG signal classification. Additionally, the window duration experiment showed that a 20ms Hamming window provides optimal performance. These findings emphasize the importance of feature extraction techniques in improving classification rate. This study proposes a novel approach for classifying multi-heartbeat PCG signals using Wavelet Cepstral Coefficients (WCC) and a Hidden Markov Model (HMM). The system achieved a high classification rate of 97.73% on a subset of the PASCAL heart sounds classification challenge, demonstrating its effectiveness. The results highlight that the optimal configuration involves using the Daubechies order 2 wavelet at a decomposition level of 7 with WCC descriptors. Future work could explore alternative machine learning models to further improve classification performance. Additionally, testing on larger and more diverse datasets could enhance the generalizability of the proposed method. References [1] Ghosh, S. (2020). Automated detection of heart valve diseases using chirplet transform and multiclass composite classifier with PCG signals. Comput. Biol. Med. [2] Kumar, D., Carvalho, P., Antunes, M., Gil, P., Henriques, J., & Eugenio, L. (2006). New algorithm for detection of S1 and S2 heart sounds. In Proc. IEEE ICASSP, Vol. 2, pp. 1180–1183. [3] Gomes, E., & Pereira, E. (2012). Classifying heart sounds using peak location for segmentation and feature construction. AISTATS, pp. 1–5. [4] Mei, N., Wang, H., Zhang, Y., Liu, F., Jiang, X., & Wei, S. (2021). Classification of heart sounds based on quality assessment and wavelet scattering transform. Comput. Biol. Med., 137, 104814. [5] Kui, H., Pan, J., Zong, R., Yang, H., & Wang, W. (2021). Heart sound classification based on log Mel-frequency spectral coefficients features and convolutional neural networks. Biomed. Signal Process. Control, 69, 102893. [6] Li, T., Yin, Y., Ma, K., Zhang, S., & Liu, M. (2021). Lightweight end-to-end neural network model for automatic heart sound classification. Information, 12, 54. [7] Tschannen, M., Kramer, T., Marti, G., Heinzmann, M., & Wiatowski, T. (2016). Heart sound classification using deep structured features. In Computing in Cardiology, pp. 565–568. [8] Li, F., Tang, H., Mathiak, K., & Cong, F. (2020). Classification of heart sounds using convolutional neural network. Appl. Sci., 10, 3956. [9] Er, M. (2021). Heart sounds classification using convolutional neural network with 1D-local binary pattern and 1D-local ternary pattern. [10] Wu, J., Tsai, M., Huang, Y., Islam, S., Hassan, M., & Alelaiwi, A. (2019). Applying an ensemble convolutional neural network with Savitzky–Golay filter to construct a phonocardiogram prediction model. Appl. Soft Comput., 78, 29–40. [11] Hacine-Gharbi, A., & Ravier, P. (2018). Wavelet cepstral coefficients for electrical appliances identification using hidden Markov models. In Proc. ICPRAM. 242
[12] Ajit, S., & Swanirbhar, M. (2019). Classification of unsegmented heart sound recording using KNN classifier. Medicine and Biology. [13] Zheng, Y., Guo, X., Wang, Y., Qin, J., & Lv, F. (2022). A multi-scale and multi-domain heart sound feature-based machine learning model for ACC/AHA heart failure stage classification. Physiol. Meas., 43, 065002. [14] Touahria, R., Hacine-Gharbi, A., & Ravier, P. (2023). Feature selection algorithms highlight the importance of the systolic segment for normal/murmur PCG beat classification. Biomed. Signal Process. Control. [15] Barschdorff, B., Bothe, A., & Rengshausen, U. (1989). Heart sound analysis using neural and statistical classifiers: a comparison. Comput. Cardiol., pp. 415–418. [16] Milani, M., Abas, P., & Silva, L. (2022). A critical review of heart sound signal segmentation algorithms. Smart Health, 24, 100283. [17] Li, S., Li, F., Tang, S., & Luo, F. (2021). Heart sounds classification based on feature fusion using lightweight neural networks. IEEE Trans. Instrum. Meas., 70, 1–9. [18] Wang, P., Lim, C., Chauhan, S., Foo, J., & Anantharaman, V. (2007). Phonocardiographic signal analysis method using a modified hidden Markov model. Ann. Biomed. Eng., 35, 367–374. [19] Chauhan, S., Wang, P., Lim, C., & Anantharaman, V. (2008). A computer-aided MFCC based HMM system for automatic auscultation. Comput. Biol. Med., 38, 221–233. [20] Saracoglu, R. (2012). Hidden Markov model-based classification of heart valve disease with PCA for dimension reduction. Eng. Appl. Artif. Intell., 25, 1523–1528. [21] Touahria, R., Hacine-Gharbi, A., & Ravier, P. (2024). Phonocardiogram segmentation based on HMM modelling combined with LWE: Application for heart valve disorder classification. In NCASEE’24. [22] Touahria, R., Hacine-Gharbi, A., & Ravier, P. (2021). Discrete wavelet-based features for PCG signal classification using hidden Markov models. In Proc. ICPRAM. [23] Bentley, P., Nordehn, G., Coimbra, M., Mannor, S., & Getz, R. (2011). The PASCAL classifying heart sounds challenge. [24] Praat. (n.d.). https://praat.fr.softonic.com/ [25] Young, S., Kershaw, D., Odell, J., & Ollason, D. (1999). The HTK Book. Cambridge: Entropic Ltd. 243