A method for detecting abnormal electrocardiogram signals for wearable devices

Through the comparative learning loss function and supervised contrast loss function of the deep learning model, the feature learning model is trained, which solves the problem that wearable devices cannot achieve long-term wireless real-time transmission and diagnosis, improves the detection ability of abnormal heart states, and realizes real-time early warning. and data screening to improve health monitoring efficiency.

CN114587365BActive Publication Date: 2024-08-30HUNAN UNIV
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202210194173.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-01
Publication Date
2024-08-30
Estimated Expiration
2042-03-01

AI Technical Summary

Technical Problem

Existing wearable ECG signal detection equipment cannot achieve long-term wireless real-time transmission and real-time diagnosis, and judgment based on signal characteristics cannot adapt to individual characteristics, resulting in diagnostic results that are not completely reliable, rely on manual review, and are time-consuming and labor-intensive.

Method used

Using a deep learning model, the feature learning model is trained by contrasting the learning loss function and the supervised contrasting loss function. After removing the nonlinear projection part, a linear classification layer is added to achieve real-time monitoring and anomaly detection of ECG signals and adapt to individual user characteristics.

Benefits of technology

It improves the detection ability of abnormal heart conditions, reduces doctor review pressure, reduces energy consumption, realizes real-time warning and data screening, and improves the health monitoring efficiency of wearable devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114587365B
    Figure CN114587365B
Patent Text Reader

Abstract

The present invention discloses a method for detecting abnormal ECG signals for wearable devices, including collecting original ECG signals to form a contrast relationship as training data for a network and performing preprocessing; using batch data for model pretraining to obtain a feature learning model and a supervised contrast loss function; freezing the parameters of the encoder after removing the nonlinear projection part, adding a linear classification layer, using a cross entropy loss function to train the linear layer parameters, and obtaining a trained abnormality detection model; using the trained abnormality detection model, monitoring the ECG signal in real time through a wearable device, and determining whether an abnormality occurs. The present invention sets a comparison between normal and abnormal data features, so that normal data samples are closer in the feature space and abnormal samples are farther apart, which greatly enhances the generalization ability of the model and has a stronger feature expression ability. The present invention is more suitable for individual users while improving the abnormality detection ability, and improves the efficiency of the wearable device health monitoring system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of data detection, and in particular relates to an abnormal electrocardiogram signal detection method for a wearable device. Background Art

[0002] The electrocardiogram records the electrical activity of the heart from the body surface in a non-invasive way, and uses P, Q, R, S, and T waves to mark different and distinguishable spikes. It is an important basis for doctors to analyze the physiological state of the heart and diagnose different types of heart disease. The monitoring of ECG signals is of great significance for the early screening of diseases that pose serious health threats to the human body, such as atrial fibrillation and myocardial ischemia. At present, the standard twelve-lead electrocardiogram is generally used for detection. Due to the time limit of conventional electrocardiogram examinations, the abnormal state of the patient's heart is very likely to be undetectable because it is not in the attack period. Although the 24-hour dynamic electrocardiogram technology is used to record the patient's long-term ECG signals, it still relies on manual observation and analysis of the collected long-term ECG data because it does not have the function of uploading and analyzing data in real time. Due to differences in physiological characteristics and the influence of noise, the waveform performance of the ECG in different individuals and different environments will also be different. Therefore, manual diagnosis of ECG abnormalities is time-consuming and laborious. The diagnosis results are greatly affected by the subjectivity of the physician and often rely on the physician to have a rich theoretical foundation and clinical experience. With the development of deep learning wearable intelligent ECG monitoring technology, a portable recorder can be used to achieve continuous monitoring and automatic diagnosis of the heart, which is conducive to improving the diagnosis and early warning speed of heart abnormalities and protecting the life and health of patients.

[0003] Generally speaking, wearable ECG signal monitoring products are generally restricted by computing, storage and battery life performance. Most of the existing wearable devices on the market use offline detection to track daily data. These wearable ECG detection devices cannot provide long-term wireless real-time transmission or real-time diagnosis services.

