An electrocardiogram artifact confirmation method, terminal device, and storage medium
By constructing a QRS confidence calculation model, the QRS confidence of each core in the electrocardiogram data is calculated, the characteristic leads are determined and the molecular set is divided, which solves the problem of low artifact confirmation efficiency in the prior art, and realizes efficient artifact judgment and analysis.
Patent Information
- Application Number
- CN202210105887.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-28
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2042-01-28
AI Technical Summary
Existing electrocardiogram analysis software is prone to false detection and missed detection when dealing with artifacts, and the cardiac pulsation fragments that confirm artifacts and QRS require frequent switching of leads, resulting in high labor consumption.
A method of electrocardiogram artifact confirmation is adopted to construct a QRS confidence calculation model, calculate the QRS confidence of each core in the electrocardiogram data under each lead, and calculate the reliability score based on the confidence, determine the characteristic leads, divide the molecular set, and make the artifact judgment.
It improves the efficiency of judging artifacts in electrocardiogram, reduces the number of manpower confirmations, greatly saves manpower, and improves analysis efficiency.
Smart Images

Figure CN114494798B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electrocardiogram analysis, and particularly to a method for confirming electrocardiogram artifacts, a terminal device, and a storage medium. Background Art
[0002] Ambulatory electrocardiogram is an important means for analyzing arrhythmias. Patients wear a multi-channel electrocardiogram recorder to collect electrocardiograms for no less than 24 hours, and then hand over the data to doctors for analysis. Due to the huge amount of data (generally, about 100,000 heartbeats are included in 24 hours), doctors rely on computer-aided analysis software to improve efficiency in analyzing ambulatory electrocardiograms. Most of such software includes the following functional modules: heartbeat recognition, template management, and scatter plot. The heartbeat recognition algorithm marks the positions of candidate QRS waves in the electrocardiogram signal and extracts some features (R wave amplitude, width, P-R interval, etc.). The template management module classifies the candidate QRSs into different sets according to certain clustering principles to highlight their commonalities. The scatter plot provides a two-dimensional coordinate system to plot the scatter points of two characteristic values of each heartbeat, so as to provide a statistical pattern that can be distinguished by users. Figure 1 Shows a typical software operation interface, including template management, template details, and scatter plot.
[0003] Ambulatory electrocardiogram signals are extremely vulnerable to interference, and the interference signals may have some similar characteristics to QRS, but professionals can determine that it is not QRS. Such signals are called artifacts. Two types of errors often occur when dealing with artifacts: false detection and missed detection. Figure 2 Shows Figure 1 A false detection error in the artifact template. This heartbeat is marked as being interfered with on all leads, but it is not QRS. Figure 3 Shows a typical missed detection error. The selected heartbeat has a clear QRS in lead V3, and the signals in other leads are very weak. This is because the interference acts on different leads, but generally only 2 to 3 leads are analyzed for efficiency or a synthetic composite lead is used, and the QRS information of those leads not affected by interference is ignored.
[0004] If the above false detection and missed detection errors are to be corrected, the most direct method is to browse through all heartbeats on the template details page to distinguish artifacts from QRS. If the number of real heartbeats is large, "superposition anti-confusion" (a visualization method for discovering abnormal heartbeats by superimposing the heartbeats in the set, as shown in Figure 4 ) can also be used to reduce the operation. However, both of these methods have great limitations. When the number of heartbeats in the template is large, the confirmation work is very labor-intensive.
[0005] (1) In the current commercially available software, the lead selection for plotting heartbeat segments is uniformly set on the template details page. This means that to confirm an artifact on the details page, all leads need to be switched one by one. And to confirm a heartbeat, the leads need to be switched until the lead where the heartbeat can be clearly distinguished appears. Taking Figure 3 as an example, assume there are X interferences (artifacts) and N heartbeats (QRS) in the artifact template, and the heartbeat can only be seen on the V3 lead. Considering the limited display area, generally at most two leads are displayed on the practice details page. Then the number of times to switch to the V3 lead is 5 (in the order of I, II, III, avR, avL, avF, V1, V2, V3). The number of times the doctor needs to traverse the heartbeats to screen out the QRS is (X + N) * 5 times. Then, to confirm the remaining artifacts, an additional X * 1 time traversal is needed (switching once from V3 and V4 to V5 and V6), for a total of 6X + 5N times.
[0006] (2) Anti - aliasing is more restricted because anti - aliasing can only work on the same lead at a time. Still taking Figure 3 as an example, there are X artifacts and N heartbeats overlapping on the same lead, and generally the orders of magnitude of X and N are similar, so it is very difficult to visually distinguish them. Figure 5 And Figure 6 respectively show Figure 1 the results of anti - aliasing according to the II lead and V3 lead in the artifact template, and it can be seen that both are very difficult to decompose. Even if X is very small, it is still necessary to switch 8 times (I -> II -> III -> avL -> avR -> avF -> V1 -> V2 -> V3) of leads until a clear superimposed line appears on V3 to confirm these N heartbeats. In this ideal case, it also requires 6N (6N is because one detail box can display 2 leads, so to traverse all the artifacts through the traversal method and cover all 12 leads, it is 6 * the number of heartbeats) times of traversing heartbeats + 8 times of anti - aliasing operations to complete. Summary of the Invention
[0007] To solve the above problems, the present invention proposes an electrocardiogram artifact confirmation method, a terminal device, and a storage medium.
[0008] The specific solution is as follows:
[0009] An electrocardiogram artifact confirmation method, comprising the following steps:
[0010] S1: Collect electrocardiogram data with QRS wave annotations, and construct a training set based on the single - lead electrocardiogram data of a fixed length in the electrocardiogram data;
[0011] S2: Construct a QRS confidence calculation model and train the model with a training set. The input of the model is single-lead electrocardiogram data of a fixed length, and the output is the QRS confidence for each sampling point in the input single-lead electrocardiogram data where there is a QRS;
[0012] S3: Calculate the QRS confidence for each heartbeat in the electrocardiogram data to be recognized in each lead through the trained model, and calculate the corresponding reliability score according to the QRS confidence. The lead with the highest reliability score greater than the score threshold is used as the characteristic lead of the heartbeat. Otherwise, it is set that the heartbeat has no characteristic lead;
[0013] S4: Set the heartbeats without a characteristic lead and those with a QRS confidence less than the confidence threshold under the characteristic lead as artifacts, and set the heartbeats with a QRS confidence greater than or equal to the confidence threshold under the characteristic lead as heartbeats to be analyzed;
[0014] S5: Divide the heartbeats to be analyzed into multiple subsets according to the corresponding characteristic leads and the QRS confidence under the characteristic leads, satisfying that all heartbeats in each subset have the same corresponding characteristic lead, and the difference between the maximum and minimum values of the QRS confidence under the characteristic lead is less than the difference threshold;
[0015] S6: Judge whether the heartbeats to be analyzed are artifacts according to the subsets.
[0016] Furthermore, the label corresponding to each training data in the training set is a binary sequence of the same length as the electrocardiogram data of a fixed length. Each element in the binary sequence corresponds to a sampling point in the electrocardiogram data. The values of the elements corresponding to the sampling points within 60 milliseconds before and after the labeled points of the QRS wave in the electrocardiogram data are set to 1, and the values of the elements corresponding to other sampling points are set to 0.
[0017] Furthermore, the L1 loss is adopted as the loss function during model training.
[0018] Furthermore, the calculation formula for the reliability score is:
[0019] I1 = {i|y i ≥thres2}
[0020]
[0021] I2 = {i|thres1 < y i < thres2}
[0022]
[0023] I3 = {i|(y i -thres1)*(y i+1-thres1)<0}
[0024]
[0025] where score represents the reliability score, y i and y i+1 both represent the outputs of the QRS confidence calculation model, i represents the serial number of the sampling point; thres1 and thres2 respectively represent the first threshold and the second threshold, and thres1 < thres2; I1 represents the set of all points with probabilities greater than or equal to thres2; I2 represents the set of all points greater than thres1 but less than thres2; a + and a - respectively represent the non-linear weighted modulo operation on I1 and I2, b represents the central position b; σ represents the empirical constant; I3 represents the set of rising and falling edge points of the pulse.
[0026] Furthermore, the method for judging whether the heartbeat to be analyzed is an artifact according to the subset is as follows: According to the number of heartbeats in the subset, the individual heartbeats are judged sequentially or a combination of the superposition anti-aliasing method and the sequential judgment of individual heartbeats is used for judgment.
[0027] Furthermore, in the implementation process of steps S4 and S5, a scatter plot with the characteristic lead as the abscissa and the QRS confidence as the ordinate is used to plot the QRS confidence corresponding to all heartbeats under the characteristic lead; when selecting the heartbeat to be analyzed, by drawing a dividing line on the scatter plot, the heartbeats corresponding to all points above the dividing line are set as the heartbeats to be analyzed; when performing subset division, by means of circle selection, the heartbeats corresponding to all points within the selected range in the scatter plot are set to belong to the same subset.
[0028] An electrocardiogram artifact confirmation terminal device includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the method described above in the embodiments of the present invention are implemented.
[0029] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described above in the embodiments of the present invention are implemented.
[0030] The present invention adopts the above technical solutions, which can improve the judgment efficiency of artifacts in electrocardiograms and greatly save manpower. Description of the Drawings
[0031] Figure 1 Shown is a schematic diagram of the operation interface of the ambulatory electrocardiogram analysis software.
[0032] Figure 2Shown is a schematic diagram of a misdetection error in the artifact template.
[0033] Figure 3 Shown is a schematic diagram of a missed detection error in the artifact template.
[0034] Figure 4 Shown is a schematic diagram of the superposition anti-aliasing method.
[0035] Figure 5 Shown is a schematic diagram of the result of anti-aliasing the artifact template according to Lead II.
[0036] Figure 6 Shown is a schematic diagram of the result of anti-aliasing the artifact template according to Lead V3.
[0037] Figure 7 Shown is a flowchart of the method in the first embodiment of the present invention.
[0038] Figure 8 Shown are the electrocardiograms of a cardiac electrogram segment on 8 independent leads and the predicted output results after passing through the model in the first embodiment of the present invention.
[0039] Figure 9 Shown is a schematic diagram of the scatter plot in the first embodiment of the present invention.
[0040] Figure 10 Shown is a schematic diagram of the selection of the heartbeat to be analyzed in the scatter plot in the first embodiment of the present invention.
[0041] Figure 11 Shown is a schematic diagram of the selection of the subset of the heartbeat to be analyzed in the scatter plot by encircling in the first embodiment of the present invention.
[0042] Figure 12 Shown is a schematic diagram of the artifact confirmation process for the Lead III subset in the heartbeat to be analyzed in the first embodiment of the present invention.
[0043] Figure 13 Shown is a schematic diagram of the Lead V3 subset in the heartbeat to be analyzed in the first embodiment of the present invention.
[0044] Figure 14 Shown is a schematic diagram of the superposition anti-aliasing operation for the Lead V3 subset in the heartbeat to be analyzed in the first embodiment of the present invention.
[0045] Figure 15 Shown is a schematic diagram of the artifact confirmation process for another subset of Lead V3 in the heartbeat to be analyzed in the first embodiment of the present invention. Detailed implementation manners
[0046] To further illustrate the embodiments, the present invention provides accompanying drawings. These drawings are part of the disclosure of the present invention, mainly used to illustrate the embodiments, and can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these contents, those of ordinary skill in the art should be able to understand other possible implementation manners and the advantages of the present invention.
[0047] The present invention will be further described below in conjunction with the accompanying drawings and specific implementation manners.
[0048] Embodiment 1:
[0049] The embodiment of the present invention provides an electrocardiogram artifact confirmation method, taking QRS as an example for illustration. In other embodiments, other types of QRS can also be used for artifact confirmation, which is not limited herein. As Figure 7 shown, it is a flowchart of the electrocardiogram artifact confirmation method described in the embodiment of the present invention. The method includes the following steps:
[0050] S1: Collect electrocardiogram data with QRS wave annotations, and construct a training set based on the single-lead electrocardiogram data of a fixed length in the electrocardiogram data.
[0051] In this embodiment, the fixed length is set to 10 seconds. The electrocardiogram data is split according to the length of 10 seconds. Each lead in each split electrocardiogram data segment is used as a training data. The label corresponding to the training data is a binary sequence of the same length as the electrocardiogram data of the fixed length. Each element in the binary sequence corresponds to a sampling point in the electrocardiogram data. The values of the elements corresponding to the sampling points within 60 milliseconds before and after the annotation points of the QRS wave in the electrocardiogram data are set to 1, and the values of the elements corresponding to other sampling points are set to 0. If there are multiple leads in the electrocardiogram data, each lead shares the same set of labels.
[0052] S2: Construct a QRS confidence calculation model, and train the model through the training set. The input of the model is the single-lead electrocardiogram data of a fixed length, and the output is the QRS confidence that there is a QRS at each sampling point in the input single-lead electrocardiogram data.
[0053] In this embodiment, the range of the QRS confidence is set to 0-1. As Figure 8 shown is the electrocardiogram of an electrocardiogram segment on 8 independent leads and the corresponding model prediction output. The central position of this segment was mislabeled as an artifact by a preprocessing algorithm (traditional artifact recognition algorithm) based on the principle of comprehensive lead adaptive threshold, but there is a clearly identifiable QRS in the middle position of Lead II, and the response of the model proves this.
[0054] The network structure of the QRS confidence calculation model can adopt any segmentation network, such as FCN, U-net, Deeplab, etc.
[0055] The loss function during model training uses the L1 loss, that is where n represents the number of samples in one training batch, is the predicted value, and y i is the label value. The model is trained by stochastic gradient descent with the goal of reducing the loss function.
[0056] S3: Calculate the QRS confidence of each heartbeat (corresponding to one heartbeat) in the electrocardiogram data to be recognized in each lead through the trained model, and calculate the corresponding reliability score according to the QRS confidence. The lead with the reliability score greater than the score threshold (set to 1.5 in this embodiment) and the highest is used as the characteristic lead of this heartbeat. Otherwise, it is set that this heartbeat has no characteristic lead.
[0057] The characteristic lead calculated by the method of this embodiment is the lead with less interference and easy to determine the presence of QRS.
[0058] The purpose of calculating the reliability score score is to provide a parameter for measuring uncertainty. From Figure 8 it can be seen that the outputs in the places with high certainty (the first lead) are all steep, tall and straight (>0.8), full rectangular wave pulse-like graphs, while in the places with uncertainty, there are low and jerky irregular pulses. The reliability score score quantifies this feature. In this embodiment, it is characterized by the average number of effective sampling points contained in each pulse. The specific calculation formula is:
[0059] I1 = {i|y i ≥thres2}
[0060]
[0061] I2 = {i|thres1 < y i < thres2}
[0062]
[0063] I3 = {i|(y i -thres1)*(y i+1 -thres1) < 0}
[0064]
[0065] where y i and y i+1Both represent the output of the QRS confidence calculation model. \(i\) represents the serial number of the sampling point, which is a sequence composed of 1280 points in this embodiment. The value range of each point is \(0 - 1\), indicating the probability that the point is included in the QRS; thres1 and thres2 respectively represent the first threshold and the second threshold, and thres1 < thres2. In this embodiment, thres1 = 0.1 and thres2 = 0.8 are set; I1 represents the set of all points with probabilities greater than or equal to thres2, and these points reflect high certainty; I2 represents the set of all points greater than thres1 but less than thres2, and these are the irregular points in the pulse curve, reflecting uncertainty; a + and a - respectively represent the non-linear weighted modulus calculation of I1 and I2, that is, the contribution of points closer to the central position \(b\) (640 in this embodiment) is greater because the target heartbeat is in the middle during input, and users are more concerned about whether the probability activation curve near it is regular; \(\sigma\) represents an empirical constant used to control the speed of weight decay along the center. In this embodiment, \(\sigma = 200\) is set; I3 represents the set of rising and falling edge points of the pulse. In this embodiment, crossing thres1 is used as the judgment criterion; dividing \(|I3| / 2\) can obtain the count of all pulse waves. Finally, a + subtracts a - to obtain the number of valid points. The number of valid points rewards points greater than thres2 and punishes points greater than thres1 but less than thres2, and the weight is greater closer to the center. Finally, dividing this value by the number of pulse waves (\(|i3| / 2\)) gives the average number of valid points, which is used as the sorting score.
[0066] S4: Set the heartbeats without characteristic leads and with QRS confidence less than the confidence threshold under the characteristic leads as artifacts, and set the heartbeats with QRS confidence greater than or equal to the confidence threshold under the characteristic leads as heartbeats to be analyzed.
[0067] S5: Divide the heartbeats to be analyzed into multiple subsets according to the corresponding characteristic leads and the QRS confidence under the characteristic leads, satisfying that all heartbeats in each subset correspond to the same characteristic lead, and the difference between the maximum value and the minimum value of the QRS confidence under the characteristic lead is less than the difference threshold.
[0068] S6: Judge whether the heartbeats to be analyzed are artifacts according to the subsets.
[0069] The method for judging whether the analyzed heartbeat is an artifact by treating it as a subset is as follows: According to the number of heartbeats in the subset, individual heartbeats are judged one by one (traversing and browsing on the details page) or a method combining the superposition anti-confusion method and judging individual heartbeats one by one is used for judgment. Specifically, when the number of heartbeats in the subset is less than the data threshold (such as 12, those skilled in the art can set it by themselves according to the size of the display area), the method of judging individual heartbeats one by one is adopted (for example, all heartbeats are sequentially displayed in the display interface, and it is manually checked by the staff whether it is an artifact); otherwise, first, the superposition anti-confusion method is adopted to extract the heartbeats belonging to QRS from the subset, and the other heartbeats are further determined by the method of judging individual heartbeats one by one.
[0070] To facilitate the operation of the user, a visual operation method can be provided in this embodiment, that is, a scatter plot with the characteristic lead as the abscissa and the QRS confidence as the ordinate is used to plot the QRS confidence under the characteristic lead corresponding to all heartbeats; when selecting the heartbeat to be analyzed, by drawing a dividing line on the scatter plot, the heartbeats corresponding to all points above the dividing line are set as the heartbeats to be analyzed; when performing subset division, by means of circle selection, it is set that the heartbeats corresponding to all points within the selected range in the scatter plot belong to the same subset.
[0071] This embodiment also includes representing the QRS confidence corresponding to the heartbeat without a characteristic lead by a point on the vertical axis of the scatter plot.
[0072] As Figure 9 shown, the interface uses a combined scatter plot in the lower right corner to draw a heartbeat scatter plot in a two-dimensional manner, where the horizontal axis coordinate is the characteristic lead and the vertical axis coordinate is the QRS confidence (for the convenience of observation, in this embodiment, the vertical axis coordinate value is set to QRS confidence * 100). This scatter plot has the following inductive characteristics:
[0073] 1. When the characteristic lead exists and the heartbeat is QRS, such scatter points converge in the upper half-axis region corresponding to the characteristic lead;
[0074] 2. When the characteristic lead exists and the heartbeat is an artifact, such scatter points converge in the lower half-axis region corresponding to the characteristic lead;
[0075] 3. When the characteristic lead exists and the heartbeat is uncertain, such scatter points converge in the middle-axis region corresponding to the characteristic lead, but the probability of such scatter points appearing is small, because as long as the model is trained sufficiently, the QRS confidence is small on the lead with little interference;
[0076] 4. When the characteristic lead does not exist, that is, when it is assigned to the vertical coordinate (X) axis, it means that all leads are severely interfered, and regardless of the QRS confidence level, it can be treated as an artifact.
[0077] It can be seen that the heartbeats are effectively clustered in two dimensions. If the user makes a selection using the above characteristics and combines it with anti-confusion and detailed browsing, the operation cost will be greatly reduced.
[0078] The following uses Figure 9 the artifact template case in
[0079] 1. Select the artifact template. It can be seen that 366 heartbeats to be confirmed are as Figure 10 shown by the arrow. In the combined scatter plot in the lower right corner, circle the heartbeats with an X-lead and a QRS confidence less than 0.5 and directly set them as artifacts (1 confirmation operation).
[0080] 2. At this time, there are still 176 heartbeats to be confirmed, and they are clustered in 5 regions as Figure 11 shown.
[0081] 3. Circle the scatter points of lead II. Since there are not many heartbeats, directly set the display of lead II browsing in the detailed page. After 14 confirmations, all are QRS (14 confirmation operations).
[0082] 4. Repeat the above operation on lead III. After 11 confirmations, all are QRS, as Figure 12 shown (11 operations).
[0083] 5. The next clustering region is on lead V3, as Figure 13 shown. It can be seen that there are 144 heartbeats. Use superimposed anti-confusion. On the anti-confusion interface, circle 125 superimposed heartbeats and set them as QRS after one confirmation. The remaining 19 are set to display lead V3 browsing in the detailed page. After confirmation, there are 16 QRS and 3 artifacts, as Figure 14 shown (20 confirmation operations).
[0084] 6. The next region is still on V3, but the confidence is medium. After 2 confirmations in the detailed page, it is an artifact, as Figure 15 shown (2 confirmation operations).
[0085] 7. The last region is on V4, with a total of 5 heartbeats. Directly in the detailed page, after 5 confirmations, 4 are QRS and 1 is an artifact (5 confirmation operations).
[0086] So far, the separation of 196 artifacts and 170 QRS has been completed for 366 heartbeats after a total of 53 confirmation operations. If the traditional method in the background introduction is used, then 196*6 (artifacts) + 14*1 (QRS of lead II feature) + 11*2 (QRS of lead III feature) + 141*5 (QRS of lead V3 feature) + 4*5 (QRS of lead V4 feature) = 1937 confirmation operations are required. Therefore, the method proposed in this embodiment improves the efficiency by more than 30 times.
[0087] In two extreme cases, the method of this embodiment can achieve the best efficiency improvement: one is that all are artifacts, and in this case, only the operation of 1 above needs to be performed once; the other is that all are QRSs, and then only the operation of 2 needs to be performed once for anti-confusion confirmation.
[0088] In general, assuming there are X artifacts and N QRSs, and there are K characteristic leads, and there is a proportion J of medium-confidence QRSs and a proportion M of QRSs that need to be separately confirmed after anti-confusion on these K characteristic leads. Then according to the above operations, it is necessary to perform the operation of 1 once + K anti-confusion operations + N*(J + M) separate confirmation operations. The traditional method requires 6*X + 3*N confirmation operations. In comparison, the improvement is (6*X + 3*N) / (1 + K + N*(J + M)). Taking the empirical values K = 3, J = 0.5, M = 0.1 and ignoring the constant term, we get 40*X / N + 20, that is, at least a 20-fold efficiency improvement.
[0089] The method of this embodiment can assign QRS confidence on single-lead electrocardiogram data and can measure the degree of interference of electrocardiogram segments.
[0090] Embodiment 2:
[0091] The present invention also provides an electrocardiogram artifact confirmation terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps in the above method embodiment of Embodiment 1 of the present invention are implemented.
[0092] Further, as an executable solution, the electrocardiogram artifact confirmation terminal device can be a computing device such as a desktop computer, a notebook, a palm computer, and a cloud server. The electrocardiogram artifact confirmation terminal device may include, but is not limited to, a processor and a memory. Those skilled in the art can understand that the above composition structure of the electrocardiogram artifact confirmation terminal device is only an example of the electrocardiogram artifact confirmation terminal device and does not constitute a limitation on the electrocardiogram artifact confirmation terminal device. It may include more or fewer components than the above, or combine some components, or different components. For example, the electrocardiogram artifact confirmation terminal device may further include input / output devices, network access devices, buses, etc. The embodiments of the present invention do not make limitations in this regard.
[0093] Further, as an executable solution, the so-called processor may be a Central Processing Unit (CPU), or may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The processor is the control center of the electrocardiogram artifact confirmation terminal device, and connects various parts of the entire electrocardiogram artifact confirmation terminal device through various interfaces and lines.
[0094] The memory can be used to store the computer program and / or module. By running or executing the computer program and / or module stored in the memory, and by calling the data stored in the memory, the processor realizes various functions of the electrocardiogram artifact confirmation terminal device. The memory mainly includes a program storage area and a data storage area. Among them, the program storage area can store the operating system and application programs required for at least one function; the data storage area can store data created according to the use of the mobile phone, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, memory, plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, at least one magnetic disk storage device, flash device, or other volatile solid-state storage devices.
[0095] The present invention also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the method in the above embodiments of the present invention are realized.
[0096] If the module / unit integrated in the electrocardiogram artifact confirmation terminal device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, to implement all or part of the processes in the above-described embodiment methods of the present invention, it can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-described various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), and software distribution medium, etc.
[0097] Although the present invention has been specifically shown and described in conjunction with the preferred embodiments, those skilled in the art should understand that various changes can be made to the present invention in terms of form and details without departing from the spirit and scope of the present invention defined by the appended claims, and all of them are within the protection scope of the present invention.
Claims
1. A method for confirming electrocardiogram artifacts, characterized in that, It includes the following steps: S1: Collect electrocardiogram data with QRS wave annotations, and construct a training set based on the single-lead electrocardiogram data of a fixed length in the electrocardiogram data; S2: Construct a QRS confidence calculation model, and train the model with the training set. The input of the model is the single-lead electrocardiogram data of a fixed length, and the output is the QRS confidence that there is a QRS at each sampling point in the input single-lead electrocardiogram data; S3: Calculate the QRS confidence that there is a QRS at each heartbeat in each lead of the electrocardiogram data to be recognized through the trained model, and calculate the corresponding reliability score according to the QRS confidence. The lead when the reliability score is greater than the score threshold and is the highest is used as the characteristic lead of the heartbeat. Otherwise, it is set that there is no characteristic lead for the heartbeat; S4: Set the heartbeats with no characteristic lead and the QRS confidence less than the confidence threshold under the characteristic lead as artifacts, and set the heartbeats with the QRS confidence greater than or equal to the confidence threshold under the characteristic lead as heartbeats to be analyzed; S5: Divide the heartbeats to be analyzed into multiple subsets according to the corresponding characteristic leads and the QRS confidence under the characteristic leads, so as to satisfy that the characteristic leads corresponding to all heartbeats in each subset are the same, and the difference between the maximum value and the minimum value of the QRS confidence under the characteristic lead is less than the difference threshold; S6: Judge whether the heartbeats to be analyzed are artifacts according to the subsets.
2. The electrocardiogram artifact confirmation method according to claim 1, wherein: The label corresponding to each training data in the training set is a binary sequence of the same length as the electrocardiogram data of a fixed length. Each element in the binary sequence corresponds to a sampling point in the electrocardiogram data. The values of the elements corresponding to the sampling points within 60 milliseconds before and after the annotated points of the QRS wave in the electrocardiogram data are set to 1, and the values of the elements corresponding to other sampling points are set to 0.
3. The electrocardiogram artifact confirmation method according to claim 1, characterized in that: The loss function during model training uses the L1 loss.
4. The electrocardiogram artifact confirmation method according to claim 1, wherein: The calculation formula for the reliability score is: I1 = {i | y i ≥ thres2} I2 = {i | thres1 < y i < thres2} I3 = {i|(y i - thres1)*(y i+1 - thres1) < 0} where score represents the reliability score, and y i and y i+1 both represent the outputs of the QRS confidence calculation model, i represents the serial number of the sampling point; thres1 and thres2 respectively represent the first threshold and the second threshold, and thres1 < thres2; I1 represents the set of all points with probabilities greater than or equal to thres2; I2 represents the set of all points greater than thres1 but less than thres2; a + and a - respectively represent the non-linear weighted modulo operations on I1 and I2, b represents the central position b; σ represents the empirical constant; I3 represents the set of rising and falling edge points of the pulse.
5. The electrocardiogram artifact confirmation method according to claim 1, wherein: The method for judging whether the heartbeats to be analyzed are artifacts according to the subsets is: According to the number of heartbeats in the subset, judge by using the single heartbeat in turn or a combination of the superposition anti-confusion method and the single heartbeat in turn.
6. The electrocardiogram artifact confirmation method according to claim 1, wherein: In the implementation process of steps S4 and S5, a scatter plot with the characteristic lead as the abscissa and the QRS confidence as the ordinate is used to plot the QRS confidence under the characteristic leads corresponding to all heartbeats; when selecting the heartbeats to be analyzed, by drawing a dividing line on the scatter plot, the heartbeats corresponding to all points above the dividing line are set as the heartbeats to be analyzed; when performing subset division, by means of circle selection, it is set that the heartbeats corresponding to all points within the selected range in the scatter plot belong to the same subset.
7. An electrocardiogram artifact confirmation terminal device, characterized in that: It includes a processor, a memory, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by the processor, it implements the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Electrocardiogram analysis method and device based on target detection
CN113080996A
Method and device for positioning and classifying QRS waves based on artificial intelligence model
CN113892955A