A method and related device for extracting PT wave interval features from electrocardiogram signals based on DE algorithm

By using a feature extraction method for the PT wave interval of ECG signals based on the DE algorithm, the problem of real-time detection of P and T waves was solved, improving computational efficiency and the reliability of feature recognition, and ensuring the safety and accuracy of IABP equipment.

CN118902470BActive Publication Date: 2025-12-02XI AN JIAOTONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411024491.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2025-12-02
Estimated Expiration
2044-07-29

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively detect P and T waves in ECG signals in real time, especially in IABP devices. Due to the low energy and complex morphology of the waveforms, they are susceptible to noise interference, making detection difficult and affecting the accuracy of the device's triggering mode.

Method used

A feature extraction method for the PT wave interval of ECG signals based on the DE algorithm is adopted, including first-order difference, normalization, Shannon energy transformation, bidirectional mean filtering, finding the R peak position, truncating the signal interval, removing baseline drift, performing phase allocation, and optimizing the parameters of the parabolic fitting feature template through the DE algorithm to determine the PT wave interval features.

Benefits of technology

It improves the reliability and computational efficiency of PT wave interval features in ECG signals, ensuring the safety and reliability of medical devices such as IABP equipment, and is suitable for real-time monitoring and feature recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118902470B_ABST
    Figure CN118902470B_ABST
Patent Text Reader

Abstract

This invention belongs to the field of electrocardiogram (ECG) signal feature recognition, and discloses a method and related device for extracting PT wave interval features from ECG signals based on the DE algorithm. The invention first preprocesses the acquired ECG signal, then performs two types of interval peak finding to determine the R-peak position. The interval is truncated based on the peak finding results. Baseline drift is removed from the truncated ECG signal, and after normalization, phase allocation is performed. Feature templates are extracted based on the phase allocation results. Finally, the parameters of the parabolic fitting feature template are optimized using the DE algorithm, resulting in the P and T wave peak finding intervals and approximate peak positions. Since the feature template is extracted from the patient's ECG signal, it contains the patient's ECG characteristic waveform distribution information. Therefore, the final optimized parameters can be used as prior information to predict the subsequent PT wave peak finding interval, helping to ensure or improve the safety and reliability of medical devices that require real-time ECG signal monitoring and feature recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of electrocardiogram (ECG) signal feature recognition, and relates to a method and related device for extracting PT wave interval features of ECG signals based on the DE algorithm. Background Technology

[0002] An electrocardiogram (ECG) is a weak electrical signal generated by the heart muscle during contraction and relaxation. These electrical signals can be detected by electrodes on the skin surface, then amplified and recorded to form an electrocardiogram (ECG). By analyzing the morphology and characteristics of ECG signals, doctors can assess the health of the heart, diagnose heart diseases, and develop appropriate treatment plans. ECG signals also play an important role in medical devices, especially in devices like intraaortic balloon pumps (IABPs).

[0003] The principle of an intra-aortic balloon pump (IABP) device is to monitor the rhythm and changes of electrocardiogram (ECG) signals to accurately determine the timing of the heart's contraction and relaxation, thereby helping to regulate the heart's rhythm and improve blood supply to the heart. The most important function of an IABP device is controlling the trigger mode for balloon inflation and deflation. There are four trigger modes available on the market: ECG trigger, pressure trigger, natural frequency, and pacing mode, with ECG trigger and pressure trigger being the most commonly used. The ECG trigger mode requires real-time acquisition of ECG signals and identification of their characteristic waveforms; therefore, ECG signal characteristic detection is a crucial component of an IABP device. Since the P wave represents the beginning of heart contraction and the T wave represents the end of contraction and the approaching diastolic phase, and the balloon needs to deflate during contraction and inflate during diastole, the balloon needs to be kept inflated during the TP interval and deflated during the RT interval. Because the P wave and T wave waveforms have low energy and complex morphology, they are highly susceptible to noise interference, making real-time detection very difficult.

[0004] Regarding feature recognition of ECG signals, there are many classic algorithms both domestically and internationally, such as conventional threshold detection methods, classic R-wave detection algorithms including the Pan-Tompkins algorithm and filter-based methods, wavelet transform methods, empirical mode analysis, and machine learning-based methods. The Pan-Tompkins algorithm, proposed by Pan and Tompkins, is a QRS wave detection algorithm with adaptive dual thresholds, capable of real-time R-wave detection. Detection is primarily based on the amplitude, slope, and time information of the R-wave. The algorithm consists of two parts: R-wave enhancement and R-wave comprehensive decision-making. It first enhances the R-wave features, then uses dual thresholding and search backtracking techniques to detect missed waves. The advantage of this algorithm is its effective detection of R-waves through slope, amplitude, and width information; however, its ability to suppress noise interference is somewhat insufficient. The P wave and T wave are also relevant in ECG signals. Due to their low waveform energy and complex morphology, wavelet transform is highly susceptible to noise interference, making it difficult for conventional algorithms such as threshold detection and the Pan-Tompkins algorithm to identify them. Wavelet transform, with its high degree of temporal localization for low-frequency components, is particularly effective in detecting singularities in low-frequency components. Therefore, it is widely used by researchers for detecting the P and T waves in ECG signals. Xiong Peng et al. utilized the multi-scale information of continuous wavelet transform to extract the main components of the P and T waves in ECG signals. By fusing stationary wavelets to smooth the candidate segments of the P and T waves, they effectively eliminated jagged spikes in the waveform, improving the accuracy of peak point detection. Finally, time-shift correction was applied to the zero-crossing points of the P and T waves to ensure they accurately correspond to their peak points when restored to the original signal, significantly improving the detection accuracy of the P and T waves. However, wavelet transform requires multi-scale decomposition of a signal, necessitating a large number of data points and resulting in high computational complexity. EMD, on the other hand, is an adaptive decomposition method that does not require predefined basis functions or filters. It adapts to the local characteristics of a signal by decomposing the signal data itself into IMFs with different time scales. Zine-Eddine et al. used the EMD method for QRS group detection and used all ECG signals in the MIT / BIH database as the evaluation set, achieving good accuracy and robustness. The advantage of the EMD method is its adaptability, which does not require predefined basis functions or filters. It adapts to the local characteristics of a signal by decomposing the signal data itself into IMFs with different time scales, and the EMD method also has the completeness of signal decomposition; adding the components together yields the original signal. However, unlike wavelet analysis or neural networks, the EMD method does not have a fixed mathematical model; therefore, some of its important properties have not yet been rigorously proven mathematically.Furthermore, the definition of the Modal Component Analysis (IMF) is not yet unified. The process of decomposing the IMF requires numerous iterations, and there is no standard for stopping the iteration. Therefore, different stopping conditions result in different IMFs. Additionally, both the EMD method and wavelet transform method require processing signals containing large amounts of data, leading to poor real-time performance. Machine learning, a technology in the field of artificial intelligence (AI), uses data to train models that can predict, classify, identify, or make decisions based on new data. Shweta Jain et al. used a genetic algorithm to search for optimal adaptive filter parameters by simulating natural evolutionary processes such as crossover, mutation, and selection to improve the detection performance of QRS peaks, demonstrating excellent accuracy and sensitivity. Machine learning methods for ECG signal feature recognition offer advantages such as automatic feature extraction, rapid processing of large-scale data, and highly accurate classification and detection. However, machine learning methods are often complex to implement and have high hardware requirements.

