Heartbeat location classification method, system, medium and device based on deep learning

Through the extraction and classification of morphology and rhythm characteristics of ECG signals based on deep learning, the problems of rhythmic features loss and task time-consuming in the existing technology center positioning classification are solved, and high accuracy and low time-consuming hearts are achieved Positioning and classification.

CN115105084BActive Publication Date: 2025-02-11CHONGQING KOANRULER SCI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210465748.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-29
Publication Date
2025-02-11
Estimated Expiration
2042-04-29

AI Technical Summary

Technical Problem

The prior art has the problem of losing rhythmic characteristics when locating a single cardiac beat in the electrocardiogram positioning classification, and the need for non-maximum suppression after using multiple pre-selected boxes, which increases the task time.

Method used

Using a deep learning-based method, the ECG data set is determined by acquiring and preprocessing the ECG signals, and the cardiac positioning classification model is trained using feature extraction networks and regression networks to achieve simultaneous ECG morphology and rhythm characteristics of the ECG signal. Extraction and classification.

Benefits of technology

It improves the accuracy of cardiac positioning and classification, reduces dependence on prior knowledge, reduces task time-consuming, realizes end-to-end detection tasks, and simplifies task flow.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115105084B_ABST
    Figure CN115105084B_ABST
Patent Text Reader

Abstract

The present invention discloses a heartbeat localization classification method, system, medium and device based on deep learning, characterized in that the method comprises: obtaining an electrocardiogram signal to be detected; preprocessing the electrocardiogram signal to be detected; segmenting the preprocessed electrocardiogram signal to determine an electrocardiogram data set; obtaining a heartbeat localization classification model; inputting the electrocardiogram data set into the heartbeat localization classification model to determine the heartbeat vertex position and heartbeat category of the electrocardiogram signal to be detected. The present invention uses a deep learning algorithm to realize automatic feature extraction, solves the problem of manually extracting electrocardiogram signal features in traditional algorithms, and reduces the coupling degree between features and reduces the dependence on prior knowledge. Furthermore, unlike other deep learning detection algorithms, the present invention realizes the simultaneous extraction of electrocardiogram signal morphology and rhythm features, and does not use non-maximum suppression tasks to realize end-to-end detection, simplifies the task process, and reduces the time consumption of heartbeat localization classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of artificial intelligence one-dimensional data technology and medical electrocardiogram detection technology, and in particular to a method, system, medium and equipment for heartbeat positioning and classification based on deep learning. Background Art

[0002] Cardiovascular disease diagnosis relies on electrocardiograms. Electrocardiogram signals are used to diagnose various cardiovascular diseases. Electrocardiogram signal analysis requires the determination of the categories of all heartbeats within a period of time. The determination of the categories of heartbeats requires reference to both the morphological characteristics and the rhythm characteristics of the heartbeats. Both of these characteristics are essential for the determination of cardiovascular diseases. If the categories of heartbeats can be directly identified, it will be beneficial for the pre-diagnosis of cardiovascular diseases and save doctors’ working time.

[0003] At present, most of the automatic analysis software using traditional algorithms for heartbeat location, identification and classification manually enhances the QRS wave signal strength and then designs the threshold to locate the heartbeat position. After locating the heartbeat, manual feature extraction is performed, and the heartbeat is identified and classified by first verifying the knowledge. However, the traditional algorithm first needs to ensure that the QRS wave positioning accuracy is high, and secondly, the accuracy of the characteristic value calculation of the heartbeat is also high, and the threshold is designed by prior knowledge. If there is a false detection or missed detection of the heartbeat or the QRS wave width is inaccurately calculated, the identification of the heartbeat category will also be misjudged. It can be seen that the traditional algorithm's manual feature extraction method has a high coupling, which affects the whole body, and the waveform of the ECG signal is complex, and the manual threshold setting method has low adaptability.

[0004] Deep learning has a strong autonomous learning ability and can learn ECG signal features from a large amount of training data. It has high adaptability and the advantage of automatic feature extraction, which solves a series of problems caused by manual feature extraction. This provides the possibility for ECG signal positioning and recognition of heartbeats. At present, some algorithms for positioning and classifying ECG signal heartbeats have been implemented using deep learning technology. The technical solution is divided into two directions. First, after the heartbeat is intercepted, a deep learning network is used to classify and identify a single heartbeat. Second, a deep learning target detection network is used to design multiple pre-selection boxes for positioning and recognition. The former loses the rhythm characteristics of the ECG signal when identifying a single heartbeat, and the latter needs to perform non-maximum suppression after using multiple pre-selection boxes to obtain the prediction result, which increases the time consumption of the task. Summary of the invention

