A joint processing system and method for heart beat segmentation and classification

By combining feature extraction networks and conditional random fields, the problem of identification errors in abnormal electrocardiograms by existing heartbeat classification methods is solved. This achieves efficient and accurate joint processing of heartbeat segmentation and classification, and is applicable to the accurate localization of multi-category electrocardiogram signals.

CN116327212BActive Publication Date: 2025-10-17SHAN DONG MSUN HEALTH TECH GRP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310330682.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-28
Publication Date
2025-10-17
Estimated Expiration
2043-03-28

AI Technical Summary

Technical Problem

Existing cardiac beat classification methods struggle to accurately identify abnormal heartbeats such as P waves when faced with abnormal electrocardiograms, especially complex arrhythmias like atrioventricular block. Furthermore, existing methods often process heartbeat segmentation and classification independently, leading to erroneous interpretations, and are computationally expensive for long-term electrocardiogram signals.

Method used

By simultaneously acquiring the alignment features of ECG segmentation and classification through a feature extraction network, and using conditional random fields and Viterbi decoding algorithms to obtain the segmentation sequence and classification results with the highest probability, and combining multi-scale convolution and recurrent neural networks to extract local ECG features, the joint processing of heartbeat segmentation and classification is achieved.

Benefits of technology

It improves the accuracy of heartbeat classification, solves the error problem of traditional methods in the division and classification of abnormal electrocardiograms, saves storage resources and computing costs, and is suitable for the precise localization of multi-class electrocardiogram signals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116327212B_ABST
    Figure CN116327212B_ABST
Patent Text Reader

Abstract

The application provides a heart beat division and classification combined processing system and method, and the scheme comprises: a data acquisition unit for acquiring electrocardio data to be predicted, obtaining an electrocardio waveform tensor and a corresponding sub-waveform position tensor after corresponding preprocessing; a feature extraction unit for processing the electrocardio waveform tensor by using a pre-trained feature extraction network model to obtain electrocardio position combined features; a heart beat division unit for performing feature extraction according to the sub-waveform position tensor based on division features in the electrocardio position combined features, and obtaining a heart beat division result by using a Viterbi decoding algorithm after mask processing; and a heart beat classification unit for obtaining a heart beat classification result according to the sub-waveform position tensor and the heart beat division result based on classification features in the electrocardio position combined features.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of electrocardiosignal processing, and particularly relates to a joint processing system and method for heart beat division and classification. BACKGROUND

[0002] The statements in this section merely provide background information related to the present application and do not necessarily constitute the prior art.

[0003] As a gold standard for measuring cardiac electrical physiology diseases, electrocardiogram has been widely used in clinical practice. However, only through manual interpretation, the skill requirement for doctors is high, and the time consumption is large, and in dynamic electrocardiogram, which is a continuous electrocardiosignal for more than 24 hours, it is extremely unrealistic to rely only on manual interpretation for diagnosis. With the development of machine learning, numerous electrocardio algorithms have been proposed and applied to assist clinical electrocardio interpretation, saving a large amount of medical resources. In addition, the stability of the computer also reduces the influence of human factors. Among them, heart beat classification as an important part of auxiliary diagnosis has become a current research hotspot.

[0004] The existing heart beat classification is mainly divided into three types: (1) the method based on waveform morphology, which uses medical rules to make judgments on voltage amplitude, width, electrical axis and interval; (2) the method based on waveform features, which manually makes morphological features or wavelet features and uses classification algorithms to learn; among them, the first two designs require a large amount of medical experience of experts, thus having great limitations; (3) the most commonly used classification method based on learning at present, which inputs a segment of electrocardiosignal into a deep learning network, learns the mapping relationship between electrocardio data and classification labels, and then obtains the category to which the electrocardio belongs.

[0005] The inventors found that the existing heart beat classification method mainly focuses on classifying three to five arrhythmia categories such as normal or bundle branch block (N), supraventricular ectopic beat (S), and ventricular ectopic beat (V), which provides limited auxiliary diagnosis information, and does not involve atrial fibrillation, poor perception and pacing heart rate information. At present, the heart beat classification is mostly for the classification of one electrocardio segment, but in the real production environment, there may be multiple categories in one electrocardio segment, and the abnormal category needs to be accurately positioned, thus having great limitations. The few single heart beat classification algorithms take the segment category centered on the heart beat as the category of the heart beat, which has a large amount of redundant calculation and great cost overhead in long electrocardiosignal.

[0006] Meanwhile, existing single heart beat classification methods are based on QRS wave (QRS wave complex) as the classification benchmark of heart beat, but in abnormal heart beats such as P wave non-transmission, atrioventricular separation, and poor perception, there is no corresponding QRS wave for P wave and the like, which needs to be classified separately, so the existing classification method cannot better identify these diseases. Moreover, the existing heart beat division and heart beat classification are often independent of each other, and the current heart beat division often uses a rule-based method, for example: first find the QRS wave, and then search for the P wave within a certain period of time and the T wave within a certain period of time. Such a rule-based method has no obstacles in the application of normal electrocardiogram, but in abnormal electrocardiogram, especially in complex arrhythmia diseases represented by atrioventricular block, division errors will seriously affect the final interpretation results. SUMMARY