[0005] Because medical devices like IABPs have high requirements for the real-time performance of ECG signals, and the P wave and T wave waveforms have low energy and complex morphology, they are easily affected by noise, making real-time detection very difficult. Summary of the Invention

[0006] To address the problems existing in the prior art, the present invention aims to provide a method and related device for feature extraction of the PT wave interval of electrocardiogram (ECG) signals based on the DE algorithm. This invention extracts features from ECG signals, and the extracted information can be used as prior information to help predict the occurrence intervals of P and T wave peaks in subsequent ECG signals. This method has advantages such as low computational complexity, fewer manual parameter settings, and good reliability of extracted features, which helps to ensure or improve the safety and reliability of some medical devices.

[0007] To achieve the above objectives, the present invention provides the following technical solution:

[0008] A method for extracting PT wave interval features from electrocardiogram (ECG) signals based on the DE algorithm includes:

[0009] The acquired electrocardiogram signals were sequentially subjected to first-order difference, normalization, Shannon energy transformation, and bidirectional mean filtering to obtain the preprocessed signal.

[0010] The position of the R peak is found in the preprocessed signal by sequentially searching for peaks in the first interval and the second interval; wherein the interval of the first interval search is larger than the interval of the second interval search.

[0011] The preprocessed signal is truncated, and the data between the first peak point and the last peak point of the second interval peak search is retained to obtain the truncated signal;

[0012] The intercepted signal is processed by removing baseline drift and normalizing to obtain the first array;

[0013] Phase allocation is performed on the data in the first array to obtain the truncated data phase array;

[0014] Extract feature templates based on the phase array of the extracted data;

[0015] The parameters of the parabolic fitting feature template are optimized using the DE algorithm (Differential Evolutionary Algorithm) to determine the optimization parameters;

[0016] The optimal parameters of the optimization parameters are determined, and the obtained optimal parameters are the PT wave interval characteristics of the electrocardiogram signal.

[0017] Preferably, the peak finding process in both the first interval and the peak finding process in the second interval includes:

[0018] A sliding window of a preset length moves across the entire preprocessed signal. When the data point in the very center of the sliding window is greater than all other data points on the entire sliding window, the data point in the very center of the sliding window is considered to be the maximum value point, and this maximum value point is the R peak position.

[0019] Preferably, when performing phase allocation on the truncated interval data: a phase of magnitude of -π to π is allocated to each data point in the truncated interval data, and an interval allocation ratio coefficient k is introduced, specifically including the following process:

[0020] The phase value of the first R peak in a segment of RR interval in the first array is assigned to 0;

[0021] The phase allocation of a RR interval is divided into two intervals. The relationship between the number of data intervals n1 and the total number of data intervals N of the RR interval is n1 = Nk. The number of data intervals n2 of the second interval is N(1-k).

[0022] The phases of points within a given RR interval are arithmetically increased across the first and second intervals, with the common difference of the first interval being... The tolerance of the second interval is

[0023] Subtract 2π from the phase of each data point whose phase is greater than or equal to π to obtain the truncated data phase array.

[0024] Preferably, the range of the interval allocation ratio coefficient k is 0.5 to 0.6.

[0025] Preferably, the process of extracting feature templates based on the truncated data phase array includes:

[0026] The number of data points for the feature template is determined based on the sampling rate of the acquired electrocardiogram signals.

[0027] The phase assignment of the feature template is determined by splitting it into two intervals, where the number of data intervals M in the first interval is... n1 Total data interval M of feature template n The relationship is M n1 =m n (1-k), the number of data intervals M in the second interval n2 For M n k;

[0028] The phase of the first point in the feature template data is assigned as -π, and the other data points are arithmetically increased according to the first and second intervals. The common difference of the first interval is... The tolerance of the second interval is Thus, the phase array m of the feature template is obtained. phase (i);

