An interpretable method and system for auxiliary diagnostic models of ventricular premature beats
By combining layer-by-layer correlation propagation and Bayesian models, the contribution and uncertainty of waveform features in electrocardiogram (ECG) data are obtained, and a decision tree is constructed. This solves the limitations of existing ECG data processing techniques and improves the accuracy and interpretability of ventricular premature beat diagnosis.
Patent Information
- Application Number
- CN202510210346.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-25
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2045-02-25
AI Technical Summary
Existing interpretable methods have limitations when processing complex electrocardiogram data, leading to reduced accuracy in the diagnosis of premature ventricular contractions.
A layer-by-layer correlation propagation interpretability method is adopted. Starting from the output layer of the ventricular premature beat auxiliary diagnosis model, the correlation score is propagated back to the input layer layer by layer to obtain the contribution of each waveform feature to the predicted classification result. The uncertainty is calculated by Bayesian model and a decision tree is constructed to improve the interpretability and accuracy of the model.
It improves the accuracy of ventricular premature beat diagnosis, increases the credibility and transparency of the model in clinical applications, and helps doctors make more reliable decisions.
Smart Images

Figure CN120131035B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electrocardiogram signal analysis technology, and in particular to an interpretable method, system, and computer-readable storage medium for an auxiliary diagnostic model of premature ventricular contractions. Background Technology
[0002] Electrocardiography (ECG), as a non-invasive tool for examining heart health, is widely used in the screening, diagnosis, and monitoring of heart diseases. In recent years, with the rapid development of medical imaging technology, sensor technology, and deep learning algorithms, the accuracy and efficiency of ECG analysis have been significantly improved.
[0003] In traditional electrocardiogram (ECG) analysis, doctors typically rely on manual methods to identify various abnormalities. While this approach offers high accuracy, it still involves a degree of error and workload. With the application of deep learning, particularly the introduction of convolutional neural networks and recurrent neural networks, automated ECG analysis has made significant progress. Premature ventricular contraction (PVC) auxiliary diagnostic models can automatically extract complex features from large amounts of ECG data and perform classification, prediction, and abnormality detection based on these features. These technologies greatly improve the efficiency and accuracy of ECG analysis, especially in the detection of arrhythmias such as PVCs.
[0004] However, as the complexity of auxiliary diagnostic models for premature ventricular contractions (PVCs) continues to increase, the "black box" nature of these models has become a major obstacle in clinical application. Physicians often cannot directly understand how the model arrives at the target classification result, which limits its use in clinical decision-making. To overcome this problem, model interpretability has gradually become a research hotspot. Common interpretability methods include Local Interpretable Model-Agnostic Explanations (LIME) and SHAP (SHapley Additive exPlanations). These interpretability methods improve model transparency by analyzing the model's decision-making mechanism on specific inputs. While they provide some interpretability, they still have limitations in processing complex electrocardiogram (ECG) data. Especially in the medical field, existing interpretability methods are often oversimplified and cannot accurately reflect the feature interactions in time-series data. Particularly in complex ECG signal processing, they cannot fully demonstrate the actual contribution of different ECG features to the target classification result. For example, LIME cannot effectively capture the temporal and nonlinear characteristics of ECG waveforms, resulting in low reliability and accuracy of its interpretation results. While SHAP can provide a contribution score for each feature, its computational and resource consumption is extremely high in ECG data analysis. Especially on large-scale ECG datasets, the computational overhead of SHAP often makes its application inefficient and unable to meet the needs of real-time clinical diagnosis.
[0005] In summary, existing interpretable methods still have limitations when processing complex electrocardiogram (ECG) data, reducing the efficiency and accuracy of ECG data analysis, and consequently leading to a decrease in the accuracy of ventricular premature beat diagnosis. Summary of the Invention
[0006] Therefore, the technical problem to be solved by the present invention is to overcome the limitations of existing interpretable methods in processing complex electrocardiogram data, which leads to a decrease in the accuracy of ventricular premature beat diagnosis.
[0007] To address the aforementioned technical problems, this invention provides an interpretable method for an auxiliary diagnostic model of ventricular premature beats, comprising:
[0008] The preprocessed electrocardiogram image is input into the trained ventricular premature beat auxiliary diagnosis model, and the predicted classification results of ventricular premature beats are output.
[0009] A layer-by-layer correlation propagation interpretability method is adopted, starting from the output layer of the ventricular premature beat auxiliary diagnosis model, and the correlation score is propagated back to the input layer layer by layer to obtain the contribution of each waveform feature to the prediction classification result; wherein, the correlation score of the output layer is obtained based on the prediction classification result of ventricular premature beats;
[0010] The statistical features of the contribution of each waveform feature to the predicted classification result are obtained and input into the Bayesian model to calculate the uncertainty of the predicted classification result of ventricular premature beats.
[0011] A decision tree is constructed based on the contribution of each waveform feature to the predicted classification result and the uncertainty of the predicted classification result, and the target classification result is obtained.
[0012] Preferably, acquiring and preprocessing electrocardiogram (ECG) images includes:
[0013] The original electrocardiogram image containing 12 leads was converted to grayscale and then cropped. The cropped electrocardiogram image was then denoised.
[0014] The denoised electrocardiogram image is divided along the middle axis, and the right half of the image is stitched below the left half of the image and aligned according to the time sequence.
[0015] The desired heart rate signal is selected from the aligned image, cropped, and divided into 12 sub-images according to the lead signal;
[0016] The 12 sub-images are stitched together along the depth direction to obtain the preprocessed electrocardiogram image.
[0017] Preferably, a local neighborhood-based filtering method is used to denoise the cropped electrocardiogram image, including:
[0018] For each pixel x in the cropped electrocardiogram image ab Calculate the average value of its 3×3 neighborhood using the following formula:
[0019]
[0020] in, Represents pixel x ab The neighborhood average, x a+m,b+n Represents pixel x ab The neighboring pixels, where m and n represent the neighboring index values of the horizontal and vertical coordinates, respectively;
[0021] If the average value of a pixel's neighborhood is greater than 200, then the value of that pixel is set to 255.
[0022] Preferably, the ventricular premature beat auxiliary diagnostic model includes a number of 3×3 convolutional layers, a number of residual blocks, an average pooling layer, a 5×1 convolutional layer, and a fully connected layer connected in sequence; the residual block includes two 3×3 convolutional layers and an SE attention block connected in sequence, and the input features of the residual block and the output features of the SE attention block are skip-connected.
[0023] Preferably, a layer-by-layer correlation propagation interpretability method is employed. Starting from the output layer of the ventricular premature beat auxiliary diagnostic model, the correlation scores are propagated back to the input layer layer by layer to obtain the contribution of each waveform feature to the predicted classification result, including:
[0024] The correlation of the i-th pixel node in the feature map of the l-th layer electrocardiogram image of the auxiliary diagnostic model for ventricular premature beats. The calculation formula is:
[0025]
[0026] Where, n l+1 The number of pixel nodes in the (l+1)th layer. This represents the activation value of the k-th pixel node in the (l+1)-th layer. This represents the weighted sum of the inputs to the i-th pixel node in the l-th layer. σ' represents the correlation of the k-th pixel node in the (l+1)-th layer; σ′ is the derivative of the activation function σ. This represents the input weighted sum, obtained by weighting and summing the activation values of all pixel nodes in the l-th layer, where n... l The number of pixel nodes in the l-th layer. Let represent the weight connecting the j-th pixel node in layer l to the k-th pixel node in layer (l+1). Represents the activation value of the j-th pixel node in the l-th layer. This represents the weight connecting the i-th pixel node in layer l to the k-th pixel node in layer (l+1).
[0027] The correlation score is backpropagated layer by layer to the input layer. The correlation of all pixel nodes in the feature map of the ECG image in the input layer constitutes a contribution heatmap. The contribution of each waveform feature to the prediction classification result is obtained through the contribution heatmap.
[0028] Preferably, the weights connecting the i-th pixel node in the l-th layer to the k-th pixel node in the (l+1)-th layer are... The calculation method is as follows: calculate the weights from the i-th pixel node in the l-th layer to the k-th pixel node in the (l+1)-th layer based on spatial distance. Where d(k,i) represents the spatial distance between the i-th pixel node in layer l and the k-th pixel node in layer (l+1), and σ1 represents the hyperparameter controlling the weight decay.
[0029] Preferably, the statistical features of the contribution of each waveform feature to the predicted classification result are obtained and input into the Bayesian model. The uncertainty of the predicted classification result of ventricular premature beats is calculated using the MC Dropout method, including:
[0030] The Bayesian model performs multiple random forward propagations, and the mean of the prediction probabilities of each random forward propagation is calculated based on the prediction probabilities of each random forward propagation.
[0031] Obtain the statistical characteristics of the contribution of each waveform feature to the predicted classification result, including the mean and variance of the contribution of each waveform feature to the predicted classification result; calculate the uncertainty of the predicted classification result of ventricular premature beats based on the mean of the predicted probability of random forward propagation and the statistical characteristics of the contribution of each waveform feature to the predicted classification result.
[0032] Preferably, the uncertainty of the predicted classification result of ventricular premature beats is calculated based on the mean of the predicted probability of random forward propagation and the statistical characteristics of the contribution of each waveform feature to the predicted classification result, using the following formula:
[0033]
[0034] Among them, U c This indicates the uncertainty of the predicted classification result c for premature ventricular contractions (PVCs). Let T represent the mean of the predicted probabilities from the random forward propagation, and let T represent the number of random forward propagations. f1 represents the prediction probability of the t-th random forward propagation; f2 and f1 represent the mean and variance of the contribution of each waveform feature to the prediction classification result, respectively.
[0035] This invention also provides an interpretable system for an auxiliary diagnostic model of ventricular premature beats, comprising:
[0036] The classification module is used to input the preprocessed electrocardiogram image into the trained ventricular premature beat auxiliary diagnostic model and output the predicted classification results of ventricular premature beats.
[0037] The contribution acquisition module is used to employ a layer-by-layer correlation propagation interpretability method, starting from the output layer of the ventricular premature beat auxiliary diagnosis model, and propagating the correlation scores back to the input layer layer by layer to obtain the contribution of each waveform feature to the prediction classification result; wherein, the correlation score of the output layer is obtained based on the prediction classification result of ventricular premature beats;
[0038] The uncertainty acquisition module is used to acquire the statistical features of the contribution of each waveform feature to the prediction classification result and input them into the Bayesian model to calculate the uncertainty of the prediction classification result of ventricular premature beats.
[0039] The decision module is used to construct a decision tree based on the contribution of each waveform feature to the predicted classification result and the uncertainty of the predicted classification result, so as to obtain the target classification result.
[0040] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described interpretable method for an auxiliary diagnostic model of ventricular premature beats.
[0041] Compared with the prior art, the above-described technical solution of the present invention has the following advantages:
[0042] This invention discloses an interpretable method for an auxiliary diagnostic model of ventricular premature beats (PVCs). First, a predicted classification result is obtained through the PVC auxiliary diagnostic model. Then, a layer-by-layer correlation propagation interpretability method is used to obtain the contribution of each waveform feature to the classification result. The contribution of each waveform feature to the classification result is input into a Bayesian model, and a Bayesian deep network is used to calculate the uncertainty of the predicted classification result of PVCs. Finally, a decision tree is constructed based on the contribution of each waveform feature to the classification result and the uncertainty of the classification result to obtain the target classification result of PVCs. This invention not only improves the accuracy of PVC diagnosis but also increases the credibility and transparency of the model in clinical applications through uncertainty assessment and interpretability analysis, enabling doctors to make more reliable decisions. Attached Figure Description
[0043] To make the content of this invention easier to understand, the invention will be further described in detail below with reference to specific embodiments and accompanying drawings, wherein:
[0044] Figure 1 This is a flowchart of an interpretable method for an auxiliary diagnostic model of ventricular premature beats according to the present invention;
[0045] Figure 2This is a patient statistics chart from Example 1;
[0046] Figure 3 This is an example of a raw electrocardiogram image;
[0047] Figure 4 This is an example image of a cropped electrocardiogram (ECG).
[0048] Figure 5 This is an example image of a preprocessed electrocardiogram (ECG).
[0049] Figure 6 This is a structural diagram of an auxiliary diagnostic model for ventricular premature beats;
[0050] Figure 7 This is a heatmap illustration of LRP contribution, in which... Figure 7 a) in the figure is a heatmap illustration of the contribution of category 0. Figure 7 b) in the figure is a heatmap illustration of the contribution of category 1. Figure 7 c) in the figure is a heatmap illustration of the contribution of category 2. Figure 7 In Figure d), the contribution heatmap diagram for category 3 is shown. Figure 7 e) in the figure is a heatmap illustration of the contribution of category 4. Figure 7 f) in the figure is a heatmap illustration of the contribution of category 5;
[0051] Figure 8 This is an example diagram of a decision parsing tree. Detailed Implementation
[0052] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, so that those skilled in the art can better understand and implement the present invention. However, the embodiments described are not intended to limit the present invention.
[0053] Reference Figure 1 As shown, this invention provides an interpretable method for an auxiliary diagnostic model of ventricular premature beats, comprising:
[0054] S1: Acquire electrocardiogram images and perform preprocessing.
[0055] This embodiment uses real data from patients who underwent premature ventricular ablation at the First Affiliated Hospital of Soochow University to illustrate the technical solution of this invention in detail. All data was manually collected by several professional cardiologists and underwent rigorous review and screening. Patients were divided into six categories, such as... Figure 2 As shown, categories 0 and 1 account for 77% of the images, while categories 2 to 5 account for only 23%, so it can be said that the data is imbalanced.
[0056] S1 specifically includes the following steps:
[0057] S101: Convert the original electrocardiogram image containing 12-lead signals to grayscale, crop it, and then perform noise reduction processing on the cropped electrocardiogram image;
[0058] S102: Divide the denoised electrocardiogram image along the middle axis, stitch the right half of the image below the left half of the image, and align them according to the time sequence;
[0059] S103: Select the required heartbeat signal from the aligned image, crop it, and divide it into 12 sub-images according to the lead signal;
[0060] S104: Stitch the 12 sub-images along the depth direction to obtain the preprocessed electrocardiogram image.
[0061] In this embodiment, each electrocardiogram image contains signals from 12 leads, and the original image size is 3×1346×2496, as shown below. Figure 3 As shown. However, the electrocardiogram (ECG) signal itself does not depend on color information. Therefore, the ECG image is converted from RGB format to grayscale, simplifying the image to have only one layer, resulting in an image size of 1×1346×2496. At this point, the image only contains grayscale information. The original ECG image contains background noise, especially light gray grid points and other interfering points. These elements do not contain useful information and may negatively impact subsequent deep learning model training. Therefore, it is necessary to remove the edge regions of the image, as these areas typically do not contain effective signals. The cropped image size is 1×1100×2496, as shown. Figure 4 As shown in the image. Next, the cropped electrocardiogram image is subjected to noise reduction processing.
[0062] To remove background noise, this embodiment employs a local neighborhood-based filtering method. For each pixel x in the cropped electrocardiogram image... ab Calculate the average value of its 3×3 neighborhood using the following formula:
[0063]
[0064] in, Represents pixel x ab The neighborhood average, x a+m,b+n Represents pixel x ab The neighboring pixels, m and n represent the neighborhood index values respectively.
[0065] After calculating the average value of the neighborhood, noise reduction is performed according to the following condition: If the average value of a pixel's neighborhood is greater than 200 (i.e., the area is mostly white with little information), then the value of that pixel is set to 255, as expressed by the formula:
[0066]
[0067] The advantage of this filtering method is that it avoids the traditional Gaussian filtering approach, which directly replaces each pixel value with the average value of the neighborhood. This method eliminates irrelevant background by setting the pixel value to 255, without affecting the electrocardiogram signal.
[0068] After image denoising, heartbeat extraction continues. Each ECG image contains multiple heartbeat cycles. To extract effective heartbeat data, appropriate heartbeat segments are selected based on the ECG structure. Since the original ECG image is divided into two parts (the left side contains limb leads and enhanced limb leads, and the right side contains chest leads V1-V6), directly extracting a single heartbeat from the image is difficult. To align the signals of the 12 leads, the original image needs to be divided along the central axis, and the right half of the image (chest lead signals) is stitched below the left half of the image to ensure that the leads are aligned in time sequence. Next, the required heartbeat signals are selected from the aligned image and cropped. Typically, 1 to 4 heartbeat cycles are retained in each ECG image, and redundant parts are discarded. Finally, each ECG image is divided into 12 sub-images, each corresponding to one lead signal. The height of each sub-image is 1 / 12 of the original image, and the time sequence of each lead signal is stored separately.
[0069] Finally, the 12 sub-images are stitched together along the depth direction to obtain the preprocessed electrocardiogram image. Each sub-image still retains the original signal, but is arranged in time series, which facilitates processing and training of deep learning models.
[0070] Assume each subgraph is I k (k=1,2,…,12), then the final stitched image I final It can be represented as:
[0071] I final =concat(I1,I2,...,I 12 )
[0072] Here, concat() means to stitch the subgraphs together along the depth direction.
[0073] Through this series of preprocessing operations, a final electrocardiogram image of suitable size for the input of a deep learning model is obtained, such as... Figure 5 As shown, redundant information in the preprocessed electrocardiogram image has been effectively removed, and the signal has been sufficiently enhanced, making it suitable for subsequent model training and inference.
[0074] S2: Input the preprocessed electrocardiogram image into the trained ventricular premature beat auxiliary diagnostic model and output the predicted classification results of ventricular premature beats.
[0075] In this embodiment, the predicted classification results of ventricular premature beats include: right ventricular outflow tract as category 0, left ventricular outflow tract as category 1, papillary muscle as category 2, valve annulus as category 3, peak as category 4, and His bundle-Pukkenyo fiber system as category 5.
[0076] This invention employs a hybrid model architecture combining convolutional neural networks (CNN), Squeeze-and-Excitation Networks (SENet), and residual structures, referring to... Figure 6 As shown, the constructed auxiliary diagnostic model for premature ventricular contractions (PVCs) comprises several 3×3 convolutional layers, several residual blocks, an average pooling layer, a 5×1 convolutional layer, and a fully connected layer connected in sequence. Each residual block consists of two consecutive 3×3 convolutional layers and an SE attention block, with the input features of the residual block and the output features of the SE attention block connected in a skip connection.
[0077] Within the residual block, convolutional layers are used to extract local features from the electrocardiogram signal, particularly key waveforms such as the QRS wave, P wave, and T wave. The calculation formula is as follows:
[0078]
[0079] Where, x i′+m′,j′+n′ W represents a local region of the input signal. m′,n′ y is the convolution kernel, b is the bias term, and y is the bias term. i′,j′ This is the feature map output by the convolution.
[0080] By introducing the SE channel attention mechanism, the SE module first compresses the features of each convolutional channel through global average pooling, generating a channel-level global feature description. The formula is expressed as:
[0081]
[0082] Among them, e c′ This represents the global feature description of the c′-th channel, where H and W are the height and width of the feature map, respectively, and x... i′j′c′ Let be the feature value of position (i′j′) in channel c′.
[0083] Next, the features are recalibrated using two fully connected layers, and the channel weight coefficients are generated using the sigmoid activation function:
[0084] s c′ =σ(W2.ReLU(W1.e c′ )
[0085] Where W1 and W2 are the learned weight matrices, e c′It is the channel feature after global pooling, s c′ These are the weighting coefficients generated for each channel.
[0086] The output of the SE module is used to weight the original channel features to obtain new channel features:
[0087] y c ′=s c ′.x c ′
[0088] Through this weighted operation, the model can focus more on feature channels crucial for the diagnosis of premature ventricular contractions (PVCs), thereby improving overall diagnostic performance. To further improve training efficiency and avoid the vanishing gradient problem, a residual structure is also introduced into the model. Residual connections, through skip connections, directly pass the input of each layer to subsequent layers, allowing information to propagate along shorter paths and reducing information loss in deep networks. The formula for implementing the residual structure is as follows:
[0089] y = f(x, {W i})+x
[0090] Where x is the input, f(x,{W i}) represents the output of the transformation performed by convolution and the SE module, and y represents the final output of the residual structure.
[0091] During model training, the cross-entropy loss function is used, combined with L2 regularization to prevent overfitting.
[0092]
[0093] Among them, y i For actual labels, For the prediction result, N is the total number of samples. The Adam optimizer is used to optimize the parameters, and a dynamic learning rate is set to ensure that the model converges efficiently.
[0094] S3: Employing a layer-by-layer correlation propagation interpretability method, starting from the output layer of the ventricular premature beat (VPB) auxiliary diagnostic model, the correlation scores are propagated back to the input layer layer by layer to generate a contribution heatmap, obtaining the contribution of each waveform feature to the predicted classification result; wherein, the correlation score of the output layer is obtained based on the predicted classification result of VPB. The waveform features include QRS complex, T wave, P wave, and other waveform features.
[0095] After model training, interpretability analysis is performed using the Layer-wise Relevance Propagation (LRP) method. The LRP method calculates the contribution of each input feature to the model's decision result through layer-by-layer backpropagation. Given a neuron R... jThe activation value is used to calculate the contribution of LRP to the input neuron as follows:
[0096]
[0097] Among them, R i For the correlation of input feature i, a i w is the activation value for this feature. ij For connection weights, R j This represents the correlation value of the neurons in the previous layer. In this step, starting from the output layer, the propagation proceeds backward layer by layer to progressively determine the contribution of each input feature.
[0098] However, some studies have attempted to enhance the interpretability of ventricular premature beat (PVC) auxiliary diagnostic models by combining layer-wise relevance propagation (LRP) methods. LRP generates heatmaps by analyzing the activation of each layer of the model to demonstrate the contribution of different input features to the model's decisions. However, existing LRP methods mainly focus on image classification tasks, have poor adaptability to one-dimensional signals such as electrocardiograms, and lack an effective combination for assessing the complexity and uncertainty of PVC auxiliary diagnostic models.
[0099] This invention considers that electrocardiogram (ECG) signals are one-dimensional signals with unique waveform characteristics, and that traditional LRP methods have adaptability issues when applied. To address this, this invention makes the following improvement: each pixel in the ECG is treated as a node, and node-by-node correlation propagation is performed. For input layer nodes, their value is the grayscale value of the corresponding pixel in the image. In the convolutional layer, the input of a node is a weighted sum of the outputs of the nodes in the previous layer, calculated as described above using the convolution method. For output layer nodes, their correlation... The initialization (L being the last layer) is determined based on the prediction results. For node i in the l-th layer, its correlation... The calculation needs to consider the contribution of the correlation of its next-level nodes. According to the chain rule, the contribution of node i to the correlation of its next-level node k (at the (l+1)th level) is: First calculate because and so so Therefore, the correlation of the i-th node in the l-th layer The calculation formula is:
[0100]
[0101] Where, n l+1 The number of nodes in the (l+1)th layer. This represents the activation value of the k-th node in the (l+1)-th layer. This represents the weighted sum of the inputs to the i-th node in the l-th layer. Let represent the correlation of the k-th node in the (l+1)-th layer; σ′ is the derivative of the activation function σ. This represents the weighted sum of the inputs, obtained by summing the activation values of all nodes in the l-th layer. l Let l be the number of nodes in the l-th layer. Let represent the weight connecting the j-th node in layer l and the k-th node in layer (l+1). Let represent the activation value of the j-th node in the l-th layer. This represents the weight connecting the i-th node in layer l to the k-th node in layer (l+1). This represents the activation value of the i-th node in the l-th layer.
[0102] During the calculation process, due to the spatial characteristics of the data, the weights connecting the i-th node in the l-th layer to the k-th node in the (l+1)-th layer... The calculation method is as follows: calculate the weights from the i-th node in the l-th layer to the k-th node in the (l+1)-th layer based on spatial distance. Where d(k,i) represents the spatial distance between the i-th node in layer l and the k-th node in layer (l+1), and σ1 represents the hyperparameter controlling the weight decay. This approach makes correlation propagation more consistent with the spatial characteristics of an electrocardiogram, emphasizing the influence between spatially adjacent or related nodes.
[0103] The correlation score is backpropagated layer by layer to the input layer. The correlation of all pixel nodes in the feature map of the ECG image in the input layer constitutes a contribution heatmap. The contribution of each waveform feature to the prediction classification result is obtained through the contribution heatmap.
[0104] In this embodiment, the method for obtaining the contribution of each waveform feature to the predicted classification result through a contribution heatmap may include: firstly, automatically locating the spatial position of each waveform feature in the electrocardiogram image using an attention mechanism; then, extracting the correlation scores of all pixels within the target waveform feature region from the contribution heatmap; and finally, summing the correlation scores of the pixels within the region into a single value. To compare the relative importance of different waveform features, the contribution is finally normalized to obtain the contribution of each waveform feature to the predicted classification result.
[0105] Considering an electrocardiogram (ECG) signal of a premature ventricular contraction (PVC), after LRP analysis, a contribution heatmap will show which waveform features in the ECG contribute most to the prediction results. For example... Figure 7 As shown, where Figure 7 a) in the figure is a heatmap illustration of the contribution of category 0. Figure 7 b) in the figure is a heatmap illustration of the contribution of category 1. Figure 7c) in the figure is a heatmap illustration of the contribution of category 2. Figure 7 In Figure d), the contribution heatmap diagram for category 3 is shown. Figure 7 e) in the figure is a heatmap illustration of the contribution of category 4. Figure 7 f) in the diagram illustrates the contribution heatmap for category 5. The LRP analysis shows that the model's focus areas for each category align with physicians' clinical focus, indicating their impact on PVC diagnosis. These heatmaps help physicians understand how the model makes diagnostic judgments, comprehend the model's decision-making basis, and improve the model's interpretability in clinical practice.
[0106] S4: Obtain the statistical features of the contribution of each waveform feature to the predicted classification result and input them into the Bayesian model to calculate the uncertainty of the predicted classification result of ventricular premature beats.
[0107] In recent years, several Bayesian uncertainty estimation methods have been introduced into medical diagnosis to quantify the model's confidence in its predictions. Bayesian methods can provide more reliable diagnostic support by inferring the uncertainty of the output. However, most existing Bayesian estimation methods operate independently of ventricular premature beat auxiliary diagnostic models and fail to effectively integrate the feature learning capabilities of deep learning, resulting in significant room for improvement in the model's uncertainty assessment.
[0108] Therefore, this invention combines a Bayesian model with multiple random forward propagations to assess uncertainty during the inference phase. This part quantifies the model's uncertainty by calculating a weighted average prediction variance. In the decision tree part, a decision tree is constructed through contribution ranking and uncertainty assessment, and finally, the category is predicted based on contribution and uncertainty. For the classification of electrocardiogram signals, the combination of the Bayesian model and the decision tree enables more accurate inference and decision-making.
[0109] Specifically, the statistical features of the contribution of each waveform feature to the classification result are obtained and input into the Bayesian model. The uncertainty of the predicted classification result of ventricular premature beats is calculated using the MC Dropout method, including:
[0110] In the Bayesian model, the mean of the prediction probability of the random forward propagation is calculated by using the prediction probability of each random forward propagation through multiple random forward propagations.
[0111] Obtain the statistical characteristics of the contribution of each waveform feature to the classification result, including the mean and variance of the contribution of each waveform feature to the classification result; calculate the uncertainty of the predicted classification result of ventricular premature beats based on the mean of the predicted probability of random forward propagation and the statistical characteristics of the contribution of each waveform feature to the classification result.
[0112] In this embodiment, the statistical features of the contribution of each waveform feature to the classification result are used to evaluate the uncertainty of each category. Through Bayesian inference, the output distribution can be simulated through multiple random forward propagations, and the variance and uncertainty of the predictions can be calculated (estimated using a weighted average prediction variance formula). Specifically, in the input stage of the Bayesian model, the input statistical features F = {f1, f2, f3, f4} are used. For example, the statistical features F of the QRS wavegroup region... QRS ={0.75, 0.12, 0.6, 1.2}. During the inference phase, T random forward propagations are performed, and the predicted probability of each propagation is recorded. The formula for calculating the mean of the predicted probability is:
[0113]
[0114] The uncertainty of the predicted classification result of ventricular premature beats is calculated based on the mean of the predicted probability of random forward propagation and the statistical characteristics of the contribution of each waveform feature to the classification result. The formula is as follows:
[0115]
[0116] Among them, U c This indicates the uncertainty of the predicted classification result c for premature ventricular contractions (PVCs). Let T represent the mean of the predicted probabilities from the random forward propagation, and let T represent the number of random forward propagations. f1 represents the predicted probability of the t-th random forward propagation; f2 and f1 represent the mean and variance of the contribution of each waveform feature to the classification result, respectively.
[0117] S5: Construct decision trees for each category based on the contribution of each waveform feature to the predicted classification result and the uncertainty of the predicted classification result as input features to obtain the target classification result. The categories are the classification categories of ventricular premature beats.
[0118] In the decision tree construction logic, each waveform feature is sorted according to its contribution to the predicted classification result, and the waveform feature with the highest contribution to the predicted classification result is selected as the splitting feature. A decision threshold is selected based on the uncertainty of the predicted classification result corresponding to the current node of the decision tree; this decision threshold includes a lenient threshold and a strict threshold. Finally, the contribution of each waveform feature to the predicted classification result is judged against the decision threshold, and the predicted classification result of ventricular premature beats is updated based on the judgment result to obtain the target classification result.
[0119] This example uses category 0 (right ventricular outflow tract, RVOT) as an example. Assuming an input electrocardiogram image, the model performs T = 50 forward propagations. For each forward propagation, the model outputs a probability distribution, which may include predicted probabilities for category 0 (RVOT) and other categories (e.g., categories 1 to 5). Assuming the predicted results for category 0 (RVOT) after 50 forward propagations are as follows (each value represents the probability of category 0): in Let represent the predicted probability of class 0 in the t-th forward propagation. To evaluate the final prediction result for class 0, calculate the average of all 50 forward propagation results: This average represents the model's final predicted probability for category 0. Meanwhile, the uncertainty is calculated by determining the variance of these predictions. A smaller variance indicates that the model is more confident in predicting category 0; a larger variance indicates that the model has higher uncertainty in predicting that category. The mean predicted probability for category 0 is obtained through 50 forward propagations. The uncertainty U0 = 0.002. In Bayesian inference, uncertainty U0 is used to adjust the classification rules of the decision tree. For example, if the model has high uncertainty in predicting class 0, the decision tree may choose to apply a stricter classification threshold to make a decision.
[0120] The waveform features are sorted according to their contribution to the predicted classification results: QRS group (R QRS =0.45), T wave (R T =0.3), P wave ( RP =0.2), other features. Select the QRS wavegroup with the highest contribution as the splitting feature. If the uncertainty U of the category corresponding to the current node of the decision tree is 0.2), c If the value is less than 0.1, a lenient threshold (such as R) is used. QRS >0.4); if U c If the value is ≥0.1, then a strict threshold (e.g., R) is used. QRS >0.6).
[0121] Now, R QRS R T R p The decision tree is constructed using the contribution features of category 0 (U0) and the prediction uncertainty of category 0 (U0) as input features. In the decision tree for category 0 (RVOT), the QRS complex has the largest contribution, while the T and P waves also have some influence on the decision outcome. The decision parse tree is as follows: Figure 8As shown, in this decision parse tree, the first step is to check if the prediction uncertainty U0 for category 0 (RVOT) is less than 0.1. If U0 < 0.1, it indicates that the model has high confidence in predicting category 0, and the process continues based on the contribution R of the QRS group. QRS The following steps are taken to determine the category. If the QRS complex contribution is greater than 0.4, the T wave contribution is further examined. If the T wave contribution is greater than 0.25, the final prediction is category 0 (RVOT); otherwise, it is predicted as category 1 (LVOT). If the QRS complex contribution is less than or equal to 0.4, the P wave contribution is examined instead. If the P wave contribution is greater than 0.15, the prediction is category 2 (PM); otherwise, it is predicted as category 3 (VA).
[0122] When U0 ≥ 0.1, it indicates that the model has high uncertainty in predicting category 0, and the prediction will be based on the contribution R of the QRS group. QRS Further decision-making. If the contribution of the QRS complex is greater than 0.5, the contribution of the T wave is then considered. If the contribution of the T wave is greater than 0.3, it is predicted as category 4 (Summit); otherwise, it is predicted as category 5 (HPS). If the contribution of the QRS complex is less than or equal to 0.5, the next decision node is reached, checking the contribution of the P wave. If the contribution of the P wave is greater than 0.2, it is predicted as category 2 (PM); otherwise, it is predicted as category 3 (VA). Overall, the contribution of the QRS complex plays the most important role in predicting category 0, while the T and P waves have some influence on the classification results, especially when uncertainty is high. The contributions of the T and P waves help the model make the final decision. This provides doctors with a clear decision-making path, helps them understand the model's reasoning process, and increases their confidence in the model.
[0123] In summary, the interpretable method for an auxiliary diagnostic model of ventricular premature beats (PVCs) described in this invention first obtains the predicted classification result through the PVC auxiliary diagnostic model. Then, it obtains the contribution of each waveform feature to the classification result through a layer-by-layer correlation propagation interpretability method. The contribution of each waveform feature to the classification result is input into a Bayesian model, and a Bayesian deep network is used to calculate the uncertainty of the predicted classification result of PVCs. Finally, a decision tree is constructed based on the contribution of each waveform feature to the classification result and the uncertainty of the classification result to obtain the target classification result of PVCs. This invention not only improves the accuracy of PVC diagnosis but also increases the credibility and transparency of the model in clinical applications through uncertainty assessment and interpretability analysis, helping doctors make more reliable decisions.
[0124] Example 2
[0125] Based on the interpretable method for an auxiliary diagnostic model of ventricular premature beats described in Embodiment 1, this embodiment provides an interpretable system for an auxiliary diagnostic model of ventricular premature beats, including:
[0126] The preprocessing acquisition module is used to acquire electrocardiogram images and perform preprocessing.
[0127] The classification module is used to input the preprocessed electrocardiogram image into the trained ventricular premature beat auxiliary diagnostic model and output the predicted classification results of ventricular premature beats.
[0128] The contribution acquisition module uses a layer-by-layer correlation propagation interpretability method to propagate the correlation scores back to the input layer layer by layer from the output layer of the ventricular premature beat auxiliary diagnosis model, thereby obtaining the contribution of each waveform feature to the classification result and generating a contribution heatmap; wherein, the correlation score of the output layer is obtained based on the predicted classification result of ventricular premature beats;
[0129] The uncertainty acquisition module is used to acquire the statistical features of the contribution of each waveform feature to the classification result and input them into the Bayesian model to calculate the uncertainty of the predicted classification result of ventricular premature beats.
[0130] The decision module is used to construct a decision tree based on the contribution of each waveform feature to the classification result and the uncertainty of the classification result, so as to obtain the target classification result.
[0131] This embodiment also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described interpretable method for an auxiliary diagnostic model of ventricular premature beats.
[0132] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0133] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0134] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0135] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0136] Obviously, the above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.
Claims
1. An interpretable method for an auxiliary diagnostic model of ventricular premature beats, characterized in that, include: The preprocessed electrocardiogram image is input into the trained ventricular premature beat auxiliary diagnosis model, and the predicted classification results of ventricular premature beats are output. A layer-by-layer correlation propagation interpretability method is adopted, starting from the output layer of the ventricular premature beat auxiliary diagnosis model, and the correlation score is propagated back to the input layer layer by layer to obtain the contribution of each waveform feature to the prediction classification result; wherein, the correlation score of the output layer is obtained based on the prediction classification result of ventricular premature beats; The statistical features of the contribution of each waveform feature to the predicted classification result are obtained and input into the Bayesian model to calculate the uncertainty of the predicted classification result of ventricular premature beats. A decision tree is constructed based on the contribution of each waveform feature to the predicted classification result and the uncertainty of the predicted classification result, and the target classification result is obtained.
2. The interpretable method for an auxiliary diagnostic model of ventricular premature beats according to claim 1, characterized in that, Acquire electrocardiogram (ECG) images and perform preprocessing, including: The original electrocardiogram image containing 12 leads was converted to grayscale and then cropped. The cropped electrocardiogram image was then denoised. The denoised electrocardiogram image is divided along the middle axis, and the right half of the image is stitched below the left half of the image and aligned according to the time sequence. The desired heart rate signal is selected from the aligned image, cropped, and divided into 12 sub-images according to the lead signal; The 12 sub-images are stitched together along the depth direction to obtain the preprocessed electrocardiogram image.
3. The interpretable method for an auxiliary diagnostic model of ventricular premature beats according to claim 2, characterized in that, A local neighborhood-based filtering method is used to denoise the cropped electrocardiogram image, including: For each pixel x in the cropped electrocardiogram image ab Calculate the average value of its 3×3 neighborhood. The formula is: in, Represents pixel x ab The neighborhood average, x a+m,b+n Represents pixel x ab The neighboring pixels, where m and n represent the neighboring index values of the horizontal and vertical coordinates, respectively; If the average value of a pixel's neighborhood is greater than 200, then the value of that pixel is set to 255.
4. The interpretable method for an auxiliary diagnostic model of ventricular premature beats according to claim 1, characterized in that, The ventricular premature beat auxiliary diagnostic model includes several 3×3 convolutional layers, several residual blocks, an average pooling layer, a 5×1 convolutional layer, and a fully connected layer connected in sequence; the residual block includes two 3×3 convolutional layers and an SE attention block connected in sequence, and the input features of the residual block and the output features of the SE attention block are skip-connected.
5. The interpretable method for an auxiliary diagnostic model of ventricular premature beats according to claim 1, characterized in that, A layer-by-layer correlation propagation interpretability method is employed. Starting from the output layer of the ventricular premature beat auxiliary diagnostic model, the correlation scores are propagated back to the input layer layer by layer to obtain the contribution of each waveform feature to the predicted classification result, including: The correlation of the i-th pixel node in the feature map of the l-th layer electrocardiogram image of the auxiliary diagnostic model for ventricular premature beats. The calculation formula is: Where, n l+1 The number of pixel nodes in the (l+1)th layer. This represents the activation value of the k-th pixel node in the (l+1)-th layer. This represents the weighted sum of the inputs to the i-th pixel node in the l-th layer. σ' represents the correlation of the k-th pixel node in the (l+1)-th layer; σ′ is the derivative of the activation function σ. This represents the input weighted sum, obtained by weighting and summing the activation values of all pixel nodes in the l-th layer, where n... l The number of pixel nodes in the l-th layer. Let represent the weight connecting the j-th pixel node in layer l to the k-th pixel node in layer (l+1). Represents the activation value of the j-th pixel node in the l-th layer. This represents the weight connecting the i-th pixel node in layer l to the k-th pixel node in layer (l+1). The correlation score is backpropagated layer by layer to the input layer. The correlation of all pixel nodes in the feature map of the ECG image in the input layer constitutes a contribution heatmap. The contribution of each waveform feature to the prediction classification result is obtained through the contribution heatmap.
6. The interpretable method for an auxiliary diagnostic model of ventricular premature beats according to claim 5, characterized in that, The weights connecting the i-th pixel node in layer l to the k-th pixel node in layer (l+1) The calculation method is as follows: calculate the weights from the i-th pixel node in the l-th layer to the k-th pixel node in the (l+1)-th layer based on spatial distance. Where d(k,i) represents the spatial distance between the i-th pixel node in layer l and the k-th pixel node in layer (l+1), and σ1 represents the hyperparameter controlling the weight decay.
7. The interpretable method for an auxiliary diagnostic model of ventricular premature beats according to claim 1, characterized in that, The statistical features of the contribution of each waveform feature to the predicted classification result are obtained and input into the Bayesian model. The uncertainty of the predicted classification result of ventricular premature beats is calculated using the MCDropout method, including: The Bayesian model performs multiple random forward propagations, and the mean of the prediction probabilities of each random forward propagation is calculated based on the prediction probabilities of each random forward propagation. Obtain the statistical characteristics of the contribution of each waveform feature to the predicted classification result, including the mean and variance of the contribution of each waveform feature to the predicted classification result; calculate the uncertainty of the predicted classification result of ventricular premature beats based on the mean of the predicted probability of random forward propagation and the statistical characteristics of the contribution of each waveform feature to the predicted classification result.
8. The interpretable method for an auxiliary diagnostic model of ventricular premature beats according to claim 7, characterized in that, The uncertainty of the predicted classification result of ventricular premature beats is calculated based on the mean of the predicted probability of random forward propagation and the statistical characteristics of the contribution of each waveform feature to the predicted classification result. The formula is as follows: Among them, U c This indicates the uncertainty of the predicted classification result c for premature ventricular contractions (PVCs). Let T represent the mean of the predicted probabilities from the random forward propagation, and let T represent the number of random forward propagations. f1 represents the prediction probability of the t-th random forward propagation; f2 and f1 represent the mean and variance of the contribution of each waveform feature to the prediction classification result, respectively.
9. An interpretable system for an auxiliary diagnostic model of ventricular premature beats, characterized in that, include: The classification module is used to input the preprocessed electrocardiogram image into the trained ventricular premature beat auxiliary diagnostic model and output the predicted classification results of ventricular premature beats. The contribution acquisition module is used to employ a layer-by-layer correlation propagation interpretability method, starting from the output layer of the ventricular premature beat auxiliary diagnosis model, and propagating the correlation scores back to the input layer layer by layer to obtain the contribution of each waveform feature to the prediction classification result; wherein, the correlation score of the output layer is obtained based on the prediction classification result of ventricular premature beats; The uncertainty acquisition module is used to acquire the statistical features of the contribution of each waveform feature to the prediction classification result and input them into the Bayesian model to calculate the uncertainty of the prediction classification result of ventricular premature beats. The decision module is used to construct a decision tree based on the contribution of each waveform feature to the predicted classification result and the uncertainty of the predicted classification result, so as to obtain the target classification result.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of an interpretable method for an auxiliary diagnostic model of ventricular premature beats as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Optimization method for brain glioma prognosis prediction model
CN119092106A
KR20220091714A