[0007] To solve the above problems, the present application provides a joint processing system and method for heart beat division and classification. The scheme simultaneously obtains the alignment features of electrocardiogram division and classification through a feature extraction network, and converts them into division features and classification features corresponding to the sub-waveform. During training, the division features are used to obtain the sequence labeling loss with the maximum probability through conditional random field, and during decoding, the division type is obtained using Viterbi decoding to obtain a reasonable heart beat division sequence, solving the problem that traditional manual reasoning cannot be compatible with abnormal electrocardiogram. At the same time, according to the classification category and the corresponding classification category, the category with a probability exceeding a threshold value is selected from all possible heart beat classification categories of the classification category as the heart beat classification category to which the sub-waveform belongs, effectively improving the accuracy of heart beat classification.

[0008] According to a first aspect of an embodiment of the present application, a joint processing system for heart beat division and classification is provided, comprising:

[0009] a data acquisition unit for acquiring electrocardiogram data to be predicted, obtaining an electrocardiogram waveform tensor and a corresponding sub-waveform position tensor after corresponding preprocessing;

[0010] a feature extraction unit for processing the electrocardiogram waveform tensor using a pre-trained feature extraction network model to obtain electrocardiogram alignment features; wherein the feature extraction network model specifically includes the following processing process: based on the electrocardiogram waveform tensor, a first feature of different perception field scales is obtained using multi-scale convolution; the first feature is modeled through a multi-layer SE network to obtain the relationship between multiple channels, and a second feature is obtained; the second feature is modeled through a bidirectional recurrent neural network to obtain a time sequence feature, and a third feature is obtained; after the third feature is processed through a multi-layer perception machine, electrocardiogram alignment features including heart beat division features and classification features are obtained;

[0011] a heartbeat division unit configured to perform feature extraction according to the sub-waveform position tensor based on a division feature in the electrocardiogram position joint feature, and obtain a heartbeat division result through a Viterbi decoding algorithm after mask processing;

[0012] a heartbeat classification unit configured to obtain a heartbeat classification result according to the sub-waveform position tensor and the heartbeat division result based on a classification feature in the electrocardiogram position joint feature.

[0013] Further, the training of the feature extraction network model specifically includes:

[0014] constructing a historical data training set, wherein the samples in the training set include an electrocardiogram waveform tensor obtained after electrocardiogram data preprocessing and corresponding label data preprocessing results;

[0015] training the feature extraction network model based on the samples in the training set, and obtaining the trained feature extraction network model when a preset loss function reaches convergence.

[0016] Further, the loss function used in the training of the feature extraction network model includes a division loss function calculated based on a division feature in the electrocardiogram position joint feature and label data, using mask processing and conditional random field; and a classification loss function calculated through cross-entropy loss based on a classification feature in the electrocardiogram position joint feature and label data.

[0017] Further, the heartbeat division loss function is specifically represented as follows:

[0018]

[0019] wherein, denotes the transition probability of the transition of the previous sub-waveform wave i-1 classification T_wave i-1 to the next sub-waveform wave i classification T_wave i ; i denotes the i-th sub-waveform; denotes the feature value of the i-th sub-waveform in the first dimension T_wave i in the electrocardiogram waveform tensor ECG feature divide_wave wave ; and L denotes all transition combinations of the waveform.

[0020] Further, the classification loss function is specifically represented as follows:

[0021]

[0022] wherein, wave num is the number of sub-waves, classify label mat is the actual label matrix containing the classification corresponding to each sub-wave, is the predicted feature matrix containing the classification corresponding to each sub-wave.

[0023] According to a second aspect of the embodiments of the present application, a joint processing method for heart beat division and classification is provided, comprising:

[0024] obtaining electrocardio data to be predicted, and obtaining an electrocardio waveform tensor and a corresponding sub-wave position tensor after corresponding pre-processing;

[0025] processing the electrocardio waveform tensor by using a pre-trained feature extraction network model to obtain electrocardio position joint features; wherein the feature extraction network model specifically comprises the following processing process: based on the electrocardio waveform tensor, a first feature of different perception field scales is obtained by using multi-scale convolution; the first feature is modeled by using a multi-layer SE network to model the relationship between multiple channels to obtain a second feature; the second feature is modeled by using a bidirectional recurrent neural network to model the timing characteristics to obtain a third feature; after the third feature is processed by using a multi-layer perception machine, electrocardio position features including heart beat division features and classification features are obtained;

[0026] based on the division features in the electrocardio position joint features, feature extraction is performed according to the sub-wave position tensor, and after mask processing, a heart beat division result is obtained by using a Viterbi decoding algorithm;

[0027] based on the classification features in the electrocardio position joint features, a heart beat classification result is obtained according to the sub-wave position tensor and the heart beat division result.