[0029] Template amplitude array m amplitude The first point m in (i) amplitude The value of (0) is equal to the phase array of the truncated data. cut The first array ECG corresponding to all points with a phase of -π in (i) cut The mean of (i) is used, and the amplitude distribution of subsequent data is the same as that of the second point. The amplitude distribution of the second point is as follows: The data phase array (Phase) is extracted. cut (i) has a phase greater than M phase (0) and less than or equal to M phase (1) The first array ECG corresponding to the point cut The value of (i) is the mean, which is the second point M of the feature template amplitude array. amplitude The value of (1) is obtained by taking the remaining points of the feature template amplitude array in the same way as the second point, and finally the feature template is obtained by taking the number of all data points of the feature template.

[0030] Preferably, the process of optimizing the parameters of the feature template for parabolic fitting using the DE algorithm to obtain the optimized parameters includes:

[0031] Extract the P-wave interval from the feature template;

[0032] Subtract the minimum value of the amplitude of the P-wave interval from the entire extracted P-wave interval amplitude array, and shift it above the zero line to obtain the shifted P-wave interval;

[0033] The P-wave interval is found by fitting a parabola to the translated curve, where the formula for the parabola is as follows:

[0034]

[0035] Where a is the point corresponding to the axis of symmetry of the parabola, b is half the number of points contained in the line connecting the intersection of the parabola and the horizontal axis, and x is a point on the parabola.

[0036] The objective function of the DE algorithm is determined based on the parabola, and the formula for the objective function of the DE algorithm is as follows:

[0037]

[0038] Where, p size To find the length of the interval p;

[0039] Based on the objective function of the DE algorithm, the optimization parameters of the DE algorithm are determined to be a and b, where the value of a ranges from 1 to p. size The range of values ​​for b is

[0040] Preferably, the process of determining the optimal parameters of the optimization parameters includes:

[0041] Generate an initial population, where each individual in the initial population contains two parameters, a and b. The initial population is generated randomly using the following formula:

[0042] x i,j =x jmin +rand(0,1)(x jmax -x jmin )

[0043] Where i represents the i-th individual in the initial population, j represents the j-th optimization parameter, and x jmin x represents the lower bound of the range of values ​​for the j-th optimization parameter. jmax This represents the upper bound of the range of values ​​for the j-th optimization parameter;

[0044] A mutant population is generated, where each individual in the mutant population is one of three individuals randomly selected from the initial population. Two of these three individuals are subjected to a difference operation to interfere with the third individual, thus achieving mutation. The formula for generating mutant individuals is as follows:

[0045] v i (g)=a1(g)+F(a2(g)-a3(g))

[0046] Among them, v i (g) represents the i-th individual in the mutant population of generation g, and a1(g), a2(g), and a3(g) are three individuals randomly selected from the initial population of generation g.

[0047] For each individual in the initial population and its generated offspring mutants, the optimized parameters are cross-referenced to generate crossover individuals. The formula for generating crossover individuals is as follows:

[0048]

[0049] Where, j rand The optimized components are randomized to ensure that at least one component crosses over.

[0050] For individuals in the crossover population, boundary conditions are applied to ensure that the two optimization parameters of each individual are within a certain range. Specifically, when the parameter is less than the minimum value of the range, the parameter value is set to the minimum value of the range; when the parameter is greater than the maximum value of the range, the parameter value is set to the maximum value of the range.

[0051] By calculating the objective function value for the initial population and the crossover population, and comparing the individuals in the corresponding sequence in the two populations one by one, the individuals with the smaller objective function value are retained as the individuals in the new generation of the initial population; the above process is repeated iteratively to obtain the optimal parameters.

[0052] This invention also provides a system for extracting PT wave interval features from electrocardiogram signals based on the DE algorithm, comprising:

[0053] Data preprocessing module: used to sequentially perform first-order difference, normalization, Shannon energy transformation and bidirectional mean filtering on the acquired electrocardiogram signal to obtain the preprocessed signal;

[0054] Peak finding module: used to find the position of R peak in the preprocessed signal by sequentially finding peaks in the first interval and the second interval; wherein, the interval of the first interval peak finding is larger than the interval of the second interval peak finding;

[0055] Signal interception module: used to intercept the preprocessed signal, retain the data between the first peak point and the last peak point of the second interval peak search, and obtain the intercepted signal;

[0056] The intercepted signal processing module is used to remove baseline drift and normalize the intercepted signal to obtain a first array;

[0057] Phase allocation module: used to allocate the phase of the data in the first array to obtain the truncated data phase array;

[0058] Feature template extraction module: used to extract feature templates based on the phase array of the truncated data;

[0059] Optimization parameter determination module: used to optimize the parameters of the feature template for parabolic fitting using the DE algorithm, and to determine the optimization parameters;

[0060] Parameter optimization module: used to determine the optimal parameters of the optimization parameters, and the obtained optimal parameters are the PT wave interval characteristics of the electrocardiogram signal.

[0061] The present invention also provides an electronic device, comprising:

[0062] One or more processors;

[0063] A storage device on which one or more programs are stored;

[0064] When the one or more programs are executed by the one or more processors, the one or more processors implement the ECG signal PT wave interval feature extraction method based on the DE algorithm described above.

[0065] The present invention also provides a storage medium storing a computer program thereon, wherein the computer program, when executed by a processor, implements the ECG signal PT wave interval feature extraction method based on the DE algorithm described above.

[0066] The present invention has the following beneficial effects:

