Semi-supervised multi-label ECG abnormal event recognition method and system
Through the semi-supervised multi-label ECG abnormal event recognition method, using data augmentation and pseudo-label generation technology, the accuracy of cardiovascular disease recognition under sparse ECG data conditions is improved, the problems of inaccurate pseudo-label generation and insufficient model representation are solved, and stable ECG abnormal event recognition is achieved.
Patent Information
- Application Number
- CN202410908948.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2044-07-08
AI Technical Summary
Under the condition of sparse labeled ECG data, existing technologies find it difficult to effectively identify cardiovascular diseases, especially due to inaccurate pseudo-label generation and insufficient model representation capabilities, which lead to insufficient accuracy of deep learning models in identifying abnormal ECG events.
A semi-supervised multi-label ECG abnormal event recognition method is adopted. Data augmentation is performed through a pre-trained teacher model, a feature-label memory module is constructed, high-quality pseudo labels are generated, and pseudo labels are screened using global and local category correlations. Combined with the ECG consistency learning module, the model's ability to represent intra-class features of ECG data is improved.
In scenarios with sparse labeled data, the recognition accuracy of abnormal ECG events is improved, the dependence on labeled data is reduced, the recognition ability of the model is enhanced, and ECG intelligent assisted diagnosis is supported.
Smart Images