[0005] In view of the above-mentioned shortcomings of the prior art, an object of the present invention is to provide a heartbeat localization and classification method, system, medium and device based on deep learning, so as to solve at least one problem in the prior art.

[0006] To achieve the above-mentioned purpose and other related purposes, the present invention provides a method for heartbeat localization and classification based on deep learning, comprising: obtaining an electrocardiogram signal to be detected; preprocessing the electrocardiogram signal to be detected; segmenting the preprocessed electrocardiogram signal to determine an electrocardiogram data set; obtaining a heartbeat localization and classification model; inputting the electrocardiogram data set into the heartbeat localization and classification model to determine the heartbeat apex position and heartbeat category of the electrocardiogram signal to be detected.

[0007] Optionally, the preprocessing includes: denoising processing and data normalization processing.

[0008] Optionally, before acquiring the heartbeat localization classification model, the method further includes training the heartbeat localization classification model.

[0009] Optionally, the training of the heartbeat localization classification model includes: collecting sample ECG signals; preprocessing the sample ECG signals; segmenting the preprocessed sample ECG signals to determine a sample ECG data set, wherein the sample ECG data set includes heartbeat apex position markers and heartbeat category markers; extracting features from the sample ECG data set using a feature extraction network; and training the extracted features using a regression network model to determine the heartbeat localization classification model.

[0010] Optionally, the extracting features of the sample ECG dataset using a feature extraction network includes: extracting morphological features of the sample ECG dataset using a convolutional neural network; and extracting rhythm features of the sample ECG dataset using a transformer network.

[0011] Optionally, the training of the heartbeat localization classification model includes establishing a target data set as an optimization target of the heartbeat localization classification model. The establishment of the target data set includes: dividing the preprocessed sample ECG signal into a certain number of equal parts; determining whether the data in each divided area after the equal parts contain heartbeats; obtaining the heartbeat apex position and heartbeat category of the divided areas containing heartbeats; normalizing the heartbeat apex position of the divided areas containing heartbeats; one-hot encoding the heartbeat category of the divided areas containing heartbeats; data splicing of the normalized heartbeat apex position and the one-hot encoded heartbeat category of the divided areas containing heartbeats to obtain the target data set.

[0012] Optionally, the preprocessing includes: denoising processing and data normalization processing.

[0013] To achieve the above-mentioned purpose and other related purposes, the present invention provides a heartbeat localization classification system based on deep learning, including: a signal acquisition module, used to acquire an electrocardiogram signal to be detected; a preprocessing module, used to preprocess the electrocardiogram signal to be detected; an electrocardiogram data set determination module, used to segment the preprocessed electrocardiogram signal and determine the electrocardiogram data set; a heartbeat localization classification model determination module, used to train and determine the heartbeat localization classification model; a heartbeat localization classification module, used to determine the heartbeat apex position and heartbeat category of the electrocardiogram signal to be detected based on the electrocardiogram data set and the heartbeat localization classification model.

[0014] To achieve the above-mentioned purpose and other related purposes, the present invention provides a computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, the deep learning-based heartbeat localization and classification method described in any one of claims 1 to 7 is implemented.

[0015] To achieve the above-mentioned purpose and other related purposes, the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that when the processor executes the computer program, the steps of the deep learning-based heartbeat localization and classification method described in any one of claims 1 to 7 are implemented.

[0016] As described above, the heartbeat localization classification method, system and computer-readable storage medium based on deep learning of the present invention have the following beneficial effects:

[0017] In view of the problems existing in the prior art, the present invention proposes a heartbeat localization and classification method based on deep learning, which can reduce the dependence on prior knowledge, realize automatic feature extraction, and thus improve the adaptability of the algorithm. Furthermore, different from other deep learning ECG detection algorithms, the timing features extracted by the deep learning method adopted by the present invention are more feasible, and can simultaneously realize the extraction of ECG signal morphology and rhythm features. In addition, the present invention uses a large number of training samples containing various heartbeat types to train the model, and the anti-interference ability of the model is enhanced, which greatly improves the accuracy of heartbeat localization and classification. In addition, the present invention does not use the pre-selection box solution, bypasses the non-maximum suppression task, reduces the task time consumption, realizes end-to-end detection tasks, and simplifies the task process. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 is an exemplary flow chart of a heartbeat localization classification method based on deep learning according to an embodiment of the present invention;