[0004] In specific technologies, the diagnosis methods for abnormal ECG signals on wearable devices generally include traditional judgments based on signal features, judgments based on intelligent models, and manual review. Among them, the intelligent model refers to a method of realizing automatic discrimination based on computing devices through artificial intelligence technology. Based on signal features refers to a method of setting manual judgment rules based on experience and statistical laws for ECG signal waveform features to give judgment results. Manual review refers to a method of giving a subjective diagnosis after a professional doctor with rich clinical experience reads the ECG. Generally speaking, although manual review has higher accuracy, it is more dependent on clinical experience. It is limited by the number and quality of doctors involved in the review, and it still takes a lot of time and economic costs. Judgment based on signal features relies on statistical laws, and the judgment rules cannot be adaptively modified for the individual specificity of a single patient, and can only be used for some relatively simple ones, such as judgments of heart rate measurement. Therefore, it is necessary to rely on intelligent models to conduct intelligent analysis and judgment based on individual characteristics of patients.

[0005] Intelligent models often infer the ECG signal data of the subjects based on various types of machine learning models. Due to the specificity of physiological characteristics of different individuals, the ECG signals of subjects of different age groups and physical conditions often have their own characteristics. Therefore, the scoring results given by machine learning models trained based on training sets are not always completely reliable and cannot be adapted to individual users. Summary of the invention

[0006] The purpose of the present invention is to provide a stable and reliable method for detecting abnormal ECG signals for wearable devices, which enables a deep learning model to further improve the detection capability of abnormal cardiac states while distinguishing user-specific characteristics.

[0007] The present invention provides a wearable device-oriented ECG signal anomaly detection method, comprising the following steps:

[0008] S1. Collecting the original ECG signals to form a contrast relationship as the training data of the network and preprocessing;

[0009] S2. Set the supervised contrast loss function, use batch data for model pre-training, and obtain the feature learning model;

[0010] S3. Freeze the encoder parameters after removing the nonlinear projection part, add a linear classification layer, train the linear layer parameters using the cross entropy loss function, and obtain the trained anomaly detection model;

[0011] S4. Use the trained anomaly detection model to monitor the ECG signal in real time through wearable devices and determine whether there is an abnormality.

[0012] The step S1, acquisition includes acquiring the original ECG signal from the human chest through a single-lead or multi-lead device, or acquiring the original ECG signal from the human wrist through a smart watch device; and dividing the original ECG signal by heart beat or time slice.

[0013] The step S1, preprocessing includes dividing the ECG signals of different users into several categories according to the disease state through the user ID and the abnormal heart rhythm label in the data set, and selecting ECG data from each category to form a batch of comparison data groups during training, including: selecting batch data, selecting a number of normal ECG samples M and abnormal ECG samples N from the ECG data generated by S users one by one to form a batch; setting the comparison relationship between different categories of data under the same user includes: randomly selecting user A in the batch, selecting all samples Z of user A in the batch, and selecting the normal ECG samples M and abnormal ECG samples N in the batch. A Select a normal data slice As an anchor example, except for the anchor example The normal data fragments other than Will Together with the previous anchor example, a positive sample pair is formed; the abnormal fragment is recorded as Will Form a negative sample pair with the anchor example; form a contrast relationship between different user data: for the anchor example Will The positive sample pairs are formed with the remaining data from user A, and the positive sample pairs are formed with the data Z of users other than user A in the batch. p Form a negative sample pair, p∈S, p≠A.

[0014] The step S2 uses batch data with contrast relationships set to pre-train a feature extraction network, and the pre-trained network includes a first training part and a second training part; the first training part selects a neural network to construct an encoder to learn the feature expression of ECG data, and outputs a feature vector, which represents the learning result of the encoder on the network; the second training part performs nonlinear projection on the feature vector learned by the encoder, maps the feature vector learned by the encoder to a specific space for feature description, and obtains a feature learning model.

[0015] The supervised contrast loss function loss total include,

[0016]

[0017]

[0018] loss total =loss1+βloss2

