# Optimal Heart Sound Segmentation Algorithm Based on K-Mean Clustering and Wavelet Transform
## 3 Results
### Evaluation Criteria  
To evaluate the performance of the methods, the sensitivity Se and positive predictive value PPV were used as evaluation criteria. Sensitivity describes the proportion of identified positive cases to all positive cases. Meanwhile, the positive predictive value is the proportion of true positive cases in all positive cases detected via screening tests. The overall performance of the algorithm is measured via accuracy Acc. The respective formulas are defined by  
\[\begin{split}\&\text{Se}=\frac{\text{TP}}{\text{TP}+\text{FN}} \times 100\%\\ &\text{\&PPV}=\frac{\text{TP}}{\text{TP}+\text{FP}} \times 100\%\\ &\text{Acc}=\frac{\text{TP}}{\text{TP}+\text{FP}+\text{FN}} \times 100\%\end{split} \tag{11}\]  
In the formulas, true positives (TP) mean the number of S1 and S2 which are correctly detected in the PCG signals. False positives (FP) represent the number of S1 and S2 obtained by false detection. False negatives (FN) represent the number of misidentified S1 and S2 in heart sounds.  
### Evaluation Criteria  
Thirty different heart sound signals were randomly selected. Their duration varied from 30 s to 36 s, in which the normal heart sound accounted for 1/5 and abnormal signal accounted for 4/5. Abnormal heart sound included murmurs relating to mitral valve prolapse (MVP), innocent or benign murmurs (Benign), aortic disease (AD), and other miscellaneous pathological conditions (MPC), each of which accounted for 1/5. This study proposes an adaptive PCG signal localization method based on K-means clustering and Haar wavelet transform. The results are shown in Table 1.  
The recognition rate of S1 and S2 reached 98.02% and 96.76%, respectively.  
Table 2 shows some previously reported studies on heart sound segmentation. At the same time, it compares the algorithm with the most advanced recent algorithms for extracting heart sound features. Our algorithm has lower computational complexity and higher accuracy. To a certain extent, our model can be compared with [PERSON]'s work [9]. The algorithm used in this reference is not smooth enough to extract the envelope, which causes some trouble for subsequent identification. The zero-frequency filter introduced by the system does not have real-time performance. The algorithm proposed in this paper can be embedded into a real-time processing hardware system later.  
\begin{table}
\begin{tabular}{c c c c c c c c c} \hline
**PCG** & **Types** & **FP** & **FN** & **TP** & **Se** & **PPV** & **Acc** & **Std** \\ \hline \multirow{4}{*}{Total S1} & Normal & 6 & 0 & 212 & 100\% & 97.25\% & 97.25\% & \(\pm\)2.46\% \\  & Aortic & 3 & 0 & 158 & 100\% & 98.14\% & 98.14\% & \(\pm\)4.22\% \\  & Benign & 3 & 0 & 208 & 100\% & 98.58\% & 98.58\% & \(\pm\)2.54\% \\  & Miscell. & 2 & 3 & 206 & 98.56\% & 99.04\% & 97.63\% & \(\pm\)3.65\% \\  & MVP & 3 & 0 & 208 & 100\% & 98.58\% & 98.58\% & \(\pm\)1.70\% \\  & Total & 17 & 3 & 992 & 99.70\% & 98.51\% & 98.02\% & \(\pm\)2.93\% \\ \hline \multirow{4}{*}{Total S2} & Normal & 9 & 0 & 213 & 100\% & 95.95\% & 95.95\% & \(\pm\)2.58\% \\  & Aortic & 1 & 3 & 158 & 99.37\% & 99.37\% & 97.53\% & \(\pm\)4.19\% \\ \cline{1-1}  & Benign & 8 & 0 & 204 & 100\% & 96.22\% & 96.22\% & \(\pm\)3.34\% \\ \cline{1-1}  & Miscell. & 3 & 3 & 208 & 98.58\% & 98.58\% & 97.20\% & \(\pm\)3.38\% \\ \cline{1-1}  & MVP & 6 & 0 & 204 & 100\% & 97.14\% & 97.14\% & \(\pm\)3.4\% \\ \cline{1-1}  & Total & 27 & 6 & 987 & 99.40\% & 97.34\% & 96.76\% & \(\pm\)3.35\% \\ \hline \end{tabular}
\end{table}
Table 1: Performance of segmentation of heart sounds taken in different conditions.  
Figure 7 shows the segmentation of a heart sound with harmless or benign murmurs. It depicts S1 and S2 and divides a cardiac cycle into four segments, namely S1 duration, systole, S2 duration, and diastole.