ECG signal parameterization method, model training method, device, equipment and medium
Through the parameterization method of the ECG signal, the relative position information of key points is used to convert the ECG signal into a parameter vector sequence, which solves the problems of versatility and high storage cost of the existing ECG analysis method, and realizes the reduction of data volume. reduction and improved clinical interpretability.
Patent Information
- Application Number
- CN202010833864.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-18
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2040-08-18
AI Technical Summary
Existing ECG analysis methods have shortcomings in versatility and clinical interpretability, and the large amount of data results in high storage costs.
By acquiring the ECG signal, a parameterized model is determined to reconstruct the relative position information of key points, and the signal is parameterized into a parameter vector sequence, thereby reducing storage requirements and improving clinical interpretability.
This reduces the amount of data and storage costs, while improving the clinical interpretability and analysis efficiency of ECG signals.
Smart Images

Figure CN111956203B
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of electrocardiography technology, and in particular to an electrocardiography signal parameterization method, a model training method, a device, a equipment and a medium. Background Art
[0002] As society ages, the incidence and harmfulness of cardiovascular diseases continue to rise. As a routine physical examination item, electrocardiogram is of great significance for the diagnosis and monitoring of cardiovascular diseases. In clinical medicine, doctors mainly diagnose diseases by observing electrocardiogram waveforms and measuring certain key parameters. Therefore, an electrocardiogram analysis method that can quickly and accurately extract electrocardiogram waveform information and measure key parameters is needed to help doctors work.
[0003] Existing ECG analysis methods usually use end-to-end methods based on deep learning to obtain the probability that ECG signals may be abnormal. Although the performance of deep learning-based analysis methods is good, their versatility and clinical interpretability have always been their shortcomings. In addition, the existing methods require a huge amount of ECG data to be stored, and the data storage cost is high. Summary of the invention
[0004] The present invention provides an electrocardiogram signal parameterization method, a model training method, a device, equipment and a medium, which can reduce the amount of stored data and reduce storage costs, and the electrocardiogram signal has good clinical interpretability after parameterization.
[0005] In a first aspect, an embodiment of the present invention provides a method for parameterizing an electrocardiogram signal, comprising:
[0006] Acquiring an electrocardiogram signal, wherein the electrocardiogram signal includes a plurality of characteristic wave signals;
[0007] Determining an ECG signal parameterized model, wherein model parameters of the ECG parameterized model include relative position information of a plurality of key points used to reconstruct the ECG signal;
[0008] The ECG signal is input into the ECG signal parameterization model for processing to obtain a parameter vector sequence of the ECG signal, wherein the parameter vector sequence includes a plurality of parameter vectors for characterizing the characteristic wave signal, and the parameter vector includes relative position information of the key point.
[0009] In a second aspect, an embodiment of the present invention further provides a method for training a parameterized model of an electrocardiogram signal, comprising:
[0010] Acquire an electrocardiogram signal sample, wherein the electrocardiogram signal sample includes a plurality of characteristic wave signal samples;
[0011] Determining an ECG signal parameterized model, wherein model parameters of the ECG parameterized model include relative position information of a plurality of key points used to reconstruct the ECG signal sample;
[0012] Inputting the ECG signal sample into the ECG signal parameterization model for processing to obtain a parameter vector sequence of the ECG signal sample, wherein the parameter vector sequence includes a plurality of parameter vectors for characterizing the characteristic wave signal sample, and the parameter vector includes relative position information of the key point;
[0013] Reconstruct the electrocardiogram signal sample according to the parameter vector sequence to obtain a reconstructed signal sample;
[0014] Calculating the error between the electrocardiogram signal sample and the reconstructed signal sample;
[0015] The relative position information of the key points in the ECG parameterized model is updated according to the error.
[0016] In a third aspect, an embodiment of the present invention further provides an electrocardiogram signal parameterization device, comprising:
[0017] An ECG signal acquisition module, used to acquire an ECG signal, wherein the ECG signal includes a plurality of characteristic wave signals;
[0018] A parameterized model determination module, used to determine a parameterized model of an ECG signal, wherein the model parameters of the parameterized model include relative position information of a plurality of key points used to reconstruct the ECG signal;
[0019] The parameterized processing module is used to input the ECG signal into the ECG signal parameterized model for processing to obtain a parameter vector sequence of the ECG signal, wherein the parameter vector sequence includes a plurality of parameter vectors for characterizing the characteristic wave signal, and the parameter vector includes relative position information of the key point.
[0020] In a fourth aspect, an embodiment of the present invention further provides an electrocardiogram signal parameterized model training device, comprising:
[0021] A sample acquisition module, used to acquire an ECG signal sample, wherein the ECG signal sample includes a plurality of characteristic wave signal samples;
[0022] A parameterized model determination module, used for determining a parameterized model of an ECG signal, wherein the model parameters of the parameterized model include relative position information of a plurality of key points used for reconstructing the ECG signal sample;
[0023] A parameterized processing module, used for inputting the ECG signal sample into the ECG signal parameterized model for processing to obtain a parameter vector sequence of the ECG signal sample, wherein the parameter vector sequence includes a plurality of parameter vectors for characterizing the characteristic wave signal sample, and the parameter vector includes relative position information of the key point;
[0024] A reconstruction module, used for reconstructing the electrocardiogram signal sample according to the parameter vector sequence to obtain a reconstructed signal sample;
[0025] An error calculation module, used for calculating the error between the electrocardiogram signal sample and the reconstructed signal sample;
[0026] A key point updating module is used to update the relative position information of the key points in the ECG parameterized model according to the error.
[0027] In a fifth aspect, an embodiment of the present invention further provides a computer device, including:
[0028] one or more processors;
[0029] A storage device for storing one or more programs;
[0030] When the one or more programs are executed by the one or more processors, the one or more processors implement the ECG signal parameterization method provided in the first aspect of the present invention, or implement the ECG signal parameterization model training method provided in the second aspect of the present invention.
[0031] In a sixth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the ECG signal parameterization method provided in the first aspect of the present invention, or implements the ECG signal parameterization model training method provided in the second aspect of the present invention.
[0032] The electrocardiogram signal parameterization method provided by the embodiment of the present invention includes: obtaining an electrocardiogram signal, the electrocardiogram signal includes multiple characteristic wave signals; determining an electrocardiogram signal parameterization model, the model parameters of the electrocardiogram parameterization model include the relative position information of multiple key points for reconstructing the electrocardiogram signal; inputting the electrocardiogram signal into the electrocardiogram signal parameterization model for processing, and obtaining a parameter vector sequence of the electrocardiogram signal, the parameter vector sequence includes multiple parameter vectors for characterizing the characteristic wave signal, and the parameter vector includes the relative position information of the key points. By parameterizing the characteristic wave signal in the electrocardiogram signal into parameters of different dimensions including the relative position information of multiple key points, the electrocardiogram signal can be directly analyzed using these parameter areas, and the clinical interpretability is good. When the electrocardiogram signal needs to be reconstructed later, it is only necessary to determine the waveform of the characteristic wave signal according to the key points, and adjust each characteristic wave signal according to these parameters to obtain a reconstructed signal. Since there is no need to store the original electrocardiogram, only the parameter vector sequence needs to be stored, so the amount of stored data is greatly reduced, and the storage cost is greatly reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1A A flow chart of a method for parameterizing an electrocardiogram signal provided in the first embodiment of the present invention;
[0034] Figure 1B A structural diagram of an electrocardiogram signal provided in Embodiment 1 of the present invention;
[0035] Figure 2A is a flow chart of a method for parameterizing an electrocardiogram signal provided in Embodiment 2 of the present invention;
[0036] Figure 2B A schematic diagram of generating a standardized characteristic wave signal template provided by an embodiment of the present invention;
[0037] Figure 2C A schematic diagram of determining a maximum value in a matching degree sequence provided by an embodiment of the present invention;
[0038] Figure 3 A flowchart of a method for training a parameterized model of an electrocardiogram signal provided in Embodiment 3 of the present invention;
[0039] Figure 4 A flowchart of a method for training a parameterized model of an electrocardiogram signal provided in Embodiment 4 of the present invention;
[0040] Figure 5 A schematic diagram of the structure of an electrocardiogram signal parameterization device provided in Embodiment 5 of the present invention;
[0041] Figure 6 A structural schematic diagram of an electrocardiogram signal parameterized model training device provided in Embodiment 6 of the present invention;
[0042] Figure 7A schematic diagram of the structure of a computer device provided in Embodiment 7 of the present invention. DETAILED DESCRIPTION
[0043] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0044] Embodiment 1
[0045] Figure 1A This is a flow chart of a method for parameterizing an ECG signal provided in the first embodiment of the present invention. This embodiment is applicable to the case of parameterizing an ECG signal. The method can be executed by the ECG signal parameterizing device provided in the embodiment of the present invention. The device can be implemented in software and / or hardware and is usually configured in a computer device. Figure 1A As shown, the method specifically comprises the following steps:
[0046] S101. Acquire an electrocardiogram signal, where the electrocardiogram signal includes a plurality of characteristic wave signals.
[0047] Specifically, the myocardium is excited before and after the heart beats. During the myocardial excitement, a weak bioelectric current is generated. In this way, each cardiac cycle is accompanied by bioelectric changes. This bioelectric change can be transmitted to various parts of the body surface. Due to the different tissues of various parts of the body and the different distances from the heart, the potentials of the electrocardiogram in different parts of the body are also different. For a normal heart, the direction, frequency, and intensity of this bioelectric change are regular. If the electrical signals from different parts of the body surface are detected by electrodes, amplified by amplifiers, and recorded by recorders, an electrocardiogram (ECG) can be obtained.
[0048] An electrocardiogram is a graph of various forms of potential changes in each cardiac cycle of the heart, which is accompanied by changes in bioelectricity, as the pacemaker, atrium, and ventricle are excited successively. Since each heartbeat is regular, the waveform in the electrocardiogram is also regular. The waveform in the electrocardiogram that can fully represent one cardiac cycle of the heart is called a heartbeat signal. An ECG record usually contains hundreds of thousands of heartbeat signals. In an embodiment of the present invention, at least one continuous heartbeat is intercepted from the ECG record as an electrocardiogram signal. Specifically, the electrocardiogram can be obtained from the user's electrocardiogram physical examination results.
[0049] Figure 1B This is a structural diagram of an electrocardiogram signal provided in the first embodiment of the present invention, referring to Figure 1BIt can be seen that the ECG signal includes a heartbeat, and a heartbeat includes multiple characteristic wave signals, such as P wave, Q wave, R wave, S wave and T wave. By detecting the characteristics of one or more waves among the P wave, Q wave, R wave, S wave and T wave, the ECG signal can be determined in the ECG. Among them, the horizontal axis is the time axis, which is measured in time, and the vertical axis is the intensity of the ECG signal, which is characterized by voltage. In clinical practice, the straight segment (TS segment) between the T wave and the S wave in the ECG signal is usually extended to obtain the time axis.
[0050] S102: Determine an ECG signal parameterized model, where model parameters of the ECG parameterized model include relative position information of a plurality of key points used to reconstruct the ECG signal.
[0051] Specifically, in an embodiment of the present invention, the ECG signal parameterization model is used to parameterize the ECG signal to obtain parameters of different dimensions for characterizing the ECG signal. Exemplarily, in a specific embodiment of the present invention, the above parameters may include the amplitude of each characteristic wave signal in the ECG signal, the offset relative to the time axis, the position information, and the relative position information of the key points for determining the shape of the characteristic wave signal in the subsequent reconstruction of the characteristic wave signal, etc. The embodiment of the present invention does not limit the type of parameters for characterizing the ECG signal, and in other embodiments of the present invention, it may also be parameters of other different dimensions.
[0052] The model parameters of the ECG parameterization model include the relative position information of multiple key points used to reconstruct the ECG signal, and the relative position information of the key points can be optimized by training the ECG parameterization model with a large number of ECG signal samples. Specifically, in a specific embodiment of the present invention, multiple (e.g., 5) key points are set for each characteristic wave signal, and two adjacent key points have the same spacing on the horizontal axis. The relative position information of the multiple key points can be determined through the vertical coordinates of each key point.
[0053] S103, inputting the ECG signal into the ECG signal parameterization model for processing to obtain a parameter vector sequence of the ECG signal.
[0054] The parameter vector sequence includes a plurality of parameter vectors for characterizing the characteristic wave signal, and the parameter vectors include relative position information of key points.
[0055] Specifically, the ECG signal is input into the ECG signal parameterization model for processing to obtain parameters for characterizing the characteristic wave signal, and the above parameters are organized into a vector form to obtain a parameter vector for characterizing the characteristic wave signal. The parameter vectors of each characteristic wave signal are arranged in the time sequence of the characteristic wave signal in the ECG signal to obtain a parameter vector sequence for characterizing the ECG signal.
[0056] Among them, the parameters of the parameter vector of the characteristic wave signal include the relative position information of multiple key points. Multiple key points are used to determine the waveform of the characteristic wave signal in the process of reconstructing the electrocardiogram signal. Specifically, in a specific embodiment of the present invention, multiple (for example, 5) key points are set for each characteristic wave signal, and two adjacent key points have the same spacing on the horizontal axis. The relative position information of multiple key points can be determined by the position of each key point on the vertical axis.
[0057] In the subsequent application process, if the ECG signal needs to be used, it is only necessary to determine the waveform of the characteristic wave signal according to the key points, and then adjust the characteristic wave signal according to the parameters in the parameter vector, such as adjusting the amplitude of the characteristic wave signal, the offset relative to the time axis, and the position on the time axis, so as to reconstruct the ECG signal. Since there is no need to store the original ECG, only the parameter vector sequence needs to be stored, so the amount of stored data is greatly reduced and the storage cost is greatly reduced. In addition, by parameterizing the ECG signal, these parameters can be directly used to analyze the ECG signal, which has good clinical interpretability.
[0058] The electrocardiogram signal parameterization method provided by the embodiment of the present invention includes: obtaining an electrocardiogram signal, the electrocardiogram signal includes multiple characteristic wave signals; determining an electrocardiogram signal parameterization model, the model parameters of the electrocardiogram parameterization model include the relative position information of multiple key points for reconstructing the electrocardiogram signal; inputting the electrocardiogram signal into the electrocardiogram signal parameterization model for processing, and obtaining a parameter vector sequence of the electrocardiogram signal, the parameter vector sequence includes multiple parameter vectors for characterizing the characteristic wave signal, and the parameter vector includes the relative position information of the key points. By parameterizing the characteristic wave signal in the electrocardiogram signal into parameters of different dimensions including the relative position information of multiple key points, the electrocardiogram signal can be directly analyzed using these parameter areas, and the clinical interpretability is good. When the electrocardiogram signal needs to be reconstructed later, it is only necessary to determine the waveform of the characteristic wave signal according to the key points, and adjust each characteristic wave signal according to these parameters to obtain a reconstructed signal. Since there is no need to store the original electrocardiogram, only the parameter vector sequence needs to be stored, so the amount of stored data is greatly reduced, and the storage cost is greatly reduced.
[0059] Embodiment 2
[0060] Embodiment 2 of the present invention provides a method for parameterizing an electrocardiogram signal. Figure 2A is a flow chart of a method for parameterizing an ECG signal provided by Embodiment 2 of the present invention. This embodiment is refined on the basis of Embodiment 1 above, and describes in detail the processing process of the ECG signal parameterization model. Figure 2A As shown, the method comprises the following steps:
[0061] S201. Acquire an electrocardiogram signal, where the electrocardiogram signal includes a plurality of characteristic wave signals.
[0062] Specifically, in a specific embodiment of the present invention, an electrocardiogram signal includes a heartbeat, and a heartbeat includes multiple characteristic wave signals, such as a P wave, a Q wave, an R wave, an S wave, and a T wave. By detecting the characteristics of one or more of the P wave, the Q wave, the R wave, the S wave, and the T wave, the electrocardiogram signal can be determined.
[0063] Specifically, in some embodiments of the present invention, step S201 may include the following steps:
[0064] Obtain an electrocardiogram (ECG) signal. The ECG signal may come from a physical examination result. The electrical signals from different parts of the body surface are detected by electrodes, and the collected signals are processed by analog circuits such as impedance matching, filtering, and amplification. The analog signal of the human physiological parameter is then converted into a digital signal by an analog-to-digital converter and stored in a memory. Exemplarily, the ECG signal may be a single-lead ECG signal or a multi-lead ECG signal. A single-lead ECG signal is an ECG signal obtained by collecting electrical signals from one part of the body, and a multi-lead ECG signal is an ECG signal obtained by collecting electrical signals from multiple parts of the body. The embodiment of the present invention does not limit the type of ECG signal.
[0065] The electrocardiogram signal is a low-amplitude, low-frequency, weak physiological electrical signal measured by electrodes on the body surface. Its amplitude is usually between 0.1mv-5mv, and its energy is concentrated in the range of 0.5Hz-40Hz. It is very susceptible to environmental influences. The electrocardiogram signal directly collected and recorded by the electrocardiograph through the electrodes is often interfered by various noises. Common interferences include myoelectric interference, baseline drift, and power frequency interference. If these original signals are used directly for electrocardiogram classification, the accuracy of classification will be reduced due to the presence of noise. Therefore, before processing the electrocardiogram signal, it is generally necessary to filter the original signal first. In an embodiment of the present invention, the electrocardiogram signal is filtered to obtain a first signal. Specifically, the electrocardiogram signal is filtered by a bandpass filter with a cutoff frequency of 0.5Hz, 30Hz, and 40 orders to remove the interference of low-frequency noise and power frequency noise to obtain a first signal.
[0066] The first signal is resampled to obtain a second signal with a preset sampling frequency (eg, 250 Hz).
[0067] The second signal is cut into a plurality of third signals of a preset length (e.g., 10s). Specifically, each heartbeat includes a preR segment (from a given heartbeat to the midpoint of a given heartbeat and the previous heartbeat) and a proR segment (from a given heartbeat to the midpoint of a given heartbeat and the subsequent heartbeat). The length of the preR segment and the proR segment is set to 0.1s. If the length of the intercepted segment exceeds the preset length, truncation is performed. If the length of the intercepted segment is shorter than the preset length, zero padding is performed.
[0068] The third signal is normalized to obtain a heartbeat signal. Specifically, z-score normalization is used to process each 10-second segment into a heartbeat signal with "zero mean and one variance". The specific formula of z-score is as follows:
[0069]
[0070] Among them, μ is the mean and σ is the standard deviation.
[0071] S202: Determine an ECG signal parameterized model, where model parameters of the ECG parameterized model include relative position information of a plurality of key points used to reconstruct the ECG signal.
[0072] Specifically, the ECG signal parameterization model is used to parameterize the ECG signal to obtain parameters for characterizing different dimensions of the ECG signal. The model parameters of the ECG parameterization model include relative position information of multiple key points for reconstructing the ECG signal, and the relative position information of the key points can be optimized by training the ECG parameterization model with a large number of ECG signal samples. Specifically, in a specific embodiment of the present invention, 5 key points are set for each characteristic wave signal, and two adjacent key points have the same spacing on the horizontal axis. The relative position information of multiple key points can be determined by the position of each key point on the vertical axis.
[0073] S203, performing spline interpolation on multiple key points to generate a standardized characteristic wave signal template.
[0074] Specifically, a spline interpolation calculation is performed on multiple key points corresponding to each characteristic wave signal to obtain a standardized characteristic wave signal template with an amplitude of 1, a mean of 0, and a preset width. The so-called interpolation is to interpolate a continuous function based on discrete data so that this continuous curve passes through all discrete points (i.e., multiple key points), and the approximate value of the function at other points can also be estimated. Spline interpolation is to determine a function between every two points (i.e., key points). This function is a spline. Different functions have different splines. The width mentioned here is the duration of the characteristic wave signal. The preset width is set according to clinical prior knowledge in the field of electrocardiographic analysis. For example, the width of a normal P wave is less than 0.1s, and the width of a normal QRS complex is 0.06s-0.12s.
[0075] Specifically, taking the P wave in the electrocardiogram signal as an example, the generation of a standardized characteristic wave signal template is described. The above step S203 may include the following sub-steps:
[0076] S2031. Perform cubic spline interpolation on multiple key points to generate a first spline wave signal with an amplitude of 1 and a mean of 0.
[0077] Figure 2BA schematic diagram of generating a standardized characteristic wave signal template provided by an embodiment of the present invention is illustratively shown as follows: Figure 2B As shown, cubic spline interpolation is performed on 5 key points to generate a first spline wave signal with an amplitude of 1 and a mean of 0. Among them, a cubic function curve is generated between two adjacent key points, and at the key point, the two adjacent cubic function curves are second-order continuous, that is, the two adjacent cubic function curves transition smoothly.
[0078] S2032. Scale the first sample wave signal to a preset width to obtain a standardized characteristic wave signal template.
[0079] Specifically, the width mentioned here is the duration of the characteristic wave signal. By scaling the first sample wave signal to a preset width, a standardized characteristic wave signal template is obtained. It should be noted that the scaling described here is to scale the first sample wave signal along the time axis direction, while it remains unchanged in the direction perpendicular to the time axis.
[0080] S204: Calculate the matching degree between the characteristic wave signal template and the characteristic wave signal.
[0081] Specifically, the matching degree is used to characterize the error between the characteristic wave signal template and the characteristic wave signal or the similarity of the waveforms of the two. The greater the matching degree, the smaller the error or the greater the similarity.
[0082] Specifically, the above step S204 may include the following sub-steps:
[0083] S2041. Calculate the correlation coefficient between the characteristic wave signal template and the characteristic wave signal as a matching degree sequence.
[0084] The correlation coefficient is used to characterize the correlation degree between the characteristic wave signal template and the characteristic wave signal. Exemplarily, in one embodiment of the present invention, the Pearson correlation coefficient is used to characterize the correlation degree between the characteristic wave signal template and the characteristic wave signal.
[0085] Specifically, several points are selected from the characteristic wave signal, which may be the points inserted in the above interpolation process. The ordinate values of these points and the ordinate values of the points corresponding to the positions on the characteristic wave signal template are used as two variables X (x1, x2...x n )、Y(y1,y2…y n ), and then calculate the Pearson correlation coefficient of these two variables according to the following formula:
[0086]
[0087]
[0088] Among them, p X,Yis the Pearson correlation coefficient of X and Y, cov(X,Y) is the covariance of X and Y, δ X is the standard deviation of X, δ Y is the standard deviation of Y, x u is the mean of X, y u is the mean of Y.
[0089] Through the above calculations, the Pearson correlation coefficient sequence between the two variables X and Y is obtained. The Pearson correlation coefficient sequence includes multiple Pearson correlation coefficients. The Pearson correlation coefficient is a value between -1 and 1. When the linear relationship between the two variables is enhanced, the correlation coefficient tends to 1 or -1. For example, when one variable increases and the other variable also increases, it indicates that they are positively correlated, and the correlation coefficient is greater than 0; if one variable increases and the other variable decreases, it indicates that they are negatively correlated, and the correlation coefficient is less than 0; if the correlation coefficient is equal to 0, it indicates that there is no linear correlation between them. The Pearson correlation coefficient sequence is used as the matching degree sequence between the characteristic wave signal template and the characteristic wave signal. Each Pearson correlation coefficient is x i and i degree of matching.
[0090] It should be noted that the above-mentioned calculation of the Pearson correlation coefficient between the characteristic wave signal template and the characteristic wave signal as the matching degree sequence is an exemplary explanation of the present invention rather than a limitation. In other embodiments of the present invention, the Cosine similarity, the square of the Euclidean distance, etc. between the characteristic wave signal template and the characteristic wave signal can also be calculated as the matching degree sequence, and the embodiments of the present invention will not be repeated here.
[0091] S2042: Determine the maximum value in the matching degree sequence.
[0092] Specifically, the maximum value is selected from each matching degree in the matching degree sequence. Exemplarily, in one embodiment of the present invention, the local maximum value in the matching degree sequence is determined based on a sliding window algorithm, and non-maximum value suppression is performed on the matching degree sequence in the sliding window.
[0093] Figure 2C A schematic diagram of determining a maximum value in a matching degree sequence provided by an embodiment of the present invention is exemplarily shown as follows: Figure 2C As shown, the matching degree sequence obtained in the above steps is 0.5, 0.7, 0.9, 0.7, 0.2, 0.1, 0.1, 0.7, 0.4, 0.2. It should be noted that the matching degree sequence is an exemplary description, and in other embodiments of the present invention, the matching degree sequence may include more matching degree values.
[0094] A sliding window is used to slide over the matching degree sequence, and the width of the sliding window is at least greater than the width of the two matching degrees. Exemplarily, in an embodiment of the present invention, the width of the sliding window is equal to the preset width in the standardized characteristic wave signal template. When the sliding window slides over a certain area on the matching degree sequence, the local maximum value in the area is obtained, and non-maximum suppression is performed at the same time to reduce the non-maximum value in the sliding window (such as to 0.1). For example, when the sliding window passes through the area where 0.7, 0.4, and 0.2 are located, the local maximum value of the area is determined to be 0.7, and the non-maximum value of the area is modified to 0.1. By analogy, the local maximum value sequence obtained after sliding over the matching degree sequence is 0.1, 0.1, 0.9, 0.1, 0.1, 0.1, 0.1, 0.7, 0.1, 0.1, and 0.9 and 0.7 in the sequence are the local maximum values found.
[0095] Non-maximum suppression can improve the efficiency of the subsequent process of determining the position information of the characteristic wave signal and the accuracy of the position information of the characteristic wave signal.
[0096] S2043. Use the maximum value as the matching degree between the characteristic wave signal template and the characteristic wave signal.
[0097] Specifically, a maximum value (0.9) is determined from the multiple local maximum values obtained in the above steps, and the maximum value is used as the matching degree between the characteristic wave signal template and the characteristic wave signal. The matching degree between the characteristic wave signal template and the characteristic wave signal is a parameter in the parameterized vector.
[0098] S205. Determine the position information of the characteristic wave signal on the time axis.
[0099] Specifically, the position information of the characteristic wave signal on the time axis may be the position information of a certain point on the characteristic wave signal on the time axis, and the position information of the characteristic wave signal on the time axis can be determined based on the position information of the point.
[0100] Specifically, in one embodiment of the present invention, in the aforementioned steps, the sliding window will record the position of the local maximum during the sliding process, and the position of the largest local maximum (ie, 0.9) is used as the position information of the characteristic wave signal.
[0101] S206: Calculate the amplitude of the characteristic wave signal and the offset of the characteristic wave signal relative to the time axis.
[0102] Specifically, the amplitude of the characteristic wave signal refers to the difference between the highest point and the lowest point of the characteristic wave signal, that is, the difference between the maximum voltage value and the minimum voltage value on the characteristic wave signal. The offset of the characteristic wave signal relative to the time axis refers to the vertical coordinate of the position where the mean value of the characteristic wave signal is located.
[0103] The embodiment of the present invention calculates the amplitude of the characteristic wave signal and the offset of the characteristic wave signal relative to the time axis based on the least square method. Specifically, the fitting function of the characteristic wave signal is assumed to be f(x)=ax+b, and several points on the characteristic wave signal are taken, and the horizontal coordinate values of these points are x i , take the points at the corresponding positions of the original signal, the ordinate values of these points are y i , the corresponding fitting function value is f(x i ), the least squares method is used to calculate the sum of the squares of the differences between the two. The specific formula is as follows:
[0104]
[0105] By iteratively calculating the parameters of the fitting function f(x) when the above formula reaches the minimum value, the amplitude a of the characteristic wave signal and the offset b of the characteristic wave signal relative to the time axis are obtained.
[0106] S207 . Determine a parameter vector sequence of the electrocardiogram signal based on key points, matching degree, amplitude, offset, preset width, and position information of the characteristic wave signal.
[0107] Specifically, the relative position information, matching degree, amplitude, bias, preset width of the characteristic wave signal and position information of the key points corresponding to the characteristic wave signal obtained in the above steps are sorted into parameter vectors. Among them, the relative position information of the key points is the ordinate of each key point (because the spacing between two adjacent key points on the horizontal axis is equal). Then, the parameter vectors are arranged in the order of the position information of the characteristic wave signal to obtain the parameter vector sequence of the ECG signal. Exemplarily, the structure of the parameter vector sequence is shown in the following table:
[0108] Parameter vector 1 Parameter vector 2 … Parameter vector N Matching Degree 1 Matching Degree 2 … Matching degree N Location information 1 Location information 2 … Location InformationN Default width 1 Default Width 2 … Default width N Amplitude 1 Amplitude 2 … Amplitude N Bias 1 Bias 2 … Bias N Key Point 11 Key Point 21 … Key Point N1 Key Point 12 Key Point 22 … Key point N2 … … … … Key Point 1n Key Point 2n … Key Points Nn
[0109] Specifically, the first parameter vector 1 is used to characterize the first characteristic wave signal in the electrocardiogram signal, and so on, the Nth parameter vector N is used to characterize the Nth characteristic wave signal in the electrocardiogram signal.
[0110] The ECG signal parameterization method provided by the embodiment of the present invention parameterizes the characteristic wave signal in the ECG signal into parameters of different dimensions including the relative position information of multiple key points, so that these parameter areas can be directly used to analyze the ECG signal, and the clinical interpretability is good. When the ECG signal needs to be reconstructed in the future, it is only necessary to determine the waveform of the characteristic wave signal according to the key points, and adjust each characteristic wave signal according to these parameters to obtain the reconstructed signal. Since there is no need to store the original ECG, only the parameter vector sequence needs to be stored, so the amount of stored data is greatly reduced and the storage cost is greatly reduced. The standardized characteristic wave signal template is generated by spline interpolation, and the amplitude of the characteristic wave signal and the offset of the characteristic wave signal relative to the time axis are calculated by the least squares method. Compared with the previous method of directly measuring on the characteristic waveform, its ability to resist outlier interference is greatly improved, and a more accurate parameter result can be obtained even on a noisy signal.
[0111] Embodiment 3
[0112] Figure 3 This is a flowchart of a method for training a parameterized model of an ECG signal provided in the third embodiment of the present invention. This embodiment can be used for training the parameterized model of an ECG provided in the above embodiments of the present invention to optimize the relative position information of key points in the model. This method can be performed by the ECG parameterized model training device provided in the embodiment of the present invention. The device can be implemented in software and / or hardware and is usually configured in a computer device. Figure 3 As shown, the method specifically comprises the following steps:
[0113] S301. Acquire an electrocardiogram signal sample, where the electrocardiogram signal sample includes a plurality of characteristic wave signal samples.
[0114] Specifically, the ECG signal samples are ECG signals used to train the ECG signal parameterization model. The ECG signal samples can be obtained from other corresponding physical examination results, or can be selected from an existing database, such as the ECEC electrocardiogram waveform database (CSE). Specifically, an ECG sample is obtained from the database, and starting from the first heartbeat signal in the ECG sample, a continuous preset number (at least one) of heartbeat signals are intercepted, and so on, the ECG is divided into multiple groups of ECG signal samples, and when the number of heartbeat signals in the last group of ECG signal samples is less than the preset number, zero filling is performed. Specifically, the processing of the ECG signal samples is similar to the processing of the ECG signal in the aforementioned embodiment, and the embodiments of the present invention will not be repeated here.
[0115] S302: Determine an ECG signal parameterized model, where model parameters of the ECG parameterized model include relative position information of a plurality of key points used to reconstruct ECG signal samples.
[0116] Specifically, the ECG signal parameterization model is used to parameterize the ECG signal to obtain parameters for characterizing different dimensions of the ECG signal. The model parameters of the ECG parameterization model include relative position information of multiple key points used to reconstruct the ECG signal. The relative position information of the key points can be optimized by training the ECG parameterization model with a large number of ECG signal samples. Specifically, in a specific embodiment of the present invention, 5 key points are set for each characteristic wave signal, and two adjacent key points have the same spacing on the horizontal axis. The relative position information of multiple key points can be determined by the position of each key point on the vertical axis. When the model is just established, the relative position information of the key points is randomly generated, that is, the value of the vertical coordinate of the key point is randomly generated.
[0117] Exemplarily, in this embodiment, the ECG parameterization model includes a template generation module, a matching degree calculation module, and an amplitude and offset calculation module. Specifically, the template generation module is used to perform spline interpolation calculation on key points to generate a characteristic wave signal template; the matching degree calculation module is used to calculate the matching degree between the characteristic wave signal template and the characteristic wave signal sample; the amplitude and offset calculation module is used to calculate the amplitude of the characteristic wave signal sample and the offset relative to the time axis.
[0118] S303: Input the ECG signal samples into the ECG signal parameterization model for processing to obtain a parameter vector sequence of the ECG signal samples.
[0119] Specifically, in the embodiment of the present invention, the ECG signal parameterization model is used to parameterize the ECG signal samples to obtain parameters of different dimensions for characterizing the ECG signal samples.
[0120] The parameter vector sequence includes a plurality of parameter vectors for characterizing characteristic wave signal samples, and the parameter vectors include relative position information of key points.
[0121] Specifically, the process of processing the ECG signal samples by the ECG signal parameterized model may refer to the process of processing the ECG signal by the ECG signal parameterized model in the aforementioned embodiment of the present invention, which will not be described in detail here.
[0122] S304: Reconstruct the ECG signal samples according to the parameter vector sequence to obtain reconstructed signal samples.
[0123] Specifically, each parameter vector in the parameter vector sequence is reconstructed to obtain a reconstructed characteristic wave signal sample, and the reconstructed characteristic wave signal samples are spliced in chronological order to obtain a reconstructed signal sample.
[0124] S305: Calculate the error between the ECG signal sample and the reconstructed signal sample.
[0125] Specifically, several points are selected from the ECG signal sample, and the mean square error between the ordinate values of these points and the ordinate values of the points corresponding to the positions on the reconstructed signal sample is calculated. For example, assuming that the ordinate value of the sampling point in the ECG signal sample is The ordinate value of the sampling point corresponding to the reconstructed signal sample is y i , then the mean square error between the ECG signal sample and the reconstructed signal sample is calculated as the error between the two, and the calculation formula is as follows:
[0126]
[0127] It should be noted that, in this embodiment, the mean square error of the ECG signal sample and the reconstructed signal sample is calculated as the error between the two. In other embodiments of the present invention, the root mean square error or the mean absolute error of the ECG signal sample and the reconstructed signal sample may also be calculated as the error between the two. The embodiments of the present invention are not limited here.
[0128] S306: Update the relative position information of the key points in the ECG parameterized model according to the error.
[0129] Specifically, the obtained error is compared with the preset error. When the calculated error is greater than the preset error, the relative position information of the key points in the ECG signal parameterization model is updated, and the process returns to execute S301 and obtain the ECG signal sample. This process is repeated until the calculated error is less than or equal to the preset error, and the ECG parameterization model training is determined to be completed.
[0130] When updating the relative position information of the key points, since the distance between two adjacent key points on the horizontal axis is the same and constant, only the vertical coordinate value of the key points needs to be updated.
[0131] Specifically, the vertical coordinate value of the key point is taken as the parameter to be optimized, the calculated error is used as the objective function, and then the gradient descent method is used to find the vertical coordinate value of the key point that makes the error less than or equal to the preset error.
[0132] The ECG parameterized model training method provided in the embodiment of the present invention includes: obtaining ECG signal samples, the ECG signal samples include multiple characteristic wave signal samples; determining the ECG signal parameterized model, the model parameters of the ECG parameterized model include the relative position information of multiple key points used to reconstruct the ECG signal samples; inputting the ECG signal samples into the ECG signal parameterized model for processing to obtain a parameter vector sequence of the ECG signal samples, the parameter vector sequence includes multiple parameter vectors for characterizing the characteristic wave signal samples, the parameter vector includes the relative position information of the key points; reconstructing the ECG signal samples according to the parameter vector sequence to obtain a reconstructed signal sample; calculating the error between the ECG signal sample and the reconstructed signal sample; and updating the relative position information of the key points in the ECG parameterized model according to the error. In the embodiment of the present invention, the ECG signal samples do not need to be labeled, and the unlabeled ECG signal samples are used for self-supervised training, saving the labeling cost.
[0133] Embodiment 4
[0134] Figure 4 This is a flowchart of a method for training a parameterized model of an ECG signal provided in Embodiment 4 of the present invention. This embodiment is a refinement of Embodiment 3 above, and describes in detail the specific process of reconstructing ECG signal samples according to a parameter vector sequence to obtain reconstructed signal samples, such as Figure 4 As shown, the method comprises the following steps:
[0135] S401. Acquire an electrocardiogram signal sample, where the electrocardiogram signal sample includes a plurality of characteristic wave signal samples.
[0136] Specifically, the process of acquiring the ECG signal samples has been described in detail in the aforementioned embodiments, and will not be described in detail in the embodiments of the present invention.
[0137] S402: Determine an ECG signal parameterized model, where model parameters of the ECG parameterized model include relative position information of a plurality of key points used to reconstruct ECG signal samples.
[0138] Specifically, the ECG signal parameterization model is used to parameterize the ECG signal to obtain parameters for characterizing different dimensions of the ECG signal. The model parameters of the ECG parameterization model include relative position information of multiple key points used to reconstruct the ECG signal, and the relative position information of the key points can be optimized by training the ECG parameterization model with a large number of ECG signal samples.
[0139] Exemplarily, in this embodiment, the ECG parameterization model includes a template generation module, a matching degree calculation module, and an amplitude and offset calculation module. Specifically, the template generation module is used to perform spline interpolation calculation on key points to generate a characteristic wave signal template; the matching degree calculation module is used to calculate the matching degree between the characteristic wave signal template and the characteristic wave signal sample; the amplitude and offset calculation module is used to calculate the amplitude of the characteristic wave signal sample and the offset relative to the time axis.
[0140] S403: Input the ECG signal samples into the ECG signal parameterization model for processing to obtain a parameter vector sequence of the ECG signal samples.
[0141] The parameter vector sequence includes a plurality of parameter vectors for characterizing characteristic wave signal samples, and the parameter vectors include relative position information of key points.
[0142] Specifically, the process of processing the ECG signal samples by the ECG signal parameterized model may refer to the process of processing the ECG signal by the ECG signal parameterized model in the aforementioned embodiment of the present invention, which will not be described in detail here.
[0143] The parameter vector includes: relative position information of key points, matching degree, amplitude, offset, preset width and position information of characteristic wave signal samples.
[0144] S404, performing spline interpolation on multiple key points in each parameter vector to generate a standardized characteristic wave signal template.
[0145] Specifically, a spline interpolation calculation is performed on a plurality of key points in each parameter vector to obtain a standardized characteristic wave signal template with an amplitude of 1, a mean of 0, and a preset width.
[0146] Exemplarily, in a specific embodiment of the present invention, cubic spline interpolation is performed on multiple key points in each parameter vector to generate a third spline wave signal with an amplitude of 1 and a mean of 0. A cubic function curve is generated between two adjacent key points, and at the key point, the two adjacent cubic function curves are second-order continuous, that is, the two adjacent cubic function curves transition smoothly.
[0147] Next, the third spline wave signal is scaled to a preset width to obtain a standardized characteristic wave signal template.
[0148] Specifically, the preset width is set according to clinical prior knowledge in the field of electrocardiogram analysis. By scaling the third spline wave signal to the preset width, a standardized characteristic wave signal template is obtained. It should be noted that the scaling described here is to scale the third spline wave signal along the time axis direction, while the direction perpendicular to the time axis remains unchanged.
[0149] S405. Adjust the amplitudes and positions of multiple characteristic wave signal templates according to the amplitude, offset and position information of the characteristic wave signal samples in the parameter vector to obtain reconstructed signal samples.
[0150] Specifically, the characteristic wave signal template is scaled proportionally according to the amplitude of the characteristic wave signal sample in the parameter vector to obtain the reconstructed characteristic wave signal sample. The position of the reconstructed characteristic wave signal sample on the time axis (horizontal axis) is determined according to the position information of the characteristic wave signal sample in the parameter vector, and the position of the reconstructed characteristic wave signal sample on the voltage axis (vertical axis) is determined according to the offset in the parameter vector to obtain the reconstructed characteristic wave signal sample.
[0151] Specifically, in the above step S405, when determining the position of each reconstructed characteristic wave signal sample on the time axis, it is determined whether two adjacent reconstructed characteristic wave signal samples overlap on the time axis. If so, the overlapping part of the reconstructed characteristic wave signal sample with a smaller matching degree among the two adjacent reconstructed characteristic wave signal samples is removed, and the overlapping part of the reconstructed characteristic wave signal sample with a higher matching degree is retained to obtain a reconstructed signal sample, thereby reducing the error between the reconstructed signal sample and the electrocardiogram signal.
[0152] In another embodiment of the present invention, when two adjacent reconstructed characteristic wave signal samples overlap on the time axis, the waveform signal of the overlapping portion can also be determined based on the weighted summation of the overlapping portion. Exemplarily, where the matching degree of the first characteristic wave signal sample is 0.9 and the matching degree of the second characteristic wave signal sample is 0.8, then the first weight corresponding to the first characteristic wave signal sample is 0.9 / (0.9+0.8), and the second weight corresponding to the second characteristic wave signal sample is 0.8 / (0.9+0.8). The ordinate of the overlapping portion of the first characteristic wave signal sample is multiplied by the first weight to obtain a first weighted signal, and the ordinate of the overlapping portion of the second characteristic wave signal sample is multiplied by the second weight to obtain a second weighted signal, and then the first weighted signal and the second weighted signal are added as the signal of the reconstructed signal sample in the overlapping portion.
[0153] In the subsequent application process, if the ECG signal needs to be reconstructed, the multiple key points in the parameter vector are also spline interpolated to produce a smooth spline wave signal, and the spline wave signal is adjusted to obtain a smooth reconstructed signal. Therefore, even if the original ECG signal has noise, a smooth reconstructed signal can be obtained after parameterization and reconstruction, which reduces the impact of noise on the analysis results and improves the accuracy of the analysis results.
[0154] S406: Calculate the error between the ECG signal sample and the reconstructed signal sample.
[0155] Specifically, several points are selected from the ECG signal sample, and the mean square error between the ordinate values of these points and the ordinate values of points corresponding to the positions on the reconstructed signal sample is calculated.
[0156] S407: Update the relative position information of key points in the ECG parameterized model according to the error.
[0157] Specifically, the obtained error is compared with the preset error. When the calculated error is greater than the preset error, the relative position information of the key points in the ECG signal parameterization model is updated, and the process returns to execute S401 and obtain the ECG signal sample. This process is repeated until the calculated error is less than or equal to the preset error, and it is determined that the ECG parameterization model training is completed.
[0158] When updating the relative position information of the key points, since the distance between two adjacent key points on the horizontal axis is the same and constant, only the vertical coordinate value of the key points needs to be updated.
[0159] Specifically, the vertical coordinate value of the key point is taken as the parameter to be optimized, the calculated error is used as the objective function, and then the gradient descent method is used to find the vertical coordinate value of the key point that makes the error less than or equal to the preset error.
[0160] The ECG parameter model training method provided by the embodiment of the present invention includes: obtaining an ECG signal sample, the ECG signal sample includes a plurality of characteristic wave signal samples; determining an ECG signal parameter model, the model parameters of the ECG parameter model include the relative position information of a plurality of key points for reconstructing the ECG signal sample; inputting the ECG signal sample into the ECG signal parameter model for processing, obtaining a parameter vector sequence of the ECG signal sample, the parameter vector sequence includes a plurality of parameter vectors for characterizing the characteristic wave signal sample, the parameter vector includes the relative position information of the key points; reconstructing the ECG signal sample according to the parameter vector sequence, obtaining a reconstructed signal sample; calculating the error between the ECG signal sample and the reconstructed signal sample; and updating the relative position information of the key points in the ECG parameter model according to the error. In the embodiment of the present invention, the ECG signal sample does not need to be labeled, and the unlabeled ECG signal sample is used for self-supervised training, saving the labeling cost. In addition, in the subsequent application process, even if the original ECG signal has noise, after parameterization and reconstruction, a smooth reconstructed signal can be obtained, reducing the influence of noise on the analysis result and improving the accuracy of the analysis result.
[0161] Embodiment 5
[0162] Figure 5 A schematic diagram of the structure of an electrocardiogram signal parameterization device provided in Embodiment 5 of the present invention is shown in FIG. Figure 5 As shown, the device comprises:
[0163] The ECG signal acquisition module 501 is used to acquire an ECG signal, wherein the ECG signal includes a plurality of characteristic wave signals;
[0164] A parameterized model determination module 502, used to determine a parameterized model of an ECG signal, wherein the model parameters of the parameterized model include relative position information of a plurality of key points used to reconstruct the ECG signal;
[0165] The parameterized processing module 503 is used to input the ECG signal into the ECG signal parameterized model for processing to obtain a parameter vector sequence of the ECG signal, wherein the parameter vector sequence includes a plurality of parameter vectors for characterizing the characteristic wave signal, and the parameter vector includes relative position information of the key points.
[0166] In some embodiments of the present invention, the parameterization processing module 503 includes:
[0167] A spline interpolation submodule, used for performing spline interpolation on a plurality of key points to generate a standardized characteristic wave signal template, wherein the characteristic wave signal template has a preset width;
[0168] A matching degree calculation submodule, used to calculate the matching degree between the characteristic wave signal template and the characteristic wave signal;
[0169] A position information determination submodule, used to determine the position information of the characteristic wave signal on the time axis;
[0170] An amplitude and offset calculation submodule, used to calculate the amplitude of the characteristic wave signal and the offset of the characteristic wave signal relative to the time axis;
[0171] The parameter vector sequence determination submodule is used to determine the parameter vector sequence of the electrocardiogram signal based on the key point, the matching degree, the amplitude, the offset, the preset width and the position information of the characteristic wave signal.
[0172] In some embodiments of the present invention, the spline interpolation submodule includes:
[0173] A first spline wave signal generating unit, used for performing cubic spline interpolation on multiple key points to generate a first spline wave signal with an amplitude of 1 and a mean of 0;
[0174] The first scaling unit is used to scale the first spline wave signal to a preset width to obtain a standardized characteristic wave signal template.
[0175] In some embodiments of the present invention, the matching degree calculation submodule includes:
[0176] A correlation coefficient calculation unit, used for calculating the correlation coefficient between the characteristic wave signal template and the characteristic wave signal as a matching degree sequence;
[0177] A maximum value determining unit, used to determine the maximum value in the matching degree sequence;
[0178] A matching degree determining unit is used to use the maximum value as the matching degree between the characteristic wave signal template and the characteristic wave signal.
[0179] In some embodiments of the present invention, the maximum value determining unit includes:
[0180] A maximum value determination subunit, used for determining a maximum value in the matching degree sequence based on a sliding window algorithm;
[0181] The non-maximum suppression subunit is used to perform non-maximum suppression on the matching degree sequence.
[0182] In some embodiments of the present invention, the location information determination submodule includes:
[0183] The position information determining unit is used to determine the position of the maximum value as the position information of the characteristic wave signal.
[0184] In some embodiments of the present invention, the amplitude and offset calculation submodule includes:
[0185] The least squares unit is used to calculate the amplitude of the characteristic wave signal and the offset of the characteristic wave signal relative to the time axis based on the least squares method.
[0186] The above-mentioned device can execute the methods provided in the above-mentioned embodiments 1 and 2 of the present invention, and has functional modules and beneficial effects corresponding to the execution methods.
[0187] Embodiment 6
[0188] Figure 6 A structural diagram of an electrocardiogram signal parameterized model training device provided by an embodiment of the present invention is shown in FIG. Figure 6 As shown, the device comprises:
[0189] The sample acquisition module 601 is used to acquire an ECG signal sample, wherein the ECG signal sample includes a plurality of characteristic wave signal samples;
[0190] A parameterized model determination module 602 is used to determine an ECG signal parameterized model, wherein the model parameters of the ECG parameterized model include relative position information of a plurality of key points used to reconstruct the ECG signal sample;
[0191] The parameterization processing module 603 is used to input the ECG signal sample into the ECG signal parameterization model for processing to obtain a parameter vector sequence of the ECG signal sample, wherein the parameter vector sequence includes a plurality of parameter vectors for characterizing the characteristic wave signal sample, and the parameter vector includes relative position information of the key point;
[0192] A reconstruction module 604, configured to reconstruct the ECG signal sample according to the parameter vector sequence to obtain a reconstructed signal sample;
[0193] An error calculation module 605 is used to calculate the error between the ECG signal sample and the reconstructed signal sample;
[0194] The key point updating module 606 is used to update the relative position information of the key points in the ECG parameterized model according to the error.
[0195] In some embodiments of the present invention, the parameter vector includes the matching degree between the characteristic wave signal sample and the characteristic wave signal sample template, the amplitude of the characteristic wave signal sample, the offset of the characteristic wave signal sample relative to the time axis, the preset width of the characteristic wave signal sample and the position information of the characteristic wave signal sample, and the reconstruction module 604 includes:
[0196] A spline interpolation submodule, used for performing spline interpolation on a plurality of key points in each parameter vector to generate a standardized characteristic wave signal template, wherein the characteristic wave signal template has a preset width;
[0197] The adjustment submodule is used to adjust the amplitude and position of multiple characteristic wave signal templates according to the amplitude, offset and position information of the characteristic wave signal samples in the parameter vector to obtain reconstructed reconstructed signal samples.
[0198] In some embodiments of the present invention, the spline interpolation submodule includes:
[0199] A spline interpolation unit is used to perform cubic spline interpolation on multiple key points to generate a third spline wave signal with an amplitude of 1 and a mean of 0;
[0200] The second scaling unit is used to scale the third spline wave signal to a preset width to obtain a standardized characteristic wave signal template.
[0201] In some embodiments of the present invention, the adjustment submodule includes:
[0202] An amplitude adjustment unit, used for adjusting the amplitude of the characteristic wave signal template according to the amplitude in the parameter vector to obtain a reconstructed characteristic wave signal sample;
[0203] The position adjustment unit is used to determine the position of the reconstructed characteristic wave signal sample on the time axis according to the position information and offset of the characteristic wave signal sample in the parameter vector to obtain the reconstructed characteristic wave signal sample.
[0204] In some embodiments of the present invention, the position adjustment unit includes:
[0205] A judging subunit, used for judging whether two adjacent reconstructed characteristic wave signal samples overlap on the time axis;
[0206] The signal removal subunit is used to remove the overlapping part of the reconstructed characteristic wave signal samples with a smaller matching degree between the two adjacent reconstructed characteristic wave signal samples when it is determined that the two adjacent reconstructed characteristic wave signal samples overlap on the time axis.
[0207] The above-mentioned device can execute the methods provided in the above-mentioned embodiments three and four of the present invention, and has the corresponding functional modules and beneficial effects of the execution methods.
[0208] Embodiment 7
[0209] Embodiment 7 of the present invention provides a computer device, Figure 7 A schematic diagram of the structure of a computer device provided in Embodiment 7 of the present invention is shown in FIG. Figure 7 As shown, the computer device includes a processor 701, a memory 702, a communication module 703, an input device 704 and an output device 705; the number of processors 701 in the computer device can be one or more. Figure 7 A processor 701 is taken as an example; the processor 701, the memory 702, the communication module 703, the input device 704 and the output device 705 in the computer device can be connected by a bus or other means. Figure 7 The above processor 701, memory 702, communication module 703, input device 704 and output device 705 can be integrated on a control mainboard of a computer device.
[0210] The memory 702 is a computer-readable storage medium that can be used to store software programs, computer executable programs and modules, such as the modules corresponding to the ECG signal parameterization method or the ECG signal parameterization model training method in this embodiment. The processor 701 executes various functional applications and data processing of the computer device by running the software programs, instructions and modules stored in the memory 702, that is, the ECG signal parameterization method or ECG signal parameterization model training method provided in the above embodiment is implemented.
[0211] The memory 702 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 702 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 702 may further include a memory remotely arranged relative to the processor 701, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0212] The communication module 703 is used to establish a connection with an external device (such as a smart terminal) and realize data interaction with the external device. The input device 704 can be used to receive input digital or character information and generate key signal input related to user settings and function control of the computer device.
[0213] The present embodiment provides a computer device that can execute the ECG signal parameterization method or ECG signal parameterization model training method provided in any of the above embodiments of the present invention, and has specific corresponding functions and beneficial effects.
[0214] Embodiment 8
[0215] Embodiment 8 of the present invention provides a storage medium containing computer executable instructions, on which a computer program is stored. When the program is executed by a processor, the electrocardiogram signal parameterization method or electrocardiogram signal parameterization model training method provided in any of the above embodiments of the present invention is implemented.
[0216] ECG signal parameterization methods include:
[0217] Acquiring an electrocardiogram signal, wherein the electrocardiogram signal includes a plurality of characteristic wave signals;
[0218] Determining an ECG signal parameterized model, wherein model parameters of the ECG parameterized model include relative position information of a plurality of key points used to reconstruct the ECG signal;
[0219] The ECG signal is input into the ECG signal parameterization model for processing to obtain a parameter vector sequence of the ECG signal, wherein the parameter vector sequence includes a plurality of parameter vectors for characterizing the characteristic wave signal, and the parameter vector includes relative position information of the key point.
[0220] The ECG signal parameterized model training method includes:
[0221] Acquire an electrocardiogram signal sample, wherein the electrocardiogram signal sample includes a plurality of characteristic wave signal samples;
[0222] Determining an ECG signal parameterized model, wherein model parameters of the ECG parameterized model include relative position information of a plurality of key points used to reconstruct the ECG signal sample;
[0223] Inputting the ECG signal sample into the ECG signal parameterization model for processing to obtain a parameter vector sequence of the ECG signal sample, wherein the parameter vector sequence includes a plurality of parameter vectors for characterizing the characteristic wave signal sample, and the parameter vector includes relative position information of the key point;
[0224] Reconstruct the electrocardiogram signal sample according to the parameter vector sequence to obtain a reconstructed signal sample;
[0225] Calculating the error between the electrocardiogram signal sample and the reconstructed signal sample;
[0226] The relative position information of the key points in the ECG parameterized model is updated according to the error.
[0227] Of course, the storage medium containing computer executable instructions provided by the embodiment of the present invention is not limited to the method operations described above, and can also execute related operations in the ECG signal parameterization method or ECG signal parameterization model training method provided by the embodiment of the present invention.
[0228] It should be noted that, for the device, equipment and storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0229] Through the above description of the implementation methods, technicians in the relevant field can clearly understand that the present invention can be implemented with the help of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a robot, a personal computer, a server, or a network device, etc.) to execute the electrocardiogram signal parameterization method or the electrocardiogram signal parameterization model training method described in any embodiment of the present invention.
[0230] It is worth noting that in the above-mentioned device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0231] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution device. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0232] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0233] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for parameterizing an electrocardiogram signal, characterized in that: include: Acquiring an electrocardiogram signal, wherein the electrocardiogram signal includes a plurality of characteristic wave signals; Determine an ECG signal parameterization model, wherein the model parameters of the ECG signal parameterization model include relative position information of a plurality of key points used to reconstruct the ECG signal; the ECG signal parameterization model is used to parameterize the ECG signal to obtain parameters for characterizing different dimensions of the ECG signal, wherein each of the characteristic wave signals is provided with a plurality of key points, and two adjacent key points have the same spacing on the time axis; when establishing the ECG signal parameterization model, the relative position information of the plurality of key points is randomly generated; Inputting the ECG signal into the ECG signal parameterization model for processing to obtain a parameter vector sequence of the ECG signal, wherein the parameter vector sequence includes a plurality of parameter vectors for characterizing the characteristic wave signal, and the parameter vector includes relative position information of the key point; The step of inputting the electrocardiogram signal into the electrocardiogram signal parameterization model for processing to obtain a parameter vector sequence of the electrocardiogram signal includes: Performing spline interpolation on multiple key points to generate a standardized characteristic wave signal template, wherein the characteristic wave signal template has a preset width; Calculating the matching degree between the characteristic wave signal template and the characteristic wave signal; Determining the position information of the characteristic wave signal on the time axis; Calculating the amplitude of the characteristic wave signal and the offset of the characteristic wave signal relative to the time axis; A parameter vector sequence of the electrocardiogram signal is determined based on the key point, the matching degree, the amplitude, the offset, the preset width, and the position information of the characteristic wave signal.
2. The method for parameterizing an ECG signal according to claim 1, characterized in that: The step of performing spline interpolation on a plurality of key points to generate a standardized characteristic wave signal template includes: Perform cubic spline interpolation on multiple key points to generate a first spline wave signal with an amplitude of 1 and a mean of 0; The first spline wave signal is scaled to a preset width to obtain a standardized characteristic wave signal template.
3. The method for parameterizing an ECG signal according to claim 1, characterized in that: The calculating the matching degree between the characteristic wave signal template and the characteristic wave signal comprises: Calculating the correlation coefficient between the characteristic wave signal template and the characteristic wave signal as a matching degree sequence; Determining a maximum value in the matching degree sequence; The maximum value is used as the matching degree between the characteristic wave signal template and the characteristic wave signal.
4. The method for parameterizing an ECG signal according to claim 3, characterized in that: The determining of the maximum value in the matching degree sequence includes: Determine the maximum value in the matching degree sequence based on a sliding window algorithm; Non-maximum suppression is performed on the matching degree sequence.
5. The method for parameterizing an ECG signal according to claim 3, characterized in that: The determining of the position information of the characteristic wave signal on the time axis includes: The position of the maximum value is determined as the position information of the characteristic wave signal.
6. The method for parameterizing an ECG signal according to claim 1, characterized in that: The calculating the amplitude of the characteristic wave signal and the offset of the characteristic wave signal relative to the time axis comprises: The amplitude of the characteristic wave signal and the offset of the characteristic wave signal relative to the time axis are calculated based on the least square method.
7. A method for training a parameterized model of an electrocardiogram signal, characterized in that: include: Acquire an electrocardiogram signal sample, wherein the electrocardiogram signal sample includes a plurality of characteristic wave signal samples; Determine an ECG signal parameterization model, wherein the model parameters of the ECG signal parameterization model include relative position information of a plurality of key points used to reconstruct the ECG signal sample; the ECG signal parameterization model is used to parameterize the ECG signal sample to obtain parameters for characterizing different dimensions of the ECG signal sample, wherein each of the characteristic wave signal samples is provided with a plurality of key points, and two adjacent key points have the same spacing on the time axis; when establishing the ECG signal parameterization model, the relative position information of the plurality of key points is randomly generated; Inputting the ECG signal sample into the ECG signal parameterization model for processing to obtain a parameter vector sequence of the ECG signal sample, wherein the parameter vector sequence includes a plurality of parameter vectors for characterizing the characteristic wave signal sample, and the parameter vector includes relative position information of the key point; Reconstruct the electrocardiogram signal sample according to the parameter vector sequence to obtain a reconstructed signal sample; Calculating the error between the electrocardiogram signal sample and the reconstructed signal sample; Update the relative position information of the key points in the electrocardiogram signal parameterized model according to the error; The parameter vector also includes the matching degree between the characteristic wave signal sample and the characteristic wave signal template, the amplitude of the characteristic wave signal sample, the offset of the characteristic wave signal sample relative to the time axis, the preset width of the characteristic wave signal sample and the position information of the characteristic wave signal sample. The reconstructing the electrocardiogram signal sample according to the parameter vector sequence to obtain the reconstructed signal sample includes: Performing spline interpolation on a plurality of key points in each parameter vector to generate a standardized characteristic wave signal template, wherein the characteristic wave signal template has a preset width; The amplitudes and positions of the plurality of characteristic wave signal templates are adjusted according to the amplitude, offset and position information of the characteristic wave signal samples in the parameter vector to obtain reconstructed signal samples.
8. The method for training a parameterized model of an ECG signal according to claim 7, characterized in that: The step of performing spline interpolation on a plurality of key points in each parameter vector to generate a standardized characteristic wave signal template comprises: Perform cubic spline interpolation on multiple key points to generate a third spline wave signal with an amplitude of 1 and a mean of 0; The third spline wave signal is scaled to a preset width to obtain a standardized characteristic wave signal template.
9. The method for training a parameterized model of an ECG signal according to claim 7, characterized in that: The step of adjusting the amplitudes and positions of the plurality of characteristic wave signal templates according to the amplitude, bias and position information of the characteristic wave signal samples in the parameter vector to obtain reconstructed signal samples comprises: Adjusting the amplitude of the characteristic wave signal template according to the amplitude in the parameter vector to obtain a reconstructed characteristic wave signal sample; The position of the reconstructed characteristic wave signal sample on the time axis is determined according to the position information and offset of the characteristic wave signal sample in the parameter vector to obtain the reconstructed signal sample.
10. The method for training a parameterized model of an ECG signal according to claim 9, characterized in that: The step of determining the position of the reconstructed characteristic wave signal sample on the time axis according to the position information and the offset of the characteristic wave signal sample in the parameter vector to obtain the reconstructed signal sample comprises: Determine whether two adjacent reconstructed characteristic wave signal samples overlap on the time axis; If so, the overlapping parts of the reconstructed characteristic wave signal samples with a smaller matching degree in two adjacent reconstructed characteristic wave signal samples are removed.
11. An electrocardiogram signal parameterization device, characterized in that: include: An ECG signal acquisition module, used to acquire an ECG signal, wherein the ECG signal includes a plurality of characteristic wave signals; A parameterized model determination module, used for determining an ECG signal parameterized model, wherein the model parameters of the ECG signal parameterized model include relative position information of a plurality of key points used to reconstruct the ECG signal; the ECG signal parameterized model is used for parameterizing the ECG signal to obtain parameters for characterizing different dimensions of the ECG signal, wherein each of the characteristic wave signals is provided with a plurality of key points, and two adjacent key points have the same spacing on the time axis; when establishing the ECG signal parameterized model, the relative position information of the plurality of key points is randomly generated; A parameterized processing module, used for inputting the ECG signal into the ECG signal parameterized model for processing to obtain a parameter vector sequence of the ECG signal, wherein the parameter vector sequence includes a plurality of parameter vectors for characterizing the characteristic wave signal, and the parameter vector includes relative position information of the key point; The parameterization processing module includes: A spline interpolation submodule, used for performing spline interpolation on a plurality of key points to generate a standardized characteristic wave signal template, wherein the characteristic wave signal template has a preset width; A matching degree calculation submodule, used to calculate the matching degree between the characteristic wave signal template and the characteristic wave signal; A position information determination submodule, used to determine the position information of the characteristic wave signal on the time axis; An amplitude and offset calculation submodule, used to calculate the amplitude of the characteristic wave signal and the offset of the characteristic wave signal relative to the time axis; The parameter vector sequence determination submodule is used to determine the parameter vector sequence of the electrocardiogram signal based on the key point, the matching degree, the amplitude, the offset, the preset width and the position information of the characteristic wave signal.
12. A device for training a parameterized model of an electrocardiogram signal, characterized in that: include: A sample acquisition module, used to acquire an ECG signal sample, wherein the ECG signal sample includes a plurality of characteristic wave signal samples; A parameterized model determination module, used for determining an ECG signal parameterized model, wherein the model parameters of the ECG signal parameterized model include relative position information of a plurality of key points used to reconstruct the ECG signal sample; the ECG signal parameterized model is used for parameterizing the ECG signal sample to obtain parameters of different dimensions used to characterize the ECG signal sample, wherein each of the characteristic wave signal samples is provided with a plurality of key points, and two adjacent key points have the same spacing on the time axis; when establishing the ECG signal parameterized model, the relative position information of the plurality of key points is randomly generated; A parameterized processing module, used for inputting the ECG signal sample into the ECG signal parameterized model for processing to obtain a parameter vector sequence of the ECG signal sample, wherein the parameter vector sequence includes a plurality of parameter vectors for characterizing the characteristic wave signal sample, and the parameter vector includes relative position information of the key point; A reconstruction module, used for reconstructing the electrocardiogram signal sample according to the parameter vector sequence to obtain a reconstructed signal sample; An error calculation module, used for calculating the error between the electrocardiogram signal sample and the reconstructed signal sample; A key point updating module, used for updating the relative position information of the key points in the ECG signal parameterized model according to the error; The parameter vector also includes the matching degree between the characteristic wave signal sample and the characteristic wave signal template, the amplitude of the characteristic wave signal sample, the offset of the characteristic wave signal sample relative to the time axis, the preset width of the characteristic wave signal sample and the position information of the characteristic wave signal sample. The reconstruction module includes: A spline interpolation submodule, used for performing spline interpolation on a plurality of key points in each parameter vector to generate a standardized characteristic wave signal template, wherein the characteristic wave signal template has a preset width; The adjustment submodule is used to adjust the amplitude and position of multiple characteristic wave signal templates according to the amplitude, offset and position information of the characteristic wave signal samples in the parameter vector to obtain reconstructed reconstructed signal samples.
13. A computer device, characterized in that: include: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the ECG signal parameterization method as described in any one of claims 1-6, or implement the ECG signal parameterization model training method as described in any one of claims 7-10.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, it implements the electrocardiogram signal parameterization method as described in any one of claims 1-6, or implements the electrocardiogram signal parameterization model training method as described in any one of claims 7-10.
Citation Information
Patent Citations
Systems and methods for keypoint detection
CA3032983A1
P wave information measuring method based on electrocardiogram 12 lead correlation computing
CN103549951A
Inclined-well dual laterolog curve correction method
CN105114063A
Human face recognition method and device for quickly processing human face shading
CN106570464A
Heartbeat type classification method and device, and electrocardiogram equipment
CN107358196A