[0067] This invention first performs first-order difference, normalization, Shannon energy transformation, and bidirectional mean filtering on the acquired electrocardiogram (ECG) signal. Then, it performs two interval peak-finding operations to determine the R-peak position. The intervals are truncated based on the peak-finding results. After removing baseline drift and normalizing the truncated ECG signal, phase assignment is performed, and feature templates are extracted based on the phase assignment results. Finally, the parameters of the parabolic fitting feature template are optimized using the DE algorithm. The obtained parameters are the peak-finding intervals for the P and T waves and the approximate peak positions. Because the feature template is extracted from the patient's ECG signal, it contains the patient's ECG characteristic waveform distribution information. Therefore, the final optimized parameters can be used as prior information to predict the peak-finding intervals for the subsequent PT wave, helping to ensure or improve the safety and reliability of medical devices that require real-time ECG signal monitoring and feature recognition. Attached Figure Description

[0068] Figure 1 This is a flowchart of an embodiment of the present invention;

[0069] Figure 2 This is the original electrocardiogram signal curve used in the embodiments of the present invention;

[0070] Figure 3 This is a graph of the electrocardiogram signal after preprocessing in step S1 in this embodiment of the invention;

[0071] Figure 4 This is a peak finding result diagram after step S2 in this embodiment of the invention;

[0072] Figure 5 This is a data curve graph after the interval is truncated in step S3 in this embodiment of the invention;

[0073] Figure 6 This is a diagram showing the result of phase allocation in step S4 of this embodiment of the invention;

[0074] Figure 7 This is the template phase map extracted in step S4 in this embodiment of the invention;

[0075] Figure 8 This is the template amplitude map extracted in step S4 in this embodiment of the invention;

[0076] Figure 9 This is a graph showing the change in the minimum value of the objective function of the population for each generation, obtained through step S5 in this embodiment of the invention.

[0077] Figure 10 This is a graph showing the variation of the optimal solution of the P-wave parameters of each generation of the population obtained after step S5 in this embodiment of the invention.

[0078] Figure 11 This is a diagram showing the P-wave intervals and P-peak prediction locations as determined by the optimal parameters obtained in step S6 of this invention.

[0079] Figure 12 This is a diagram showing the T-wave intervals and predicted T-peak locations as determined by the optimal parameters obtained in step S6 of this invention.

[0080] Figure 13 P-wave intervals and predicted P-peak locations for ECG signals not involved in template extraction. Detailed Implementation

[0081] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.

[0082] Since most patients need to remain relatively still and avoid strenuous exercise when receiving treatment with medical devices such as IABP to ensure the normal operation of the device and the effectiveness of the treatment, their heart rate generally does not change drastically in a short period of time. Furthermore, the lengths of the PR and RT intervals in each individual's electrocardiogram signal have certain personal characteristics. Based on the above considerations, the technical solution of this invention is proposed.

[0083] like Figure 1 As shown in the figure, the ECG signal PT wave interval feature extraction method based on the DE algorithm in this embodiment includes the following steps:

[0084] S1: The acquired electrocardiogram signal is preprocessed sequentially using signal processing methods such as first-order difference, normalization, Shannon energy transformation, and bidirectional mean filtering to obtain the preprocessed signal;

[0085] S2: Find the position of the R peak in the preprocessed signal by finding the peak in the large interval and the peak in the small interval. The interval for finding the peak in the large interval is larger than the interval for finding the peak in the small interval.

[0086] S3: Based on the peak finding results, the preprocessed signal is truncated, and the data between the first peak point and the last peak point of the peak finding in the small interval is retained to obtain the truncated signal. The baseline drift of the truncated signal is removed and normalized to obtain the first array.

[0087] S4: Perform phase allocation on the intercepted interval data (i.e., the first array obtained in S3) to obtain the intercepted data phase array, and extract the feature template based on the phase allocation result (i.e. the intercepted data phase array);

[0088] S5: Optimize the parameters of the feature template for parabolic fitting using the DE algorithm, and determine the optimization parameters;

[0089] S6: Calculate the optimal parameters of the optimization parameters according to the DE algorithm. The obtained optimal parameters are the PT wave interval characteristics of the electrocardiogram signal.

[0090] Finally, the reliability of the ECG signal PT wave interval feature extraction method based on the DE algorithm can be verified by using the above-mentioned optimal parameters to cut the ECG signal PT wave interval peak.

[0091] like Figure 2 The image shows a segment of electrocardiogram (ECG) signal data used in this embodiment. This ECG signal data comes from the MIT-BIH database provided by MIT. There are three internationally recognized standard ECG databases: the MIT-BIH database provided by MIT, the AHA database of the American Heart Association, and the European ST-T ECG database. Among them, the MIT-BIH database has been widely used in recent years. The ECG signal data used in this embodiment is the data from lead II in sample number 100. This data has a sampling rate of 360, and this example extracts the first 7000 data points of this ECG signal as a sample.

[0092] Figure 3 The data after the above preprocessing process of this invention is used to enhance the R-peak characteristics, reduce noise interference, and facilitate the search for the R-peak. The preprocessing specifically includes the following steps:

[0093] S11: Perform a first-order difference on the original ECG signal data as follows:

[0094] d i =x i+1 -x i

[0095] Where d i It is the i-th data obtained after first-order difference, x i+1 The (i+1)th data point of the original electrocardiogram signal, x i The i-th data point of the original electrocardiogram signal;

[0096] S12: Normalize the data after first-order differencing, using the following formula:

[0097]

[0098] Where d′ i It is the i-th data after normalization, d i It is the i-th data obtained after first-order difference, d min It is the minimum value among the data obtained after first-order difference, d max It is the maximum value in the data obtained after first-order difference;

[0099] S13: Perform Shannon energy transformation on the normalized data, using the following formula:

[0100] s i =-d′ i 2 log2d′ i 2

[0101] Where s i It is the i-th data obtained from Shannon energy transformation, d′ i It is the i-th data after normalization;