[0028] According to a third aspect of the embodiments of the present application, an electronic device is provided, comprising a memory, a processor and a computer program stored on the memory and running on the memory, and the processor executes the program to realize the joint processing method for heart beat division and classification.

[0029] According to a fourth aspect of the embodiments of the present application, a non-transitory computer readable storage medium is provided, and a computer program is stored on the non-transitory computer readable storage medium, and the program is executed by a processor to realize the joint processing method for heart beat division and classification.

[0030] Compared with the prior art, the present application has the following beneficial effects:

[0031] (1) The application provides a combined processing system and method for heart beat division and classification, wherein the scheme simultaneously obtains the corresponding features of electrocardiogram division and classification through a feature extraction network, and converts the features into division features and classification features corresponding to the sub-waveform, the division features are used to obtain the sequence labeling loss with the maximum probability through conditional random field during training, and the division type is obtained through Viterbi decoding during decoding to obtain a reasonable heart beat division sequence, thereby solving the problem that the traditional manual reasoning cannot be compatible with abnormal electrocardiogram.

[0032] (2) According to the scheme, the classification category is selected from all possible heart beat classification categories, and the category with a probability exceeding a threshold value is selected as the heart beat classification category of the sub-waveform.

[0033] (3) The feature extraction network of the application shares one set of parameters of one model in two tasks (i.e., division and classification), the heart beat division task can guide the classification task to provide heart beat level feature guidance for the classification task, and the classification task can also provide category level feature guidance for the division to enrich the features during model optimization; at the same time, the same set of parameters also takes into account the storage resource overhead and efficiency, and one model can solve two tasks; in addition, the network simultaneously extracts local electrocardiogram features, lead correlation features and time sequence features through a multi-scale convolution SE network and a recurrent neural network; the convolution is more focused on local morphology; the SE network extracts the relationship between channels to promote the combination of multiple leads for diseases, such as abnormality in certain leads when some diseases occur; and the recurrent neural network can better integrate electrocardiogram rhythm information.

[0034] The advantages of the additional aspects of the application will be partially given in the following description, partially become obvious from the following description, or be understood through the practice of the application. BRIEF DESCRIPTION OF DRAWINGS

[0035] The drawings accompanying the specification of the application serve to provide further understanding of the application, the illustrative embodiments of the application and the description thereof serve to explain the application, and do not constitute an improper limitation of the application.

[0036] Figure 1 A processing flow schematic diagram of a heart beat division and classification combined processing system described in an embodiment of the application. DETAILED DESCRIPTION

[0037] The application will be further described below in combination with the drawings and embodiments.

[0038] It should be pointed out that the following detailed description is exemplary and is intended to provide further explanation of the application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as generally understood by those skilled in the art to which the application belongs.

[0039] It is to be noted that the terms used herein are merely for describing specific embodiments and are not intended to limit exemplary embodiments according to the present application. As used herein, the singular forms are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in this specification, specify the presence of stated features, steps, operations, elements, components, and / or combinations thereof, but do not preclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof.

[0040] The embodiments in the present application and the features in the embodiments can be combined with each other without conflict.

[0041] Term explanation:

[0042] Heartbeat division: obtaining the heartbeat to which the subwaveform belongs, to determine the state to which the current subwaveform belongs, and using the state to which the subwaveform belongs as a guide for classifying the subwaveform;

[0043] Heartbeat classification: predicting the possible disease category corresponding to the current heartbeat signal.

[0044] Embodiment one:

[0045] The purpose of the present embodiment is to provide a joint processing system for heartbeat division and classification.

[0046] A joint processing system for heartbeat division and classification, comprising:

[0047] A data acquisition unit for acquiring electrocardio data to be predicted, and obtaining an electrocardio waveform tensor and a corresponding subwaveform position tensor after corresponding preprocessing;

[0048] A feature extraction unit for processing the electrocardio waveform tensor by using a pre-trained feature extraction network model to obtain electrocardio position joint features; wherein the feature extraction network model specifically includes the following processing process: based on the electrocardio waveform tensor, a first feature of different perception field scales is obtained by using multi-scale convolution; the first feature is modeled by a multi-layer SE network to model the relationship between multiple channels, to obtain a second feature; the second feature is modeled by a bidirectional recurrent neural network to model the timing feature, to obtain a third feature; after the third feature is processed by a multi-layer perception machine, electrocardio position features including heartbeat division features and classification features are obtained;

[0049] A heartbeat division unit for performing feature extraction according to the subwaveform position tensor based on the division features in the electrocardio position joint features, and obtaining a heartbeat division result by a Viterbi decoding algorithm after mask processing;

[0050] a heart beat classification unit configured to obtain a heart beat classification result based on a classification feature in the electrocardiogram pair joint feature, according to the wavelet position tensor and the heart beat division result.

[0051] For ease of understanding, the entire processing process of the joint processing system for heart beat division and classification described in the embodiment is described in detail in the order of training first and then using from the perspective of specific implementation as follows:

[0052] The overall processing process of the system includes:

[0053] Step 1: Preprocessing the obtained historical electrocardiogram data to obtain an electrocardiogram waveform tensor;

[0054] Specifically, the step 1 is to preprocess the obtained original 12-lead electrocardiogram data to obtain an electrocardiogram waveform tensor ECG wave , which has a dimension of (12, wave len ), 12 representing 12 leads, wave len representing the length of the electrocardiogram signal; the preprocessing specifically includes filtering out out-of-band noise in the electrocardiogram data, inserting invalid heart beat noise to increase the robustness of wavelet position errors, and randomly replacing leads to weaken the memory of leads.

[0055] Step 2: obtaining labeled data of the electrocardiogram data, wherein the labeled data includes a position tensor of each wavelet in the waveform, a waveform category list corresponding to each wavelet, and a heart beat division label list corresponding to each wavelet; wherein the waveform category list corresponding to each wavelet and the heart beat division label list corresponding to each wavelet are only used in the training process of the feature extraction network;

[0056] Specifically, the step 2 is:

[0057] Preprocessing the labeled data corresponding to the electrocardiogram data to obtain the following three kinds of data: a position tensor wave loc of each wavelet in the waveform, wave loc having a dimension of (wave num , 2), wherein wave num represents the number of wavelets, and 2 is the starting position [start, end] of the waveform; a waveform category list wave type list corresponding to each wavelet, having a length of wave num ; a 40-division label list divide label list corresponding to each wavelet, having a length of wave num , and a 29-division label matrix classify loc corresponding to each wavelet labellist, length is wave num .

[0058] Wherein, the label data format is: the label data is a heartbeat list HB = [Set1, Set2, …, Set k , …], if i ∈ Set k , it indicates that the sub-waveform i belongs to the heartbeat Set k , the sub-waveform i attribute has the sub-waveform type wave type i, wherein wave type i ∈ [P, QRS, T, U, pacemaker]. The sub-waveform classification category classify label i, wherein classify label i is the designed 29 classification categories.

[0059] Wherein, the 29 classification categories are: N sinus, S atrial, SP supraventricular, V ventricular, J junctional, Je junctional escape, Se atrial escape, Ve ventricular escape, Sa atrial premature non-transmitted, Af atrial fibrillation, AF atrial flutter, PEN poor sensing, PMN poor pacing, AP atrial pacing, VP ventricular pacing, DP atrial-ventricular sequential pacing, Pa sinus P wave non-transmitted, Q uncertain heartbeat, X artifact, F fusion wave, I intraventricular differential conduction, LB left bundle branch block, RB right bundle branch block, IB intraventricular block, LAFB left anterior branch block, WPW pre-excitation syndrome, WPW a pre-excitation syndrome type A, WPWb pre-excitation syndrome type B, and T reverse connection.

[0060] Wherein, the preprocessing is specifically:

[0061] (1) Traverse the heartbeat list HB, judge which heartbeat division label the sub-waveform combination and order in Set belong to, we pre-design 11 possible sub-waveform combinations of 5 sub-waveform types, there are 40 division labels, for example, if the heartbeat f only exists P, QRS, T, U four sub-waveforms, which conforms to {1_P, 1_QRS, 1_T, 1_U_r} in 11 combinations, then the P, QRS, T, U four sub-waveform divide label attributes of the heartbeat are respectively assigned as 1_P, 1_QRS, 1_T, 1_U_r.

[0062] (2) Traverse the heartbeat list, take out all the sub-waveforms in Set, and sort them according to the order of sub-waveforms, get the sorted sub-waveform wave sort .

[0063] (3) Extract the classify sort , divide label , and divide labelTwo attributes, respectively extract two attribute list classify label list and wave type list.

[0064] In a specific implementation, 40 partition labels of 11 possible sub-waveform combinations are designed in advance, wherein the 11 combinations are {1_P, 1_QRS, 1_T, 1_U_r}, {2_QRS, 2_T, 2_U_r}, {3_NAIL}, {4_P, 4_QRS, 4_T, 4_U, 4_PNAIL}, {5_P, 5_PNAIL}, {6_QRS, 6_T, 6_U_r, 6_QRSNAIL}, {7_P, 7_QRS, 7_T, 7_U_r, 7_QRSNAIL}, {8_P, 8_QRS, 8_T, 8_U_r, 8PANIL, 8_QRSNAIL}, {9_QRS, 9_T, 9_U_r, 9_PNAIL, 9_QRSNAIL}, {10_P}, {11_P_r, 11_QRS_r, 11_T_r, 11_U_r}, a total of 11 groups, 40 partition labels, and the elements separated by _ in the label, the first value is which group, the second value indicates which waveform, and the third value r is an optional label indicating that the value can not exist, and the last group of heartbeats is a false heartbeat, which is automatically classified into the 11th type when the first 10 types are not matched.