[0019] Figure 2 is an exemplary module diagram of a heartbeat localization and classification system based on deep learning according to an embodiment of the present invention;

[0020] Figure 3A is an exemplary flow chart of determining a heartbeat localization classification model according to an embodiment of the present invention;

[0021] Figure 3B is an exemplary flow chart of a heartbeat localization classification model according to another embodiment of the present invention;

[0022] Figure 4 is an exemplary flow chart of determining a target data set according to an embodiment of the present invention;

[0023] Figure 5 It is a schematic diagram showing inputting an electrocardiogram signal into a heartbeat localization classification model for detection according to an embodiment of the present invention. DETAILED DESCRIPTION

[0024] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0025] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0026] The purpose of this application is to use a deep learning network to locate and classify multiple heartbeat electrocardiogram signals, in order to solve the problems of existing methods of locating and classifying a single heartbeat, and the need to perform non-maximum suppression after prediction using multiple pre-selected boxes, which increases time consumption, thereby achieving end-to-end rapid heartbeat location and classification, simplifying the heartbeat location and classification process, and using a large number of samples containing various heartbeat types to train the model with strong anti-interference ability, can be applied to any category of heartbeat location and classification, greatly improving the accuracy of heartbeat location and classification, and has good application prospects and very important practical significance.

[0027] The overall concept of the present application is to use deep learning to locate and classify heartbeats. Specifically, first obtain the ECG signal to be detected; preprocess the ECG signal to be detected; segment the preprocessed ECG signal to determine the ECG data set; then input the ECG data set into a pre-trained heartbeat location classification model, thereby determining the heartbeat apex position and heartbeat category of the ECG signal to be detected. Among them, training the heartbeat location classification model includes: collecting sample ECG signals; preprocessing the sample ECG signals; segmenting the preprocessed sample ECG signals to determine the sample ECG data set, wherein the sample ECG data set contains a heartbeat apex position marker and a heartbeat category marker; then, use a feature extraction network to extract features of the sample ECG data set (including morphological feature extraction and rhythm feature extraction); after feature extraction, the regression network can be further used to determine the heartbeat apex position and the classification network can be used to determine the heartbeat category, so as to train the model and determine the heartbeat location classification model. Among them, the morphological features of the sample ECG data set can be extracted using a convolutional neural network, and the rhythm features of the sample ECG data set can be extracted using a transformer network.

[0028] Figure 1 It is an exemplary flow chart of a heartbeat localization classification method based on deep learning according to an embodiment of the present invention.

[0029] In step 101 , an electrocardiogram signal to be detected may be acquired. Step 101 may be completed by the signal acquisition module 201 .

[0030] In step 102, the ECG signal to be detected may be preprocessed. This step 102 may be completed by the preprocessing module 202. The preprocessing may include denoising and normalizing the ECG signal. The denoising may include passing the ECG signal through a bandpass filter to remove power frequency interference, baseline drift, myoelectric interference, etc.

[0031] In step 103, the preprocessed ECG signal can be segmented to determine the ECG data set. This step 103 can be completed by the ECG data set determination module 203. In some embodiments, the ECG signal can be sliced ​​into segments with a set length. The segmentation can ensure that the ECG data set contains heartbeats of different categories. The set length can be 10 seconds or greater than 10 seconds. For example, the length can be 10 seconds, 11 seconds, 12 seconds, 13 seconds, 14 seconds, 15 seconds, 16 seconds, 17 seconds, 18 seconds, 19 seconds, 20 seconds, etc. The segmented data segments are the ECG data sets. In some embodiments, if the length of the ECG data to be detected exceeds a certain length (for example, the sample data length required by the model), the long data is segmented with the sample data length as a window and overlapped by 1s.

[0032] In step 104, a heartbeat localization classification model can be obtained. This step 104 can be completed by the heartbeat localization classification model determination module 204. The heartbeat localization classification model can be used to identify the heartbeat contained in the electrocardiographic signal to be detected. The identification includes heartbeat vertex position identification and heartbeat category identification. The heartbeat category includes other heartbeat categories such as sinus, atrial fibrillation, atrial flutter, artifact, ventricular escape beats, atrial escape beats, nodal escape beats, premature beats, atrial premature beats, ventricular premature beats, atrial pacing, ventricular pacing, and atrioventricular pacing. The specific method for determining the heartbeat classification model can refer to Figure 3 and its related description, which will not be repeated here.

