Electrocardiosignal PT wave interval feature extraction method based on DE algorithm and related device
Through the DE algorithm-based ECG signal PT wave interval feature extraction method, the problem of difficulty in detecting P and T waves of ECG signal is solved, low-complexity and high-reliability feature extraction is achieved, and the safety of medical devices is improved Sex and real-time.
Patent Information
- Application Number
- CN202411024491.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-07-29
AI Technical Summary
The prior art detects P and T waves in electrocardiogram signals in real-time due to low waveform energy, complex shapes and susceptible to noise interference, making it difficult to detect, especially in medical devices with high real-time requirements in IABP devices. Sexual reliability challenges.
Using the DE algorithm-based ECG signal PT wave interval feature extraction method, pre-processing is performed through first-order differential, normalization, Shannon energy transformation and bidirectional mean filtering, combining the first and second interval peak searches, the signal is intercepted for phase Assignment and feature template extraction, parabolic fitting parameters are optimized through differential evolution algorithms, and PT wave interval characteristics are determined.
Reduces computational complexity, reduces artificial parameter settings, improves the reliability of feature extraction, and helps ensure the safety and reliability of medical devices, especially in real-time monitoring and feature recognition.
Smart Images

Figure CN118902470A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of electrocardiogram signal feature recognition, and relates to an electrocardiogram signal PT wave interval feature extraction method based on a DE algorithm and a related device. Background Art
[0002] ECG signals are weak electric currents generated by the heart muscle when it contracts and relaxes. These electrical signals can be detected by electrodes on the surface of the skin, then amplified and recorded to form an electrocardiogram (ECG). By analyzing the morphology and characteristics of ECG signals, doctors can determine the health of the heart, diagnose heart disease, and develop corresponding treatment plans. ECG signals also play an important role in medical devices, especially in devices such as the heart assist device IABP (Intra-Aortic Balloon Counterpulsation).
[0003] The principle of IABP equipment is to accurately determine the timing of heart contraction and relaxation by monitoring the rhythm and changes of ECG signals, thereby helping to regulate the heart's rhythm and improve the heart's blood supply. The most important function of IABP equipment is to control the trigger mode of balloon inflation and deflation. There are four trigger modes available for IABP equipment on the market, namely ECG trigger, pressure trigger, natural frequency and pacing mode, of which ECG trigger and pressure trigger are the most commonly used. ECG trigger mode requires real-time acquisition of ECG signals and identification of their characteristic waveforms, so ECG signal feature detection is a very important component of IABP equipment. Since the P wave represents the beginning of heart contraction and the T wave represents the end of heart contraction and the entry into diastole, and the balloon needs to be deflated during heart contraction and inflated during diastole, it is necessary to keep the balloon inflated during the TP interval and deflated during the RT interval. Since the P wave and T wave waveforms have low energy and complex shapes, they are easily interfered by noise, so real-time detection is very difficult.
[0004] There are many classic algorithms for feature recognition of ECG signals at home and abroad, such as conventional threshold detection methods. Some classic R peak detection algorithms include Pan-Tompkins algorithm and filter-based methods, wavelet transform method, empirical mode analysis, machine learning-based methods, etc. Pan-Tompkins is a QRS wave detection algorithm with adaptive dual thresholds proposed by Pan and Tompkins. It can be used to detect R waves in real time. The detection basis is mainly 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. The algorithm first enhances the R wave characteristics, and then uses dual threshold technology and search backtracking technology for missed detection. The advantage of this algorithm is that it effectively detects the R wave through slope, amplitude, and width information, but the algorithm is not good at suppressing noise interference. P wave and T wave in ECG signal. Due to its low waveform energy and complex shape, it is very susceptible to noise interference, which makes it impossible to identify it by conventional algorithms such as threshold detection and Pan-Tompkins algorithm. The wavelet transform method has the advantage of high temporal localization for the low-frequency components of the signal, and has a good effect on the detection of singular points of low-frequency components. Therefore, it is widely used by researchers for the detection of low-frequency components P and T waves in ECG signals. Xiong Peng et al. used the multi-scale information of continuous wavelet transform to extract the main components of P and T waves in ECG signals. By integrating stationary wavelets, the candidate segments of P and T waves are smoothed to effectively eliminate the jagged burrs in the waveform to improve the accurate detection of peak points. Finally, the zero-crossing points of P and T waves are time-shifted to ensure that they can accurately correspond to their peak points when restored to the original signal, thereby significantly improving the detection accuracy of P and T waves. However, since wavelet transform needs to perform multi-scale decomposition on a signal, it requires a large number of data points and has a high computational complexity. EMD is an adaptive decomposition method that does not require predefined basis functions or filters. It adapts to the local characteristics of the signal by decomposing the signal data itself into IMFs with different time scales. Zine-Eddine et al. used the EMD method for QRS complex 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 that it is adaptive and does not require predefined basis functions or filters. It adapts to the local characteristics of the signal by decomposing the signal data itself into IMFs with different time scales, and the EMD method also has the completeness of signal decomposition, and the original signal can be obtained by adding each component. However, the EMD method does not have a fixed mathematical model like wavelet analysis or neural networks, so some of its important properties have not yet been proven through rigorous mathematical methods.Moreover, the definition of modal component IMF has not been unified. In the process of decomposing IMF, it is necessary to iterate many times, and there is no standard for stopping the iteration. Therefore, different conditions for stopping the iteration also result in different IMFs. At the same time, both the EMD method and the wavelet transform method need to process a signal containing a large amount of data, resulting in poor real-time performance. Machine learning is a technology in the field of artificial intelligence (AI). The core idea of machine learning is to use data to train models so that they can predict, classify, identify or make decisions on new data. Shweta Jain et al. used genetic algorithms to search for the optimal parameters of adaptive filters by simulating evolutionary processes such as crossover, mutation and selection in nature to improve the detection performance of QRS peaks, and proved that the method performed well in terms of accuracy and sensitivity. The machine learning method has the advantages of automatic feature extraction, rapid processing of large-scale data, and highly accurate classification and detection for feature recognition of ECG signals. However, the machine learning method is often more complex to implement and has high requirements for the hardware platform.
[0005] Since medical devices such as IABP have high real-time requirements for ECG signals, and P and T wave waveforms have low energy and complex shapes and are easily affected by noise, real-time detection is very difficult. Summary of the invention
[0006] In order to solve the problems existing in the prior art, the purpose of the present invention is to provide a method and related device for extracting PT wave interval features of ECG signals based on DE algorithm. The present invention extracts features from ECG signals, and the extracted information can be used as prior information to help predict the subsequent P and T wave peak intervals of ECG signals. The method has the advantages of low computational complexity, fewer artificial parameter settings, and better reliability of extracted features, which helps to ensure or improve the safety and reliability of some medical devices.
[0007] In order to achieve the above object, the present invention provides the following technical solutions:
[0008] A method for extracting PT wave interval features of an electrocardiogram signal based on a DE algorithm, comprising:
[0009] The collected ECG signals are sequentially subjected to first-order difference, normalization, Shannon energy transformation and bidirectional mean filtering to obtain preprocessed signals;
[0010] Searching for the R peak position in the preprocessed signal by sequentially searching for peaks in a first interval and searching for peaks in a second interval; wherein the interval of the first interval peak search is larger than the interval of the second interval peak search;
[0011] The preprocessed signal is intercepted, and the data between the first peak point and the last peak point of the second interval peak search are retained to obtain an intercepted signal;
[0012] removing the baseline drift of the intercepted signal and normalizing the signal to obtain a first array;
[0013] Performing phase allocation on the data in the first array to obtain an intercepted data phase array;
[0014] Extracting feature templates according to the intercepted data phase array;
[0015] Optimizing the parameters of the parabola fitting the feature template by using a DE algorithm (i.e., differential evolution 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 process of searching for peaks in the first interval and searching for peaks in the second interval both include:
[0018] A sliding window of preset length is used to move on the entire preprocessed signal. When the data point in the middle of the sliding window is larger than all other data points on the entire sliding window, the data point in the middle of the sliding window is considered to be a maximum point, which is the R peak position.
[0019] Preferably, when performing phase allocation on the intercepted interval data: a phase of -π to π is allocated to each data point in the intercepted 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 RR interval in the first array is assigned as 0;
[0021] The phase distribution of a RR interval is divided into two intervals, wherein the relationship between the number of data intervals n1 in the first interval and the total data interval N of the RR interval is n1=Nk, and the number of data intervals n2 in the second interval is N(1-k);
[0022] The phase of a point on a RR interval is increased arithmetic progression according to the first interval and the second interval. The tolerance of the first interval is The tolerance for the second interval is
[0023] Subtract 2π from the phase of each data point whose phase is greater than or equal to π, and thus obtain the intercepted data phase array.
[0024] Preferably, the interval allocation ratio coefficient k ranges from 0.5 to 0.6.
[0025] Preferably, the process of extracting the feature template according to the intercepted data phase array includes:
[0026] Determine the number of data points of the feature template according to the sampling rate of the collected electrocardiogram signal;
[0027] Determine the phase distribution of the feature template after it is split into two intervals, where the number of data intervals in the first interval is M n1 and the total data interval M of the feature template n The relationship is M n1 =m n (1-k), the number of intervals of the second interval data M n2 M n k;
[0028] The phase of the first point of the feature template data is assigned to -π, and the other data points are increased arithmetic progression according to the first interval and the second interval. The tolerance of the first interval is The tolerance for the second interval is So far, 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 intercepted data phase array Phase cut The first array of ECG corresponding to all points with phase -π in (i) cut (i), the amplitude distribution of subsequent data is the same as the second point, and the amplitude distribution of the second point is as follows: intercept the data phase array Phase cut (i) The phase is greater than M phase (0) and less than or equal to M phase The first array ECG corresponding to the point (1) cut The value of (i) is taken as the mean, which is the second point M of the feature template amplitude array. amplitude (1), the method for obtaining the remaining points of the feature template amplitude array is the same as the second point, and finally the feature template composed of all the data points of the feature template is obtained.
[0030] Preferably, the process of optimizing the parameters of the parabola fitting the feature template by the DE algorithm and obtaining the optimized parameters includes:
[0031] Intercept the P wave search interval on the characteristic template;
[0032] Subtract the minimum value of the P-wave-seeking interval amplitude from the entire intercepted P-wave-seeking interval amplitude array, and translate it above the zero line to obtain the translated P-wave-seeking interval;
[0033] The parabola fitting is used to find the P-wave interval after translation, where the parabola formula is as follows:
[0034]
[0035] Where a is the point corresponding to the axis of symmetry of the parabola, b is half of the number of points included 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 according to the parabola. The objective function formula of the DE algorithm is as follows:
[0037]
[0038] Among them, p size is the length of the interval for finding p;
[0039] According to the objective function of the DE algorithm, the optimization parameters of the DE algorithm are determined as a and b, where the value range of a is 1-p size , b ranges from
[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, and the generation formula is as follows:
[0042] x i,j =x jmin +rand(0,1)(x jmax -x jmin )
[0043] Among them, i represents the i-th individual of the initial population, j represents the j-th optimization parameter, and x jmin represents the lower bound of the jth optimization parameter range, x jmax Represents the upper bound of the value range of the jth optimization parameter;
[0044] Generate a mutant population, where each individual in the mutant population is three individuals randomly selected from the initial population. Two of the three individuals are differentially operated to interfere with the third individual to achieve mutation. The mutant individual generation formula 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 g-th generation mutant population, a1(g), a2(g), and a3(g) are three individuals randomly selected from the g-th generation initial population;
[0047] For each individual in the initial population, the optimized parameters of the offspring variant individuals generated by it are crossed to generate crossover individuals. The crossover individual generation formula is as follows:
[0048]
[0049] Among them, j rand is a random optimization component to ensure that at least one component is crossed;
[0050] The crossover individuals are processed by boundary conditions so that the two optimization parameters of the individuals in the crossover population are within the range; the specific method includes: when the parameter is less than the minimum value of the range, the parameter value takes the minimum value of the parameter range, and when the parameter is greater than the maximum value of the range, the parameter value takes the maximum value of the parameter range;
[0051] By calculating the objective function value for the initial population and the crossover population, the individuals of the corresponding sequences in the two populations are compared one by one, and the individuals with smaller objective function values are retained as individuals of the new generation initial population; the above process is iterated to obtain the optimal parameters.
[0052] The present invention also provides a PT wave interval feature extraction system for an electrocardiogram signal based on a DE algorithm, comprising:
[0053] Data preprocessing module: used to perform first-order difference, normalization, Shannon energy transformation and bidirectional mean filtering on the collected ECG signals in sequence to obtain the preprocessed signals;
[0054] Peak search module: used to search for the R peak position in the preprocessed signal by first interval peak search and second interval peak search in sequence; wherein the interval of the first interval peak search is larger than the interval of the second interval peak search;
[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] An intercepted signal processing module is used to remove the baseline drift of the intercepted signal and normalize it to obtain a first array;
[0057] Phase allocation module: used for performing phase allocation on the data in the first array to obtain an intercepted data phase array;
[0058] Feature template extraction module: used to extract feature templates according to the intercepted data phase array;
[0059] Optimization parameter determination module: used to optimize the parameters of the parabola fitting the feature template through the DE algorithm and 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 having one or more programs stored thereon;
[0064] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for extracting PT wave interval features of electrocardiographic signals based on the DE algorithm as described above in the present invention.
[0065] The present invention also provides a storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method for extracting PT wave interval features of electrocardiogram signals based on the DE algorithm as described above.
[0066] The present invention has the following beneficial effects:
[0067] The present invention first performs first-order difference, normalization, Shannon energy transformation, and bidirectional mean filtering on the collected ECG signal, and then performs two interval peak searches to determine the R peak position. The interval is intercepted according to the peak search result. The intercepted ECG signal is subjected to phase allocation after removing the baseline drift and normalization, and a feature template is extracted according to the result of the phase allocation. Finally, the parameters of the parabola fitting feature template are optimized by the DE algorithm, and the obtained parameters are the peak search interval of the P and T wave peaks and the approximate position of the peak. Because the feature template is extracted based on the patient's ECG signal, the feature template has the distribution information of the patient's ECG characteristic waveform, so the final optimized parameters can be used as prior information to predict the peak search interval of the subsequent PT wave, which helps to ensure or improve the safety and reliability of some medical devices that need to monitor ECG signals in real time and perform feature recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] Figure 1 is a flowchart of an embodiment of the present invention;
[0069] Figure 2 is a graph of the original electrocardiogram signal used in the embodiment of the present invention;
[0070] Figure 3 is a graph of the ECG signal after preprocessing in step S1 in the embodiment of the present invention;
[0071] Figure 4 This is a peak search result diagram after searching for R peaks in step S2 in an embodiment of the present invention;
[0072] Figure 5 This is a data curve diagram after the interval is intercepted in step S3 in the embodiment of the present invention;
[0073] Figure 6 This is a result diagram of phase allocation in step S4 in an embodiment of the present invention;
[0074] Figure 7 is the template phase image extracted in step S4 in the embodiment of the present invention;
[0075] Figure 8 is the template amplitude map extracted in step S4 in the embodiment of the present invention;
[0076] Fig. 9 The minimum value variation diagram of the objective function of each generation of population obtained in step S5 in the embodiment of the present invention;
[0077] Fig.10 The optimal solution variation diagram of the P wave parameters of each generation population obtained through step S5 in the embodiment of the present invention;
[0078] Fig.11 The P wave interval and the P peak predicted position diagram divided according to the optimal parameters obtained in step S6 in the embodiment of the present invention;
[0079] Fig.12 The T wave interval and T peak predicted position diagram divided according to the optimal parameters obtained in step S6 in the embodiment of the present invention;
[0080] Fig.13 The P wave interval and P peak predicted position map of the ECG signal that is not involved in template extraction. DETAILED DESCRIPTION
[0081] In order to make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be further described in 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 equipment and the treatment effect, the patient's heart rate generally does not change suddenly in a short period of time, and the length of each person's ECG signal PR interval and RT interval will have certain personal characteristics. Based on the above considerations, the technical solution of the present invention is proposed.
[0083] like Figure 1 As shown, the method for extracting PT wave interval features of ECG signals based on DE algorithm in this embodiment includes the following steps:
[0084] S1: Preprocessing the collected ECG signal in sequence through the signal processing methods of first-order difference, normalization, Shannon energy transformation, and bidirectional mean filtering to obtain a preprocessed signal;
[0085] S2: Find the R peak position in the preprocessed signal by large interval peak search and small interval peak search, wherein the interval for large interval peak search is larger than the interval for small interval peak search;
[0086] S3: intercepting the preprocessed signal according to the peak search result, retaining the data between the first peak point and the last peak point of the inter-cell peak search to obtain an intercepted signal, removing the baseline drift of the intercepted signal and normalizing it to obtain a first array;
[0087] S4: performing phase allocation on the intercepted interval data (i.e., the first array obtained in S3) to obtain an intercepted data phase array, and extracting a feature template according to the phase allocation result (i.e., the intercepted data phase array);
[0088] S5: Optimizing the parameters of the parabola fitting the feature template by using the DE algorithm to determine the optimization parameters;
[0089] S6: Calculate the optimal parameters of the optimization parameters according to the DE algorithm, and 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 of the present invention can be verified by cutting the ECG signal PT wave interval peak through the above optimal parameters.
[0091] like Figure 2 Shown is a section of ECG signal data used in this embodiment, which comes from the MIT-BIH database provided by the Massachusetts Institute of Technology. There are three internationally recognized standard ECG databases, namely the MIT-BIH database provided by the Massachusetts Institute of Technology, 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 II lead data in the sample number 100, and the data sampling rate is 360. This example intercepts the first 7000 data of this section of ECG signal as a sample;
[0092] Figure 3 The data is processed by the preprocessing process described above. The preprocessing is to enhance the R peak feature and reduce noise interference, so as to facilitate the search for the R peak. The preprocessing specifically includes the following steps:
[0093] S11: Perform first-order difference on the original ECG signal data. The formula is as follows:
[0094] d i =x i+1 -x i
[0095] where d i is the i-th data obtained after the first-order difference, x i+1 The i+1th data of the original ECG signal, x i The i-th data of the original ECG signal;
[0096] S12: Normalize the data after the first-order difference. The formula is as follows:
[0097]
[0098] where d′ i is the normalized ith data, d i is the i-th data obtained after the first-order difference, d min is the minimum value of the data obtained after the first-order difference, d max is the maximum value of the data obtained after the first-order difference;
[0099] S13: Perform Shannon energy transformation on the normalized data. The formula is as follows:
[0100] s i = -d′ i 2 log2d′ i 2
[0101] where s i is the ith data obtained by Shannon energy transformation, d′ i is the normalized i-th data;
[0102] S14: Perform bidirectional mean filtering on the data after Shannon energy transformation. The filter width of the mean filter should be consistent with the width of the wider QRS complex that may appear. According to experience, the filter width should be the same as the number of points sampled in 150ms. Since the sampling rate of the data samples used is 360Hz, the filter width is 54. Bidirectional rectangular filtering is used to prevent the phase from shifting. First, the data after Shannon energy transformation is convolved with the rectangular filter, and then the convolved data is inverted and convolved with the rectangular filter for the second time. Finally, the data is inverted to obtain the R peak data;
[0103] Figure 4 This is the peak search result after searching for the R peak in step S2. The R peak position is found in the preprocessed signal through large interval peak search and small interval peak search. The principles of the two interval peak searches are the same. A sliding window with a length of n moves from left to right on the entire data. The maximum point is found when the data point in the middle of the sliding window is larger than all other data points on the entire sliding window. Peak search in a large interval also requires threshold judgment of the maximum point, because some smaller extreme values will appear in the RR interval due to the existence of PT waves. Specifically, the peak point position found by the large interval peak search is not the peak point position of the original signal R peak. Assuming the sampling rate is 120, there will be a deviation of less than 5 points, so small interval peak search is required. In this embodiment, the threshold is set to 30 based on experience, the large interval peak search window length is 54, and the small interval peak search window length is 16. Figure 4 All R peaks in the data sample have been found through two peak searches.
[0104] like Figure 5 The data after the interception interval in step S3. Only the complete RR interval can be phase-assigned according to the position information of the R peak, so the interception interval is to facilitate phase assignment. The interception interval needs to be intercepted according to the peak search result. The intercepted interval is the data before the first R peak and the data after the last R peak. After removing the baseline drift of the intercepted signal and normalizing it, the first array ECG can be obtained. cut (i);
[0105] like Figure 6 It is the result of the phase allocation in step S4. Phase allocation needs to allocate a phase of -π to π for each data point. For the convenience of calculation, the present invention takes the phase π as 3.14 and 2π as 6.28 as an example for explanation, and introduces an interval allocation proportional coefficient k when allocating phase. When allocating phase, it is hoped that the P wave appears in the phase interval of -3.14 to 0, and the T wave appears in the phase interval of 0 to 3.14. According to the distribution of PT waves in the RR interval in the human electrocardiogram signal, in most cases the interval allocation proportional coefficient k is 0.5. However, sometimes the RT interval of some patients with arrhythmia is prolonged, resulting in a large proportion of the RT interval to the RR interval. When the proportional coefficient k is 0.5, it cannot meet the requirement that the P wave appears in the phase interval of -3.14 to 0 and the T wave appears in the phase interval of 0 to 3.14. Therefore, it is necessary to adjust the k value according to the actual situation. The electrocardiogram signal sample used in this implementation case is the above case, so the k value is taken as 0.6, and the specific steps of phase allocation are as follows:
[0106] S41: Input the first ECG array cut (i);
[0107] S42: assigning the phase value of the first R peak in a RR interval to 0;
[0108] S43: splitting a RR interval phase into two intervals, wherein the relationship between the number of data intervals n1 in the first interval and the total number of data intervals N in the RR 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 RR interval is increased arithmetic-incrementally in two intervals. The tolerance of the first interval is The tolerance for 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 the points in the first interval is 0 to 3.14, and the phase of the points in the second interval is -3.14 to 0, ensuring that the P wave appears in the phase interval of -3.14 to 0, and the T wave appears in the phase interval of 0 to 3.14, so that the intercepted data phase array Phase is obtained cut (i) According to Figure 6 It can be seen that the phase of all R peaks is 0;
[0111] Figure 7 is the template phase image extracted in step S4, Figure 8 It is the template amplitude diagram extracted by step S4. The template is a piece of data extracted from a segment of ECG signal with the characteristics of the P wave, QRS complex, and T wave of the segment, and is also a representation of the characteristics of a person's ECG signal. The ECG signal feature template is extracted based on the result of phase allocation. The feature template needs to have amplitude and phase. The specific steps are as follows:
[0112] S46: The number of data points of the feature template is the same as the sampling rate, which is 360 Hz. Therefore, the number of data points in this embodiment is 360.
[0113] S47: The phase distribution of the feature template is divided into two intervals. The number of data intervals in the first interval is M. n1 and template total data interval M n The relationship is M n1 =M n (1-k)-1, calculated as 143, the number of intervals of the second interval data is M n2 M n k, calculated as 216;
[0114] S48: The phase of the first point of the template data is assigned to -3.14, and the other data points are arithmetic increments in two intervals. The tolerance of the first interval is The tolerance for the second interval is So far, the phase array M of the feature template is obtained phase (i);
[0115] S49: Allocation of characteristic template data amplitude and the first ECG array intercepted 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) is equal to Phase cut ECG corresponding to all points with a phase of -3.14 in (i) cut (i) The amplitude distribution of subsequent data is based on the second point as an example.cut (i) The phase is greater than M phase (0) and less than or equal to M phase The ECG corresponding to the point (1) cut The average value of (i) is the second point M of the template amplitude array. amplitude (1), the method for obtaining the remaining points of the template amplitude array is the same as the second point. cut (i) The phase is greater than M phase (j) and less than or equal to M phase The number of points at (j+1) is 0, then M amplitude (j+1)=M amplitude (j) This is done to avoid calculation errors caused by division by 0;
[0116] DE algorithm optimizes the parabola fitting feature template parameters, taking P wave parameters as an example, and T wave parameters in the same way. Fig. 9 is the minimum value of the objective function of each generation of P-wave parameters obtained by the DE algorithm in step S5, Fig.10 It is the optimal solution of the P wave parameters of each generation of population obtained by the DE algorithm in step S5. The DE algorithm is a global optimization algorithm, which is usually used to solve unconstrained optimization problems. It is an evolutionary algorithm that simulates the process of biological evolution and gradually 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 the calculation of the gradient or second-order derivative of the problem, so it is suitable for some complex problems. There is a lot of independence in the calculation process of the DE algorithm, which can be easily parallelized to improve the operation efficiency of the algorithm. Before using the DE algorithm, the feature template is searched for P and T wave intervals. The use of the DE algorithm requires determining the population size of the DE algorithm, the optimization parameters, the range of optimization parameters, the differential weights, the crossover probability, and the objective function. The specific steps are as follows:
[0117] S51: intercept the P wave search interval on the feature template. Since the ECG signal is composed of P wave, QRS complex and T wave, the feature template amplitude array is P wave to QRS complex and then to T wave, with a phase of -3.14-3.14. The R peak phase of the feature template obtained according to the phase allocation rule is 0. The duration of the QRS complex generally does not exceed 110ms. When the sampling rate is 360, 40 data points are collected in 110ms. Therefore, the P wave search interval starts from the first point of the template and ends at the position 20 points before the R peak.
[0118] S52: The intercepted P-wave interval amplitude array needs to be subtracted from the minimum value of the interval amplitude as a whole and translated above the zero line. This is to simplify the parabola fitting formula and ensure that the parabola part of the parabola fitting model is only above the zero line.
[0119] S53: Use parabola fitting to find the P wave interval. The parabola formula is as follows:
[0120]
[0121] Where a is the point corresponding to the axis of symmetry of the parabola, b is half of the number of points included 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 of the DE algorithm is as follows:
[0123]
[0124] where p size is the length of the interval for finding p;
[0125] S55: DE algorithm optimization parameters are a and b, the population size NP is set to 50, and the value range of a is 1-p size , b ranges from The difference 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 of DE algorithm optimization parameters is as follows:
[0127] 1) Generate the initial population. Each individual in the population has two parameters, a and b. The initial population is generated randomly. The generation formula is as follows:
[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 represents the lower bound of the jth optimization parameter range, x jmax Represents the upper bound of the value range of the jth optimization parameter;
[0130] 2) Each individual in the mutant population is randomly selected from three individuals in the initial population, two of which are subjected to differential operation to interfere with the third individual to achieve mutation. The mutant individual generation formula 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 g-th generation mutant population, a1(g), a2(g), and a3(g) are three individuals randomly selected from the g-th generation initial population;
[0133] 3) For each individual in the initial population, the optimized parameters of the offspring variant individuals generated by it are cross-linked to generate crossover individuals. The crossover individual generation formula is as follows:
[0134]
[0135] where j rand is a random optimization component to ensure that at least one component is crossed;
[0136] 4) After the crossover, the individuals must pass the boundary condition processing to ensure that the two optimization parameters of the individuals in the crossover population are within the range. Specifically, when the parameter is less than the minimum value of the range, the parameter value takes the minimum value of the parameter range, and when the parameter is greater than the maximum value of the range, the parameter value takes 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 of the corresponding sequences in the two populations are compared one by one, and the individuals with smaller objective function values are retained as individuals of the new generation of initial population;
[0138] 6) Continue to iterate the above process 50 times to obtain the optimal parameters. Fig.10 As a result, the optimal parameters were obtained after 25 iterations;
[0139] Fig.11 The P wave interval and the predicted P peak position are divided by the optimal parameters obtained by the DE algorithm in step S6. Taking the P wave as an example, the T wave is similar. The optimized parameters obtained are the P wave peak position on the template and the starting and ending points of the P wave peak search interval. If the starting point exceeds the P search interval, the starting point takes the initial value of the interval. If the ending point exceeds the P search interval, the ending point takes the ending value of the interval. The same is true for the T wave parameters. The phases of these three points are assumed to be M phase (a1), M phase (a2), M phase (a3), in the phase array Phase of the intercepted data cut (i) Find the point closest to the three phase points on the graph, which is the starting position of the peak search interval. Predict the P peak and the end 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. Fig.11 Each P wave peak is between the starting point and the ending point of the P wave peak search interval. The P wave peak can be found by simply searching for the maximum value in each interval in turn.
[0140] Fig.12 To find the optimal parameters of T wave according to the above method, and divide the T wave interval and T peak prediction position according to the optimal parameters, Fig.12Each T wave peak is between the starting point and the ending point of the T wave peak search interval. The T wave peak can be found by simply searching for the maximum value in each interval in turn.
[0141] Fig.13 This is a segment of ECG signal from the II lead data with sample number 100 in the MIT-BIH database that is not involved in template extraction.
[0142] The sample points of this signal are from 120000 to 127000, which is 5 minutes apart from the signal involved in template extraction. The P wave interval and P peak prediction position are divided according to the parameters extracted from the template. Fig.12 Each P wave peak is between the starting point and the ending point of the P wave peak search interval. Although this section of ECG signal does not participate in the template feature extraction, since the ECG signal characteristics of a person will not change dramatically over a period of time, it also proves 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 subsequent PT wave peak search interval, which helps to ensure or improve the safety and reliability of some medical devices that need to monitor ECG signals in real time and perform feature recognition.
[0143] The present invention also provides a system based on the method for extracting PT wave interval features of an electrocardiogram signal based on the DE algorithm as described above, the system comprising:
[0144] Data preprocessing module: used to perform first-order difference, normalization, Shannon energy transformation and bidirectional mean filtering on the collected ECG signals in sequence to obtain the preprocessed signals;
[0145] Peak search module: used to search for the R peak position in the preprocessed signal by first interval peak search and second interval peak search in sequence; wherein the interval of the first interval peak search is larger than the interval of the second interval peak search;
[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] An intercepted signal processing module is used to remove the baseline drift of the intercepted signal and normalize it to obtain a first array;
[0148] Phase allocation module: used for performing phase allocation on the data in the first array to obtain an intercepted data phase array;
[0149] Feature template extraction module: used to extract feature templates according to the intercepted data phase array;
[0150] Optimization parameter determination module: used to optimize the parameters of the parabola fitting the feature template through the DE algorithm and 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 by the embodiments of the present invention.
[0153] Among them, the device includes a memory and a processor, the memory is used to store instructions or codes, and the processor is used to execute the instructions or codes so that the device executes the method for extracting PT wave interval features of electrocardiogram signals based on DE algorithm as described in any embodiment of the present application.
[0154] The storage medium stores a computer program, wherein the computer program, when executed by the processor, implements the method for extracting PT wave interval features of electrocardiogram signals based on the DE algorithm as described in any embodiment of the present 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 principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for extracting PT wave interval features of ECG signals based on DE algorithm. It is characterized in that include: The collected ECG signals are sequentially subjected to first-order difference, normalization, Shannon energy transformation and bidirectional mean filtering to obtain preprocessed signals; Searching for the R peak position in the preprocessed signal by sequentially searching for peaks in a first interval and searching for peaks in a second interval; wherein the interval of the first interval peak search is larger than the interval of the second interval peak search; The preprocessed signal is intercepted, and the data between the first peak point and the last peak point of the second interval peak search are retained to obtain an intercepted signal; removing the baseline drift of the intercepted signal and normalizing the signal to obtain a first array; Performing phase allocation on the data in the first array to obtain an intercepted data phase array; Extracting feature templates according to the intercepted data phase array; Optimizing the parameters of the parabola fitting the feature template by 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. According to the method for extracting PT wave interval features of electrocardiogram signals based on DE algorithm according to claim 1, It is characterized in that The processes of the first interval peak search and the second interval peak search both include: A sliding window of preset length is used to move on the entire preprocessed signal. When the data point in the middle of the sliding window is larger than all other data points on the entire sliding window, the data point in the middle of the sliding window is considered to be a maximum point, which is the R peak position.
3. According to the method for extracting PT wave interval features of electrocardiogram signals based on DE algorithm according to claim 1, It is characterized in that When performing phase allocation on the intercepted interval data: a phase of -π to π is allocated to each data point in the intercepted interval data, and an interval allocation ratio coefficient k is introduced, which specifically includes the following process: The phase value of the first R peak in a RR interval in the first array is assigned as 0; The phase distribution of a RR interval is divided into two intervals, where the number of data intervals in the first interval is n. 1 The relationship between the total RR interval data interval N is n 1 =Nk, the number of intervals of data in the second interval n 2 is N(1-k); The phase of a point on a RR interval is increased arithmetic progression according to the first interval and the second interval. The tolerance of the first interval is The tolerance for the second interval is Subtract 2π from the phase of each data point whose phase is greater than or equal to π, and thus obtain the intercepted data phase array.
4. The method for extracting PT wave interval features of an electrocardiogram signal based on a DE algorithm according to claim 3, It is characterized in that The value range of the interval allocation ratio coefficient k is 0.5 to 0.
6.
5. The method for extracting PT wave interval features of an electrocardiogram signal based on a DE algorithm according to claim 1, It is characterized in that According to the intercepted data phase array, the process of extracting the feature template includes: Determine the number of data points of the feature template according to the sampling rate of the collected electrocardiogram signal; Determine the phase distribution of the feature template after it is split into two intervals, where the number of data intervals in the first interval is M n1 and the total data interval M of the feature template n The relationship is M n1 =M n (1-k), the number of intervals of the second interval data M n2 M n k; The phase of the first point of the feature template data is assigned to -π, and the other data points are increased arithmetic progression according to the first interval and the second interval. The tolerance of the first interval is The tolerance for the second interval is So far, 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 intercepted data phase array Phase cut The first array of ECG corresponding to all points with phase -π in (i) cut (i), the amplitude distribution of subsequent data is the same as the second point, and the amplitude distribution of the second point is as follows: intercept the data phase array Phase cut (i) The phase is greater than M phase (0) and less than or equal to M phase The first array ECG corresponding to the point (1) cut The value of (i) is taken as the mean, which is the second point M of the feature template amplitude array. amplitude (1), the method for obtaining the remaining points of the feature template amplitude array is the same as the second point, and finally the feature template composed of all the data points of the feature template is obtained.
6. The method for extracting PT wave interval features of an electrocardiogram signal based on a DE algorithm according to claim 5, It is characterized in that The process of optimizing the parameters of the parabola fitting the feature template by the DE algorithm and obtaining the optimized parameters includes: Intercept the P wave search interval on the characteristic template; Subtract the minimum value of the P-wave-seeking interval amplitude from the entire intercepted P-wave-seeking interval amplitude array, and translate it above the zero line to obtain the translated P-wave-seeking interval; The parabola fitting is used to find the P-wave interval after translation, where the parabola formula is as follows: Where a is the point corresponding to the axis of symmetry of the parabola, b is half of the number of points included 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 according to the parabola. The objective function formula of the DE algorithm is as follows: Among them, p size is the length of the interval for finding p; According to the objective function of the DE algorithm, the optimization parameters of the DE algorithm are determined as a and b, where a ranges from 1 to p. size , b ranges from 7. The method for extracting PT wave interval features of an electrocardiogram signal based on a DE algorithm according to claim 6, It is 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, and the generation formula is as follows: x i,j =x jmin +rand(0,1)(x jmax -x jmin ) Among them, i represents the i-th individual of the initial population, j represents the j-th optimization parameter, and x jmin represents the lower bound of the jth optimization parameter range, x jmax Represents the upper bound of the value range of the jth optimization parameter; Generate a mutant population, where each individual in the mutant population is three individuals randomly selected from the initial population. Two of the three individuals are differentially operated to interfere with the third individual to achieve mutation. The mutant individual generation formula is as follows: v i (g)=a 1 (g)+F(a 2 (g)-a 3 (g)) Among them, v i (g) represents the i-th individual in the g-th generation mutant population, a 1 (g), a 2 (g), a 3 (g) are three individuals randomly selected from the initial population of the gth generation; For each individual in the initial population, the optimized parameters of the offspring variant individuals generated by it are crossed to generate crossover individuals. The crossover individual generation formula is as follows: Among them, j rand is a random optimization component to ensure that at least one component is crossed; The crossover individuals are processed by boundary conditions so that the two optimization parameters of the individuals in the crossover population are within the range; the specific method includes: when the parameter is less than the minimum value of the range, the parameter value takes the minimum value of the parameter range, and when the parameter is greater than the maximum value of the range, the parameter value takes the maximum value of the parameter range; By calculating the objective function value for the initial population and the crossover population, the individuals of the corresponding sequences in the two populations are compared one by one, and the individuals with smaller objective function values are retained as individuals of the new generation initial population; the above process is iterated to obtain the optimal parameters.
8. A PT wave interval feature extraction system for ECG signals based on DE algorithm. It is characterized in that include: Data preprocessing module: used to perform first-order difference, normalization, Shannon energy transformation and bidirectional mean filtering on the collected ECG signals in sequence to obtain the preprocessed signals; Peak search module: used to search for the R peak position in the preprocessed signal by first interval peak search and second interval peak search in sequence; wherein the interval of the first interval peak search is larger than the interval of the second interval peak search; 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; An intercepted signal processing module is used to remove the baseline drift of the intercepted signal and normalize it to obtain a first array; Phase allocation module: used for performing phase allocation on the data in the first array to obtain an intercepted data phase array; Feature template extraction module: used to extract feature templates according to the intercepted data phase array; Optimization parameter determination module: used to optimize the parameters of the parabola fitting the feature template through the DE algorithm and 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, It is characterized in that include: one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors implement the method for extracting PT wave interval features of electrocardiogram signals based on DE algorithm as described in any one of claims 1 to 7.
10. A storage medium, It is characterized in that A computer program is stored thereon, wherein when the computer program is executed by a processor, the method for extracting PT wave interval features of an electrocardiogram signal based on a DE algorithm as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Ultrasonic diagnosis device, ultrasonic image processing device and method
CN101361665A
3D angiography algorithm based on reverse principal component analysis
CN109171670A
Method for optimizing neural network model in combination with gradient algorithm and evolutionary algorithm
CN114912368A
Manufacturing method of eco-friendly vinyl, the eco-friendly vinyl and eco-friendly sanitary vinyl gloves manufactured by the same
KR1020240119932A
Method and system for analyzing the cardiac activity of a patient and uses thereof
US20130053715A1