[0065] Step 3: input the obtained electrocardio waveform tensor into a pre-trained feature extraction network to obtain electrocardio position joint features, wherein the electrocardio position joint features include partition features and classification features of heartbeats.

[0066] The feature extraction network specifically performs the following processing process:

[0067] The electrocardio waveform tensor ECG wave Different perception field scales are obtained by using multi-scale convolution to obtain features net out1 , net out1 The dimension is (hiden_conv, wave len ), wherein hiden_conv represents the output dimension of multi-scale convolution.

[0068] The net out1 is input into a plurality of layers of SE network (Squeeze-and-Excitation Networks) to model the relationship between multiple channels to obtain net out2 , net out2(hiden_SE, wave len ), wherein hiden_SE represents an output dimension corresponding to the SE network;

[0069] net out2 is input into a bidirectional recurrent neural network (RNN) to model the timing feature net out3 , and the dimension of net out3 is (hiden_RNN, wave len ), wherein hiden_RNN represents an output dimension corresponding to the bidirectional recurrent neural network;

[0070] net out3 is input into a multi-layer perceptron (MLP) to obtain wave feature , and wave feature represents a final output of the alignment feature matrix, and the dimension of wave feature is (69, wave len ).

[0071] The training process of the feature extraction network comprises the following steps.

[0072] ECG wave is input into the feature extraction network to obtain electrocardiogram alignment joint features wave feature , and the dimension of wave feature is (69, wave len ). The first 40 dimensions of the 69 dimensions are 40 partition features, and the last 29 dimensions represent 29 classification features of heartbeats, and wave len represents the length of electrocardiogram data.

[0073] The first 40 dimensions of wave feature are partition features divide feature , and wave loc is combined with the features and mask auxiliary and conditional random field to calculate partition loss loss divide , wherein the dimension of divide feature is (40, wave len ).

[0074] The calculation of the partition loss comprises the following steps.

[0075] (1) A wave loc tensor is taken out, the first dimension of which is the number of subwaveforms wave num , and the second dimension is 2, representing the start and end points start and end of each subwaveform in wave feature , and wave loc is taken out according to wave featureThe features in the waveform are as follows: i , end i , then in divide feature Take out the start in the second dimension i to the end i Part, get divide feature i, divide feature The dimension of i is (40, end i -start i ), where 40 represents 40 classification categories, end i -start i Indicates the length of sub-waveform i. Then take the average value in the second dimension to get the sub-waveform i division feature dimension (40, 1), all sub-waveform division features divide_wave feature The dimension is (40, wave num ).

[0076] (2) Since each of the 40 classification labels corresponds to five waveforms, type Generate divide in list mask , to automatically mask out the 40 types of division features that are related to wave type Incompatible types. divide mask The dimension is (40, wave num ), if wave num Neutron waveform i, find wave type List the five sub-waveform types i corresponding to the sub-waveform i type , in 40 categories of heart beat classification and i type The corresponding position dimension is set to 0, and the remaining positions are set to -∞. Finally, let divide_wave feature =divide_wave feature +divide mask , to shield invalid paths in the conditional random field.

[0077] (3) We use the conditional random field to calculate the transfer loss of the current heartbeat classification label and initialize the trainable (40*40) dimension transfer probability matrix trans, trans (i,j) It represents the probability of transferring from classification category i to classification category j. The heartbeat sequence loss function is:

[0078]

[0079] in, Indicates the previous sub-waveform wave i-1 Classification category T_wavei-1 backward wave i T_wave i transition probability of transition. i represents the i-th sub-waveform. ECG wave divide_wave feature T_wave i category in the first dimension, i.e. L represents all transition combinations of the waveforms. The probability of the current heartbeat division label sequence accounting for all label combinations is obtained as the loss, so the smaller the better.

[0080] The last 29-dimensional classification features of wave feature and classify label list are calculated according to the position of wave loc to obtain the cross-entropy loss loss classify ;

[0081] The calculation of the cross-entropy loss specifically includes:

[0082] (1) The last 29 dimensions of wave featute are taken out to obtain classification features, and each value is mapped to a probability by a sigmoid function to obtain classify feature , with a dimension of (29, wave len ).

[0083] (2) classify feature is used to collect each waveform feature classify_wave loc in the same way as the division loss calculation using wave feature , with a dimension of (29, wave num ).

[0084] (3) classify label list is used to generate a label matrix classify feature mat corresponding to classify_wave label . classify label mat has a dimension of (29, wave num ), wherein classify label mat[i, j] = 1 indicates that the sub-waveform j belongs to category i, and vice versa. classify label mat[i, j] = 0 in the matrix.

[0085] (4) The predicted value classffy_wave feature, and the generated label value classify label Mat calculates the cross entropy loss, the formula is:

[0086]

[0087] Using optimization algorithms, through loss divide and loss classify Optimize the parameters of the alignment feature extraction network and the conditional random field and save them. Specifically, the optimization algorithm uses the AdamW optimization algorithm. Repeat the above process until the loss divide and loss classify Reach convergence; obtain a trained feature extraction network.