Figure CN118845028B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical fields of electrocardiogram (ECG) signal classification, multi-label learning, semi-supervised learning, pseudo-label learning and representation learning, and in particular to a semi-supervised multi-label ECG abnormal event recognition method and system. Background Art
[0002] Cardiovascular disease (CVD) is one of the diseases with the highest mortality rate. Electrocardiogram (ECG) is the most commonly used method for clinical detection of cardiovascular disease due to its portability and low price. Although deep learning technology has achieved certain results in identifying CVD, sufficient labeled data is a key factor in determining its recognition performance. This poses a new challenge for the deep learning task of identifying CVD, namely, how to accurately identify CVD in ECG data under the condition of sparse labeled ECG data. Solving this challenge has great clinical significance for automatically identifying CVD and reducing patient mortality.
[0003] The sparseness of labeled ECG data means that deep neural networks can only learn limited ECG knowledge under fully supervised training. Semi-supervised learning aims to utilize unlabeled ECG data to improve the performance of deep neural networks in identifying CVD. It usually generates pseudo-labels for unlabeled ECG data and constructs them for unsupervised entropy minimization training. However, for ECG data, the onset of CVD is concurrent, and there are certain correlations between diseases. Therefore, when generating pseudo-labels, the correlation between these multi-label CVD diseases needs to be considered. In addition, when learning difficult ECG samples in unlabeled data, deep neural networks often have limited representation capabilities, resulting in outliers in the features of difficult ECG samples or generating unreliable pseudo-labels for difficult ECG samples, affecting model performance. Therefore, improving the model's representation capabilities and filtering out unreliable pseudo-labels are crucial.
[0004] In summary, how to construct a semi-supervised multi-label ECG abnormal event recognition method that can effectively identify CVD in scenarios with sparse labeled ECG data is an urgent problem to be solved. Summary of the Invention
[0005] The purpose of the present invention is to solve the problems existing in the prior art and propose a semi-supervised multi-label ECG abnormal event recognition method and system, which can effectively identify various types of ECG abnormal events in scenarios with sparse labeled ECG data samples.
[0006] In order to achieve the above purpose, the technical solutions adopted are:
[0007] A semi-supervised multi-label ECG abnormal event recognition method, comprising:
[0008] Pre-training the teacher ECG classification model using labeled ECG data, and then performing data augmentation on the ECG data;
[0009] Based on the pre-trained teacher model, the features and prediction vectors of the weakly augmented dataset are extracted as elements to construct a feature-label memory module.
[0010] Based on global and local category correlations, the pseudo-label generation module generates pseudo labels for unlabeled ECG data;
[0011] Based on the double-boundary threshold strategy, the pseudo-label screening module selects high-quality pseudo-labels;
[0012] The ECG consistency learning module is used to learn the intra-class features of ECG data.
[0013] According to the semi-supervised multi-label ECG abnormal event recognition method of the present invention, further, the teacher ECG classification model includes a teacher feature extractor and a teacher classifier, the teacher feature extractor integrates a residual convolutional neural network and a multi-head self-attention network, and the teacher classifier is a multi-layer perceptron; data augmentation includes weak data augmentation and strong data augmentation, and weak data augmentation is performed on labeled ECG data to generate a weak augmented view of labeled data Unlabeled ECG data is weakly augmented and strongly augmented to generate unlabeled data weak augmentation views and strong augmentation view of unlabeled data Among them, α and ε are weak augmentation flags and strong augmentation flags respectively, l means that the data is labeled, u means that the data is unlabeled, and i represents an instance.
[0014] According to the semi-supervised multi-label ECG abnormal event recognition method of the present invention, the process of constructing the feature-label memory module is as follows: weakly augmenting the labeled data and unlabeled data weak augmentation view Input the teacher feature extractor respectively to extract feature vectors and This constructs a feature set; then these feature vectors are input into the teacher classifier and the prediction vector is output and This constructs the label set.
[0015] According to the semi-supervised multi-label ECG abnormal event recognition method of the present invention, the student ECG classification model is further trained using the augmented labeled ECG dataset and the unlabeled ECG dataset, and the student network and the teacher network structure and parameters are completely consistent; the initialization weights of the student network are the pre-trained weights of the teacher network, and the student network updates the teacher network by means of weight sliding average after each round of gradient update.
[0016] According to the semi-supervised multi-label ECG abnormal event recognition method of the present invention, further, the pseudo-label generation module generates pseudo-labels for unlabeled ECG data, including global pseudo-label generation and local pseudo-label generation;
[0017] In global pseudo-label generation, the true labels of the labeled ECG data are used as prior knowledge to calculate the relevant probabilities of the global categories. The calculation formula is as follows:
[0018]
[0019] Where y l,i,c For a labeled label x l,i The true label of class c is, y l,i,c The conditional value of ρ c,d is the correlation probability between category c and category d;
[0020] Next, the weak augmentation view of unlabeled data is extracted through the student feature extractor and student classifier The eigenvector of and output the corresponding prediction vector Calibrate the classification prediction vector using the global class correlation probability Generate pseudo labels based on global category correlation. The calculation formula of global pseudo labels is as follows:
[0021]
[0022]
[0023] Where, for The prediction vector belonging to class c, express The probability of positive correlation belonging to category c, express The probability of negative correlation belonging to category c, sigmod(·) is the logistic regression function, which adjusts the predicted probability to the range of 0 to 1, express Global pseudo labels for ;
[0024] In local pseudo-label generation, the unlabeled ECG data feature vector extracted by the student feature extractor As anchor point, based on K nearest neighbor algorithm and Euclidean distance, measure feature vector The K nearest neighbor feature elements in the feature-label memory module are calculated based on the prediction vector corresponding to the neighbor feature elements. The local pseudo label is calculated as follows:
[0025]
[0026]
[0027] Where f(·) is the metric function, is the eigenvector The kth most recent feature element in the feature-label memory module, yes The corresponding prediction vector in the label set; σ i The label contribution weight for the kth neighbor, express Local pseudo labels of ;
[0028] Finally, the weak augmentation view of unlabeled data is calculated The pseudo label is calculated as follows:
[0029]
[0030] Where γ represents the global-local pseudo-label ratio parameter, y u,i Represents a weak augmentation view of unlabeled data Pseudo labels.
[0031] According to the semi-supervised multi-label ECG abnormal event recognition method of the present invention, further, a corresponding positive boundary threshold and a negative boundary threshold are defined for each category using a double boundary threshold strategy;
[0032] In terms of calculating the positive boundary threshold, the positive boundary threshold is optimized in an adaptive update manner by calculating the increment of the overall prediction vector and the prediction vector for each category in each iteration. The threshold calculation formula is as follows:
[0033]
[0034] Where λ is a hyperparameter that controls the threshold update, represents the positive threshold of the c-th category in the t-th iteration; and reflects the learning status of the student model in terms of overall positive prediction and positive prediction of category c in the tth iteration;
[0035] In terms of calculating the negative boundary threshold, the negative boundary threshold is optimized in an adaptive update manner by calculating the reduction of the overall prediction vector and the prediction vector for each category in each iteration. The threshold calculation formula is as follows:
[0036]
[0037] Where, represents the negative threshold of the c-th class in the t-th iteration, and It reflects the learning status of the student model in terms of overall negative prediction and negative prediction of category c in the tth iteration.
[0038] According to the semi-supervised multi-label ECG abnormal event recognition method of the present invention, further, in the ECG consistency learning module, samples from the same category are defined as positive samples, and the similarity between the features of each sample is measured by cosine similarity:
[0039]
[0040] Where, Map feature vectors to the projection network P(·) The output latent vector, Predict the feature vector for the prediction network Q(·) The potential vector output by the mapping, the i-th unlabeled sample x u,i and the jth unlabeled sample x u,j With the same category, cos(·) is the cosine similarity function.
[0041] According to the semi-supervised multi-label ECG abnormal event recognition method of the present invention, a multi-label consistency loss function is further constructed:
[0042]
[0043]
[0044] Where, and Do not participate in gradient update, CL i,j Represents the unlabeled data sample x u,i and x u,j The feature consistency loss function, y u,i and y u,j Represents the unlabeled data sample x u,i and x u,j Pseudo labels, β i,j Represents the pseudo label y u,i and y u,j , 1(·) is the discriminant function, and the value is 1 when the condition in the brackets is true and 0 when the condition is false.
[0045] According to the semi-supervised multi-label ECG abnormal event recognition method of the present invention, the constructed final loss function is further used to optimize the student network. The final loss function expression is:
[0046] Loss F =Loss sup +λ1·Lossusup +λ2·Loss CL
[0047] Where λ1 and λ2 represent Loss usup and Loss CL Weight, Loss usup Is the binary cross entropy loss function for unlabeled data, Loss sup is the binary cross entropy loss function for labeled data.
[0048] Furthermore, the present invention also provides a semi-supervised multi-label ECG abnormal event recognition system for implementing the above-mentioned semi-supervised multi-label ECG abnormal event recognition method, comprising:
[0049] The pre-training and data augmentation module is used to pre-train the teacher ECG classification model using labeled ECG data and then perform data augmentation on the ECG data;
[0050] A feature-label memory module extracts the features and prediction vectors of the weakly augmented dataset as elements based on the pre-trained teacher model;
[0051] A pseudo-label generation module is used to generate pseudo-labels for unlabeled ECG data based on global and local category correlations;
[0052] Pseudo-label screening module, used to screen out high-quality pseudo-labels based on a double-boundary threshold strategy;
[0053] ECG consistency learning module is used to learn intra-class features of ECG data.
[0054] The beneficial effects achieved by adopting the above technical solution are:
[0055] The present invention proposes a semi-supervised multi-label ECG abnormal event recognition method suitable for scenarios with sparse labeled ECG data. The method generates pseudo labels that are more consistent with the CVD distribution by constructing a feature-label memory module and based on global and local category correlations; further, a double-boundary threshold strategy is used to screen out high-quality and reliable pseudo labels to reduce the impact of pseudo labels of uncertain categories on model training. The ECG consistency learning module is used to promote the model to learn the intra-class representation of ECG data, thereby improving the model's recognition accuracy for cardiovascular diseases. In short, the present invention enables deep neural networks to stably and accurately identify cardiovascular diseases even when labeled ECG data is scarce, which is beneficial to the clinical application of ECG intelligent auxiliary diagnosis technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings of the embodiments of the present invention. The drawings are only used to illustrate some embodiments of the present invention, but not to limit all embodiments of the present invention thereto.
[0057] Figure 1 1 is a flow chart of a semi-supervised multi-label abnormal ECG event recognition method according to an embodiment of the present invention;
[0058] Figure 2 is a framework diagram of a semi-supervised multi-label abnormal ECG event recognition method according to an embodiment of the present invention;
[0059] Figure 3 is a structural diagram of a feature extractor and a classifier according to an embodiment of the present invention;
[0060] Figure 4 is a list of the results of the pseudo-label generation method according to an embodiment of the present invention and other advanced methods;
[0061] Figure 5 It is a radar chart showing the results of the pseudo-label generation method according to an embodiment of the present invention and other advanced methods;
[0062] Figure 6 is a list of the results of the semi-supervised ECG representation learning method according to an embodiment of the present invention and other advanced methods;
[0063] Figure 7 is an ROC curve diagram of the results of the semi-supervised ECG representation learning method according to an embodiment of the present invention and other advanced methods;
[0064] Figure 8 This is a bar chart of the results of the semi-supervised ECG representation learning method according to an embodiment of the present invention with different label proportions. DETAILED DESCRIPTION
[0065] The following will be combined with the accompanying drawings of specific embodiments of the present invention to clearly and completely describe the exemplary embodiments of the present invention. Unless otherwise defined, technical or scientific terms used in the present invention should be given the common meanings understood by people with ordinary skills in the relevant field.
[0066] The semi-supervised multi-label ECG abnormal event recognition method of this embodiment is used to solve the problem of insufficient CVD diagnosis accuracy caused by sparse labeled ECG data, such as Figure 1 and Figure 2 As shown, the following steps are included:
[0067] Step S101: pre-train a teacher ECG classification model using labeled ECG data, and then perform data augmentation on the ECG data.
[0068] Step S102: extracting the features and prediction vectors of the weakly augmented data set as elements based on the pre-trained teacher model to construct a feature-label memory module.
[0069] Step S103: Based on the global and local category correlations, the pseudo label generation module generates pseudo labels for the unlabeled ECG data.
[0070] Step S104: Based on the double-boundary threshold strategy, the pseudo-label screening module screens out high-quality pseudo-labels.
[0071] Step S105: Using the ECG consistency learning module to learn intra-class features of the ECG data.
[0072] In this embodiment, the ECG data set is expressed as formulas (1) and (2).
[0073] X L ={x l,1 ,…x l,i ,…,x l,n},i∈N l (1)
[0074] X U ={x u,1 ,…x u,i ,…,x u,n’},i∈N u (2)
[0075] Where, X L and X U Represent the labeled ECG dataset and the unlabeled ECG dataset respectively, x l,i and x u,i X L and X U ECG data of a certain instance, N l and N u X L and X U The total number of instances.
[0076] In the teacher model pre-training stage, the labeled ECG dataset X is used L Pre-trained teacher feature extractor F T (·) and the teacher classifier H T (·), where F T (·) Integrates residual convolutional neural network and multi-head self-attention network, H T (·) is a multi-layer perceptron, F T (·) and H T (·) Network structure such as Figure 3As shown in the figure, binary cross entropy is used as the loss function to minimize the entropy of high-dimensional features and data labels, and the teacher feature extractor and teacher classifier are trained, as shown in the following formula (5).
[0077]
[0078]
[0079] Where x l,i is the i-th ECG data in the labeled data, l means the data is labeled (conversely, u means the data is unlabeled), M is the total number of label categories, N l is the total number of labeled data samples, y l,i For labeled data x l,i The true label of (in one-hot encoding form). RES(·) and MHA(·) are residual convolutional neural networks and multi-head self-attention networks, respectively. and F T (·) and H T (·) Output feature vector and prediction vector.
[0080] Next, random data augmentation is performed on the ECG data, including conversion methods such as signal zeroing, signal flipping, channel reorganization, and random noise. Here, only one type of data augmentation is randomly performed on the labeled ECG data, which is defined as weak augmentation. The unlabeled ECG data is subjected to weak augmentation and strong augmentation respectively. Strong augmentation means randomly performing less than or equal to four of the above conversion methods. The augmentation process is shown in the following formula (6) as an example. The labeled data weak augmentation view, unlabeled data weak augmentation view, and unlabeled data strong augmentation view generated by data augmentation are respectively expressed as and Among them, α and ε are weak augmentation flag and strong augmentation flag respectively.
[0081]
[0082] Where x i,v,t represents the amplitude of the ECG data at the sth sampling point in the vth lead of the i-th case. A1, A2, A3, and A4 represent signal zeroing, signal inversion, channel reorganization, and random noise, respectively.
[0083] In terms of constructing the feature-label memory module, the feature-label memory module is divided into feature set and label set. and unlabeled data weak augmentation view Input the teacher feature extractor F respectively T (·) to extract the feature vector and Then input these feature vectors into the teacher classifier H T(·), output prediction vector and To this end, the feature set consists of a set of labeled ECG dataset feature vectors and the unlabeled ECG dataset feature vector set As shown in the following formula (7). The label set is composed of the predicted vector set of the labeled ECG dataset and the unlabeled ECG dataset prediction vector set The composition is shown in the following formula (8).
[0084]
[0085] In addition, the feature set and label set in the feature-label memory module are associated with each other through the subscripts l, u, and i, and both the feature set and the label set are updated with the semi-supervised training iterations.
[0086] In semi-supervised training, the augmented labeled ECG dataset and the unlabeled ECG dataset are used to train the student feature extractor and the student classifier. In this embodiment, the structure and parameters of the student feature extractor and the student classifier (i.e., the student network) are exactly the same as those of the teacher feature extractor and the teacher classifier (i.e., the teacher network), which are represented by F S (·) and H S The student network’s initial weights are the pre-trained weights of the teacher network. After each round of gradient update, the student network updates the teacher network using a sliding average of the weights.
[0087] During training, for labeled ECG datasets, training is performed according to the binary cross-entropy loss function in formula (5). For unlabeled ECG datasets, a pseudo-label generation module is required to generate pseudo-labels for them. The student model generates pseudo-labels in the pseudo-label generation module, and the generation process is divided into global pseudo-label generation and local pseudo-label generation.
[0088] In the generation of global pseudo labels, the correlation of CVD diseases is calculated based on the labels of the labeled ECG data. The co-occurrence probability between diseases is used to further optimize the student model prediction vector, thereby improving the correlation between diseases in the pseudo labels. Specifically, the true labels of the labeled ECG data are used as prior knowledge to calculate the correlation probability of the global categories, as shown in the following formula (10):
[0089]
[0090] Where y l,i,c For a labeled label x l,i The true label of class c is, y l,i,C The conditional value of ρ C,d is the relative probability of category c and category d.
[0091] During training, the student feature extractor and student classifier are used to extract weak augmentation views of unlabeled data. And output the corresponding prediction vector, as shown in equations (11) and (12) below.
[0092]
[0093]
[0094] Where, F S (·) and H S (·) are student feature extractors and student classifiers respectively, and are the feature vector and prediction vector of the augmented view to be identified.
[0095] Next, the classification prediction vector is calibrated using the global category correlation probability Generate pseudo labels based on global category correlation as shown in Equation (17).
[0096]
[0097] Where, yes The component in the cth category, The prediction vector belonging to class c, express The probability of positive correlation belonging to category c, express The probability of negative correlation belonging to category c, sigmod(·) is the logistic regression function, which adjusts the predicted probability to the range of 0 to 1, express The global pseudo-label of .
[0098] In the local pseudo-label generation, since the label distribution of adjacent samples is similar, all sample features and prediction vectors (features and prediction vectors are generated by the teacher model) are used to construct a feature-label memory module, and the labels of the nearest neighbor samples are used to adjust the pseudo-label distribution. Specifically, the unlabeled ECG data feature vector extracted by the student feature extractor is As the anchor point, in the feature-label memory module, based on the K nearest neighbor algorithm and Euclidean distance, K features with the same distribution as the feature vector are measured. The nearest neighbor feature vector element. Then, based on the feature-label mapping in the feature-label memory module, the prediction vector corresponding to these neighbor feature vector elements is calculated. The local pseudo label of is as shown in the following formula (20).
[0099]
[0100] Where f(·) is the metric function, is the eigenvector The kth most recent feature element in the feature-label memory module, yes The corresponding prediction vector in the label set; σ i The label contribution weight for the kth neighbor, express local pseudo labels.
[0101] Finally, based on the global pseudo-labels and local pseudo-labels, the weak augmentation view of the unlabeled data is calculated The comprehensive pseudo label of is shown in the following formula (21).
[0102]
[0103] Where γ represents the global-local pseudo-label ratio parameter, y u,i Represents a weak augmentation view of unlabeled data Pseudo labels.
[0104] In order to verify the ECG pseudo-label generation method of this embodiment, the ECG pseudo-label generation method of the present invention was implemented in three multi-label 12-lead multi-label arrhythmia ECG datasets (Chapman dataset, G12EC dataset, PTB-XL dataset), and compared with the pseudo-label generation methods proposed by Sohn et al., Rizve et al., and Zhou et al. to verify the effectiveness of the pseudo-label generation method of the present invention. Figure 4 This is a table that records the experimental results of the pseudo-label generation method of the present invention and other advanced pseudo-label generation methods. The evaluation indicators are MAP, AUC and F1 (the closer the three indicators are to 1, the better). Figure 5 Figures 5a, 5b, and 5c show radar plots of the experimental results of the pseudo-label generation method proposed by the present invention and those proposed by Sohn et al., Rizve et al., and Zhou et al. on three datasets. Because MAP, AUC, and F1 metrics have different scales, these metrics have been normalized and converted to a range between 0 and 0.5. A larger radar plot area indicates a better overall performance. Figure 4 and Figure 5 The pseudo-labels of the present invention performed best in all the experiments, indicating that the pseudo-label generation method of the present invention is more stable and provides higher-quality pseudo-labels for unlabeled data. In summary, the pseudo-label generation method of the present invention can effectively improve the training effect of the model in semi-supervised training and achieve higher recognition accuracy.
[0105] To reduce the impact of pseudo-labels of uncertain categories in the pseudo-label generation module during semi-supervised training, a dual-boundary threshold strategy is used to define corresponding positive and negative boundary thresholds for each category. The positive threshold determines if a pseudo-label belongs to that category, while the negative threshold determines if a pseudo-label does not belong to that category. Pseudo-labels between the positive and negative thresholds are considered uncertain. Both the positive and negative thresholds are updated adaptively. If a pseudo-label has a confidence level between the positive and negative thresholds, it is considered uncertain.
[0106] In terms of calculating the positive boundary threshold, based on the overall maximum prediction vector and category prediction vector of each iteration, the learning status of the current student model is evaluated from both the overall and category aspects, and the positive boundary threshold is adaptively calculated. The threshold calculation is shown in the following formula (24).
[0107]
[0108] Where λ is a hyperparameter that controls the threshold update, represents the positive threshold of the c-th category in the t-th iteration; and reflects the learning status of the student model in terms of overall positive prediction and positive prediction of category c in the tth iteration, and the initial values of the two and Both are 0.5, so that all unlabeled ECG data are involved in the early model training.
[0109] In calculating the negative boundary threshold, the learning status of the current student model is also evaluated from both the overall and category perspectives. The difference is that the overall evaluation is based on the overall minimum prediction vector of each iteration to reflect the overall negative prediction. The calculation method is to subtract the current prediction vector from the previous round threshold to adaptively update the negative boundary threshold, as shown in the following formula (27).
[0110]
[0111] Where, represents the negative threshold of the c-th class in the t-th iteration, and Reflects the learning status of the student model in terms of overall negative prediction and negative prediction of category c in the tth iteration, and the initial values of the two and Both are 0.5.
[0112] Combined with the pseudo label y generated by the unlabeled ECG data in the pseudo label generation module u,i , entropy is minimized using the binary cross entropy loss function to train the student network, as shown in Equation (29).
[0113]
[0114] Where 1(·) is the discriminant function, which is 1 when the condition in the brackets is true and 0 when the condition is false.
[0115] The ECG consistency learning module includes consistency alignment tasks and label similarity weights, thereby promoting the expression of ECG intra-class features and improving the model's ability to learn ECG abnormal event features. In the consistency alignment task, based on the pseudo labels generated for each unlabeled sample by the present invention, samples of the same category are regarded as positive samples, and the similarity between the features of each sample is measured using cosine similarity. The similarity is then optimized in the form of entropy reduction to maximize the feature consistency of samples of the same category. Specifically, samples from the same category are first defined as positive samples, and the similarity between the features of each sample is measured using cosine similarity to narrow the distance between the positive samples to maximize the intra-class consistency, as shown in the following formula (30).
[0116]
[0117]
[0118] Where, Map feature vectors to the projection network P(·) The output latent vector, Predict the feature vector for the prediction network Q(·) The potential vector output by the mapping, the i-th unlabeled sample x u,i and the jth unlabeled sample x u,j With the same category, cos(·) is the cosine similarity function.
[0119] According to the above cosine similarity, the feature consistency loss function is constructed in the form of 1-cos(·), as shown in the following formula (33).
[0120]
[0121] Where, and Do not participate in gradient update, CL i,j Represents the unlabeled data sample x u,i and x u,j The feature consistency loss function is used.
[0122] For label similarity weights, the pseudo-labels are used as a reference to calculate the similarity of pseudo-labels for similar samples. Label similarity is used as a weight to measure the feature similarity between samples, thereby constraining the degree of feature alignment between samples. Specifically, the unlabeled data pseudo-labels obtained in the pseudo-label generation module are used to calculate the label similarity between samples, as shown in the following formula (34).
[0123]
[0124] Where y u,i and y u,j Represents the unlabeled data sample x u,i and x u,j Pseudo labels, β i,j represents the pseudo label y u,i and y u,j Similarity
[0125] According to the positive boundary threshold and negative boundary threshold calculated in the pseudo-label screening module and the sample label similarity, combined with the consistency loss function, a multi-label consistency loss function is constructed, as shown in the following formula (35).
[0126]
[0127] Finally, the binary cross entropy loss function Loss is used to calculate the loss of labeled data. sup , unlabeled data binary cross entropy loss function Loss usup And multi-label consistency loss function Loss CL , construct the final loss function of the present invention, as shown in the following formula (36).
[0128] Loss F =Loss sup +λ1·Loss usup +λ2·Loss CL (36)
[0129] Where λ1 and λ2 represent Loss usup and Loss CL The weight of .
[0130] Minimizing formula (36) realizes semi-supervised learning of ECG signal features in a scenario with sparse labeled data samples and completes multi-label ECG abnormal event classification.
[0131] In order to verify the semi-supervised ECG representation learning method of the present invention, the present invention was implemented in three multi-label 12-lead multi-label arrhythmia ECG datasets, namely the Chapman dataset, G12EC, and PTB-XL, and compared with the semi-supervised learning models proposed by Berthelot et al., Zhang(a) et al., Chen(a) et al., Chen(b) et al., Wang et al., Huang et al., and Zhang(b) et al., to verify the representation learning ability of the semi-supervised learning framework of the present invention. Figure 6 The three lists a, b and c are the experimental results of the semi-supervised learning framework proposed in this invention and the above-mentioned advanced semi-supervised methods on the Chapman, G12EC and PTB-XL datasets. The evaluation indicators are still MAP, AUC and F1. Figure 6 It can be seen that the present invention obviously performs best on the three data sets, which further illustrates that the representation learning method of the present invention is effective in semi-supervised scenarios. Figure 7 Figures 7a, 7b, 7c, 7d, and 7e are the ROC curves for the semi-supervised learning model of the present invention and the advanced semi-supervised learning model for each class (the larger the curve area, the better). It is not difficult to see that the present invention achieves optimal performance in four of the five classes and suboptimal performance in one, which once again demonstrates that the present invention enables the deep learning model to focus more on intra-class learning. Figure 8 The performance of the present invention and an advanced semi-supervised learning framework at different labeled data ratios (labeled data sample size to total data sample size) is shown. It can be seen that the present invention's semi-supervised learning framework is optimal at all ratios. In summary, the present invention, as a semi-supervised representation learning method, can effectively improve the ability to identify abnormal ECG events after pre-training, reducing reliance on labeled data samples and alleviating workload for medical professionals.
[0132] Corresponding to the above method, this embodiment also proposes a semi-supervised multi-label ECG abnormal event recognition system, comprising:
[0133] The pre-training and data augmentation module is used to pre-train the teacher ECG classification model using labeled ECG data and then perform data augmentation on the ECG data.
[0134] The feature-label memory module extracts the features and prediction vectors of the weakly augmented dataset as elements based on the pre-trained teacher model.
[0135] The pseudo-label generation module is used to generate pseudo-labels for unlabeled ECG data based on global and local category correlations.
[0136] The pseudo-label filtering module is used to filter out high-quality pseudo-labels based on a double-boundary threshold strategy.
[0137] ECG consistency learning module is used to learn intra-class features of ECG data.
[0138] Unless otherwise specifically stated, the relative steps, numerical expressions and values of the components and steps set forth in these embodiments do not limit the scope of the present invention.
[0139] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the systems disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method description.
[0140] The units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. A person of ordinary skill in the art may use different methods to implement the described functions for each specific application, but such implementation is not considered to be beyond the scope of the present invention.
[0141] Those skilled in the art will appreciate that all or part of the steps in the above method can be performed by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a magnetic disk, or an optical disk. Alternatively, all or part of the steps in the above embodiment can be implemented using one or more integrated circuits. Accordingly, each module / unit in the above embodiment can be implemented in the form of hardware or software functional modules. The present invention is not limited to any specific combination of hardware and software.
[0142] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the above-described embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-described embodiments within the technical scope disclosed by the present invention, or replace some of the technical features therein with equivalents. Such modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.
Claims
1. A semi-supervised multi-label ECG abnormal event recognition method, characterized in that: Include: Step 1: Use labeled ECG data to pre-train the teacher ECG classification model, and then perform data augmentation on the ECG data; The teacher ECG classification model includes a teacher feature extractor and a teacher classifier. The teacher feature extractor integrates a residual convolutional neural network and a multi-head self-attention network, and the teacher classifier is a multi-layer perceptron. Data augmentation includes weak data augmentation and strong data augmentation. Weak data augmentation is performed on labeled ECG data to generate a weak augmentation view of labeled data. , the unlabeled ECG data are weakly augmented and strongly augmented respectively to generate the unlabeled data weak augmentation view and strong augmentation view of unlabeled data ,in, and are weak augmentation flag and strong augmentation flag respectively, l Indicates that the data is marked. u Indicates that the data is unlabeled. Indicates an instance; Step 2: Based on the pre-trained teacher model, the features and prediction vectors of the weakly augmented dataset are extracted as elements to construct a feature-label memory module. The process of constructing the feature-label memory module is as follows: weakly augment the labeled data view and unlabeled data weak augmentation view Input the teacher feature extractor respectively to extract feature vectors and , in order to construct a feature set; then input these feature vectors into the teacher classifier and output the prediction vector and , to construct a label set; Step 3: Based on the global and local category correlations, the pseudo label generation module generates pseudo labels for the unlabeled ECG data, including global pseudo label generation and local pseudo label generation; In global pseudo-label generation, the true labels of the labeled ECG data are used as prior knowledge to calculate the relevant probabilities of the global categories. The calculation formula is as follows: ; Where, For marked labels In the The true label of the class, for The conditional value of For the Class and The relative probability of the class; Next, the weak augmentation view of unlabeled data is extracted through the student feature extractor and student classifier The eigenvector of and output the corresponding prediction vector , using the global category-related probabilities to calibrate the classification prediction vector , generate pseudo labels based on global category correlation, and the calculation formula of global pseudo labels is as follows: ; ; ; ; Where, for Belong to The prediction vector of the class, express Belong to The probability of positive correlation between classes, express Belong to Negative correlation probability of the class, Logistic regression function adjusts the predicted probability to the range of 0 to 1. express Global pseudo labels for ; In local pseudo-label generation, the unlabeled ECG data feature vector extracted by the student feature extractor As anchor point, based on K Nearest neighbor algorithm and Euclidean distance, measuring feature vector In the feature-label memory module K The nearest neighbor feature elements are calculated based on the prediction vector corresponding to the neighbor feature elements The local pseudo label is calculated as follows: ; ; Where, is the metric function, is the eigenvector In the feature-label memory module k The nearest feature element, yes The corresponding prediction vector in the label set; For the k The label contribution weight of each neighbor, express Local pseudo labels of ; Finally, the weak augmentation view of unlabeled data is calculated The pseudo label is calculated as follows: Where, represents the global-local pseudo-label ratio parameter, Represents a weak augmentation view of unlabeled data Pseudo labels of Step 4: Based on the double-boundary threshold strategy, the pseudo-label screening module selects high-quality pseudo-labels; A double boundary threshold strategy is used to define the corresponding positive boundary threshold and negative boundary threshold for each category; In terms of calculating the positive boundary threshold, the positive boundary threshold is optimized in an adaptive update manner by calculating the increment of the overall prediction vector and the prediction vector for each category in each iteration. The threshold calculation formula is as follows: ; ; Where, is a hyperparameter that controls the threshold update, Indicates in In the round of iteration Positive threshold for the class; and Reflects the student model in t The overall positive prediction and the first learning status in terms of category-positive prediction; In terms of calculating the negative boundary threshold, the negative boundary threshold is optimized in an adaptive update manner by calculating the reduction of the overall prediction vector and the prediction vector for each category in each iteration. The threshold calculation formula is as follows: ; ; Where, Indicates in In the round of iteration Negative threshold for the class, and Reflects the student model in The overall negative prediction and the first the state of learning in terms of category negative prediction; Step 5: Use the ECG consistency learning module to learn the intra-class features of ECG data.
2. The semi-supervised multi-label ECG abnormal event recognition method according to claim 1, characterized in that: The student ECG classification model is trained using the augmented labeled ECG dataset and the unlabeled ECG dataset. The structure and parameters of the student network are exactly the same as those of the teacher network. The initialization weights of the student network are the pre-trained weights of the teacher network. After each round of gradient update, the student network updates the teacher network by a weight sliding average.
3. The semi-supervised multi-label ECG abnormal event recognition method according to claim 1, characterized in that: In the ECG consistency learning module, samples from the same category are defined as positive samples, and the similarity between the features of each sample is measured by cosine similarity: ; ; Where, For projection network Mapping feature vectors The output latent vector, For prediction network Prediction feature vector The potential vector output by the mapping is i unlabeled samples Hedi j unlabeled samples With the same category, is the cosine similarity function.
4. The semi-supervised multi-label ECG abnormal event recognition method according to claim 3, characterized in that: Construct a multi-label consistency loss function: ; ; Where, and Do not participate in gradient updates. Represents unlabeled data samples and The feature consistency loss function is and Represents unlabeled data samples and Pseudo labels, Pseudo-labels and The similarity of is the discriminant function, which is 1 when the condition in the brackets is true and 0 when the condition is false.
5. The semi-supervised multi-label ECG abnormal event recognition method according to claim 4, characterized in that: The constructed final loss function is used to optimize the student network. The final loss function expression is: Where, and express and The weight of is the binary cross entropy loss function for unlabeled data, is the binary cross entropy loss function for labeled data.
6. A semi-supervised multi-label ECG abnormal event recognition system, characterized by: The method for implementing the semi-supervised multi-label abnormal ECG event recognition method according to any one of claims 1 to 5 comprises: The pre-training and data augmentation module is used to pre-train the teacher ECG classification model using labeled ECG data and then perform data augmentation on the ECG data; A feature-label memory module extracts the features and prediction vectors of the weakly augmented dataset as elements based on the pre-trained teacher model; A pseudo-label generation module is used to generate pseudo-labels for unlabeled ECG data based on global and local category correlations; Pseudo-label screening module, used to screen out high-quality pseudo-labels based on a double-boundary threshold strategy; ECG consistency learning module is used to learn intra-class features of ECG data.
Citation Information
Patent Citations
Semi-supervised rotating target detection method based on local space consistency prior information
CN117893916A
Semi-supervised three-dimensional shape segmentation method and device based on self-training
CN118071763A