[0019] Among them, sim(·) is the function for calculating the cosine similarity between feature vectors; β is a hyperparameter; M Ai represents an anchor example; M Aj Indicates the anchor-removing example M Ai Normal data fragments other than N Ai Indicates abnormal fragment; Z A represents all samples of user A; Z p represents the data of users in the batch except user A; exp[·] represents the exponential function; log(·) represents the logarithm; loss total represents the supervised contrast loss function; loss1 represents the first part of the loss; loss2 represents the second part of the loss.

[0020] The step S3 includes, for the feature learning model, removing the nonlinear projection part, freezing the parameters of the encoder, adding a linear classification layer consisting of a fully connected layer and a softmax function, using a cross entropy loss function to train the linear layer parameters based on the existing data and labels, and obtaining a trained anomaly detection model.

[0021] The step S4 includes real-time monitoring by the wearable device, classifying the monitored data through the trained anomaly detection model and giving an abnormality judgment result.

[0022] The present invention provides a wearable device-oriented ECG signal anomaly detection method, which improves the existing contrast learning loss function, makes full use of disease annotation in a supervised manner, sets the comparison of normal and abnormal data features, so that normal data samples are closer in the feature space and abnormal samples are farther away, which greatly enhances the generalization ability of the model, so that abnormal states that have never appeared in the actual abnormal detection scene can be distinguished, overcoming the limitations caused by the small size of the medical data set. In the process of completing the ECG signal anomaly detection, the present invention integrates the self-supervised contrast learning strategy. The model needs to compare the ECG data features of different tested persons during the training process, and adjusts the feature mapping according to the specificity of different users. It has stronger feature expression ability, and the model is more suitable for individual users while improving the anomaly detection ability. The anomaly detection method can effectively improve the energy consumption of the current wearable device that must transmit all monitoring data to the background, realize the transmission data with screening, and at the same time greatly avoid the privacy data leakage that may occur in the transmission at any time, and the real-time warning of abnormal results can effectively reduce the audit and verification pressure on the doctor side, and improve the efficiency of the wearable device health monitoring system. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 It is a schematic diagram of the process of the present invention.

[0024] Figure 2Schematic diagram of an implementation environment of an embodiment of the present invention.

[0025] Figure 3 Schematic diagram of a flow chart of an embodiment of the present invention.

[0026] Figure 4 The figure is a schematic diagram of a data organization form for comparative learning according to an embodiment of the present invention.

[0027] Figure 5 Schematic diagram of a contrastive learning neural network training framework used in an embodiment of the present invention. DETAILED DESCRIPTION

[0028] like Figure 1 The flowchart of the method of the present invention is as follows: The method for detecting abnormal ECG signals for wearable devices provided by the present invention comprises the following steps:

[0029] S1. Collecting the original ECG signals to form a contrast relationship as the training data of the network and preprocessing;

[0030] In this embodiment, there is no restriction on the acquisition channel and data division form of the ECG signal data. The ECG data can be collected from the human chest through a single-lead or multi-lead device, or through a smart watch or other similar device. It can be divided into single heart beats or into time slices.

[0031] Preprocessing includes dividing the ECG signals of different users into multiple categories according to the normal / abnormal disease status with the help of the user ID and abnormal heart rhythm labels provided in the data set, and selecting ECG data from each category to form a batch of comparison data groups during training. Figure 3 As an example, this is an optional specific way of data organization. The specific process includes: the first step is to select batch data. From the ECG data generated by S users, multiple normal (label 0) ECG samples M and abnormal (label 1) ECG samples N are selected one by one to form a batch; the second step is to set the comparison relationship between different categories of data under the same user. Randomly select user A in the batch and select all its samples Z. A Select a normal data slice As the anchor sample, the remaining normal data fragments are recorded as It is combined with the previous anchor example to form a positive pair, and the abnormal fragment is recorded as It forms a negative pair with the anchor example; the third step is to form a contrast relationship between different user data: for the set anchor example It is combined with the remaining data from user A to form a positive sample pair, and with the data Z from other users in the batch p The negative sample pairs are composed, p∈S, p≠A. The contrast relationship setting is used to learn the common features between the positive sample pairs and distinguish the differences between the negative sample pairs.

