ECG segmentation algorithm based on bidirectional hidden semi-Markov model. (November 2022) - Huo, Rui; Zhang, Liting; Liu, Feifei; Wang, Ying; Liang, Yesong; Wei, Shoushui
Abstract: Accurate segmentation of electrocardiogram (ECG) waves is crucial for cardiovascular diseases (CVDs). In this study, a bidirectional hidden semi-Markov model (BI-HSMM) based on the probability distributions of ECG waveform duration was proposed for ECG wave segmentation. Four feature-vectors of ECG signals were extracted as the observation sequence of the hidden Markov model (HMM), and the statistical probability distribution of each waveform duration was counted. Logistic regression (LR) was used to train model parameters. The starting and ending positions of the QRS wave were first detected, and thereafter, bidirectional prediction was employed for the other waves. Forwardly, ST segment, T wave, and TP segment were predicted. Backwardly, P wave and PQ segments were detected. The Viterbi algorithm was improved by integrating the recursive formula of the forward prediction and backward backtracking algorithms. In the QT database, the proposed method demonstrated excellent performance (Acc = 97.98%, F1 score of P wave = 98.37%, F1 score of QRS wave = 97.60%, F1 score of T wave = 97.79%). For the wearable dynamic electrocardiography (DCG) signals collected by the Shandong Provincial Hospital (SPH), the detection accuracy was 99.71% and the F1 of each waveform was above 99%. The experimental results and real DCG signal validation confirmed that the proposed new BI-HSMM method exhibits significant ability to segment the resting and DCG signals; this is conducive to the detection and monitoring of CVDs. Highlights: This study proposes a new BI-HSMM model based on a bidirectional state prediction, aiming to accurately segment and locate each waveform of the ECG signal. The results demonstrate that the BI-HSMM performs better on ECG wave segmentation, especially for the P wave and PQ segment. The influence of the probability distribution function of the waveform duration on the ECG waveform segmentation results is discussed in this paper. Two methods, gaussian probability distribution (GD) and statistical probability distribution (SD), were selected. The results demonstrated that under the condition of the same initialization, the segmentation performance of SD was significantly better than that of GD. The influence of the initialization method of initial state probability vector on the ECG waveform segmentation results is discussed in this paper. Uniform initialization (UI), random initialization (RI) and proportional initialization (PI) were used. The results show that the initialization method had a minimal effect on the results of the BI-HSMM. The proposed algorithm of ECG segmentation was verified by clinical DCG data, and has achieved excellent results, which has a very broad clinical application prospect.