[0102] S14: Perform bidirectional mean filtering on the Shannon energy-transformed data. The filter width should be consistent with the width of any potentially wide QRS group. Empirically, the filter width should be the same as the number of points sampled in 150ms. Since the data sample rate is 360Hz, the filter width is 54. Bidirectional rectangular filtering is used to prevent phase shift. First, convolve the Shannon energy-transformed data with the rectangular filter. Then, invert the convolved data and convolve it again with the rectangular filter. Finally, invert the data to obtain the R-peak finding data.

[0103] Figure 4 The peak finding result after step S2 (finding the R-peak) is obtained by searching for the R-peak position in the preprocessed signal through large-interval peak finding and small-interval peak finding. The principle of the two interval peak finding methods is the same: a sliding window of length n moves from left to right across the entire data. The maximum value is found when the data point in the exact center of the sliding window is greater than all other data points on the window. Peak finding in the large interval also requires threshold determination of the maximum and minimum values ​​because some small extreme values ​​may appear during the RR interval due to the presence of the PT wave. Specifically, the peak position found by the large-interval peak finding is not necessarily the original R-peak peak position. Assuming a sampling rate of 120, there will be a deviation of less than 5 points, therefore, small-interval peak finding is necessary. In this embodiment, based on experience, the threshold is set to 30, the large-interval peak finding window length is 54, and the small-interval peak finding window length is 16. Figure 4 All R peaks in the data sample were found through two peak-finding operations.

[0104] like Figure 5 This is the data after the interval is truncated in step S3. Only complete RR intervals can be used for phase allocation based on the position information of the R peaks; therefore, truncating the interval facilitates phase allocation. The truncated interval needs to be truncated based on the peak finding results. The truncated interval is the data before the first R peak and the data after the last R peak. After removing baseline drift and normalizing the truncated signal, the first ECG array is obtained. cut (i);

[0105] like Figure 6 This is the result of phase allocation in step S4. Phase allocation requires assigning a phase of magnitude -π to π to each data point. For ease of calculation, this invention uses π as 3.14 and 2π as 6.28 as examples for illustration, and introduces an interval allocation proportional coefficient k during phase allocation. Ideally, the P wave should appear in the phase interval from -3.14 to 0, and the T wave in the phase interval from 0 to 3.14. Based on the distribution of the PT wave in the RR interval of human electrocardiogram signals, the interval allocation proportional coefficient k is usually 0.5. However, sometimes, in patients with arrhythmias, the RT interval is prolonged, resulting in a large proportion of the RT interval to the RR interval. When the proportional coefficient k is 0.5, it is impossible to satisfy the requirement that the P wave appears in the phase interval from -3.14 to 0 and the T wave appears in the phase interval from 0 to 3.14. Therefore, the value of k needs to be adjusted according to the actual situation. The electrocardiogram signal sample used in this embodiment is in the above situation, so the value of k is 0.6. The specific steps of phase allocation are as follows:

[0106] S41: Input the first array ECG cut (i);

[0107] S42: Assign the phase value of the first R peak in an RR interval to 0;

[0108] S43: Divide a phase allocation of an RR interval into two intervals. The relationship between the number of data intervals n1 and the total number of data intervals N of the RR interval in the first interval is n1 = Nk, and the number of data intervals n2 in the second interval is N(1-k).

[0109] S44: The phase of a point on a given RR interval is arithmetically increased over two intervals, with the common difference of the first interval being... The tolerance of the second interval is

[0110] S45: Subtract 6.28 from the phase of each data point with a phase greater than or equal to 3.14, ensuring that the phase of points in the first interval is between 0 and 3.14, and the phase of points in the second interval is between -3.14 and 0. This ensures that the P wave appears in the phase interval between -3.14 and 0, and the T wave appears in the phase interval between 0 and 3.14. This yields the phase array (Phase) of the truncated data. cut (i), according to Figure 6 We can see that the phase of all R peaks is 0;

[0111] Figure 7 The template phase map is extracted in step S4. Figure 8 This is the template amplitude map extracted in step S4. The template is a data segment extracted from a segment of ECG signal, containing the characteristics of the P wave, QRS complex, and T wave of that signal; it also represents the characteristics of an individual's ECG signal. The ECG signal feature template is extracted based on the phase allocation results. The feature template must have both amplitude and phase. The specific steps are as follows:

[0112] S46: The number of data points in the feature template is the same as the sampling rate, which is 360Hz. Therefore, the number of data points in this embodiment is 360.

[0113] S47: The phase assignment of the feature template is split into two intervals, with the first interval having a data interval number M. n1 Total data interval M of the template n The relationship is M n1 =M n (1-k)-1, calculated to be 143, the second interval data interval number M. n2 For M n k is calculated to be 216;

[0114] S48: The phase of the first point in the template data is assigned to -3.14, and the phases of the other data points increase arithmetically in two intervals. The common difference of the first interval is... The tolerance of the second interval is Thus, the phase array M of the feature template is obtained. phase (i);

[0115] S49: Feature template data amplitude allocation and the first ECG array extracted in step S3 cut (i) and the assigned phase array Phase cut (i) Related to the template amplitude array M amplitude (i) The first point M amplitude The value of (0) equals Phase cut ECG corresponding to all points with a phase of -3.14 in (i) cut The mean of (i) is used as the basis for the amplitude distribution of subsequent data, taking the second point as an example.cut (i) has a phase greater than M phase (0) and less than or equal to M phase ECG corresponding to point (1) cut The average value of (i) is the second point M of the template amplitude array. amplitude The value of (1) is obtained by calculating the remaining points of the template amplitude array in the same way as the second point. Assume Phase... cut (i) has a phase greater than M phase (j) and less than or equal to M phase If the number of points in (j+1) is 0, then M amplitude (j+1)=M amplitude (j), this approach is to avoid calculation errors caused by division by zero;

