An electrocardiogram diagnosis method and device based on artificial rule enhanced neural network

Through a multi-lead ECG diagnostic method based on artificial rules, combined with deep learning and rule reasoning modules, the accuracy and efficiency of the existing ECG diagnostic system are solved, and efficient and accurate ECG signal diagnosis is achieved, which is suitable for ECG diagnosis in lower hospitals and communities.

CN114711786BActive Publication Date: 2025-08-15海宁市产业技术研究院
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210172196.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-24
Publication Date
2025-08-15
Estimated Expiration
2042-02-24

AI Technical Summary

Technical Problem

The existing electrocardiogram diagnosis system has problems such as large workload, strong subjectivity, lack of labeling tools and insufficient diagnostic accuracy. It is especially difficult to meet the needs in lower-level hospitals and community electrocardiogram diagnosis, and existing algorithms are difficult to effectively identify the heart-shot segmentation points, complex waveform superposition and multi-centric shooting joint diagnosis.

Method used

Using a method based on artificial rules to enhance neural networks, combined with deep learning modules and rule reasoning modules, a multi-lead electrocardiogram signal diagnosis model is constructed, and feature extraction is used for CNN networks, and a combination of medical signal analysis rules and mask mechanism processing is achieved to achieve accurate diagnosis of ECG signals.

Benefits of technology

It improves the accuracy and efficiency of ECG signal diagnosis, reduces the workload of doctors, and can accurately identify PQRST characteristics under the superposition of signals, assists doctors in efficient diagnosis, displays the amplitude and morphology of ECG signal, and lowers the threshold for use.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114711786B_ABST
    Figure CN114711786B_ABST
Patent Text Reader

Abstract

The present invention discloses an electrocardiogram (ECG) diagnosis method based on an artificial rule-enhanced neural network, comprising the following steps: obtaining ECG signal training samples; constructing a training model comprising a deep learning module and a rule-based reasoning module; inputting the ECG signal training samples into the deep learning module to obtain a first abnormality prediction probability vector; inputting the ECG signal training samples into the rule-based reasoning module to obtain a second abnormality prediction probability vector for probabilistically predicting an ECG diagnostic label; fusing the vectors to obtain a final abnormality prediction probability vector for probabilistically predicting an ECG diagnostic label; inputting the ECG signal training samples into the training model; optimizing the training model parameters using a total loss function to obtain a multi-lead ECG signal diagnosis model; and, when applied, inputting the ECG signal into the multi-lead ECG signal diagnosis model to obtain a predicted probability of the ECG diagnostic label for the ECG signal. This method can accurately and quickly diagnose ECG signals.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of medical data processing, and in particular relates to an electrocardiogram diagnosis method and device based on artificial rule-enhanced neural network. Background Art

[0002] According to data provided by the China Telecardiography Diagnosis Group, approximately 250 million people undergo electrocardiogram (ECG) examinations and 35 million Holter monitoring tests in my country each year. However, only about 36,000 people are truly proficient in and engaged in ECG examinations, resulting in a serious imbalance between supply and demand. Medical institutions, especially lower-level hospitals and community ECG diagnostic personnel, cannot meet the demand, and many ECG readers have limited skills. This leads to substandard ECG measurements, untimely, and inaccurate diagnoses.

[0003] Currently, there are several prominent problems with ECG annotation, including: 1. Large workload: A conventional standard ECG examination involves 12 or 18 leads, and each lead can collect 6-16 heartbeats within a standard ten-second test time. Therefore, annotating such a large number of heartbeats requires a lot of workload for doctors; 2. Strong subjective factors: Since a complete ECG annotation standard has not yet been formed in China, the annotation data is highly subjective, and the judgment of each doctor is different, resulting in different annotation names or annotation categories for the same ECG annotation; 3. Lack of annotation tools: Since ECG diagnosis images are relatively easy to collect and print, there are few ECG annotation tools that doctors can use for digital annotation. In addition, the existing annotation tools are relatively simple and not interactive, making them difficult to use effectively.