[0033] In step 105 , the ECG data set is input into the heartbeat location classification model to determine the heartbeat apex position and heartbeat category of the ECG signal to be detected. This step can be completed by the heartbeat location classification module 205 .

[0034] The heartbeat localization classification model may include a feature extraction network, a regression network, a target classification network, and a heartbeat category classification network. The feature extraction network may be used to extract the morphological features and rhythmic features of the heartbeat contained in the electrocardiogram signal. In some embodiments, a convolutional neural network may be used to extract morphological features from the electrocardiogram data, and a transformer network may be used to extract rhythmic features from the data after the morphological features are extracted. The target classification network may use the morphological features and rhythmic features of the electrocardiogram signal extracted by the feature extraction network to determine whether a heartbeat is contained in the electrocardiogram data segment in the electrocardiogram data set. If a heartbeat is contained, the heartbeat category classification network may classify the heartbeat, and the regression network may detect the position of the heartbeat apex.

[0035] Because the method used in this application does not use a large number of pre-selected windows, there will not be multiple target windows detected by the same heartbeat, so there is no need to do non-maximum suppression. It is only necessary to remove the overlapping area when the long data is segmented to obtain the heartbeat vertex position and heartbeat classification information. Therefore, the task time is greatly reduced, the end-to-end detection task is achieved, and the task process is simplified.

[0036] Figure 2 2 is an exemplary module diagram of a heartbeat localization classification system based on deep learning according to an embodiment of the present invention. The heartbeat localization classification system may include a signal acquisition module 201, a preprocessing module 202, an ECG data set determination module 203, a heartbeat localization classification model determination module 204, and a heartbeat localization classification module 205.

[0037] The signal acquisition module 201 may be used to acquire an electrocardiogram signal, which may include an electrocardiogram signal to be detected and / or a sample electrocardiogram signal.

[0038] The preprocessing module 202 is used to preprocess the ECG signal. The preprocessing may include denoising and normalizing the ECG signal. The denoising may include passing the ECG signal through a bandpass filter to remove power frequency interference, baseline drift, myoelectric interference, etc.

[0039] The ECG data set determination module 203 can be used to segment the preprocessed ECG signal to determine the ECG data set. In some embodiments, the ECG signal can be sliced ​​into segments of a set length. The segmentation can ensure that the ECG data set contains heartbeats of different categories. The set length can be 10 seconds or any length greater than 10 seconds. For example, the length can be 10 seconds, 11 seconds, 12 seconds, 13 seconds, 14 seconds, 15 seconds, 16 seconds, 17 seconds, 18 seconds, 19 seconds, 20 seconds, etc. The segmented data segments are the ECG data sets.

[0040] The heartbeat localization classification model determination module 204 is used to train and determine the heartbeat localization classification model. The heartbeat localization classification model includes a feature extraction network, a regression network, a target classification network and a heartbeat category classification network. The feature extraction network can be used to extract the morphological features and rhythmic features of the heartbeat contained in the electrocardiogram signal. In some embodiments, a convolutional neural network can be used to extract morphological features of the electrocardiogram data, and a transformer network can be used to extract rhythmic features of the data after the morphological features are extracted. The target classification network can use the morphological features and rhythmic features of the electrocardiogram signal extracted by the feature extraction network to determine whether the electrocardiogram data segment in the electrocardiogram data set contains a heartbeat. If a heartbeat is contained, the heartbeat category classification network can classify the heartbeat, and the regression network can detect the position of the heartbeat apex.

[0041] The heartbeat location classification module 205 is used to determine the heartbeat apex position and the heartbeat category of the electrocardiogram signal to be detected according to the electrocardiogram data set and the heartbeat location classification model.