[0116] The DE algorithm optimizes the feature template parameters for parabolic fitting, taking the P-wave parameters as an example; the same applies to the T-wave. Figure 9 The minimum value of the objective function for each generation of the population is the P-wave parameter obtained through the DE algorithm in step S5. Figure 10 This represents the optimal solution for the P-wave parameters of each generation of the population obtained through the DE algorithm in step S5. The DE algorithm is a global optimization algorithm, typically used to solve unconstrained optimization problems. It is an evolutionary algorithm that, by simulating the process of biological evolution, progressively optimizes parameters to find the optimal solution to the problem. The principle of the DE algorithm is relatively simple and easy to implement. It does not require calculation of the gradient or second derivative of the problem, thus it is suitable for some complex problems. The DE algorithm has a high degree of independence in its computation process, making it easy to parallelize and improve its efficiency. Before using the DE algorithm, the P and T wave intervals for finding the feature template are truncated. Using the DE algorithm requires determining the population size, optimization parameters, the range of parameter values, the difference weights, the crossover probability, and the objective function. The specific steps are as follows:

[0117] S51: Extract the P-wave finding interval from the feature template. Since the ECG signal consists of the P wave, QRS complex, and T wave, the amplitude array of the feature template is from the P wave to the QRS complex and then to the T wave, with a phase of -3.14 to 3.14. According to the phase allocation rule, the phase of the R peak of the feature template is 0. The duration of the QRS complex is generally no more than 110ms. When the sampling rate is 360, 40 data points are collected in 110ms. Therefore, the P-wave finding interval starts from the first point of the template and ends at a position 20 points away from the R peak.

[0118] S52: The extracted P-wave interval amplitude array needs to be subtracted by the minimum value of the interval and shifted above the zero line. This is to simplify the parabola fitting formula and ensure that the parabolic part of the parabola fitting model is only above the zero line.

[0119] S53: Use parabolic fitting to find the P-wave interval. The parabolic formula is as follows:

[0120]

[0121] Where a is the point corresponding to the axis of symmetry of the parabola, b is half the number of points contained in the line connecting the intersection of the parabola and the horizontal axis, and x is a point on the parabola.

[0122] S54: The objective function formula for the DE algorithm is as follows:

[0123]

[0124] Where p size To find the length of the interval p;

[0125] S55: The optimization parameters for the DE algorithm are a and b, the population size NP is set to 50, and the value of a ranges from 1 to p. size The range of values ​​for b is The differential weight F is set to 0.4, the crossover probability CR is set to 0.1, and the number of iterations G is set to 50.

[0126] S56: The specific process for optimizing parameters using the DE algorithm is as follows:

[0127] 1) Generate an initial population. Each individual in the population contains two parameters, a and b. The initial population is generated randomly using the following formula:

[0128] x i,j =x jmin +rand(0,1)(x jmax -x jmin )

[0129] Where i represents the i-th individual in the initial population, j represents the j-th optimization parameter, and x jmin x represents the lower bound of the range of values ​​for the j-th optimization parameter. jmax This represents the upper bound of the range of values ​​for the j-th optimization parameter;

[0130] 2) Each individual in the mutated population is generated by randomly selecting three individuals from the initial population. Two of these individuals undergo a difference operation to interfere with the third individual, thus achieving mutation. The formula for generating mutated individuals is as follows:

[0131] v i (g)=a1(g)+F(a2(g)-a3(g))

[0132] Where v i (g) represents the i-th individual in the mutant population of generation g, and a1(g), a2(g), and a3(g) are three individuals randomly selected from the initial population of generation g.

[0133] 3) For each individual in the initial population and its generated offspring mutants, the optimized parameters are cross-referenced to generate crossover individuals. The formula for generating crossover individuals is as follows:

[0134]

[0135] Where j rand The optimized components are randomized to ensure that at least one component crosses over.

[0136] 4) After crossover, individuals need to be processed using boundary conditions to ensure that the two optimization parameters of individuals in the crossover population are within the specified range. Specifically, when the parameter is less than the minimum value of the range, the parameter value is set to the minimum value of the parameter range; when the parameter is greater than the maximum value of the range, the parameter value is set to the maximum value of the parameter range.

[0137] 5) By calculating the objective function value for the initial population and the crossover population, the individuals in the corresponding sequence of the two populations are compared one by one, and the individuals with the smaller objective function value are retained as the individuals of the new generation initial population;

[0138] 6) Iterate the above process 50 times to obtain the optimal parameters, based on... Figure 10 The result was that the optimal parameters were obtained after 25 iterations;

[0139] Figure 11 This refers to the P-wave interval and the predicted P-peak position, defined by the optimal parameters obtained in step S6 using the DE algorithm. Taking the P-wave as an example, the same applies to the T-wave. The obtained optimized parameters are the P-wave peak position on the template and the start and end points of the P-wave peak-finding interval. If the start point exceeds the P-wave finding interval, the start point is taken as the initial value of the interval; if the end point exceeds the P-wave finding interval, the end point is taken as the end value of the interval. The T-wave parameters are treated similarly. The phase of these three points is assumed to be M. phase (a1), M phase (a2), M phase (a3), in the phase array of the truncated data cut (i) The point whose phase magnitude is closest to the three phase points is the starting position of the peak-finding interval. Predict the P-peak and the ending position. This step verifies the reliability of the parameters extracted by the ECG signal PT wave interval feature extraction method based on the DE algorithm. Figure 11 Each P-wave peak lies between the start and end points of the P-wave peak-finding interval. The P-wave peak can be found by sequentially searching for the maximum and minimum values ​​in each interval.