[0004] There are many ECG annotation algorithms on the market, including the ECG annotation method that comes with the ECG machine. These methods are often based on traditional signal recognition methods and cannot effectively identify ECG signals. Specific recognition difficulties include: 1. Heartbeat segmentation points are difficult to identify: The heartbeats of patients with serious diseases do not have clear P, Q, R, S, and T point features, which makes the heartbeats difficult to identify; 2. Complex waveform superposition: Patients with heart disease often have more than one pathological manifestation, so there is the possibility of superposition of various variant signals; 3. Multi-beat joint diagnosis is difficult: Some arrhythmia diseases require the diagnosis of multiple heartbeats. While the model needs to have sufficient recognition capabilities for detailed information, it also needs to have a large receptive field to complete multi-beat joint diagnosis;

[0005] Due to the problems of weak positioning and difficult diagnosis of ECG annotation algorithms on the market, there is an urgent need to design a system that can accurately and quickly diagnose ECG signals, which will help high-level diagnosis in the field of medical information and electronics, reduce the pressure on doctors, and greatly facilitate patients' needs for ECG diagnosis. Summary of the Invention

[0006] The present invention provides an electrocardiogram diagnosis method based on artificial rule-enhanced neural network, which can diagnose electrocardiogram signals accurately and quickly.

[0007] An electrocardiogram diagnosis method based on artificial rule-enhanced neural network, comprising:

[0008] Obtain ECG signal training samples;

[0009] Constructing a training model, the training model includes a deep learning module and a rule reasoning module, inputting an ECG signal training sample into the deep learning module to obtain a first abnormality prediction probability vector, the rule reasoning module includes a separation description submodule and a rule reasoning submodule, inputting the ECG signal training sample into the separation description submodule to obtain a PQRST numerical feature, inputting the PQRST numerical feature into the rule reasoning submodule, obtaining a second abnormality prediction probability vector for probabilistically predicting an ECG diagnostic label based on medical signal analysis rules, performing a masking mechanism on the second abnormality prediction probability vector to obtain a third abnormality prediction probability vector, such that the third abnormality prediction probability vector has the same length as the first abnormality prediction probability vector, and assigning a fusion weight to the third abnormality prediction probability vector and the first abnormality prediction probability vector using a sigmoid function to obtain a final abnormality prediction probability vector;

[0010] Constructing a total loss function, which includes a deep learning loss function and a rule reasoning loss function, wherein the deep learning loss function is constructed by the weighted cross entropy of the final abnormality prediction probability vector and the true abnormality prediction probability vector, and the rule reasoning loss function is constructed by the weighted cross entropy of the final abnormality prediction probability vector and the third abnormality prediction probability vector;

[0011] The ECG signal training samples are input into the training model, and the training model parameters are optimized by the total loss function to obtain a multi-lead ECG signal diagnosis model;

[0012] When applied, the ECG signal is input into the multi-lead electrocardiogram signal diagnosis model to obtain the predicted probability of the electrocardiogram diagnosis label of the ECG signal.

[0013] Input the ECG signal training sample into the deep learning module to obtain the first abnormality prediction probability vector, including:

[0014] The ECG signal is sequentially input into the CNN network of the deep learning module, the reshaping layer, and the maximum pooling layer to obtain the ECG feature vector. The age and gender features are combined with the ECG feature vector, and the combined feature vector is input into the fully connected layer to obtain the first abnormality prediction probability vector.

[0015] ECG signal features are extracted through a CNN network to obtain ECG feature values, where the CNN network is a ResNet, ECGNet or Transformer algorithm.

[0016] The ECG signal training sample is input into the separation descriptor module to obtain the PQRST numerical features, including:

[0017] The ECG signal is filtered using a bandpass filter to remove burrs and offsets. The filtered ECG signal is decomposed and reconstructed using the wavelet transform method to obtain the R peak of the ECG signal. The ECG signal is segmented by the R peak to obtain key segments. The first-order and second-order information processing of the P wave, QRS complex, and T wave of the key segments is performed to obtain the PQRST numerical features.

[0018] A medical signal analysis rule is constructed based on the electrocardiogram diagnostic standard, and a second abnormality prediction probability vector is obtained based on the medical signal analysis rule through the PQRST numerical feature, wherein the medical signal analysis rule is the correspondence between the PQRST numerical feature and the electrocardiogram diagnostic label.

