Method, device, equipment and storage medium for detecting characteristic waveform of electrocardiogram signal
Non-maximum suppression is performed through parallel processing, which solves the problem of low efficiency of traditional algorithms under large data volumes, improves the efficiency and accuracy of ECG signal characteristic wave detection, and takes advantage of the parallel processing capabilities of computer equipment.
Patent Information
- Application Number
- CN202110653939.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-11
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-06-11
AI Technical Summary
Due to the seriality of iterative calculations in the traditional non-maximum suppression algorithm in ECG signal characteristic wave detection, it takes a long time and is inefficient when the amount of data is large, and cannot fully utilize the parallel processing unit of computer equipment.
Parallel processing is used for non-maximum suppression. Through local maximum pooling and maximum filtering, the parallel processing unit of computer equipment is used to improve the efficiency of non-maximum suppression and the efficiency of characteristic wave detection.
Non-maximum suppression is performed through parallel processing, which significantly improves the efficiency of eigenwave detection, reduces eigenwave false detections, and makes full use of the parallel processing capabilities of computer equipment.
Smart Images

Figure CN115462800B_ABST
Abstract
Description
[0001] Technology Neighborhood
[0002] The embodiments of the present invention relate to the field of electrocardiography technology, and in particular to a method, device, equipment and storage medium for detecting characteristic waveforms of electrocardiogram signals. Background Art
[0003] As society ages, the incidence and harmfulness of cardiovascular diseases continue to rise. As an important means of examining cardiovascular status, electrocardiogram (ECG) is increasingly used.
[0004] In electrocardiogram analysis, characteristic wave detection (for example, QRS wave group detection) is a basic task of electrocardiogram analysis. By analyzing the characteristic waves, the type of cardiovascular disease and its probability can be determined.
[0005] In the process of characteristic wave detection, the processing flow includes non-maximum suppression (NMS). The role of non-maximum suppression is to suppress some detected maximum points based on the prior knowledge of the heartbeat refractory period, thereby reducing false heartbeat detection.
[0006] The traditional non-maximum suppression algorithm first sorts all the detected maximum points from high to low according to the confidence, and then iteratively deletes the points with low confidence in the window until the remaining maximum points are the maximum values in their respective windows. Since the iteration operation is a serial calculation operation, the operation of a node depends on the calculation result of the previous node, so it can only be calculated one by one. When the amount of data is large, the iteration calculation time is very long and the characteristic wave detection efficiency is very low. Summary of the invention
[0007] The present invention provides a method, device, equipment and storage medium for detecting characteristic waveforms of electrocardiogram signals, which perform non-maximum suppression by parallel processing, can fully utilize the parallel processing units of computer equipment, improve the efficiency of non-maximum suppression, and further improve the efficiency of characteristic wave detection.
[0008] In a first aspect, an embodiment of the present invention provides a method for detecting characteristic waves of an electrocardiogram signal, comprising:
[0009] Obtain ECG signals;
[0010] Calculating the confidence that each sampling point on the electrocardiogram signal is a characteristic point of a characteristic wave to obtain a confidence sequence;
[0011] Calculating the maximum value in the confidence sequence to obtain a plurality of first maximum values;
[0012] Select multiple sampling points in parallel, and for each of the sampling points, perform local maximum pooling on the confidence within a preset first neighborhood centered on the sampling point to obtain a pooling sequence;
[0013] Removing first maximum values different from corresponding pooling values in the pooling sequence from the plurality of first maximum values, to obtain a plurality of second maximum values;
[0014] Taking the sampling point corresponding to the second maximum value as the center, sampling points in a preset second neighborhood are selected as the characteristic wave.
[0015] In a second aspect, an embodiment of the present invention further provides an electrocardiogram signal characteristic wave detection device, comprising:
[0016] An ECG signal acquisition module, used for acquiring ECG signals;
[0017] A confidence calculation module, used to calculate the confidence that each sampling point on the electrocardiogram signal is a characteristic point of a characteristic wave, and obtain a confidence sequence;
[0018] A maximum value calculation module, used to calculate the maximum value in the confidence sequence to obtain multiple first maximum values;
[0019] A pooling module, used for selecting multiple sampling points in parallel, performing local maximum pooling on the confidence within a preset first neighborhood centered on each of the sampling points, and obtaining a pooling sequence;
[0020] A maximum value screening module, used to remove first maximum values different from corresponding pooling values in the pooling sequence from the plurality of first maximum values, to obtain a plurality of second maximum values;
[0021] The characteristic wave determination module is used to select sampling points in a preset second neighborhood with the sampling point corresponding to the second maximum value as the center as the characteristic wave.
[0022] In a third aspect, an embodiment of the present invention further provides a computer device, including:
[0023] one or more processors;
[0024] A storage device for storing one or more programs;
[0025] When the one or more programs are executed by the one or more processors, the one or more processors implement the electrocardiogram signal characteristic wave detection method provided in the first aspect of the present invention.
[0026] In a fourth 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 method for detecting characteristic waves of electrocardiogram signals as provided in the first aspect of the present invention.
[0027] The method for detecting characteristic waves of ECG signals provided by an embodiment of the present invention calculates the confidence that each sampling point on the acquired ECG signal is a characteristic point of a characteristic wave, and obtains a confidence sequence. The maximum value in the confidence sequence is calculated to obtain multiple first maximum values. Multiple sampling points are selected in parallel, and for each sampling point, local maximum pooling is performed on the confidence within a preset first neighborhood centered on the sampling point to obtain a pooling sequence. The first maximum values different from the corresponding pooling values in the pooling sequence are removed from the multiple first maximum values to obtain multiple second maximum values, thereby realizing non-maximum suppression and suppressing some of the detected first maximum points, thereby reducing false detection of characteristic waves. With the sampling point corresponding to the second maximum value as the center, the sampling points within the preset second neighborhood are selected as characteristic waves. Non-maximum suppression is performed by parallel processing, which can make full use of the parallel processing unit of the computer device, improve the efficiency of non-maximum suppression, and thus improve the efficiency of characteristic wave detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1A A flowchart of a method for detecting characteristic waves of an electrocardiogram signal provided in Embodiment 1 of the present invention;
[0029] Figure 1B A schematic diagram of a heartbeat signal provided by an embodiment of the present invention;
[0030] Figure 2A , 2B A schematic diagram of a flow chart of a method for detecting characteristic waves of an electrocardiogram signal provided in Embodiment 2 of the present invention;
[0031] Figure 2C A data processing flow chart for detecting characteristic waves of an electrocardiogram signal provided by an embodiment of the present invention;
[0032] Figure 2D A schematic diagram of the structure of a CenterNet model provided by an embodiment of the present invention;
[0033] Figure 3 A schematic diagram of the structure of an electrocardiogram signal characteristic wave detection device provided in Embodiment 3 of the present invention;
[0034] Figure 4 A schematic diagram of the structure of a computer device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0035] 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.
[0036] Embodiment 1
[0037] Figure 1A This is a flow chart of a method for detecting characteristic waves of an electrocardiogram signal provided in the first embodiment of the present invention. This embodiment is applicable to the case where a parallel processing method is used to realize non-maximum suppression in the process of detecting characteristic waves of an electrocardiogram signal. The method can be executed by the device for detecting characteristic waves of an electrocardiogram signal provided in the embodiment of the present invention. The device can be implemented by software and / or hardware, and is usually configured in a computer device, such as Figure 1A As shown, the method specifically comprises the following steps:
[0038] S101. Obtain an electrocardiogram signal.
[0039] Before and after the heart beats, the myocardium is excited. 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 signals 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 can be obtained.
[0040] An electrocardiogram is a graph of various potential changes in the body surface, which are caused by the successive excitement of the pacemaker, atrium, and ventricle during each cardiac cycle, accompanied by changes in bioelectricity. 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 is called a heartbeat signal. An electrocardiogram record usually contains more than 100,000 heartbeat signals, and the electrocardiogram record can be obtained from the user's physical examination results.
[0041] In order to facilitate subsequent data processing, it is usually necessary to resample the ECG record to obtain an ECG record with a sampling frequency of 250 Hz (that is, the number of sampling points collected per second is 250), and a continuous signal of a preset length (for example, 10s) is intercepted from the resampled ECG record as the ECG signal.
[0042] Figure 1B A schematic diagram of a heartbeat signal provided by an embodiment of the present invention, referring to Figure 1B It can be seen that a normal heartbeat signal includes P wave, QRS wave, T wave and U wave, which we call characteristic waves. Among them, the horizontal axis is the level baseline, which is measured in time, and the vertical axis is the strength of the ECG signal, which is characterized by voltage. In clinical practice, the level baseline is usually obtained by extending the straight segment (TS segment) between the T wave and the S wave in the ECG signal.
[0043] S102, calculating the confidence that each sampling point on the electrocardiogram signal is a characteristic point of the characteristic wave, and obtaining a confidence sequence.
[0044] The characteristic point of the characteristic wave is a representative node on the characteristic wave, for example, a point where a wave crest is located. The position of the characteristic wave is usually represented by the position of the characteristic point.
[0045] In an embodiment of the present invention, a template matching method, a nonlinear filtering method or other neural network-based methods can be used to calculate the confidence that each sampling point on the ECG signal is a characteristic point of a characteristic wave to obtain a confidence sequence, which is not limited in the embodiment of the present invention.
[0046] S103, calculating the maximum value in the confidence sequence to obtain multiple first maximum values.
[0047] Specifically, a maximum value is determined from the obtained confidence sequence to obtain a plurality of first maximum values. In the embodiment of the present invention, the method for calculating the maximum value in the confidence sequence is not limited.
[0048] S104 , selecting multiple sampling points in parallel, and for each sampling point, performing local maximum pooling on the confidence within a preset first neighborhood centered on the sampling point to obtain a pooling sequence.
[0049] After determining the maximum value in the confidence sequence, multiple sampling points are selected in parallel. For each sampling point, the confidence in the preset first neighborhood centered on the sampling point is locally maximum pooled to obtain a pooled sequence. The length of the first neighborhood (or pooling window) can be preset according to clinical prior knowledge. Exemplarily, in an embodiment of the present invention, the first neighborhood is 50 sampling points long. Specifically, for each sampling point, the maximum value of the built-in confidence of the first neighborhood centered on the sampling point is determined, and then the maximum value of the built-in confidence of the first neighborhood is used as the pooling value of the sampling point to achieve pooling of the confidence of the sampling point. Multiple sampling points are processed in parallel to improve the pooling efficiency, thereby improving the efficiency of characteristic wave detection.
[0050] S105. Remove first maximum values different from corresponding pooling values in the pooling sequence from the multiple first maximum values to obtain multiple second maximum values.
[0051] In an embodiment of the present invention, the first maximum value is the confidence corresponding to a certain sampling point, and the pooling sequence is a sequence of pooling values of the confidence of each sampling point. Therefore, the first maximum value corresponds to a pooling value in the pooling sequence. After obtaining multiple first maximum values and the pooling sequence, the first maximum value is compared with the pooling value corresponding to the sampling point of the first maximum value, and the first maximum value that is different from the corresponding pooling value in the pooling sequence is removed to obtain multiple second maximum values, thereby realizing non-maximum suppression and suppressing some detected first maximum points, thereby reducing false detection of characteristic waves.
[0052] S106 , taking the sampling point corresponding to the second maximum value as the center, selecting sampling points in a preset second neighborhood as characteristic waves.
[0053] Among the multiple first maxima, the first maxima different from the corresponding pooling values in the pooling sequence are removed to obtain multiple second maxima. After achieving non-maximum suppression, the sampling point corresponding to the second maximum is taken as the center, and the sampling point in the preset second neighborhood is selected as the characteristic wave. The length of the second neighborhood can be set based on clinical prior information, and different second neighborhood lengths can be set based on different characteristic waves to be detected. Exemplarily, taking the detection of QRS wave as an example, based on the width of the QRS wave clinically, the length of the second neighborhood is set to 0.3s, that is, the length of the second neighborhood is 75 sampling points. The sampling point corresponding to the second maximum is taken as the center, and the 75 sampling points in the neighborhood are used as QRS waves.
[0054] The method for detecting characteristic waves of ECG signals provided by an embodiment of the present invention calculates the confidence that each sampling point on the acquired ECG signal is a characteristic point of a characteristic wave, and obtains a confidence sequence. The maximum value in the confidence sequence is calculated to obtain multiple first maximum values. Multiple sampling points are selected in parallel, and for each sampling point, local maximum pooling is performed on the confidence within a preset first neighborhood centered on the sampling point to obtain a pooling sequence. The first maximum values different from the corresponding pooling values in the pooling sequence are removed from the multiple first maximum values to obtain multiple second maximum values, thereby realizing non-maximum suppression and suppressing some of the detected first maximum points, thereby reducing false detection of characteristic waves. With the sampling point corresponding to the second maximum value as the center, the sampling points within the preset second neighborhood are selected as characteristic waves. Non-maximum suppression is performed by parallel processing, which can make full use of the parallel processing unit of the computer device, improve the efficiency of non-maximum suppression, and thus improve the efficiency of characteristic wave detection.
[0055] Embodiment 2
[0056] Figure 2A , 2B A flowchart of a method for detecting characteristic waves of an electrocardiogram signal provided in Embodiment 2 of the present invention is shown in FIG. Figure 2C A data processing flow chart of an ECG signal characteristic wave detection provided by an embodiment of the present invention is provided. This embodiment is refined on the basis of the above embodiment 1, and describes in detail the detailed process of each step in the above embodiment, such as Figure 2A , 2B and Figure 2C As shown, the method comprises the following steps:
[0057] S201, obtaining an electrocardiogram signal.
[0058] ECG recording 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 ECG signals directly collected and recorded by the ECG machine through electrodes are often interfered by various noises. Common interferences include myoelectric interference, baseline drift, and power frequency interference. If these original signals are used directly for ECG classification, the accuracy of classification will be reduced due to the presence of noise. Therefore, before processing the ECG recording, it is generally necessary to filter the original signal first. In an embodiment of the present invention, the ECG recording is filtered to obtain a first signal. Specifically, the ECG signal is filtered by a bandpass filter with a cutoff frequency of 0.5Hz, 40Hz, and 40th order to remove the interference of low-frequency noise and power frequency noise to obtain a first signal.
[0059] After filtering the ECG record, the first signal is resampled to obtain a second signal with a preset sampling frequency (eg, 250 Hz) and the second signal is cut into multiple ECG signals with a preset length (eg, 10 s).
[0060] S202, inputting the ECG signal into the pre-trained CenterNet model for processing, and obtaining the confidence that each sampling point is a characteristic point of the characteristic wave.
[0061] Specifically, the CenterNet model includes a backbone network and a classification network (or classification head), and the backbone network includes a downsampling network and an upsampling network. The downsampling network is used to extract the downsampling features of the ECG signal, and the upsampling network is used to upsample the downsampling features to obtain upsampling features. The downsampling features and upsampling features are feature-fused to obtain fused features. The classification network is used to process the fused features and map the fused features to the confidence that each sampling point is a feature point of the feature wave. The downsampling features are high-dimensional features with richer semantic information, and the upsampling features are low-dimensional features with richer structural information. By fusing the downsampling features and upsampling features, both structural information and semantic information can be taken into account, thereby making the detection results more accurate.
[0062] Figure 2D A schematic diagram of the structure of a CenterNet model provided in an embodiment of the present invention is shown as an example. Figure 2DAs shown, in this embodiment, since the input is a one-dimensional data sequence, it is necessary to rewrite the number of channels of CenterNet and the dimension of the convolution kernel to 1 dimension. The CenterNet model includes an hourglass network (Hourglass Network) and a classification network, wherein the classification network can also be called a classification head (C-head). The hourglass network serves as the backbone network (backbone) of CenterNet. The hourglass network has a first output terminal and a second output terminal, which are respectively used to output the first output feature OUT1 and the second output feature OUT2. The classification network is connected to the second output terminal of the hourglass network, and is used to receive the second output feature OUT2 output from the second output terminal of the hourglass network.
[0063] The hourglass network downsamples the input by 4 times through two consecutive hourglass modules. Each hourglass module is a symmetrical 5-layer downsampling network and upsampling convolutional network, and there is a short connection between the downsampling network and the upsampling convolutional network to achieve the fusion of upsampling features and downsampling features.
[0064] Specifically, the hourglass network performs upsampling, downsampling and feature fusion processing on the input ECG signal, and outputs the fused feature OUT2. The fully connected layer in the classification network processes the fused feature OUT2 and maps the fused feature OUT2 to a logits vector with the same dimension as the number of sampling points of the ECG signal. The softmax function in the classification network normalizes the logits vector to obtain the confidence that each sampling point is a feature point of the characteristic wave, forming a confidence sequence H0(x).
[0065] S203: construct a first maximum value mask framework, wherein the first maximum value mask framework has elements corresponding one-to-one to the confidence sequences.
[0066] Specifically, a maximum value mask framework is constructed to mask the confidence sequence to obtain the first maximum value in the confidence sequence, which is called the first maximum value mask framework. The first maximum value mask framework has elements that correspond one to one with the confidence sequence, and the initial values of the elements in the first maximum value mask framework can be set arbitrarily, which is not limited in the embodiment of the present invention.
[0067] S204 , selecting the confidences of all sampling points in the confidence sequence in parallel as the target confidence, and comparing the target confidence with two confidences adjacent to the target confidence.
[0068] In the embodiment of the present invention, the confidences of all sampling points in the confidence sequence are selected in parallel as the target confidence, and the target confidence is compared with two confidences adjacent to the target confidence. Figure 2CAs shown, any confidence in the confidence sequence is compared with two adjacent confidences, and the comparison process is a parallel processing process for all confidences in the confidence sequence, which improves the calculation efficiency and is conducive to utilizing the parallel processing unit of the computer equipment.
[0069] S205 . If the target confidence is greater than the confidence of the previous sampling point and not less than the confidence of the next sampling point, the corresponding first target element in the first maximum mask frame is set to 1, otherwise it is set to 0, to obtain a first maximum mask sequence.
[0070] As mentioned above, the target confidence is compared with the two confidences adjacent to it, and the size relationship between the target confidence and the two confidences adjacent to it is determined. If the target confidence is greater than the confidence of the previous sampling point and not less than the confidence of the next sampling point, the corresponding first target element in the first maximum mask frame is set to 1, otherwise it is set to 0, and the first maximum mask sequence M1(x) is obtained.
[0071] S206: Multiply the first maximum value mask sequence by corresponding elements of the confidence sequence to obtain a first sequence, where the first sequence includes a plurality of first maximum values.
[0072] Specifically, the first maximum mask sequence is multiplied by the corresponding element of the confidence sequence (element wise multiplication) to obtain the first sequence H1(x). By multiplying the first maximum mask sequence by the corresponding element of the confidence sequence, in the first sequence, the non-maximum elements in the confidence sequence are set to 0, and the maximum elements are retained.
[0073] S207. Select all sampling points in parallel as target points.
[0074] Specifically, all sampling points are selected in parallel as target points for subsequent pooling processing, which improves computational efficiency, is conducive to utilizing parallel processing units of computer equipment, and improves characteristic wave detection efficiency.
[0075] S208: Determine the maximum value of the confidence within a preset first neighborhood centered on the target point.
[0076] With the target point as the center, a preset first neighborhood of the target point is selected, and the maximum confidence value in the first neighborhood is determined. The length of the first neighborhood (or pooling window) can be preset according to clinical prior knowledge. For example, in an embodiment of the present invention, the first neighborhood is 50 sampling points long.
[0077] S209: Taking the maximum value as the pooling value of the target point to obtain a pooling sequence.
[0078] The maximum value in the first neighborhood is used as the pooling value of the target point, and the confidence of the target point is pooled. The above pooling process is performed in parallel for all sampling points to obtain a pooling sequence H2(x). Exemplarily, for the sake of convenience, the first neighborhood is 5 sampling points in length (in a specific embodiment, the first neighborhood is 50 sampling points in length), and the pooling process of several sampling points is taken as an example to illustrate the local maximum pooling of the embodiment of the present invention. For the first sampling point, the confidences of the five sampling points in the first domain are 0, 0, 0.2, 0.6, and 0.9 respectively (if there is no element in the neighborhood, it is filled with 0), then the maximum value in the first neighborhood is 0.9, therefore, 0.9 is used as the pooling value of the confidence of the first sampling point. For the second sampling point, the confidences of the five sampling points in the first domain are 0, 0.2, 0.6, 0.9, and 0.6 respectively (if there is no element in the neighborhood, it is filled with 0), then the maximum value in the first neighborhood is 0.9, so 0.9 is used as the pooling value of the confidence of the second sampling point. For the third sampling point, the confidences of the five sampling points in the first domain are 0.2, 0.6, 0.9, 0.6, and 0.7 respectively, and the maximum value in the first neighborhood is 0.9, so 0.9 is used as the pooling value of the confidence of the third sampling point. And so on, the pooling sequence H2(x) is obtained. Since the above pooling process processes the confidences of all sampling points in parallel, the confidence pooling process of each sampling point does not depend on the pooling result of the previous sampling, therefore, the parallel processing unit of the computer equipment can be used to improve the calculation efficiency and the characteristic wave detection efficiency.
[0079] S210 , constructing a second maximum value mask framework, wherein the second maximum value mask framework has elements corresponding one-to-one to the pooling sequence.
[0080] Specifically, a maximum mask framework is constructed to mask the pooling sequence, suppress some of the detected first maximum points, and obtain the second maximum, which we call the second maximum mask framework. The second maximum mask framework has elements that correspond one to one with the pooling sequence, and the initial values of the elements in the second maximum mask framework can be set arbitrarily, which is not limited in the embodiment of the present invention.
[0081] S211. Select all first maximum values in the first sequence in parallel as first target values, and compare the first target values with corresponding pooling values in the pooling sequence.
[0082] The comparison process is a process of parallel processing of all first maxima, which can utilize the parallel processing units of computer equipment to improve the calculation efficiency and further improve the characteristic wave detection efficiency.
[0083] S212: If the first target value is the same as the corresponding pooling value in the pooling sequence, the corresponding second target element in the second maximum mask frame is set to 1, otherwise it is set to 0, to obtain a second maximum mask sequence.
[0084] The first target value is compared with the corresponding pooling value in the pooling sequence. If the first target value is the same as the corresponding pooling value in the pooling sequence, the corresponding second target element in the second maximum mask frame is set to 1, otherwise it is set to 0, and the second maximum mask sequence M2(x) is obtained.
[0085] For example, Figure 2C As shown, the maximum value corresponding to the third sampling point in the first sequence H1(x) is 0.9, and the pooling value corresponding to the third sampling point in the pooling sequence H2(x) is also 0.9, then the third element in the second maximum value mask frame is set to 1, the maximum value corresponding to the fifth sampling point in the first sequence H1(x) is 0.7, and the pooling value corresponding to the fifth sampling point in the pooling sequence H2(x) is 0.9, then the fifth element in the second maximum value mask frame is set to 0. And so on, the second maximum value mask sequence M2(x) is obtained. Since the above process is to process all the first maximum values in parallel, the parallel processing unit of the computer equipment can be used to improve the calculation efficiency and improve the characteristic wave detection efficiency.
[0086] S213: multiply the second maximum mask sequence by corresponding elements of the pooling sequence to obtain a second sequence, where the second sequence includes multiple second maximum values.
[0087] Specifically, the second maximum mask sequence is multiplied by the corresponding element of the pooling sequence (element wise multiplication) to obtain the second sequence H3(x). By multiplying the second maximum mask sequence by the corresponding element of the pooling sequence, the first maximum value in the first sequence that is different from the corresponding pooling value in the pooling sequence is set to 0, and non-maximum suppression is achieved, suppressing some of the detected first maximum points, thereby reducing false detection of characteristic waves.
[0088] S214. Select all second maximum values in parallel as second target values, and compare the second target value with a preset threshold value.
[0089] In the embodiment of the present invention, all second maximum values are selected in parallel as second target values, and each second target value is compared with a preset threshold value.
[0090] S215. If the second target value is greater than or equal to the threshold, the second target value is set to 1, otherwise it is set to 0.
[0091] Specifically, if the second target value is greater than or equal to the threshold, the second target value is set to 1, otherwise it is set to 0. For example, Figure 2CAs shown, all second maximum values in the second sequence H3(x) are compared with a threshold value (exemplarily, the threshold value is set to 0.7). If the second maximum value 0.6 is less than the threshold value 0.7, the second maximum value is set to 0, and the sequence M3(x) is obtained. By comparing the second maximum value with a preset threshold value, sampling points with a confidence level lower than the threshold value are filtered out, and only sampling points with high confidence levels are retained as characteristic points of the characteristic wave. Furthermore, some detected maximum value points are suppressed, thereby improving the detection accuracy.
[0092] S216. Taking the sampling point corresponding to the second maximum value as the center, select sampling points in a preset second neighborhood as characteristic waves.
[0093] Among the multiple first maxima, the first maxima different from the corresponding pooling values in the pooling sequence are removed to obtain multiple second maxima. After achieving non-maximum suppression, the sampling point corresponding to the second maximum is taken as the center, and the sampling point in the preset second neighborhood is selected as the characteristic wave. The length of the second neighborhood can be set based on clinical prior information, and different second neighborhood lengths can be set based on different characteristic waves to be detected. Exemplarily, taking the detection of QRS wave as an example, based on the width of the QRS wave clinically, the length of the second neighborhood is set to 0.3s, that is, the length of the second neighborhood is 75 sampling points. The sampling point corresponding to the second maximum is taken as the center, and the 75 sampling points in the neighborhood are used as QRS waves.
[0094] The ECG signal characteristic wave detection method provided in the embodiment of the present invention adopts a parallel processing method to calculate the first maximum mask and the second maximum mask sequence, adopts a parallel processing method to perform local maximum pooling on the confidence of each sampling point, and adopts a parallel processing method to perform non-maximum suppression on the first maximum. It can make full use of the parallel processing unit of the computer equipment, thereby improving the efficiency of characteristic wave detection.
[0095] Embodiment 3
[0096] Figure 3 A schematic diagram of the structure of an electrocardiogram signal characteristic wave detection device provided in Embodiment 3 of the present invention is shown in FIG. Figure 3 As shown, the device comprises:
[0097] The ECG signal acquisition module 301 is used to acquire the ECG signal;
[0098] The confidence calculation module 302 is used to calculate the confidence that each sampling point on the electrocardiogram signal is a characteristic point of a characteristic wave, and obtain a confidence sequence;
[0099] A maximum value calculation module 303 is used to calculate the maximum value in the confidence sequence to obtain multiple first maximum values;
[0100] A pooling module 304 is used to select multiple sampling points in parallel, perform local maximum pooling on the confidence within a preset first neighborhood centered on each of the sampling points, and obtain a pooling sequence;
[0101] A maximum value screening module 305 is used to remove first maximum values different from corresponding pooling values in the pooling sequence from the plurality of first maximum values to obtain a plurality of second maximum values;
[0102] The characteristic wave determination module 306 is used to select sampling points in a preset second neighborhood with the sampling point corresponding to the second maximum value as the center as the characteristic wave.
[0103] In some embodiments of the present invention, the confidence calculation module 302 is used to input the electrocardiogram signal into a pre-trained CenterNet model for processing, and obtain the confidence that each sampling point is a characteristic point of a characteristic wave.
[0104] In some embodiments of the present invention, the CenterNet model includes a downsampling network, an upsampling network and a classification network, and the confidence calculation module 302 includes:
[0105] A downsampling unit, used for extracting downsampling features of the electrocardiogram signal using the downsampling network;
[0106] An upsampling unit, configured to upsample the downsampled features using the upsampling network to obtain upsampled features;
[0107] A fusion unit, used for fusing the down-sampled features with the up-sampled features to obtain fused features;
[0108] A mapping unit is used to use the classification network to map the fused features into confidence levels that each sampling point is a feature point of a feature wave.
[0109] In some embodiments of the present invention, the maximum value calculation module 303 includes:
[0110] A first mask framework construction unit, used to construct a first maximum value mask framework, wherein the first maximum value mask framework has elements corresponding one-to-one to the confidence sequence;
[0111] A first comparison unit, configured to select in parallel the confidences of all sampling points in the confidence sequence as target confidences, and compare the target confidence with two confidences adjacent to the target confidence;
[0112] a first maximum mask sequence determining unit, configured to set the corresponding first target element in the first maximum mask frame to 1 when the target confidence is greater than the confidence of the previous sampling point and not less than the confidence of the next sampling point, and to 0 otherwise, to obtain a first maximum mask sequence;
[0113] The first sequence determination unit is used to multiply the first maximum value mask sequence with the corresponding elements of the confidence sequence to obtain a first sequence, where the first sequence includes multiple first maximum values.
[0114] In some embodiments of the present invention, the pooling module 304 includes:
[0115] A target point selection unit is used to select all sampling points as target points in parallel;
[0116] A maximum value determination unit, used to determine the maximum value of the confidence within a preset first neighborhood centered on the target point;
[0117] A pooling unit is used to use the maximum value as a pooling value of the target point to obtain a pooling sequence.
[0118] In some embodiments of the present invention, the maximum value screening module 305 includes:
[0119] A second mask frame construction unit, used to construct a second maximum value mask frame, wherein the second maximum value mask frame has elements corresponding one-to-one to the pooling sequence;
[0120] A second comparison unit, configured to select in parallel all first maximum values in the first sequence as first target values, and compare the first target values with corresponding pooling values in the pooling sequence;
[0121] a second maximum mask sequence determining unit, which sets the corresponding second target element in the second maximum mask frame to 1 when the first target value is the same as the corresponding pooling value in the pooling sequence, and sets it to 0 otherwise, to obtain a second maximum mask sequence;
[0122] The second sequence determination unit is used to multiply the second maximum mask sequence by the corresponding elements of the pooling sequence to obtain a second sequence, where the second sequence includes multiple second maximum values.
[0123] In some embodiments of the present invention, the electrocardiogram signal characteristic wave detection device further includes:
[0124] A comparison module, used for selecting all the second maximum values in parallel as second target values, and comparing the second target values with a preset threshold value;
[0125] The screening module is used to set the second target value to 1 when the second target value is greater than or equal to the threshold value, and to set the second target value to 0 otherwise.
[0126] The above-mentioned ECG signal characteristic wave detection device can execute the ECG signal characteristic wave detection method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0127] Embodiment 4
[0128] Embodiment 4 of the present invention provides a computer device, Figure 4 A schematic diagram of the structure of a computer device provided in Embodiment 4 of the present invention is shown in FIG. Figure 4 As shown, the computer device includes:
[0129] Processor 401, memory 402, communication module 403, input device 404 and output device 405; the number of processors 401 in the computer device can be one or more. Figure 4 A processor 401 is taken as an example; the processor 401, memory 402, communication module 403, input device 404 and output device 405 in the computer device can be connected by a bus or other means. Figure 4 The above processor 401, memory 402, communication module 403, input device 404 and output device 405 may be integrated in a computer device.
[0130] The memory 402 is a computer-readable storage medium that can be used to store software programs, computer executable programs and modules, such as the module corresponding to the ECG signal characteristic wave detection method in the above embodiment. The processor 401 executes various functional applications and data processing of the computer device by running the software programs, instructions and modules stored in the memory 402, that is, realizing the above ECG signal characteristic wave detection method.
[0131] The memory 402 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 microcomputer, etc. In addition, the memory 402 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 402 may further include a memory remotely arranged relative to the processor 401, 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.
[0132] The communication module 403 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 404 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.
[0133] The computer device provided in this embodiment can execute the electrocardiogram signal characteristic wave detection method provided in any of the above embodiments of the present invention, and has corresponding functions and beneficial effects.
[0134] Embodiment 5
[0135] Embodiment 5 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, a method for detecting characteristic waves of electrocardiogram signals provided in any of the above embodiments of the present invention is implemented. The method includes:
[0136] Obtain ECG signals;
[0137] Calculating the confidence that each sampling point on the electrocardiogram signal is a characteristic point of a characteristic wave to obtain a confidence sequence;
[0138] Calculating the maximum value in the confidence sequence to obtain a plurality of first maximum values;
[0139] Select multiple sampling points in parallel, and for each of the sampling points, perform local maximum pooling on the confidence within a preset first neighborhood centered on the sampling point to obtain a pooling sequence;
[0140] Removing first maximum values different from corresponding pooling values in the pooling sequence from the plurality of first maximum values, to obtain a plurality of second maximum values;
[0141] Taking the sampling point corresponding to the second maximum value as the center, sampling points in a preset second neighborhood are selected as the characteristic wave.
[0142] It should be noted that, for the device, computer 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.
[0143] 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 perform the electrocardiogram signal characteristic wave detection method described in any embodiment of the present invention.
[0144] It is worth noting that in the above-mentioned device, the various modules and units 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 modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0145] 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.
[0146] 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.
[0147] Note that the above are only preferred embodiments of the present invention and the technical principles used. It will be understood by those skilled in the art 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 detecting characteristic waves of electrocardiogram signals, It is characterized in that include: Obtain ECG signals; Calculating the confidence that each sampling point on the electrocardiogram signal is a characteristic point of a characteristic wave to obtain a confidence sequence; Calculating the maximum value in the confidence sequence to obtain multiple first maximum values; Select multiple sampling points in parallel, and for each of the sampling points, perform local maximum pooling on the confidence within a preset first neighborhood centered on the sampling point to obtain a pooling sequence; Removing first maximum values different from corresponding pooling values in the pooling sequence from the plurality of first maximum values, to obtain a plurality of second maximum values; Taking the sampling point corresponding to the second maximum value as the center, selecting sampling points in a preset second neighborhood as the characteristic wave; The step of selecting a plurality of sampling points in parallel and performing local maximum pooling on the confidence within a preset first neighborhood centered on the sampling point for each sampling point to obtain a pooling sequence includes: Select all sampling points as target points in parallel; Determine the maximum value of the confidence within a preset first neighborhood centered on the target point; The maximum value is used as the pooling value of the target point to obtain a pooling sequence.
2. The method for detecting characteristic waves of electrocardiographic signals according to claim 1, It is characterized in that Calculating the confidence that each sampling point on the electrocardiogram signal is a characteristic point of a characteristic wave to obtain a confidence sequence, including: The electrocardiogram signal is input into a pre-trained CenterNet model for processing to obtain the confidence that each sampling point is a characteristic point of a characteristic wave.
3. The method for detecting characteristic waves of electrocardiographic signals according to claim 2, It is characterized in that The CenterNet model includes a downsampling network, an upsampling network and a classification network. The ECG signal is input into the pre-trained CenterNet model for processing, including: Using the downsampling network to extract downsampling features of the electrocardiogram signal; Using the upsampling network to upsample the downsampled features to obtain upsampled features; Performing feature fusion on the down-sampled features and the up-sampled features to obtain fused features; The classification network is used to map the fused features into confidence levels that each sampling point is a feature point of a feature wave.
4. The method for detecting characteristic waves of electrocardiographic signals according to any one of claims 1 to 3, It is characterized in that Calculating the maximum value in the confidence sequence to obtain multiple first maximum values includes: Constructing a first maximum value mask framework, wherein the first maximum value mask framework has elements corresponding one-to-one to the confidence sequence; Selecting in parallel the confidences of all sampling points in the confidence sequence as target confidences, and comparing the target confidences with two confidences adjacent to the target confidences; If the target confidence is greater than the confidence of the previous sampling point and not less than the confidence of the next sampling point, the corresponding first target element in the first maximum mask frame is set to 1, otherwise it is set to 0, to obtain a first maximum mask sequence; The first maximum value mask sequence is multiplied by corresponding elements of the confidence sequence to obtain a first sequence, where the first sequence includes multiple first maximum values.
5. The method for detecting characteristic waves of electrocardiographic signals according to claim 4, It is characterized in that Removing first maximum values different from corresponding pooling values in the pooling sequence from the plurality of first maximum values to obtain a plurality of second maximum values includes: Constructing a second maximum value mask frame, wherein the second maximum value mask frame has elements corresponding one to one to the pooling sequence; Selecting all first maximum values in the first sequence in parallel as first target values, and comparing the first target values with corresponding pooling values in the pooling sequence; If the first target value is the same as the corresponding pooling value in the pooling sequence, the corresponding second target element in the second maximum mask frame is set to 1, otherwise it is set to 0, to obtain a second maximum mask sequence; The second maximum mask sequence is multiplied by corresponding elements of the pooling sequence to obtain a second sequence, where the second sequence includes multiple second maximum values.
6. The method for detecting characteristic waves of electrocardiographic signals according to any one of claims 1 to 3, It is characterized in that Before selecting a sampling point in a preset second neighborhood as the characteristic wave with the sampling point corresponding to the second maximum value as the center, the method further includes: Selecting all the second maximum values in parallel as second target values, and comparing the second target values with a preset threshold value; If the second target value is greater than or equal to the threshold, the second target value is set to 1, otherwise it is set to 0.
7. An electrocardiogram signal characteristic wave detection device, It is characterized in that include: An ECG signal acquisition module, used for acquiring ECG signals; A confidence calculation module, used to calculate the confidence that each sampling point on the electrocardiogram signal is a characteristic point of a characteristic wave, and obtain a confidence sequence; A maximum value calculation module, used to calculate the maximum value in the confidence sequence to obtain multiple first maximum values; A pooling module, used for selecting multiple sampling points in parallel, performing local maximum pooling on the confidence within a preset first neighborhood centered on each of the sampling points, and obtaining a pooling sequence; A maximum value screening module, used to remove first maximum values different from corresponding pooling values in the pooling sequence from the plurality of first maximum values, to obtain a plurality of second maximum values; A characteristic wave determination module, configured to select a sampling point in a preset second neighborhood with the sampling point corresponding to the second maximum value as the center as the characteristic wave; The pooling module includes a target point selection unit, a maximum value determination unit and a pooling unit; The target point selection unit is used to select all sampling points in parallel as target points; The maximum value determination unit is used to determine the maximum value of the confidence within a preset first neighborhood centered on the target point; The pooling unit is used to use the maximum value as the pooling value of the target point to obtain a pooling sequence.
8. A computer device, It is 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 electrocardiogram signal characteristic wave detection method as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the method for detecting characteristic waves of electrocardiographic signals as described in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Self-adaptive high-efficiency storage method of dynamic electrocardiogram (ECG) data
CN101773392A
Method for detecting, distinguishing and locating P waves and T waves of electrocardiogram
CN110013247A