[0140] Figure 12 To determine the optimal T-wave parameters using the method described above, and based on the T-wave intervals defined by the optimal parameters, the predicted location of the T-peak is determined. Figure 12Each T-wave peak lies between the start and end points of the peak-finding interval of the T-wave. The T-wave peak can be found by searching for the maximum and minimum values ​​in each interval.

[0141] Figure 13 This is an ECG signal segment from lead II data (sample number 100) in the MIT-BIH database that was not used for template extraction.

[0142] The sample points for this signal are from sample number 120,000 to 127,000, with a 5-minute interval between this signal and the signals used in template extraction. The P-wave intervals and predicted P-peak positions are determined based on the parameters extracted from the template. Figure 12 Each P-wave peak lies between the start and end points of the P-wave peak-finding interval. Although this segment of the ECG signal is not involved in template feature extraction, since a person's ECG signal characteristics do not change significantly over a period of time, this demonstrates that the parameters extracted by the ECG signal PT wave interval feature extraction method based on the DE algorithm can be used as prior information to predict the peak-finding interval of subsequent PT waves. This helps to ensure or improve the safety and reliability of medical devices that require real-time monitoring of ECG signals and feature recognition.

[0143] The present invention also provides a system based on the method for extracting PT wave interval features of electrocardiogram signals based on the DE algorithm as described above, the system comprising:

[0144] Data preprocessing module: used to sequentially perform first-order difference, normalization, Shannon energy transformation and bidirectional mean filtering on the acquired electrocardiogram signal to obtain the preprocessed signal;

[0145] Peak finding module: used to find the position of R peak in the preprocessed signal by sequentially finding peaks in the first interval and the second interval; wherein, the interval of the first interval peak finding is larger than the interval of the second interval peak finding;

[0146] Signal interception module: used to intercept the preprocessed signal, retain the data between the first peak point and the last peak point of the second interval peak search, and obtain the intercepted signal;

[0147] The intercepted signal processing module is used to remove baseline drift and normalize the intercepted signal to obtain a first array;

[0148] Phase allocation module: used to allocate the phase of the data in the first array to obtain the truncated data phase array;

[0149] Feature template extraction module: used to extract feature templates based on the phase array of the truncated data;

[0150] Optimization parameter determination module: used to optimize the parameters of the feature template for parabolic fitting using the DE algorithm, and to determine the optimization parameters;

[0151] Parameter optimization module: used to determine the optimal parameters of the optimization parameters, and the obtained optimal parameters are the PT wave interval characteristics of the electrocardiogram signal.

[0152] The embodiments of the present invention also provide corresponding electronic devices and computer-readable storage media for implementing the solutions provided in the embodiments of the present invention.

[0153] The device includes a memory and a processor. The memory is used to store instructions or code, and the processor is used to execute the instructions or code to enable the device to perform the ECG signal PT wave interval feature extraction method based on the DE algorithm according to any embodiment of this application.

[0154] The storage medium stores a computer program, which, when executed by a processor, implements the ECG signal PT wave interval feature extraction method based on the DE algorithm described in any embodiment of this application.

[0155] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for extracting PT wave interval features from electrocardiogram (ECG) signals based on the DE algorithm, characterized in that, include: The acquired electrocardiogram signals were sequentially subjected to first-order difference, normalization, Shannon energy transformation, and bidirectional mean filtering to obtain the preprocessed signal. The position of the R peak is found in the preprocessed signal by sequentially searching for peaks in the first interval and the second interval; wherein the interval of the first interval search is larger than the interval of the second interval search. The preprocessed signal is truncated, and the data between the first peak point and the last peak point of the second interval peak search is retained to obtain the truncated signal; The intercepted signal is processed by removing baseline drift and normalizing to obtain the first array; Phase allocation is performed on the data in the first array to obtain the truncated data phase array; Extract feature templates based on the phase array of the extracted data; The parameters of the feature template for parabolic fitting are optimized using the DE algorithm to determine the optimization parameters; The optimal parameters of the optimization parameters are determined, and the obtained optimal parameters are the PT wave interval characteristics of the electrocardiogram signal.

2. The method for extracting PT wave interval features from electrocardiogram signals based on the DE algorithm according to claim 1, characterized in that, The processes of finding peaks in the first interval and the second interval both include: A sliding window of a preset length moves across the entire preprocessed signal. When the data point in the very center of the sliding window is greater than all other data points on the entire sliding window, the data point in the very center of the sliding window is considered to be the maximum value point, and this maximum value point is the R peak position.

3. The method for extracting PT wave interval features from electrocardiogram signals based on the DE algorithm according to claim 1, characterized in that, When performing phase allocation on the truncated interval data: a phase of magnitude of -π to π is assigned to each data point in the truncated interval data, and an interval allocation ratio coefficient k is introduced. The specific process includes the following: The phase value of the first R peak in a segment of RR interval in the first array is assigned to 0; The phase allocation of a RR interval is divided into two intervals. The relationship between the number of data intervals n1 and the total number of data intervals N of the RR interval is n1 = Nk. The number of data intervals n2 of the second interval is N(1-k). The phases of points within a given RR interval are arithmetically increased across the first and second intervals, with the common difference of the first interval being... The tolerance of the second interval is Subtract 2π from the phase of each data point whose phase is greater than or equal to π to obtain the truncated data phase array.

4. The method for extracting PT wave interval features from electrocardiogram signals based on the DE algorithm according to claim 3, characterized in that, The range of the interval allocation ratio coefficient k is 0.5 to 0.

6.