[0032] S2. The model is pre-trained using batch data with contrast relationships set up, and the pre-trained network includes the first training part and the second training part; the first training part selects a neural network to construct an encoder to learn the feature expression of ECG data, and outputs a feature vector, which represents the learning result of the encoder on the network; the second training part performs nonlinear projection on the feature vector learned by the encoder, maps the feature vector learned by the encoder to a specific space for feature description, and obtains a feature learning model; the supervised contrast loss function includes that on the basis of the model learning to distinguish different user specificities in the original contrast learning, the model also learns to distinguish between normal and abnormal data, and improves its information encoding ability for normal and abnormal ECG segments by changing the distribution distance of the encoding features within the specific space hypersphere, thereby achieving stronger anomaly detection capabilities.

[0033] The supervised contrast loss function is set to loss total :

[0034]

[0035]

[0036] loss total =loss1+βloss2

[0037] Among them, exp[·] represents the exponential function; log(·) represents the logarithm; sim(·) is the function for calculating the cosine similarity between feature vectors. Among them, β is a hyperparameter. When the weight β is larger, the features corresponding to the normal samples of each user will have more obvious cohesion, that is, the cohesion is closer to each other and farther from the abnormal samples. Loss1 is used to learn the similarity of ECG data fragments from the same user, and update the network weights through back propagation to bring the positive sample pairs closer, that is, and and The corresponding feature encoding vector distances in the projection space while pulling away the negative sample pairs, that is, With Z p The distance of the coded feature. and and The similarity between the two samples is as high as possible, and the negative samples are With Z pWhen the similarity between the two is as low as possible, that is, the larger the numerator in the logarithmic term in loss1, the larger its proportion in the denominator, and the closer the loss1 result should be to 0; loss2 is used to close the normal data that constitutes a positive sample pair for a single user. and other normal data The distance of the encoded feature vector is pulled away to form the negative sample pair With abnormal data When the positive samples within a single user are and The similarity between the two samples is as high as possible, and the negative samples are and When the similarity between the two is as low as possible, that is, the larger the numerator in the logarithmic term in loss2, the closer the loss2 result should be to 0. Loss2 makes the normal and abnormal categories have a more obvious distribution in the feature space, improving the model's ability to distinguish abnormal ECG signals.

[0038] S3. For the feature learning model, after removing the nonlinear projection part, freeze the parameters of the encoder, add a linear classification layer consisting of a fully connected layer and a softmax function, and use the cross entropy loss function to train the parameters of the linear layer based on the existing data and labels. At this time, the model has the function of end-to-end anomaly detection;

[0039] S4. Entering the daily monitoring stage, the wearable device will classify the monitored data through the trained anomaly detection model and give the result of anomaly judgment. This step not only completes the anomaly detection function on the device, but also can filter out the abnormal fragments that need further analysis from the long fragments in the usage scenario and send them to the server, reducing the energy consumption caused by the transmission of all data fragments by existing wearable devices.

[0040] like Figure 2 Schematic diagram of the implementation environment of an embodiment of the present invention. In this implementation environment, the main hardware and software used for daily monitoring of the user's ECG signal status are roughly divided into three parts: the wearable device side, also known as the edge device (Edge Device), the background data center, and the doctor side. This method will be applied to wearable devices to perform real-time abnormal signal monitoring and send abnormal alarms to the doctor side. The background data center is a central platform designed to provide in-depth analysis of the collected ECG data for multiple users. The doctor side is to respond immediately and flexibly to abnormal alarm situations. The specific workflow in this implementation environment mainly includes:

[0041] 1. The wearable device is used to collect the user's ECG signal and execute the ECG signal abnormality detection method in the example of this application to perform online and real-time abnormal disease state detection on the collected data.

[0042] 2. When the wearable device detects an abnormality, it will immediately alert the doctor. At the same time, it only needs to upload the abnormal fragment to the data center for further analysis.