[0042] It should be noted that the heartbeat location classification system shown above is only exemplary and is not intended to limit the present invention. In some embodiments, the heartbeat location classification system may also include other units or modules to complete corresponding functions. In some embodiments, one or more modules in the heartbeat location classification system may include one or more self-modules. For example, the heartbeat location classification model determination module 204 may further include a sample signal acquisition submodule, a preprocessing submodule, a sample data set determination submodule, a feature extraction submodule, a training submodule, etc. The sample signal acquisition submodule may be used to acquire a sample ECG signal to train the model. The preprocessing submodule may preprocess the sample ECG signal. The sample data set determination unit may segment the preprocessed sample ECG signal to generate a sample data set. The feature extraction submodule may extract the morphological features and rhythm features of the heartbeat in the sample data set. The training submodule may train the model using the extracted morphological features and rhythm features. In some embodiments, the acquired ECG signals can be divided into training set data, validation set data and test set data. Accordingly, the heartbeat localization classification model determination module 204 can also include a verification submodule and a test submodule; the verification submodule is used to use the verification set data to verify the accuracy of the model training and prevent overfitting; the test submodule can be used to evaluate the performance of the final generated model using the test set data.

[0043] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0044] FIG. 3 is an exemplary flow chart of determining a heartbeat localization classification model according to an embodiment of the present application.

[0045] In step 301, sample ECG signals may be collected, wherein the sample ECG signals include photoelectric signals of various heartbeat types.

[0046] In step 302, the sample ECG signal may be preprocessed. The preprocessing may include denoising and normalizing the ECG signal. The denoising may include passing the ECG signal through a bandpass filter to remove power frequency interference, baseline drift, myoelectric interference, and the like.

[0047] In step 303, the preprocessed sample ECG signal may be segmented to determine a sample ECG data set. In some embodiments, the sample ECG signal may be sliced ​​into segments of a set length. The segmentation may ensure that the ECG data set contains heartbeats of different categories. The set length may be 10 seconds or greater, for example, the length may be 10 seconds, 11 seconds, 12 seconds, 13 seconds, 14 seconds, 15 seconds, 16 seconds, 17 seconds, 18 seconds, 19 seconds, 20 seconds, etc. The segmented data segments are the sample ECG data sets.

[0048] In step 304, a feature extraction network may be used to extract features from the sample ECG data set. The feature extraction network may be used to extract the morphological features and rhythm features of the heartbeat contained in the ECG signal. In some embodiments, a convolutional neural network may be used to extract morphological features from the ECG data. For example, a network structure with a residual network (e.g., a ResNet101 structure) may be used to extract morphological features from the sample ECG signal. In some embodiments, the starting feature number of the ResNet101 structure may be set to 8, and the feature increase multiple may be set to 2 times, so that the model parameters may be reduced while retaining a deeper network structure, effectively suppressing overfitting.

[0049] In some embodiments, a transformer network can be used to extract rhythmic features from the data after morphological features are extracted. In some embodiments, a gelu activation function can be used, and a LayerNormalization layer can be set to use horizontal normalization to retain the semantic meaning of a single sample, which is convenient for feeding into the transformer structure. In some embodiments, the encoding layer of the transformer network can be used to extract the rhythmic features of the ECG signal. The number of features output by the transformer layer is 256. In some embodiments, in order to prevent overfitting, a dropout layer can also be constructed in the transformer, and the dropout rate ranges from 0 to 0.9, and the dropout rate is formed by the number of cyclic layers.

[0050] In step 305, the extracted features may be used to train a heartbeat localization classification model. The heartbeat localization classification model includes a regression network, a target classification network, and a heartbeat category classification network. The target classification network may use the morphological features and rhythm features of the ECG signal extracted by the feature extraction network to determine whether the ECG data segment in the ECG data set contains a heartbeat. If a heartbeat is contained, the heartbeat category classification network may classify the heartbeat, and the regression network may detect the position of the heartbeat apex.

[0051] Figure 5 FIG. 1 is a schematic diagram of inputting an electrocardiogram signal into a heartbeat location classification model for detection according to an embodiment of the present invention. Figure 5 As shown, the ECG signal 501 is input into the ResNet 101 network 502, thereby extracting the morphological features 503 (also called electrocardiogram features or ECG features), and then the extracted ECG features are input into the transform network 504 to further extract the rhythm features. The multi-head attention operation, add&norm operation, and feedforward operation included in the transform network 504 are similar to the operations in the conventional transform network coding layer, and will not be repeated here.

[0052] In some embodiments, the features extracted in step 304 can be used as feature layers to input the target detection head conv_obj 505, the position recognition head conv_pos 506, and the classification head conv_type 507 of the heartbeat localization classification model. Wherein conv_obj and conv_pos are composed of convolutions with a single convolution kernel of 1 and an output feature number of 1; conv_type is composed of a convolution kernel of 1 and an output feature number of the number of categories of heartbeat classification. Finally, conv_obj, conv_pos, and conv_type are concatenated along the feature number dimension to obtain the model output result.