[0088] Step 4: Obtain the 12-lead ECG data to be predicted pred , and its corresponding sub-waveform position wave loc Specifically: the 12-lead data to be predicted is obtained after noise reduction through the filter (12, wave len ) tensor ECG wave and the corresponding position of the sub-waveform in the tensor wave loc , wave loc The dimension of wave num ,2), where wave num Indicates the number of sub-waveforms, 2 is the starting position of the waveform [start, end].

[0089] Step 5: Based on the ECG in Step 4 wave and wave loc , using the trained feature extraction network to obtain the classification feature wave feature .

[0090] Step 6: Wave feature The first 40 dimensions are wave loc After extracting features and masking, the Viterbi decoding algorithm is used to obtain the heart beat division decoding list divide pred .

[0091] Wherein, the step 6 specifically includes the following steps:

[0092] (1) Wave feature and wave loc Use the first two steps in the division loss calculation to obtain the division feature divide_wave feature , whose dimension is (40, wave num ).

[0093] (2) divide_wavefeature Combined with the trained conditional random field transfer probability parameters, the Viterbi algorithm is used to obtain the heartbeat transfer label sequence with the highest probability, which is used as the final division label result divide pred , divide pred is the length wave num A list of , each element represents the division type of the corresponding sub-waveform.

[0094] Step 7: Wave feature The last 29 dimensions are passed through the wave loc Position and divide pred Corresponding relationship, get the final classification result classify pred , visually displayed to the ECG assist system.

[0095] The classification results are obtained as follows:

[0096] (1) Wave feature and wave loc Use the first two steps in the classification loss calculation to obtain the classification feature classify_wave feature , whose dimension is (29, wave num ).

[0097] (2) The scheme described in this embodiment designs a correspondence between 40 heartbeat classification types and 29 heartbeat types. Each heartbeat classification type can correspond to multiple heartbeat categories. feature The second dimension corresponds to the predicted heartbeat division type divide pred , divide pred i represents the i-th sub-waveform wave i The division result. Traverse classify_wave along the second dimension feature , where for sub-waveform i, the column vector feature i The length is 29, corresponding to 29 heartbeat types, according to divide pred I get the corresponding n heartbeat categories and extract the feature i The corresponding n elements in , take out the classification category with probability greater than the threshold as the heartbeat category corresponding to the sub-waveform. Finally, traverse to get wave num classify the beat type of each sub-waveform pred , classify pred Is the length of wave num A list of which the elements are the heartbeat type lists corresponding to the sub-waveform (because there may be multiple categories).

[0098] In the specific embodiment, the corresponding relationship between the 40 heartbeat classification types and the 29 heartbeat types is as follows: the 40 heartbeat classification types belong to 11 groups of types, and the corresponding relationship of each type is as follows: 1: {N sinus, S atrial, J junctional, Se atrial escape}, 2: {Je junctional escape, SP supraventricular, V ventricular, Ve ventricular escape}, 3: {PMN poor pacing, PEN poor sensing}, 4: {AP atrial pacing}, 5: {AP atrial pacing, Pa sinus P wave non-conduction}, 6: {VP ventricular pacing}, 7: {VP ventricular pacing, N sinus, S atrial, J junctional, SP supraventricular}, 8: {DP atrioventricular sequential pacing}, 9: {DP atrioventricular sequential pacing, PMN poor pacing}, 10: {Pa sinus P wave non-conduction, Sa atrial premature non-conduction}, and 11: {Q uncertain heartbeat, X artifact}.

[0099] Embodiment Two

[0100] The purpose of the embodiment is to provide a joint processing method for heartbeat classification and classification.

[0101] A joint processing method for heartbeat classification and classification, comprising:

[0102] Obtaining electrocardio data to be predicted, and obtaining an electrocardio waveform tensor and a corresponding sub-waveform position tensor after corresponding preprocessing;

[0103] Processing the electrocardio waveform tensor by using a pre-trained feature extraction network model to obtain electrocardio position joint features; wherein the feature extraction network model specifically comprises the following processing process: based on the electrocardio waveform tensor, a first feature of different perception field scales is obtained by using multi-scale convolution; the first feature is modeled by using a multi-layer SE network to model the relationship between multiple channels to obtain a second feature; the second feature is modeled by using a bidirectional recurrent neural network to model the timing characteristics to obtain a third feature; and after the third feature is processed by using a multi-layer perception machine, electrocardio position features including heartbeat classification features and classification features are obtained;

[0104] Based on the classification features in the electrocardio position joint features, the features are extracted according to the sub-waveform position tensor, and the heartbeat classification results are obtained by using a Viterbi decoding algorithm after mask processing.

[0105] Based on the classification features in the electrocardio position joint features, the heartbeat classification results are obtained according to the sub-waveform position tensor and the heartbeat classification results.