[0043] 3. The data center is used to further classify the abnormal signals given by the device and generate an analysis report back to the doctor.

[0044] 4. The doctor can check the number of abnormal alarms, contact the patient in real time when an alarm occurs to confirm his or her health condition, and further check the analysis report provided by the backend server.

[0045] like Figure 3 The flowchart of the embodiment of the present invention includes the following steps:

[0046] Step 1: Collect the original ECG signal to form a comparison relationship as the training data of the network. In this embodiment, there is no restriction on the acquisition channel and data division form of the ECG signal data. The ECG data can be collected from the human chest through a single-lead or multi-lead device, or through a smart watch or other similar device. It can be divided into a single heartbeat or into time slices.

[0047] The present invention uses the user ID and abnormal heart rhythm label provided in the data set to divide the ECG signals of different users into multiple categories according to the normal / abnormal disease state, and selects ECG data from each category to form a batch of comparison data groups during training. Figure 4 The diagram is a data organization form for comparative learning in an embodiment of the present invention, which is an optional specific method of data organization. The first step is to select batch data: select multiple normal (label 0) ECG samples M and abnormal (label 1) ECG samples N from the ECG data generated by S users to form a batch; the second step is to set the comparative relationship between different categories of data under the same user: randomly select user A in the batch, and select all of its samples Z. A Select a normal data slice As an anchor example, the remaining normal data fragment is denoted as It is combined with the previous anchor example to form a positive sample pair, and the abnormal fragment is recorded as It forms a negative sample pair with the anchor example; the third step is to form a contrast relationship between different user data: for the set anchor example It is combined with the remaining data from user A to form a positive sample pair, and with the data Z from other users in the batch p Form a negative sample pair, p∈S, p≠A.

[0048] like Figure 5The schematic diagram of the training framework of the contrastive learning neural network used in the embodiment of the present invention; Step 2, using batch data with contrast relationships set up to pre-train the model, the pre-training network is divided into two parts, the first part of the training uses a neural network to construct an encoder to learn the feature expression of ECG data, and the network outputs a feature vector, which represents the learning result of the encoder on the network; the second part of the training performs nonlinear projection on the feature vector learned by the encoder, and maps it to a specific space for better feature description. In the present invention, on the basis of the model learning to distinguish different user specificities in the original contrastive learning, the model also learns to express normal and abnormal data differently, and by changing the distribution distance of the coding features in the specific space hypersphere, it improves its information encoding ability for normal and abnormal ECG segments, thereby achieving a stronger abnormality detection capability.

[0049] The supervised contrast loss function is set to loss total The first part of the loss, loss1, is to learn the similarity of ECG data segments from the same user as much as possible, and update the network weights through back propagation to get closer and and The corresponding feature encoding vector is projected in space while moving away With Z p The distance of the encoded features, that is, the model learns individual differences by distinguishing the signal features of different users during the training process; the second part of the loss, loss2, is used to bring the data within the same user closer to its normal data and other normal data The distance of the encoded feature vector is far away With abnormal data The distance between them makes the normal and abnormal categories have a more obvious distribution in the feature space, thereby improving the model's ability to distinguish abnormal ECG signals.

[0050]

[0051]

[0052] loss total =loss1+βloss2

[0053] Among them, sim(·) is a function for calculating the cosine similarity between feature vectors. Among them, β is a hyperparameter. When the weight β is larger, the features corresponding to each user's normal sample will have more obvious cohesion, that is, the normal samples are closer to each other and farther away from the abnormal samples.

[0054] Step 3: For the obtained feature learning model, remove the nonlinear projection part and freeze the parameters of the encoder. Then add a linear classification layer consisting of a fully connected layer and a softmax function. Use the cross entropy loss function to train the linear layer parameters based on the existing data and labels. At this time, the model has the function of end-to-end anomaly detection.

[0055] Step 4: Entering the daily monitoring stage, the wearable device will classify the monitored data through the trained anomaly detection model and give the result of anomaly judgment. This step not only completes the anomaly detection function on the device, but also, in the usage scenario, can filter out the abnormal fragments that need further analysis from the long-term fragments and send them to the server, reducing the energy consumption caused by the transmission of all data fragments by existing wearable devices.