[0053] In some embodiments, when training the heartbeat localization classification model, it also includes establishing a target data set as the optimization target of the heartbeat localization classification model. In some embodiments, the sample ECG data set and the target data set can be divided into a training set, a validation set, and a test set in a certain proportion. For example, 60% of them can be used as a training set, 20% as a validation set, and the remaining 20% ​​as a test set. The training set can be used to train the model; the validation set can be used to verify the accuracy of the model training and to feedback whether overfitting occurs during the training process; the test set can be used to evaluate the performance of the final generated model. It should be noted that the above method of dividing the training set, validation set, and test set is only exemplary and does not limit the present invention. In other embodiments, there may be other division methods.

[0054] Figure 3B FIG. 1 is a schematic flow chart of training and testing a heartbeat location classification model according to another embodiment of the present application. Figure 5 It can be seen that after the sample ECG signal data is preprocessed by noise reduction filtering, it can be divided into three parts: training set data, validation set data, and test set data. It should be noted that the division of training set data, validation set data, and test set data can precede the preprocessing step, and the division of training set data, validation set data, and test set data can also be later than the preprocessing step. Here, the order is restricted.

[0055] The training set data, validation set data, and test set data all contain heartbeat vertex position markers and heartbeat category markers. The training set data and validation set data can be further processed to determine the target data set required for model training. For details, please refer to Figure 4 The methods and steps shown in will not be repeated here.

[0056] The data in the preprocessed training set data and validation data set can be used to train the heartbeat localization classification model (also called "heartbeat recognition model"). The target data set determined from the training set data can be input into the heartbeat localization classification model as a model optimization target. The target data set determined from the validation set data can be used to verify the prediction results of the model (for example, to verify the accuracy and recall rate of the model), and to prevent overfitting by adjusting the model parameters.

[0057] In some embodiments, the optimizer can use Adm to construct a learning rate that gradually decays as the number of training rounds increases, and use an early stopping mechanism during training to prevent overfitting caused by a small data set. In some embodiments, the result obtained in step 406 can be used as an optimization target, and a binary classification loss function is constructed for conv_obj, a regression loss function is constructed for conv_pos, and a multi-classification loss function is constructed for conv_type. The model output result is optimized through a gradient descent scheme to obtain the optimal output target.

[0058] The test set data can be used to test the heartbeat location classification model generated by training. In some embodiments, the preprocessed test set data can be input into the heartbeat location classification model to generate a prediction result. Further, the performance and classification ability of the model are measured by comparing the result with the heartbeat vertex position mark and the heartbeat type mark contained in the test set data.

[0059] Figure 4 is an exemplary flow chart of determining a target data set according to an embodiment of the present invention.

[0060] In step 401, the preprocessed sample ECG signal can be divided into a certain number of equal parts. In some embodiments, the preprocessed data can be divided into n equal parts. Among them, the value of n is related to the time length of the sample data. The longer the time length of the sample data, the larger the value of n. In some embodiments, the time length of the sample data is 10 seconds, and n can be 32. It should be noted that the sample data time length and the values ​​of n listed here are exemplary and are not used to limit the present invention. In other embodiments, the sample data time length and the values ​​of n can also be adjusted according to specific circumstances.

[0061] In step 402, it can be determined whether the data in each equally divided area contains a heartbeat. In some embodiments, the equally divided area with a heartbeat can be marked as 1, and the equally divided area with a heartbeat can be marked as 0.

[0062] In step 403, the heartbeat apex position and the heartbeat category of the equally divided area containing the heartbeat may be obtained.

[0063] In step 404, the positions of the heartbeat apexes of the equally divided regions containing the heartbeats may be normalized and converted into offsets.

[0064] In step 405, the heartbeat categories of the equally divided regions containing the heartbeats may be one-hot encoded and recorded as hot_cls.

[0065] In step 406, the normalized heartbeat vertex position of the equally divided area containing the heartbeat and the one-hot encoded heartbeat category can be spliced ​​to obtain the target data set. In some embodiments, the data structure after splicing is (n, pos, hot_cls), where the length of n is the number of equal parts of the data; the length of pos is 1, indicating the normalized heartbeat vertex position, and the length of hot_cls is the number of categories. The data set formed after splicing is the target data set.

[0066] It should be noted that the steps shown above can be performed simultaneously or in sequence. For example, steps 404 and 405 can be performed simultaneously or in sequence (for example, step 404 is performed first, then step 405 or step 405 is performed first, then step 404).