[0019] The second abnormality prediction probability vector is processed by a mask mechanism to obtain a third abnormality prediction probability vector, including:

[0020] The mask mechanism is used to represent the probability of the ECG diagnostic label that is judged as not appearing by the rule reasoning submodule with 0, and the probability of the ECG diagnostic label that does not appear is added to the second abnormality prediction probability vector to obtain the third abnormality prediction probability vector, so that the third abnormality prediction probability vector has the same length as the first abnormality prediction probability vector.

[0021] The third abnormality prediction probability vector and the first abnormality prediction probability vector are assigned fusion weights by the S-shaped function to obtain the final abnormality prediction probability vector for:

[0022]

[0023]

[0024] h DL =[h1,h2…h N ]

[0025] l RULE =[l1, l2…l N ]

[0026] Among them, i is the index of the ECG diagnosis label category, is the mask value corresponding to the ECG diagnostic label category, where if the i-th ECG diagnostic label category has an abnormal prediction probability, then mi =1, otherwise, m i =0,h DL is the first abnormal prediction probability vector, l RULE is the third abnormality prediction probability vector, N is the total number of ECG diagnostic labels, S(ω) is the S-type function of the fusion weight vector ω, ω, l RULE and h DL All have the same number N, Indicates the inversion of each element in the mask vector, and “·” indicates element-wise multiplication.

[0027] Total loss function for:

[0028]

[0029] Where L(·) is the weighted binary cross entropy, y is the true anomaly prediction probability vector, is the final abnormal prediction probability vector, l RULE is the third abnormality prediction probability vector, and λ is a hyperparameter.

[0030] An electrocardiogram diagnostic device based on an artificial rule-enhanced neural network, comprising a computer memory, a computer processor, and a computer program stored in the computer memory and executable on the computer processor, wherein the multi-lead electrocardiogram signal diagnostic model according to any one of claims 1 to 9 is used in the computer memory;

[0031] When the computer processor executes the computer program, the following steps are implemented: inputting the ECG signal into a multi-lead electrocardiogram signal diagnosis model to obtain a predicted probability of an electrocardiogram diagnosis label of the ECG signal.

[0032] Compared with the prior art, the present invention has the following beneficial effects:

[0033] (1) The present invention fuses the predicted probability vector output by the rule reasoning module with the predicted probability vector output by the deep learning module, and deeply combines the judgment results of deep learning with the doctor's diagnostic experience to accurately diagnose electrocardiogram signals. This allows the model to better imitate the specific positions and areas of the ECG signal that the doctor focuses on, effectively improving the diagnostic accuracy and making it more applicable in medical environments.

[0034] (2) The present invention analyzes ECG signals through a rule reasoning module, and can more accurately identify PQRST features in the case of signal superposition, obtain ECG signal positioning, and extract ECG signal features through a CNN model to obtain ECG signal features, obtain sufficient ECG signal detail information, and complete multi-beat diagnosis. The deep integration of the rule reasoning module and the deep learning module makes the multi-lead ECG signal diagnosis model provided by the present invention more powerful in network interpretability than ordinary deep learning networks. As a tool to assist doctors in ECG diagnosis, it is convenient and efficient, and intuitively displays the amplitude and morphology of the ECG signal that doctors are concerned about, lowering the threshold for use. Experiments on two large public ECG data sets show that the present method is much better than the existing state-of-the-art methods. In addition, the method proposed by the present invention can not only improve diagnostic performance, but also help detect mislabeled ECG samples. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 A flow chart of an electrocardiogram diagnosis method based on artificial rule-enhanced neural network provided in a specific embodiment;

[0036] Figure 2 A block diagram of an electrocardiogram diagnosis method based on artificial rule-enhanced neural network provided in a specific embodiment;

[0037] Figure 3 A block diagram of the ResNet system provided for a specific implementation;

[0038] Figure 4 Diagrams of key segments of the cardiac cycle and ECG provided for specific embodiments;

[0039] Figure 5 A medical signal analysis rule diagram is provided for a specific implementation. DETAILED DESCRIPTION