5. The method for extracting PT wave interval features from electrocardiogram signals based on the DE algorithm according to claim 1, characterized in that, The process of extracting feature templates based on the truncated data phase array includes: The number of data points for the feature template is determined based on the sampling rate of the acquired electrocardiogram signals. The phase assignment of the feature template is determined by splitting it into two intervals, where the number of data intervals M in the first interval is... n1 Total data interval M of feature template n The relationship is M n1 =M n (1-k), the number of data intervals M in the second interval n2 For M n k; The phase of the first point in the feature template data is assigned as -π, and the other data points are arithmetically increased according to the first and second intervals. The common difference of the first interval is... The tolerance of the second interval is Thus, the phase array M of the feature template is obtained. phase (i); Template amplitude array M amplitude The first point M in (i) amplitude The value of (0) is equal to the phase array of the truncated data. cut The first array ECG corresponding to all points with a phase of -π in (i) cut The mean of (i) is used, and the amplitude distribution of subsequent data is the same as that of the second point. The amplitude distribution of the second point is as follows: The phase array of the data is extracted. cut (i) has a phase greater than M phase (0) and less than or equal to M phase (1) The first array ECG corresponding to the point cut The value of (i) is the mean, which is the second point M of the feature template amplitude array. amplitude The value of (1) is obtained by taking the remaining points of the feature template amplitude array in the same way as the second point, and finally the feature template is obtained by taking the number of all data points of the feature template.

6. The method for extracting PT wave interval features from electrocardiogram signals based on the DE algorithm according to claim 5, characterized in that, The process of optimizing the parameters of the feature template for parabolic fitting using the DE algorithm to obtain the optimized parameters includes: Extract the P-wave interval from the feature template; Subtract the minimum value of the amplitude of the P-wave interval from the entire extracted P-wave interval amplitude array, and shift it above the zero line to obtain the shifted P-wave interval; The P-wave interval is found by fitting a parabola to the translated curve, where the formula for the parabola is as follows: Where a is the point corresponding to the axis of symmetry of the parabola, b is half the number of points contained in the line connecting the intersection of the parabola and the horizontal axis, and x is a point on the parabola. The objective function of the DE algorithm is determined based on the parabola, and the formula for the objective function of the DE algorithm is as follows: Where, p size To find the length of the interval p; Based on the objective function of the DE algorithm, the optimization parameters of the DE algorithm are determined to be a and b, where the value of a ranges from 1 to p. size The range of values ​​for b is 7. The method for extracting PT wave interval features from electrocardiogram signals based on the DE algorithm according to claim 6, characterized in that, The process of determining the optimal parameters of the optimization parameters includes: Generate an initial population, where each individual in the initial population contains two parameters, a and b. The initial population is generated randomly using the following formula: x i,j =x jmin +rand(0,1)(x jmax -x jmin ) Where i represents the i-th individual in the initial population, j represents the j-th optimization parameter, and x jmin x represents the lower bound of the range of values ​​for the j-th optimization parameter. jmax This represents the upper bound of the range of values ​​for the j-th optimization parameter; A mutant population is generated, where each individual in the mutant population is one of three individuals randomly selected from the initial population. Two of these three individuals are subjected to a difference operation to interfere with the third individual, thus achieving mutation. The formula for generating mutant individuals is as follows: v i (g)=a1(g)+F(a2(g)-a3(g)) Among them, v i (g) represents the i-th individual in the mutant population of generation g, and a1(g), a2(g), and a3(g) are three individuals randomly selected from the initial population of generation g. For each individual in the initial population and its generated offspring mutants, the optimized parameters are cross-referenced to generate crossover individuals. The formula for generating crossover individuals is as follows: Where, j rand The optimized components are randomized to ensure that at least one component crosses over. For individuals in the crossover population, boundary conditions are applied to ensure that the two optimization parameters of each individual are within a certain range. Specifically, when the parameter is less than the minimum value of the range, the parameter value is set to the minimum value of the range; when the parameter is greater than the maximum value of the range, the parameter value is set to the maximum value of the range. By calculating the objective function value for the initial population and the crossover population, and comparing the individuals in the corresponding sequence in the two populations one by one, the individuals with the smaller objective function value are retained as the individuals in the new generation of the initial population; the above process is repeated iteratively to obtain the optimal parameters.

8. A system for extracting PT wave interval features from electrocardiogram signals based on the DE algorithm, characterized in that, include: Data preprocessing module: used to sequentially perform first-order difference, normalization, Shannon energy transformation and bidirectional mean filtering on the acquired electrocardiogram signal to obtain the preprocessed signal; Peak finding module: used to find the position of R peak in the preprocessed signal by sequentially finding peaks in the first interval and the second interval; wherein, the interval of the first interval peak finding is larger than the interval of the second interval peak finding; Signal interception module: used to intercept the preprocessed signal, retain the data between the first peak point and the last peak point of the second interval peak search, and obtain the intercepted signal; The intercepted signal processing module is used to remove baseline drift and normalize the intercepted signal to obtain a first array; Phase allocation module: used to allocate the phase of the data in the first array to obtain the truncated data phase array; Feature template extraction module: used to extract feature templates based on the phase array of the truncated data; Optimization parameter determination module: used to optimize the parameters of the feature template for parabolic fitting using the DE algorithm, and to determine the optimization parameters; Parameter optimization module: used to determine the optimal parameters of the optimization parameters, and the obtained optimal parameters are the PT wave interval characteristics of the electrocardiogram signal.

9. An electronic device, characterized in that, include: One or more processors; A storage device on which one or more programs are stored; When the one or more programs are executed by the one or more processors, the one or more processors implement the ECG signal PT wave interval feature extraction method based on the DE algorithm as described in any one of claims 1 to 7.

10. A storage medium, characterized in that, It stores a computer program, wherein when the computer program is executed by a processor, it implements the ECG signal PT wave interval feature extraction method based on the DE algorithm as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Ultrasonic diagnosis device, ultrasonic image processing device and method

    CN101361665A

  • 3D angiography algorithm based on reverse principal component analysis

    CN109171670A