Pre-tag based self-supervised neural network learning method and system for heartbeat classification
By using a self-supervised neural network learning method, one-dimensional ECG data is converted into two-dimensional time-frequency maps. Combining SimCLR and Gaussian clustering, this method solves the problems of traditional heartbeat classification relying on prior knowledge and supervised learning relying on labeled data, thus achieving efficient heartbeat data classification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-15
- Publication Date
- 2026-03-24
AI Technical Summary
Traditional heart rate classification methods rely on feature extraction based on prior knowledge, which limits classification performance. Furthermore, supervised deep learning requires a large amount of labeled information, resulting in low accuracy in ECG data classification.
A pre-label-based self-supervised neural network learning method is adopted. Supervised information is mined from unlabeled data through Siamese networks and clustering methods. One-dimensional ECG data is converted into two-dimensional time-frequency maps. SimCLR and Gaussian clustering methods are used for model training to generate pre-labels to improve classification accuracy.
Without requiring manual labeling, it improves the classification accuracy and precision of heart rate data, reduces reliance on label data, and achieves efficient classification results.
Smart Images

Figure CN116028858B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the technical field of automatic intelligent auxiliary detection of electrocardiograms, specifically to a method and system for heartbeat classification based on pre-labeled self-supervised neural network learning. Background Technology
[0002] The statements in this section are merely background information relating to this disclosure and do not necessarily constitute prior art.
[0003] Traditional heartbeat classification methods mainly fall into two categories: feature extraction-based machine learning algorithms and feature-free deep learning methods. Deep learning methods are further divided into supervised learning methods and unsupervised learning methods, with self-supervised learning methods being a novel technology.
[0004] Traditional machine learning algorithms, when applied to heartbeat data, require manual extraction of features in the time and frequency domains based on prior experience. When feature extraction-based machine learning algorithms are used for heartbeat classification, a suitable classifier is selected and trained based on the extracted features. Therefore, the selected features have a crucial impact on classification performance. Traditional machine learning algorithms rely on prior knowledge in the early stages of feature extraction; insufficient prior knowledge or weak feature selection negatively affects the final classification performance. The classifier design is limited by feature extraction capabilities and cannot accurately reflect the internal properties of the ECG signal. This makes the performance of heartbeat classification highly dependent on the correctness and accuracy of feature selection, affecting the accuracy of the classification results. Furthermore, traditional machine learning algorithms often suffer from complex design, high mathematical requirements for designers, and massive computational demands.
[0005] When classifying heartbeats using supervised deep learning algorithms, feature extraction is unnecessary. The preprocessed raw data can be used as input to the neural network for direct classification. The raw data can be extracted from professional databases or clinical raw test data. Features extracted from each layer of the neural network based on the raw output are used for final classification. Supervised deep learning methods often achieve very good performance, but they share two common problems: first, model training requires a large amount of labeled training data, which is time-consuming and expensive in real-world scenarios; second, ECG data is one-dimensional, containing limited information and resulting in low classification accuracy. Summary of the Invention
[0006] To address the aforementioned issues, this disclosure proposes a pre-labeled self-supervised neural network-based method and system for heartbeat classification. By constructing a Siamese network, it extracts supervised information from unlabeled data through comparison. Simultaneously, it introduces a clustering method to further enhance the learning effect, thereby achieving good classification results in a data training environment that does not require manual labeling.
[0007] To achieve the above objectives, the present disclosure adopts the following technical solution:
[0008] One or more embodiments provide a pre-labeled self-supervised neural network-based method for learning heartbeat classification, comprising the following steps:
[0009] The acquired electrocardiogram (ECG) data is preprocessed to obtain heart rate data;
[0010] The acquired one-dimensional heart rate data was converted into a two-dimensional time-frequency graph through time-frequency analysis.
[0011] The converted two-dimensional time-frequency image is input into a trained self-supervised learning network model to classify the heartbeat data and obtain the classification results.
[0012] The self-supervised learning network model uses a clustering method to pre-label the transformed two-dimensional time-frequency image at the beginning of each training round. The training loss function includes contrastive learning loss and the angle loss between the cluster center and each type of sample. The model is trained in a contrastive learning manner to obtain a well-trained model.
[0013] One or more embodiments provide a pre-labeled self-supervised neural network-based heartbeat classification system, including:
[0014] Preprocessing module: configured to preprocess the acquired ECG data to obtain heart rate data;
[0015] Conversion module: configured to perform time-frequency analysis on the acquired one-dimensional heartbeat data and convert it into a two-dimensional time-frequency graph;
[0016] The classification module is configured to input the converted two-dimensional time-frequency image into a trained self-supervised learning network model to classify the heartbeat data and obtain the classification results.
[0017] The self-supervised learning network model uses a clustering method to pre-label the transformed two-dimensional time-frequency image at the beginning of each training round. The training loss function includes contrastive learning loss and the angle loss between the cluster center and each type of sample. The model is trained in a contrastive learning manner to obtain a well-trained model.
[0018] An electronic device includes a memory and a processor, as well as computer instructions stored in the memory and running on the processor, wherein the computer instructions, when executed by the processor, perform the steps described in the above method.
[0019] A computer-readable storage medium for storing computer instructions, which, when executed by a processor, perform the steps described in the above method.
[0020] Compared with the prior art, the beneficial effects of this disclosure are as follows:
[0021] In this disclosure, one-dimensional data is converted into two-dimensional data, which can extract more information from the data and improve the accuracy of data classification. Furthermore, by combining the SimCLR method and clustering method, the loss function term is changed from one to two, which enhances the learning effect and improves the classification accuracy of heartbeat data.
[0022] The advantages of this disclosure, as well as its additional advantages, will be described in detail in the following specific embodiments. Attached Figure Description
[0023] The accompanying drawings, which form part of this disclosure, are used to provide a further understanding of this disclosure. The illustrative embodiments of this disclosure and their descriptions are used to explain this disclosure and do not constitute a limitation thereof.
[0024] Figure 1 This is a flowchart of the heart rate classification method according to Embodiment 1 of this disclosure;
[0025] Figure 2 This is a flowchart of wavelet denoising in Embodiment 1 of this disclosure;
[0026] Figure 3 Here is a diagram showing the effect of wavelet denoising in Embodiment 1 of this disclosure: Figure 3 (a) is the signal before wavelet transform. Figure 3 (b) is the signal after wavelet denoising;
[0027] Figure 4 This is an example signal diagram of a complete heartbeat data extracted in Embodiment 1 of this disclosure;
[0028] Figure 5 This is Embodiment 1 of the present disclosure. Figure 4 Two-dimensional spectrogram of the heartbeat data after Wegener distribution transformation;
[0029] Figure 6 This is a flowchart of the training method of the self-supervised learning method of Embodiment 1 of this disclosure;
[0030] Figure 7 This is the process of the pre-labeled self-supervised learning method after incorporating Gaussian clustering in Embodiment 1 of this disclosure. Detailed Implementation
[0031] The present disclosure will be further described below with reference to the accompanying drawings and embodiments.
[0032] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of this disclosure. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure pertains.
[0033] It should be noted that the terminology used herein is for descriptive purposes only and is not intended to limit the exemplary embodiments according to this disclosure. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof. It should be noted that, without conflict, the various embodiments and features within those embodiments can be combined with each other. The embodiments will now be described in detail with reference to the accompanying drawings.
[0034] Example 1
[0035] In one or more of the technical solutions disclosed in the embodiments, such as Figures 1-7 As shown, the self-supervised neural network learning method for heartbeat classification based on pre-labels includes the following steps:
[0036] Step 1: Preprocess the acquired electrocardiogram data to obtain heart rate data;
[0037] Step 2: Perform time-frequency analysis on the acquired one-dimensional heart rate data to convert it into a two-dimensional time-frequency graph;
[0038] Step 3: Input the converted two-dimensional time-frequency graph into the trained self-supervised learning network model to classify the heartbeat data and obtain the classification results;
[0039] The self-supervised learning network model uses a clustering method to pre-label the transformed two-dimensional time-frequency graph at the beginning of each training round. The training loss function includes contrastive learning loss and ProtoNEC loss, which is the angle between the cluster center and each type of sample. The model is trained in a contrastive learning manner to obtain a well-trained model.
[0040] In this embodiment, converting one-dimensional data into two-dimensional data allows for the extraction of more information from the data, improving the accuracy of data classification. Furthermore, combining self-supervised learning methods (i.e., the SimCLR method) and clustering methods transforms the loss function from one term to two terms, enhancing the learning effect and improving the accuracy of heartbeat data classification.
[0041] In step 1, data preprocessing includes data denoising and heartbeat extraction.
[0042] Optionally, wavelet transform can be used for data denoising, specifically including the following steps:
[0043] (1) The acquired electrocardiogram signal is preprocessed and subjected to wavelet transform multiscale decomposition.
[0044] Optionally, a wavelet can be selected and the number of decomposition levels N can be determined, and then the signal can be decomposed into N levels.
[0045] (2) Denoise the wavelet coefficients after wavelet transform.
[0046] (2.1) Threshold quantization is performed on the high-frequency coefficients of wavelet decomposition. Specifically, soft thresholding or hard thresholding is selected for the high-frequency coefficients from the first layer to the Nth layer.
[0047] (2.2) One-dimensional wavelet reconstruction: Based on the low-frequency coefficients of the Nth layer of wavelet decomposition and the high-frequency coefficients from the first layer to the Nth layer, one-dimensional reconstruction is performed.
[0048] (3) Perform inverse transformation on the data with denoised coefficients to restore the signal and obtain the denoised ECG data.
[0049] The key to wavelet transform denoising lies in how to select the threshold and determine the wavelet basis. In this embodiment, db5 can be used as the wavelet function for decomposition. The specific denoising effect is as follows: Figure 3 As shown.
[0050] In some embodiments, the heart rate extraction method includes the following steps:
[0051] Step 11: Process the denoised electrocardiogram signal (ECG signal) to locate the QRS wave. For the location and detection of the QRS wave, the Pan-Tompkins algorithm is used to achieve accurate location and detection of the R wave.
[0052] Step 12: After detecting the position of the R wave on the ECG signal, the heartbeat signal is truncated with the R wave position as the center, and the truncated heartbeat data is normalized.
[0053] Based on the position of the R wave, all heartbeat signals on the ECG signal are captured. Specifically, in this embodiment, 128 points are taken to the left and 128 points to the right of the R wave position, for a total of 256 points.
[0054] Due to differences in data quantification, large range variations, or high self-variability, classification errors may increase. Normalization can resolve classification errors caused by these differences.
[0055] In step 2, the acquired one-dimensional ECG data is converted into a two-dimensional time-frequency graph through time-frequency analysis. Specifically, the Wegener distribution transform time-frequency analysis method is used to reconstruct the one-dimensional ECG sequence into a two-dimensional time-frequency graph, which facilitates the application of deep learning and subsequent self-supervised methods. The resulting two-dimensional time-frequency graph is shown below. Figure 5 As shown.
[0056] The Wegener distribution transform, also known as the WVD method, uses the WV distribution, a bilinear time-frequency distribution, for nonlinear signal analysis. It reflects the energy distribution of a signal in the time-frequency domain, and its formula is as follows:
[0057]
[0058] Where x(t) is a one-dimensional signal and x* is a conjugate complex number.
[0059] Step 21: First, decompose the original signal using the HHT transform, the formula of which is as follows:
[0060]
[0061] Where x(t) is the original signal, k is the number of intrinsic modes decomposed, IMFi(t) is the i-th component of the empirical mode, and r k It is the residual term.
[0062] Step 22, then use the following formula:
[0063]
[0064] Where pv is the principal value, and Z is the principal value. i Φ(t) is the analytic signal, Φi(t) is the reconstructed signal, and finally, the two-dimensional spectrum can be obtained by transforming Φi(t) using equation (1).
[0065] In some embodiments, the self-supervised learning network model may employ a Siamese neural network, comprising a left network and a right network, wherein the output data is a high-dimensional representation of the input data.
[0066] Specifically, in this embodiment, the Siamese neural network uses two 2D-ResNet50 models, which serve as the left and right networks respectively, and the structures and parameters of the two 2D-ResNet50 models are identical during the initialization phase.
[0067] In this embodiment, the input data format of the Siamese neural network is a two-dimensional image. The data is transmitted in the Siamese network and undergoes a process of dimensionality increase to 2048 and then dimensionality reduction. The output format is a 128-dimensional representation vector.
[0068] Furthermore, it also includes methods for training the constructed self-supervised learning network model, i.e., methods for training Siamese neural networks, including the following steps:
[0069] Step S1: Obtain historical ECG data to construct a training set, perform preprocessing to obtain heartbeat data, and classify the heartbeat data to obtain heartbeat types;
[0070] In this embodiment, ECG signals from the MIT-BIH arrhythmia database can be used for training. The sampling rate is 360Hz, and 250 points centered on the R wave are extracted as one heartbeat. All extracted heartbeats from the MIT-BIH arrhythmia database are categorized as follows: N (normal or bundle branch block), V (ventricular abnormality), S (supraventricular abnormality), Q (unknown), and F (fusion). The extracted complete heartbeat signal is shown below. Figure 4 As shown.
[0071] According to the AAMI standard classification method, heartbeat signals were classified, and five categories were extracted from the classification results. These five types of heartbeats are: N class (normal or bundle branch block), V class (ventricular abnormality), S class (supraventricular abnormality), Q class (unknown), and F class (fusion). The number of heartbeat signals extracted for each of the five categories is shown in Table 1.
[0072] Table 1. Number of Heartbeats in Five Categories of AAMI
[0073]
[0074] Step S2: Perform time-frequency analysis on the acquired one-dimensional heartbeat data to convert it into a two-dimensional time-frequency graph;
[0075] Step S3: Randomly enhance the two-dimensional time-frequency graph;
[0076] Optionally, the random enhancement method is: randomly cropping the image, randomly changing the brightness, randomly changing the contrast, randomly changing the saturation and hue, and randomly horizontally flipping the image in any combination of operations. The combination includes arbitrarily combining the above operations according to different execution order and different number of items in the combination operation.
[0077] Step S4: Transmit the randomly enhanced data to the Siamese neural network to obtain the representation vector;
[0078] Specifically, in this embodiment, after the data is input into the network, it is labeled. The right network is responsible for labeling, and the left network is responsible for training. Figure 7 As shown, clustering calculations are performed in the right network, labels are assigned based on the clustering results, and then the data is input into the left network for training.
[0079] Step S5: Perform comparative self-supervised training using the InfoNCE loss function according to the set first training iterations, and adjust the Siamese neural network using stochastic gradient descent.
[0080] Furthermore, it also includes step S6: performing reinforcement training based on Gaussian mixture clustering according to the set second training number, calculating the InfoNCE loss and the angle loss ProtoNEC between the cluster center and each type of sample, training the model in a contrastive learning manner, and adjusting the Siamese neural network using stochastic gradient descent to obtain a trained self-supervised learning network model.
[0081] In this embodiment, the first number of training sessions is the first 10 training sessions, and the second number of training sessions is from the 10th training session to the end of the training.
[0082] For a specific training example, assuming a total of 1000 epochs, the first 10 epochs will use only the InfoNCE loss function for contrastive self-supervised training. Assuming each batch has n images, each image will undergo two random augmentations in the following order: random cropping to 224×224, random changes to brightness, contrast, saturation, and hue, and random horizontal flipping. After the two random augmentations, x will be obtained. a and x b Two enhanced 224×224 images, which may have different representations but are derived from the same image x through random enhancement. a Input left network, x b Inputting the right network yields two 128-dimensional representation vectors, with t a and t b Representatively, since they originate from the same image, these two representation vectors are positive sample pairs to each other; if they do not meet the condition of originating from the same image, they are negative sample pairs to each other. After normalizing the representation vectors (dividing them by their own magnitude), a dot product operation (scoring operation) is performed. The normalized vector dot product is essentially calculating the cosine of the angle between the two vectors. If the batch size is n, then the representation vector of the first image is t. a1 and t b1 The representation vector of the last image is t. an and t bn In a batch, these representation vectors collectively constitute the InfoNCE loss function, the formula of which is shown below:
[0083]
[0084] Where n is the total number of samples in the batch, t ai t bi and t bjBoth are representation vectors, where i is the number of each sample in the current batch, and j is the number of the remaining samples after removing the current number i.
[0085] An epoch represents the process of all data being fed into the training network, completing one forward computation and backpropagation cycle.
[0086] In step S5, the Siamese network is adjusted using stochastic gradient descent, keeping the corresponding parameter values of the left and right networks the same. Due to the loss function and gradient descent, the Siamese network tends to make the representation vectors of positive sample pairs have the same direction (cosine value of 1), while the representation vectors of negative sample pairs have different directions (cosine value approaching -1). The specific process is as follows... Figure 6 As shown.
[0087] Furthermore, starting from the 10th round onwards, at the beginning of each training round, the right network is used to label the data. Then, a simple random augmentation operation is performed on all training data (center-cropped to 128×128), and all of them are input into the network to obtain a large number of representation vectors. Gaussian mixture clustering is then performed on all representation vectors output by the right network, dividing them into multiple classes. In this embodiment, they are divided into 5 classes. The Gaussian mixture clustering formula is as follows:
[0088]
[0089] Where Σ is the covariance matrix, n is the total number of samples, μ is the sample mean, T is the transpose sign, and -1 is the inverse matrix.
[0090] After Gaussian mixture clustering, each image in the training samples is labeled with a category (pre-label). Then, the center coordinates of each category are calculated and represented by C1, C2, C3, C4, and C5, respectively. These center coordinates are also 128-dimensional vectors. The subsequent operations are the same as before, except that a new loss function term called ProtoNEC is added after calculating the InfoNCE loss function, as shown in the following formula:
[0091]
[0092] Where Ck is the representation vector t ai The coordinates of the center of the original image's class correspond to the coordinates of the center, and Cl represents the coordinates of the center other than Ck. Specific details and procedures are as follows: Figure 7 As shown.
[0093] In this embodiment, the model is trained using a pre-labeled self-supervised learning approach, completely eliminating the time-consuming and laborious step of labeling the training data. Supervised information is mined from massive amounts of unlabeled data, and through multiple rounds of self-supervised training, the model can approach the performance of supervised learning, thus freeing deep learning from its dependence on labeled data. Secondly, a Gaussian clustering method is introduced to generate pre-labeled information to enhance the learning effect. The Wegener distribution transformation method is used to convert the data into two-dimensional images, which are then input into a Siamese network to form representation vectors. The model is then trained using a contrastive learning approach, employing the InfoNCE loss function to construct positive and negative sample pairs, thereby avoiding degradation.
[0094] This embodiment of self-supervised learning is based on learning from unlabeled data. To enhance the contrastive learning effect, Gaussian clustering is introduced to pre-label the data at the beginning of each training round. Then, the loss function calculation simultaneously considers the contrastive information and the ProtoNEC loss (the angle between the cluster centers and samples of each class). In other words, the loss function consists of two parts. Compared to using SimCLR alone for contrastive supervised learning, combining SimCLR and Gaussian clustering transforms the loss function from one term to two, enhancing the learning effect and significantly improving classification efficiency.
[0095] An experiment was conducted to illustrate the effectiveness of the method in this embodiment, as detailed below.
[0096] The performance of this invention was evaluated using four metrics: accuracy, positive prediction rate, sensitivity, and specificity. To assess the model's classification performance, the evaluation criteria used were: true positive rate, false positive rate, true negative rate, and false negative rate. For each type of beat frequency signal sample, the model's prediction results were categorized into these four types. In the experiment, they represented the following information:
[0097] TP (True Positive): This is actually the number of samples whose predicted value is the same as the target class.
[0098] FP (False Positive): This is actually the number of samples whose predicted class is this class when other classes are not.
[0099] TN (True Negative): This is actually the number of samples that are predicted as other classes.
[0100] FN(False Negative): This is actually the number of samples that are predicted as other classes in this class.
[0101] Furthermore, the classification performance of the model is evaluated using four metrics: accuracy, positive predictive value (ppv), sensitivity, and specificity, abbreviated as acc (acc), ppv (positive predictive value), sensitivity (sensitivity), and spec (specificity), respectively. Their formulas are defined as follows:
[0102]
[0103]
[0104]
[0105]
[0106] Table 2 below shows the classification results of the Gaussian clustering pre-labeled self-supervised learning method for heartbeat classification on the test set, including the confusion matrix of the prediction results for the five types of heartbeats and various indicators. As shown in Table 2, the model has high classification accuracy for S, F, and Q type heartbeat signals, namely S: 95.12%, F: 98.11%, and Q: 96.05%, with the best classification performance for F and Q type heartbeats.
[0107] Table 2 shows the classification results of 10-fold heartbeats on the training set.
[0108]
[0109] In the confusion matrix, each column represents the predicted class, and the total in each column indicates the number of data points predicted as belonging to that class. Each row represents the true class of the data, and the total number of data points in each row indicates the number of data instances belonging to that class. The value in each column represents the number of actual data points predicted as belonging to that class.
[0110] Example 2
[0111] Based on Example 1, this example provides a pre-labeled self-supervised neural network learning heartbeat classification system, characterized by including:
[0112] Preprocessing module: configured to preprocess the acquired ECG data to obtain heart rate data;
[0113] Conversion module: configured to perform time-frequency analysis on the acquired one-dimensional heartbeat data and convert it into a two-dimensional time-frequency graph;
[0114] The classification module is configured to input the converted two-dimensional time-frequency image into a trained self-supervised learning network model to classify the heartbeat data and obtain the classification results.
[0115] The self-supervised learning network model uses a clustering method to pre-label the transformed two-dimensional time-frequency image at the beginning of each training round. The training loss function includes contrastive learning loss and the angle loss between the cluster center and each type of sample. The model is trained in a contrastive learning manner to obtain a well-trained model.
[0116] Example 3
[0117] This embodiment provides an electronic device, including a memory and a processor, as well as computer instructions stored in the memory and running on the processor. When the processor executes the computer instructions, it performs the steps described in the method of Embodiment 1.
[0118] Example 4
[0119] This embodiment provides a computer-readable storage medium for storing computer instructions, which, when executed by a processor, complete the steps described in the method of Embodiment 1.
[0120] The above description is merely a preferred embodiment of this disclosure and is not intended to limit this disclosure. Various modifications and variations can be made to this disclosure by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
[0121] While the specific embodiments of this disclosure have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of this disclosure. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of this disclosure are still within the scope of protection of this disclosure.
Claims
1. A self-supervised neural network-based method for heartbeat classification based on pre-labeled signals, characterized in that... Includes the following steps: The acquired electrocardiogram (ECG) data is preprocessed to obtain heart rate data; The acquired one-dimensional heart rate data was converted into a two-dimensional time-frequency graph through time-frequency analysis. The converted two-dimensional time-frequency image is input into a trained self-supervised learning network model to classify the heartbeat data and obtain the classification results. The self-supervised learning network model uses a clustering method to pre-label the transformed two-dimensional time-frequency graph at the beginning of each training round. The training loss function includes contrastive learning loss and the angle loss between the cluster center and each type of sample. The model is trained in a contrastive learning manner to obtain a well-trained model. The self-supervised learning network model uses a Siamese neural network, which consists of a left network and a right network. The output data is a high-dimensional representation of the input data. The Siamese neural network uses two 2D-ResNet50 models, which serve as the left and right networks respectively, and the structure and parameters of the two 2D-ResNet50 models are identical during the initialization phase. The ProtoNEC formula for the angle loss between cluster centers and samples of each class is: in, Ck For the representation vector t ai The center coordinates of the class to which the original image belongs. Cl For the center coordinates other than Ck, n The total number of samples.
2. The pre-label-based self-supervised neural network learning method for heartbeat classification as described in claim 1, characterized in that: Data preprocessing includes data denoising and heartbeat extraction; Alternatively, wavelet transform can be used for data denoising. Alternatively, the heartbeat extraction method includes the following steps: The denoised ECG signal is processed to locate the QRS wave. For the location and detection of the QRS wave, the Pan-Tompkins algorithm is used to achieve accurate location and detection of the R wave. After detecting the position of the R wave on the ECG signal, the heartbeat signal is truncated with the R wave position as the center, and the truncated heartbeat data is normalized.
3. The pre-label-based self-supervised neural network learning method for heartbeat classification as described in claim 1, characterized in that: Wegener's distribution transform time-frequency analysis method was used to reconstruct one-dimensional electrocardiogram data into two-dimensional time-frequency maps.
4. The pre-label-based self-supervised neural network learning method for heartbeat classification as described in claim 1, characterized in that: It also includes methods for training the constructed self-supervised learning network model, comprising the following steps: Historical electrocardiogram (ECG) data is acquired to construct a training set, preprocessed to obtain heartbeat data, and the heartbeat data is classified to obtain heartbeat types; The acquired one-dimensional heart rate data was converted into a two-dimensional time-frequency graph through time-frequency analysis. Randomly enhance the two-dimensional time-frequency graph; The randomly augmented data is transmitted to the Siamese neural network to obtain the representation vector; Comparative self-supervised training was performed using the InfoNCE loss function for the first set number of training iterations, and the parameters of the Siamese neural network were adjusted using stochastic gradient descent.
5. The pre-label-based self-supervised neural network learning method for heartbeat classification as described in claim 4, characterized in that: The method for training the constructed self-supervised learning network model also includes the following steps: performing reinforcement training based on Gaussian mixture clustering according to the set second training number, calculating the InfoNCE loss and the angle loss ProtoNEC between the cluster center and each type of sample, training the model in a contrastive learning manner, and adjusting the Siamese neural network using stochastic gradient descent to obtain the trained self-supervised learning network model.
6. The pre-label-based self-supervised neural network learning method for heartbeat classification as described in claim 5, characterized in that: Reinforcement training is performed based on Gaussian mixture clustering according to the set second training iteration. Specifically, after Gaussian mixture clustering, each image in the training samples is labeled with a category, and the pre-labeled images are input into the self-supervised learning network model for training.
7. A pre-labeled self-supervised neural network learning heartbeat classification system, characterized in that, include: Preprocessing module: configured to preprocess the acquired ECG data to obtain heart rate data; Conversion module: configured to perform time-frequency analysis on the acquired one-dimensional heartbeat data and convert it into a two-dimensional time-frequency graph; The classification module is configured to input the converted two-dimensional time-frequency image into a trained self-supervised learning network model to classify the heartbeat data and obtain the classification results. The self-supervised learning network model uses a clustering method to pre-label the transformed two-dimensional time-frequency graph at the beginning of each training round. The training loss function includes contrastive learning loss and the angle loss between the cluster center and each type of sample. The model is trained in a contrastive learning manner to obtain a well-trained model. The self-supervised learning network model uses a Siamese neural network, which consists of a left network and a right network. The output data is a high-dimensional representation of the input data. The Siamese neural network uses two 2D-ResNet50 models, which serve as the left and right networks respectively, and the structure and parameters of the two 2D-ResNet50 models are identical during the initialization phase. The ProtoNEC formula for the angle loss between cluster centers and samples of each class is: in, Ck For the representation vector t ai The center coordinates of the class to which the original image belongs. Cl For the center coordinates other than Ck, n The total number of samples.
8. An electronic device, characterized in that, It includes a memory and a processor, as well as computer instructions stored in the memory and running on the processor, which, when executed by the processor, perform the steps of any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, Used to store computer instructions, which, when executed by a processor, perform the steps of any one of claims 1-6.
Citation Information
Patent Citations
Feature fusion transfer learning arrhythmia classification system based on 2D heart beat
CN112329609A
Method, device, terminal and storage medium for electrocardiosignal detection
CN112690802A