[0106] Further, the method of the embodiment corresponds to the system in Embodiment One, and the technical details have been described in detail in Embodiment One, so here is not repeated.

[0107] In more embodiments, the following is also provided:

[0108] An electronic device includes a memory and a processor and computer instructions stored on the memory and running on the processor, when the computer instructions are run by the processor, the method described in embodiment one is completed. For the sake of brevity, it will not be described here.

[0109] It should be understood that in the embodiments, the processor can be a central processing unit CPU, the processor can also be other general-purpose processors, digital signal processors DSPs, application-specific integrated circuits ASICs, ready-to-program gate arrays FPGA or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0110] The memory can include read-only memory and random access memory, and provide instructions and data to the processor, a part of the memory can also include non-volatile random access memory. For example, the memory can also store device type information.

[0111] A computer readable storage medium for storing computer instructions, when the computer instructions are executed by the processor, the method described in embodiment one is completed.

[0112] The method in embodiment one can be directly embodied as a hardware processor to complete, or be completed by a combination of hardware and software modules in the processor. The software module can be located in a storage medium mature in the art such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, register, etc. The storage medium is located in the memory, and the processor reads the information in the memory to complete the steps of the above method in combination with its hardware. To avoid repetition, it will not be described in detail here.

[0113] Those of ordinary skill in the art can realize that the units of the examples described in combination with the embodiments, i.e. the algorithm steps, can be realized in electronic hardware or in a combination of computer software and electronic hardware. Whether the functions are executed in hardware or software mode depends on the specific application of the technical solution and the design constraints. The skilled person can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0114] The heart beat division and classification combined processing system and method provided by the above embodiments can be realized, which has a broad application prospect.

[0115] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A combined processing system for heart beat segmentation and classification, characterized in that: include: A data acquisition unit, which is used to acquire the ECG data to be predicted and obtain the ECG waveform tensor and its corresponding sub-waveform position tensor after corresponding preprocessing; A feature extraction unit, which is used to process the ECG waveform tensor using a pre-trained feature extraction network model to obtain ECG alignment joint features; wherein the feature extraction network model specifically includes the following processing procedures: based on the ECG waveform tensor, a first feature of different receptive field scales is obtained using multi-scale convolution; the first feature is used to model the multi-channel relationship through a multi-layer SE network to obtain a second feature; the second feature is used to model the time series feature through a bidirectional recurrent neural network to obtain a third feature, and the third feature is processed by a multi-layer perceptron to obtain an ECG alignment feature including a heart beat segmentation feature and a classification feature; the loss function used in the feature extraction network model training process includes a segmentation loss function obtained by mask processing and conditional random field calculation based on the segmentation features and labeled data in the ECG alignment joint features; and a classification loss function obtained by cross entropy loss calculation based on the classification features and labeled data in the ECG alignment joint features; The partition loss function is specifically expressed as follows: in, Indicates the previous sub-waveform Classification One sub-waveform backward Classification The transition probability of the transition; Indicates the sub-waveform number; Represented in the ECG waveform tensor Middle The sub-waveform In the first dimension The characteristic value of the category, that is Represents all transfer combinations of waveforms; The annotation data includes the position tensor of each sub-waveform in the waveform, the waveform type list corresponding to each sub-waveform, and the heart beat classification label list corresponding to each sub-waveform. Eleven sub-waveform combinations of five sub-waveform types are designed. The 11 sub-waveform combinations are {1_P, 1_QRS, 1_T, 1_U_r}, {2_QRS, 2_T, 2_U_r}, {3_NAIL}, {4_P, 4_QRS, 4_T, 4_U, 4_PNAIL}, {5_P, 5_PNAIL}, {6_QRS, 6_T, 6_U_r, 6_QRSNAIL}, {7_P, 7_QRS, 7_T, 7_U_r, 7_QRSNAIL}, {8_P, 8_QRS, 8_T, 8_U_r} , 8_PANIL, 8_QRSNAIL}, {9_QRS, 9_T, 9_U_r, 9_PNAIL, 9_QRSNAIL}, {10_P}, {11_P_r, 11_QRS_r, 11_T_r, 11_U_r}, a total of 11 groups, 40 types of classification labels, the elements separated by _ in the label, the first value indicates which group it belongs to, the second value indicates which waveform it is, and the third value r is an optional label indicating that the value does not exist. The last group of heartbeats is a pseudo-differential heartbeat. When the first 10 types are not matched, it is automatically classified as the 11th type; among them, PNAIL indicates the pacing nail corresponding to the P wave, QRSNAIL indicates the pacing nail corresponding to the QRS wave, and NAIL is a separate pacing nail without corresponding Q wave and QRS wave; a heartbeat segmentation unit, configured to extract features according to the sub-waveform position tensor based on the segmentation features in the electrocardiographic alignment joint features, and obtain a heartbeat segmentation result through a Viterbi decoding algorithm after masking; A heartbeat classification unit is used to obtain a heartbeat classification result based on the classification feature in the electrocardiogram alignment joint feature, the sub-waveform position tensor and the heartbeat classification result.