[0056] The improvement proposed in the present invention based on the existing contrastive learning loss function enables the deep learning model to further improve the detection ability of abnormal heart conditions while distinguishing user-specific characteristics.

Claims

1. A method for detecting abnormal electrocardiogram signals for wearable devices, characterized in that The steps include: S1. Collect the original ECG signals to form a comparison relationship as the training data of the network and perform preprocessing; the preprocessing includes, through the user ID and abnormal heart rhythm label in the data set, dividing the ECG signals of different users into several categories according to the disease state, and selecting ECG data from each category to form a batch of comparison data groups during training, including: selecting batch data, selecting a number of normal ECG samples M and abnormal ECG samples N from the ECG data generated by S users to form a batch; setting the comparison relationship between different categories of data under the same user includes: randomly selecting user A in the Batch, among all samples Z of user A A Select a normal data slice As an anchor example, in addition to the anchor example The normal data fragments other than Will Together with the previous anchor example, a positive sample pair is formed; the abnormal fragment is recorded as Will Form a negative sample pair with the anchor example; form a contrast relationship between different user data: for the anchor example Will The positive sample pairs are formed with the remaining data from user A, and the positive sample pairs are formed with the data Z of users other than user A in the batch. p Form a negative sample pair, p∈S, p≠A; S2. Set a supervised contrast loss function, use batch data to pre-train the model, and obtain a feature learning model; use the batch data with contrast relationships to pre-train the feature extraction network, the pre-training network includes a first training part and a second training part; the first training part selects a neural network to construct an encoder to learn the feature expression of ECG data, and outputs a feature vector, which represents the learning result of the encoder on the network; the second training part nonlinearly projects the feature vector learned by the encoder, maps the feature vector learned by the encoder to a specific space for feature description, and obtains a feature learning model; The supervised contrast loss function loss total include, loss total =loss1+βloss2 Among them, sim(·) is the function for calculating the cosine similarity between feature vectors; β is a hyperparameter; Represents an anchor example; Represents anchor removal example Normal data fragments other than Indicates abnormal fragment; Z A represents all samples of user A; Z p represents the data of users in the batch except user A; exp[·] represents the exponential function; log(·) represents the logarithm; loss total represents the supervised contrast loss function; loss1 represents the first part of the loss; loss2 represents the second part of the loss; S3. Freeze the encoder parameters after removing the nonlinear projection part, add a linear classification layer, train the linear layer parameters using the cross entropy loss function, and obtain the trained anomaly detection model; S4. Use the trained anomaly detection model to monitor the ECG signal in real time through wearable devices and determine whether there is an abnormality.

2. The method for detecting abnormal ECG signals for wearable devices according to claim 1, characterized in that The step S1, acquisition includes acquiring the original ECG signal from the human chest through a single-lead or multi-lead device, or acquiring the original ECG signal from the human wrist through a smart watch device; and dividing the original ECG signal by heart beat or time slice.

3. The method for detecting abnormal ECG signals for wearable devices according to claim 2, characterized in that The step S3 includes, for the feature learning model, removing the nonlinear projection part, freezing the parameters of the encoder, adding a linear classification layer consisting of a fully connected layer and a softmax function, using a cross entropy loss function to train the linear layer parameters based on the existing data and labels, and obtaining a trained anomaly detection model.

4. The method for detecting abnormal ECG signals for wearable devices according to claim 3, characterized in that The step S4 includes real-time monitoring by the wearable device, classifying the monitored data through the trained anomaly detection model and giving an abnormality judgment result.

Citation Information

Patent Citations

  • System for monitoring and classifying vehicle operator behavior

    CA2912906A1

  • Human body fall detection method

    CN108833036A

  • Dynamic electrocardiogram data retrieval method and device, storage medium and processor

    CN110968717A

  • Intelligent classification and recognition method of heart beat of electrocardiogram

    CN111449645A

  • Supervised contrastive learning with multiple positive examples

    WO2021216310A1