[0067] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0068] An embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the heartbeat localization and classification method based on deep learning are implemented.

[0069] An embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the deep learning-based heartbeat localization classification method when executing the computer program.

[0070] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0071] In the embodiments provided by the present invention, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0072] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0073] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0074] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory ((RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0075] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.

Claims

1. A heartbeat location classification method based on deep learning, characterized in that: include: Acquire the electrocardiogram signal to be detected; Preprocessing the electrocardiogram signal to be detected; Segment the preprocessed ECG signal to determine the ECG data set; Obtaining a heartbeat localization classification model; Inputting the ECG data set into the heartbeat location classification model to determine the heartbeat apex position and heartbeat category of the ECG signal to be detected; Before obtaining the heartbeat localization classification model, the method further includes training the heartbeat localization classification model; The training heartbeat location classification model comprises: Collecting sample ECG signals; Preprocessing the sample ECG signal; Segmenting the preprocessed sample ECG signal to determine a sample ECG data set, wherein the sample ECG data set includes a heartbeat vertex position mark and a heartbeat category mark; Using a feature extraction network to extract features from the sample ECG dataset; Using the extracted features to train a heartbeat localization classification model to determine the heartbeat localization classification model; The step of extracting features from the sample ECG data set using a feature extraction network includes: Extracting morphological features of the sample ECG dataset using a convolutional neural network; Extracting rhythm features of the sample ECG data set using a transformer network; The training of the heartbeat localization classification model includes establishing a target data set as an optimization target of the heartbeat localization classification model, including: Divide the preprocessed sample ECG signal into n equal parts; Determine whether the data in each equally divided area contains heart beats; Obtaining the heartbeat apex position and heartbeat category of the equally divided area containing the heartbeat; Normalize the positions of the heartbeat apex of the equally divided areas containing the heartbeat; One-hot encode the heartbeat type of the equally divided area containing the heartbeat; The normalized heartbeat apex positions of the equally divided regions containing the heartbeats and the one-hot encoded heartbeat categories are concatenated to obtain the target data set.

2. The heartbeat location classification method based on deep learning according to claim 1, characterized in that: The preprocessing includes: denoising processing and data normalization processing.

3. A heartbeat location classification system based on deep learning, characterized in that: include: A signal acquisition module, used for acquiring the ECG signal to be detected; A preprocessing module, used for preprocessing the electrocardiogram signal to be detected; An ECG data set determination module is used to segment the preprocessed ECG signal to determine the ECG data set; A heartbeat localization classification model determination module is used to train and determine a heartbeat localization classification model; The training and determining of the heartbeat location classification model comprises: Collecting sample ECG signals; Preprocessing the sample ECG signal; Segmenting the preprocessed sample ECG signal to determine a sample ECG data set, wherein the sample ECG data set includes a heartbeat vertex position mark and a heartbeat category mark; Using a feature extraction network to extract features from the sample ECG dataset; Using the extracted features to train a heartbeat localization classification model to determine the heartbeat localization classification model; The step of extracting features from the sample ECG data set using a feature extraction network includes: Extracting morphological features of the sample ECG dataset using a convolutional neural network; Extracting rhythm features of the sample ECG data set using a transformer network; A heartbeat location classification module, used to determine the heartbeat apex position and the heartbeat category of the electrocardiogram signal to be detected according to the electrocardiogram data set and the heartbeat location classification model; The training and determining of the heartbeat localization classification model includes establishing a target data set as an optimization target of the heartbeat localization classification model, including: Divide the preprocessed sample ECG signal into n equal parts; Determine whether the data in each equally divided area contains heart beats; Obtaining the heartbeat apex position and heartbeat category of the equally divided area containing the heartbeat; Normalize the positions of the heartbeat apex of the equally divided areas containing the heartbeat; One-hot encode the heartbeat type of the equally divided area containing the heartbeat; The normalized heartbeat apex positions of the equally divided regions containing the heartbeats and the one-hot encoded heartbeat categories are concatenated to obtain the target data set.

4. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the deep learning-based heartbeat localization classification method described in any one of claims 1 to 2 is implemented.

5. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the heartbeat localization classification method based on deep learning described in any one of claims 1 to 2 are implemented.

Citation Information

Patent Citations

  • Electrocardiogram heartbeat recognition method, terminal equipment and storage medium

    CN111772619A