[0040] The present invention will be described in further detail below with reference to the accompanying drawings and examples. It should be noted that the following examples are intended to facilitate understanding of the present invention and do not have any limiting effect on the present invention.

[0041] like Figure 1 As shown, the multi-lead ECG signal diagnosis model of artificial rule-enhanced neural network includes a training process and a testing process. Specifically, the following steps are included:

[0042] Data collection:

[0043] This example collected data from 200 patients on a CT machine from Sir Run Run Shaw Hospital affiliated to Zhejiang University School of Medicine.

[0044] Algorithm design:

[0045] The present invention uses an artificial rule-enhanced neural network multi-lead electrocardiogram signal diagnosis model (such as Figure 2 The neural network used in this case is ResNet. In fact, the specific operation is not limited to ResNet, Transformer, and ECGNet.

[0046] like Figure 3 As shown, the present invention uses 1D convolution operation to treat the input ECG as a one-dimensional signal. "Convi,j" represents a convolution layer with j kernels of size i. If followed by " / 2", it means a convolution layer with a stride of 2. "Pool,3, / 2" represents a maxpool layer with a kernel size of 3 and a stride of 2. "*n" means that the residual block is repeated n times in sequence. An important design principle for adopting a structure similar to ResNet is that when the size of the feature map is reduced by half, the number of feature maps is doubled, which maintains the complexity of the network layer. The ResNet network is also called the residual network. The present invention mainly adopts the network structure of resnet34, which includes 4 convolution layers of different scales, and each layer includes several residual modules of different numbers. The present invention adaptively increases the number of convolution layers for small-scale convolution kernel operations and reduces the number of convolution layers for large-scale convolution kernel operations. Its purpose is to expand the degree of influence on the similarity between adjacent ECG data and suppress the influencing factors of repeated periodicity under a larger receptive field. The specific network structure is as follows Figure 3 As shown in the figure, layer 1 uses 3 residuals, layer 2 uses 3 residuals, layer 3 uses 5 residuals, and layer 4 uses 2 residuals, for a total of 28 convolutional layers. Residual learning solves the degradation problem of deep networks, allowing us to train deeper networks and automatically learn features from the data, achieving better robustness and accuracy.

[0047] At the same time, the rule reasoning module of the present invention is composed of a separation description submodule and a rule reasoning submodule. The present invention uses the rule reasoning submodule to process the ECG signal to obtain the PQRST numerical features, that is, the key segments of the cardiac cycle and ECG, such as Figure 4 As shown. The PQRST numerical features are input into the rule reasoning submodule. Based on the medical signal analysis rules, a second abnormality prediction probability vector is obtained for probabilistic prediction of the ECG diagnostic label. The second abnormality prediction probability vector is processed by a mask mechanism to obtain a third abnormality prediction probability vector. The third abnormality prediction probability vector has the same length as the first abnormality prediction probability vector. The third abnormality prediction probability vector and the first abnormality prediction probability vector are fused by assigning weights using a sigmoid function to obtain the final abnormality prediction probability vector for probabilistic prediction of the ECG diagnostic label.

[0048] Among them, the present invention uses a bandpass (3-50Hz) filter to filter the ECG signal to remove signal glitches and eliminate signal offset. Secondly, R peak detection and ECG segmentation are performed. Thereafter, the first-order information and second-order information of the filtered ECG signal are used to depict the P wave, QRS complex and T wave to obtain the PQRST numerical features. The present invention has formulated 14 types of ECG abnormality rules based on previous ECG diagnostic standards, namely medical signal analysis rules. The medical signal analysis rules are the correspondence between PQRST numerical features and ECG diagnostic labels. The specific rules are as follows: Figure 5 As shown in Figure 2, the probability of ECG diagnostic labels appearing is determined by the PQRST numerical feature. The ECG signal consists of twelve leads: I, II, III, V1, V2, V3, V4, V5, V6, aVL, aVR, and aVF.

[0049] In order to combine the predictions provided by the rule-based reasoning module and the deep learning module, it is necessary to model the dependency between the two methods and fuse their outputs to ultimately identify ECG abnormalities. Here, the present invention regards both the rule-based reasoning module and the deep neural network as meta-learners and introduces a super learner for fusion. The input of the super learner is the deep learning module h DL =[h1,h2…h N ] and rule reasoning module l RULE =[l1,l2…l N ], where N is the number of elements in the abnormal prediction probability vector and i is the index of the ECG diagnostic label category. By fusing these two predictions, the super learner generates the final prediction vector Formally, the operation of the super learner is defined in the following equation, where ω is the fused weight vector of size N, S(ω) is the sigmoid function, and “·” denotes the element-wise dot product

[0050]

[0051] In particular, if the rule inference module considers fewer than N types of anomalies, the mask vector is constructed as If the rule inference module predicts the i-th anomaly (or normality), the i-th element m i =1; otherwise, m i = 0, the length of the fusion weight vector ω is the same as the length of the prediction vector generated by the rule inference module, and its elements corresponding to the predictions not provided by the rule inference module are filled with zeros (no gradient is required) to match h DL Alignment. Prediction vector l RULE Fill in the same way. Therefore, ω, l RULE and h DLAll have the same size N. The final predicted mask mechanism is performed as follows, where Indicates the inversion of each element in the mask vector, and "·" indicates element multiplication

[0052]

[0053] Model training:

[0054] In order to improve the reliability of the entire model, this embodiment uses five-fold cross validation during model training, that is, the entire data set is randomly divided into five parts, one of which is taken as the validation set each time, and the remaining four are used as training, and the training is repeated 5 times. Specify the entire framework HRNN. Assume that the ground truth value of ECG recording is When y i =1, indicating that the ECG record is abnormal type i, y i = 0 means class i is normal. The weighted cross entropy loss is defined as:

[0055]

[0056] Where, β i is the rank weight of class i, calculated as (M is the total number of all ECG cases in the dataset, Mi is the number of cases belonging to class i, is the predicted probability obtained by the super learner. The prediction of the rule reasoning module is also used to guide the prediction of HRNN, and its total loss function is

[0057]

[0058] Testing process:

[0059] After model training is complete, doctors seeking ECG diagnosis in the future only need to measure the patient's ECG signal. The model then infers the patient's ECG disease label data, along with the ECG signal's location analysis and specific features. This model assists doctors in providing ECG disease diagnostic labels more quickly. On existing datasets, the overall recall value reached 95.2%, exceeding the performance of a single model by as much as 5%.

[0060] The embodiments described above provide a detailed description of the technical solutions and beneficial effects of the present invention. It should be understood that the above are only specific embodiments of the present invention and are not intended to limit the present invention. Any modifications, supplements and equivalent substitutions made within the scope of the principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. An electrocardiogram diagnosis method based on artificial rule-enhanced neural network, characterized in that: include: Obtain ECG signal training samples; Constructing a training model, the training model includes a deep learning module and a rule reasoning module, inputting an ECG signal training sample into the deep learning module to obtain a first abnormality prediction probability vector, the rule reasoning module includes a separation description submodule and a rule reasoning submodule, inputting the ECG signal training sample into the separation description submodule to obtain a PQRST numerical feature, inputting the PQRST numerical feature into the rule reasoning submodule, obtaining a second abnormality prediction probability vector for probabilistic prediction of the electrocardiogram diagnostic label based on medical signal analysis rules, performing a mask mechanism processing on the second abnormality prediction probability vector to obtain a third abnormality prediction probability vector, so that the third abnormality prediction probability vector has the same length as the first abnormality prediction probability vector, and assigning a fusion weight to the third abnormality prediction probability vector and the first abnormality prediction probability vector through a sigmoid function to obtain a final abnormality prediction probability vector; Constructing a total loss function, which includes a deep learning loss function and a rule reasoning loss function, wherein the deep learning loss function is constructed by the weighted cross entropy of the final abnormality prediction probability vector and the true abnormality prediction probability vector, and the rule reasoning loss function is constructed by the weighted cross entropy of the final abnormality prediction probability vector and the third abnormality prediction probability vector; The ECG signal training samples are input into the training model, and the training model parameters are optimized by the total loss function to obtain a multi-lead ECG signal diagnosis model; When applied, the ECG signal is input into the multi-lead electrocardiogram signal diagnosis model to obtain the predicted probability of the electrocardiogram diagnosis label of the ECG signal; The third abnormality prediction probability vector and the first abnormality prediction probability vector are assigned fusion weights by the S-shaped function to obtain the final abnormality prediction probability vector for: h DL =[h1,h2…h N ] l RULE =[l1,l2…l N ] Among them, i is the index of the ECG diagnosis label category, is the mask value corresponding to the ECG diagnostic label category, where if the i-th ECG diagnostic label category has an abnormal prediction probability, then m i =1, otherwise, m i =0,h DL is the first abnormal prediction probability vector, l RULE is the third abnormality prediction probability vector, N is the total number of ECG diagnostic labels, S(ω) is the S-type function of the fusion weight vector ω, ω, l RULE and h DL all have the same number N, Indicates the inversion of each element in the mask vector, "·" means element multiplication; Total loss function for: Where L(·) is the weighted binary cross entropy, y is the true anomaly prediction probability vector, is the final abnormal prediction probability vector, l RULE is the third abnormality prediction probability vector, and λ is a hyperparameter.

2. The electrocardiogram diagnosis method based on artificial rule-enhanced neural network according to claim 1, characterized in that: Input the ECG signal training sample into the deep learning module to obtain the first abnormality prediction probability vector, including: The ECG signal is sequentially input into the CNN network of the deep learning module, the reshaping layer, and the maximum pooling layer to obtain the ECG feature vector. The age and gender features are combined with the ECG feature vector, and the combined feature vector is input into the fully connected layer to obtain the first abnormality prediction probability vector.

3. The electrocardiogram diagnosis method based on artificial rule-enhanced neural network according to claim 2, characterized in that: ECG signal features are extracted through a CNN network to obtain ECG feature values, where the CNN network is a ResNet, ECGNet or Transformer algorithm.

4. The electrocardiogram diagnosis method based on artificial rule-enhanced neural network according to claim 1, characterized in that: The ECG signal training sample is input into the separation descriptor module to obtain the PQRST numerical features, including: A bandpass filter is used to filter the ECG signal to remove the burrs and offset of the ECG signal. The filtered ECG signal is decomposed and reconstructed using the wavelet transform method to obtain the R peak of the ECG signal. The ECG signal is segmented by the R peak to obtain key segments, and the first-order and second-order information processing of the P wave, QRS complex and T wave of the key segments is performed to obtain the PQRST numerical features.

5. The electrocardiogram diagnosis method based on artificial rule-enhanced neural network according to claim 1, characterized in that: A medical signal analysis rule is constructed based on the electrocardiogram diagnostic standard, and a second abnormality prediction probability vector is obtained based on the medical signal analysis rule through the PQRST numerical feature, wherein the medical signal analysis rule is the correspondence between the PQRST numerical feature and the electrocardiogram diagnostic label.

6. The electrocardiogram diagnosis method based on artificial rule-enhanced neural network according to claim 1, characterized in that: The second abnormality prediction probability vector is processed by a mask mechanism to obtain a third abnormality prediction probability vector, including: The mask mechanism is used to represent the probability of the ECG diagnostic label that is judged as not appearing by the rule reasoning submodule with 0, and the probability of the ECG diagnostic label that does not appear is added to the second abnormality prediction probability vector to obtain the third abnormality prediction probability vector, so that the third abnormality prediction probability vector has the same length as the first abnormality prediction probability vector.

7. An electrocardiogram diagnostic device based on an artificial rule-enhanced neural network, comprising a computer memory, a computer processor, and a computer program stored in the computer memory and executable on the computer processor, characterized in that: A multi-lead electrocardiogram signal diagnostic model according to any one of claims 1 to 6 is used in a computer memory; When the computer processor executes the computer program, the following steps are implemented: inputting the ECG signal into a multi-lead electrocardiogram signal diagnosis model to obtain a predicted probability of an electrocardiogram diagnosis label of the ECG signal.

Citation Information

Patent Citations

  • Font recognition by dynamically weighting multiple deep learning neural networks

    US20190147304A1

  • Systems and methods for electrocardiogram diagnosis using deep neural networks and rule-based systems

    US20210100468A1