2. A combined processing system for heart beat division and classification according to claim 1, characterized in that: The training of the feature extraction network model is specifically as follows: Constructing a historical data training set, wherein the samples in the training set include an ECG waveform tensor obtained after ECG data preprocessing and its corresponding annotated data preprocessing results; The feature extraction network model is trained based on the samples in the training set, and when the preset loss function reaches convergence, a trained feature extraction network model is obtained.

3. A combined processing system for heart beat division and classification according to claim 1, characterized in that: The classification loss function is specifically expressed as follows: in, is the number of sub-waveforms, for The label matrix corresponding to the classification, It is the predicted feature matrix containing the classification corresponding to each sub-waveform.

4. A combined processing method for heart beat division and classification, characterized in that: include: Obtain the ECG data to be predicted, and obtain the ECG waveform tensor and its corresponding sub-waveform position tensor after corresponding preprocessing; The ECG waveform tensor is processed by a pre-trained feature extraction network model to obtain an ECG alignment joint feature; wherein the feature extraction network model specifically includes the following processing procedures: based on the ECG waveform tensor, a first feature of different receptive field scales is obtained by multi-scale convolution; the first feature is used to model the multi-channel relationship through a multi-layer SE network to obtain a second feature; the second feature is used to model the time series feature through a bidirectional recurrent neural network to obtain a third feature, and the third feature is processed by a multi-layer perceptron to obtain an ECG alignment feature including a heart beat segmentation feature and a classification feature; the loss function used in the feature extraction network model training process includes a segmentation loss function obtained by mask processing and conditional random field calculation based on the segmentation features and labeled data in the ECG alignment joint feature; and a classification loss function obtained by cross entropy loss calculation based on the classification features and labeled data in the ECG alignment joint feature; The partition loss function is specifically expressed as follows: in, Indicates the previous sub-waveform Classification One sub-waveform backward Classification The transition probability of the transition; Indicates the sub-waveform number; Represented in the ECG waveform tensor Middle The sub-waveform In the first dimension The characteristic value of the category, that is Represents all transfer combinations of waveforms; The annotation data includes the position tensor of each sub-waveform in the waveform, the waveform type list corresponding to each sub-waveform, and the heart beat classification label list corresponding to each sub-waveform. Eleven sub-waveform combinations of five sub-waveform types are designed. The 11 sub-waveform combinations are {1_P, 1_QRS, 1_T, 1_U_r}, {2_QRS, 2_T, 2_U_r}, {3_NAIL}, {4_P, 4_QRS, 4_T, 4_U, 4_PNAIL}, {5_P, 5_PNAIL}, {6_QRS, 6_T, 6_U_r, 6_QRSNAIL}, {7_P, 7_QRS, 7_T, 7_U_r, 7_QRSNAIL}, {8_P, 8_QRS, 8_T, 8_U_r} , 8_PANIL, 8_QRSNAIL}, {9_QRS, 9_T, 9_U_r, 9_PNAIL, 9_QRSNAIL}, {10_P}, {11_P_r, 11_QRS_r, 11_T_r, 11_U_r}, a total of 11 groups, 40 types of classification labels, the elements separated by _ in the label, the first value indicates which group it belongs to, the second value indicates which waveform it is, and the third value r is an optional label indicating that the value does not exist. The last group of heartbeats is a pseudo-differential heartbeat. When the first 10 types are not matched, it is automatically classified as the 11th type; among them, PNAIL indicates the pacing nail corresponding to the P wave, QRSNAIL indicates the pacing nail corresponding to the QRS wave, and NAIL is a separate pacing nail without corresponding Q wave and QRS wave; Based on the segmentation features in the ECG alignment joint features, feature extraction is performed according to the sub-waveform position tensor, and after masking, a heartbeat segmentation result is obtained through a Viterbi decoding algorithm; Based on the classification features in the ECG alignment joint features, a heartbeat classification result is obtained according to the sub-waveform position tensor and the heartbeat division result.

5. A combined processing method for heart beat division and classification according to claim 4, characterized in that: The training of the feature extraction network model is specifically as follows: Constructing a historical data training set, wherein the samples in the training set include an ECG waveform tensor obtained after ECG data preprocessing and its corresponding annotated data preprocessing results; The feature extraction network model is trained based on the samples in the training set, and when the preset loss function reaches convergence, a trained feature extraction network model is obtained.

6. An electronic device comprising a memory, a processor, and a computer program stored and running on the memory, characterized in that: When the processor executes the program, the combined processing method of heart beat division and classification as described in any one of claims 4-5 is implemented.

7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, a combined processing method for heart beat division and classification as described in any one of claims 4 to 5 is implemented.

Citation Information

Patent Citations

  • Automatic recognition and classification method of electrocardiogram heartbeat based on artificial intelligence

    CN107981858A

  • Electrocardiogram heartbeat recognition method, terminal equipment and storage medium

    CN111772619A