A multi-lead arrhythmia detection method based on semantic segmentation

Through semantic segmentation technology, a classification model of parallel dilated convolution and SENet modules is constructed, which solves the problem of existing electrocardiogram heartbeat classification relying on QRS recognition, improves the recognition ability and classification accuracy of information between heartbeats, and is suitable for multi-lead arrhythmias. detection.

CN115670477BActive Publication Date: 2024-10-25HANGZHOU PROTON TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202211062921.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-31
Publication Date
2024-10-25
Estimated Expiration
2042-08-31

AI Technical Summary

Technical Problem

Existing electrocardiogram heart beat classification methods rely on QRS recognition, resulting in the loss of rhythm information between heart beats, making it difficult to adapt to clinical needs, and the classification results are not accurate enough.

Method used

Using a multi-lead arrhythmia detection method based on semantic segmentation, by acquiring and labeling ECG signal data, a classification model composed of a parallel dilated convolution module and a SENet module is constructed and trained to avoid relying on QRS recognition and enhance the recognition of inter-beat information. ability.

Benefits of technology

It effectively avoids the limitations of QRS recognition, improves the recognition rate and accuracy of multiple heartbeat types, and enhances the clinical applicability of electrocardiogram heartbeat classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115670477B_ABST
    Figure CN115670477B_ABST
Patent Text Reader

Abstract

A multi-lead arrhythmia detection method based on semantic segmentation includes the following steps: (1) obtaining training data; (2) calibrating data labels; (3) model construction and training; (4) classification model application. The present invention breaks through the defect of the traditional heartbeat classification method that relies on the heartbeat recognition algorithm in actual use, and proposes a heartbeat classification method based on semantic segmentation. The method is suitable for arrhythmia heartbeat classification training of dynamic electrocardiograms of different leads, as well as classification and recognition of different types of heartbeats, which can assist doctors in reading electrocardiograms and shorten analysis time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of automatic auxiliary detection of dynamic electrocardiograms, and in particular to a multi-lead arrhythmia detection method based on semantic segmentation. Background Art

[0002] As the pace of human life continues to accelerate, heart disease has become a major threat to human health, and most heart patients suffer from arrhythmias. Therefore, accurate detection and diagnosis of arrhythmias are of great significance for the prevention, monitoring, and treatment of heart disease, as well as assisting doctors in diagnosis and improving the efficiency of doctors in reading electrocardiograms.

[0003] There are many types of electrocardiogram heart beats, including supraventricular premature beats, ventricular premature beats, fusion of ventricular premature beats and normal heart beats, bundle block, supraventricular escape beats, and ventricular escape beats, which are not only common in people with heart disease, but also in the general population.

[0004] There are many methods for classifying ECG heartbeats, including expert system classification, traditional machine learning methods, and deep methods. These methods all segment the heartbeats based on the identified R peaks as training data. On the one hand, these methods rely on the accuracy of heartbeat recognition, and on the other hand, they only retain the morphological characteristics of the heartbeats and lose the rhythm information between the heartbeats of the ECG signal. The classification results are difficult to meet actual clinical needs. Summary of the invention

[0005] In order to overcome the problem that the actual application of heart beat classification method needs to rely on the position of QRS and the recognition method is greatly limited, the present invention provides a multi-lead arrhythmia detection method based on semantic segmentation, which effectively avoids the influence of QRS recognition algorithm and increases the information between heart beats in the segment, accurately identifies and outputs multiple heart beat types and locates the position of the heart beat.

[0006] The technical solution adopted by the present invention to solve its technical problem is:

[0007] A multi-lead arrhythmia detection method based on semantic segmentation comprises the following steps:

[0008] (1) Obtaining training data: Selecting ECG signals from an ECG signal database with existing heartbeat labels as a training data set, the data set must contain at least eight categories: normal heartbeat, supraventricular premature beat, ventricular premature beat, fusion of ventricular premature beat and normal heartbeat, bundle branch block, supraventricular escape beat, ventricular escape beat, and questionable heartbeat; unifying the sampling rate of the ECG signals and filtering them; segmenting the preprocessed ECG signals into fixed segments of S points one by one, and merging the segmented data as training data, and each segment of the training data set contains at least one of the above-mentioned heartbeat types;

[0009] (2) Calibrate data labels: Label the training data set point by point. According to the heartbeat position, obtain the starting point U and the ending point J of the heartbeat. Mark the points between points U and J as the corresponding heartbeat labels, and mark other areas as other types. For each fixed segment of the ECG signal, obtain a label sequence of S points, and merge all label sequences as training labels.

[0010] (3) Model construction and training: The model consists of three parallel dilated convolution modules and a SENet module. The labels of the training set are one-hot encoded and input into the model training in batches together with the training set. After multiple trainings, if the loss no longer decreases, the best model is retained and the training ends.

[0011] (4) Application of classification model: Segment the ECG signal that needs to be classified into data segments of length S points and merge them as a test data set. Then input the test data set into the classification model obtained in step (3), output the probability sequence corresponding to the data segment, select points greater than the probability threshold and retain them, count the width of the continuous retained points, and if it is greater than the set width threshold, mark the center position of the continuous retained points as the position of the heartbeat, and mark the corresponding type as the type of the heartbeat. This completes the classification method described in the present invention.

[0012] Furthermore, in step (1), the operation steps for obtaining training data are as follows:

[0013] (1-1) The training data set is an ECG signal database with existing heartbeat type labels. The database source is not limited, the number of signal channels is not limited, and it can be single-lead or multi-lead. At the same time, the database must be labeled according to the heartbeat, and at least contain eight types of heartbeat labels: normal heartbeat, supraventricular premature beat, ventricular premature beat, fusion of ventricular premature beat and normal heartbeat, bundle block, supraventricular escape beat, ventricular escape beat, and questionable heartbeat.

[0014] (1-2) The ECG signals in the data set are uniformly resampled to 200 Hz and band-pass filtered with a band-pass frequency of [0.67-40 Hz]. The pre-processed signals are segmented into S fixed ECG signal segments, S = Fs*T, where Fs is the sampling rate and T is the time, T = 30s. All ECG signal segments are merged and recorded as trainDataSet, with a data dimension of N*S*C, where N is the data volume, S is the data volume of each sample, and C is the number of signal channels, C = 1, 2…12.

[0015] In step (2), the labels of the training data are represented by 0 to 8 to represent eight heartbeat types and other types. Different numbers are marked according to the marked heartbeat labels. The marked range is the segment from the starting position U to the ending position J of the heartbeat. The lowest inflection point is found in the 100ms range to the left as the U point, and the lowest inflection point is found in the 100ms range to the right as the J point. If not found, the 100ms position on the left is used as the U point, and the 100ms position on the right is used as the J point. Other areas outside the U point to the J point are marked as other types. Each ECG signal segment obtains a label sequence of S points, which are summarized and recorded as trainLabelSet (N*S*1).

[0016] In step (3), the operation steps of model construction and training are as follows:

[0017] (3-1) Three parallel convolutional neural network modules are used, denoted as Block1, Block2, and Block3. Each block consists of four layers of neural networks. The output dimensions of each layer are 8, 16, 32, and 64, respectively. The convolution kernels are 15, 11, 7, and 5, respectively. The three blocks use different expansion rates. The expansion rate of Block1 is 1, the expansion rate of Block2 is 2, 4, 8, and 16, and the expansion rate of Block3 is 4, 8, 16, and 32. The output results of Block1, Block2, and Block3 are connected to obtain the output dimension of 64*3=192 features. The module composed of three parallel convolutional neural networks is denoted as CnnBlock. The weight result of CnnBlock is obtained by the SENet module, and then the weight result is multiplied by CnnBlock. After passing through two fully connected layers and activation functions, the result is output;

[0018] (3-2) The training labels are encoded using one-hot encoding. The dimension of trainLabelSet(N*S*1) after encoding is N*S*H, where H is the number of classification types, H=9;

[0019] (3-3) Input the training data and test data into the model training in batches. During the training process, the model with the smallest loss value is continuously saved. If the loss value does not decrease after K times, the learning rate is dynamically adjusted. When the learning rate reaches the set minimum value and the loss value still does not decrease, the training is terminated and the best model saved is used as the final trained model.

[0020] In step (4), the operation steps of applying the classification model are as follows:

[0021] (4-1) Resample the ECG signal to 200 Hz for preprocessing. Then segment it into data segments Seg with a length of S points.i , i = 0, 1, 2 ... L-1, L is the number of test set signal segments. In order to avoid the possibility that the sequential segmentation method may divide a heartbeat into two segments, the segmentation method with a backoff of 2s is adopted. n-2 The starting position of the segmentation is stratIdx[i] = R*200, R = i*28, i = 0, 1, 2, 3...L-2, and the ending position is endIdx = startIdx+30*Fs, taking into account the last segment Seg n-1 It may be less than 30s, so the endIdx of the last segment is set to the total signal length Lens-1, startIdx[L-1]=endIdx-30*Fs, and all data segments are merged and recorded as testDataSet(L*S*C);

[0022] (4-2) Input testDataSet into the classification model of step (3), and output the prediction sequence preLabelSet with the dimension of L*S*H. The probability sequence corresponding to the i-th signal segment category j of preLabelSet is denoted as P ij (i=0,1,…,L-1; j=0,1…H-1), P ij The sequence length is S, and the value of each point represents the probability value of being predicted as category j;

[0023] (4-3) The prediction sequences are spliced ​​by category. Considering that the fallback data will lead to repeated prediction results and the possible misjudgment of incomplete heart beats at the beginning and end, 1s of prediction data are taken before and after the overlapping part, and the middle 28s are retained for each probability sequence, that is, the first 1s and the last 1s are removed. The first probability sequence only removes the last 1s, and the last probability sequence only removes the first 1s. H prediction sequences preSeq(Lens*H) of length Lens are obtained;

[0024] (4-4) The probability sequence of preSeq category j is Pj (j=0,1…Lens-1). Points with probability values ​​greater than p in Pj are selected and retained. p is the probability threshold, p=0.5. The number of consecutive retained points Counts is counted. If Counts>m, m is the set width threshold, m=8, then the middle position between the starting point and the end point of the consecutive retained points is marked as the position of the heartbeat of the corresponding category in the sequence, and the value of the position is put into the rLoc array, and the corresponding heartbeat type is put into the rLabel array. All categories of preSeq are summarized, and the corresponding heartbeat positions and heartbeat types are put into the corresponding arrays.

[0025] (4-5) The heartbeat type output result of each heartbeat corresponds to one of the eight categories described in step (1) of this method. If the same heartbeat is judged as multiple categories, the category with the larger number of consecutive retained points Counts in (4-4) is used as the final classification category. The same heartbeat here refers to the heartbeat with a position difference of two heartbeats within 150ms. Finally, the value of the rLoc array is converted to the sampling rate FsRaw of the original ECG signal, and the conversion formula is: rLock = int (rLoc*FsRaw / 200+0.5).

[0026] The beneficial effects of the present invention are mainly manifested in that the ECG heart beat classification method based on semantic segmentation can effectively avoid the shortcomings of relying on QRS recognition in dynamic ECG heart beat recognition, and can combine inter-signal features to enhance the recognition rate of multiple heart beat categories. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 It is a flow chart of a multi-lead arrhythmia detection method based on semantic segmentation.

[0028] Figure 2 It is a model architecture diagram.

[0029] Figure 3 It is a specific operation flow chart of step 4) in the above method.

[0030] Figure 4 It is a graph of ECG signals and corresponding predicted probability sequences. DETAILED DESCRIPTION

[0031] The present invention will be further described below in conjunction with the accompanying drawings.

[0032] Reference Figure 1 to Figure 4 , a multi-lead arrhythmia detection method based on semantic segmentation, comprising the following steps:

[0033] (1) Obtaining training data: Select ECG signal data from an ECG signal database with existing heartbeat type labels as a candidate set of training data, recorded as DataSet. The heartbeat type labels to be included in DataSet include normal heartbeat, supraventricular premature beat, ventricular premature beat, fusion of ventricular premature beat and normal heartbeat, bundle block, supraventricular escape beat, ventricular escape beat, questionable and other nine categories. The data set DataSet signals are uniformly sampled and filtered. The preprocessed DataSet is segmented into fixed segments of S points one by one, and the fused and segmented data is used as the training data trainDataSet. Each segment of trainDataSet contains at least one heartbeat type other than other labels.

[0034] (2) Obtaining data labels: Mark trainDataSet point by point, and obtain the starting point U and the ending point J of the heartbeat according to the heartbeat type of trainDataSet. Mark the area between points U and J as the label of the corresponding heartbeat type, and mark other areas as other types. For each fixed segment of the ECG signal, obtain a label sequence of S points, which are summarized and recorded as trainLabelSet;

[0035] (3) Model construction and training: The model consists of three parallel dilated convolution modules and a SENet module. The trainLabelSet is one-hot encoded and input into the model training in batches together with the trainDataSet. If the loss does not decrease after multiple trainings, the best model is retained and the training ends.

[0036] (4) Application of classification model: Segment the ECG signal to be classified into data segments of length S points, and merge them into testDataSet. Then input testDataSet into the classification model obtained in step (3), and output the probability value corresponding to each point in the data segment. Select points greater than the probability threshold and retain them. Count the width of the consecutive retained points. If it is greater than the set width threshold, mark the center point of the width as the location of the heartbeat, and mark the corresponding type as the type of the heartbeat. This completes the classification method described in the present invention.

[0037] Furthermore, in step (1), the operation steps for obtaining training data are as follows:

[0038] (1-1) The training data set is an ECG signal database with existing heartbeat type labels. The database source is not limited, the number of signal channels is not limited, and it can be single-lead or multi-lead. At the same time, the database must be labeled according to the heartbeat, and at least include eight types of heartbeat labels: normal heartbeat, supraventricular premature beat, ventricular premature beat, fusion of ventricular premature beat and normal heartbeat, bundle block, supraventricular extrasystole, ventricular extrasystole, and questionable heartbeat.

[0039] (1-2) The ECG signals are uniformly resampled to 200 Hz and band-pass filtered with a band-pass frequency of [0.67-40 Hz]. The pre-processed signals are segmented into S fixed ECG signal segments, S = Fs*T, where Fs is the sampling rate and T is the time, T = 30s. All ECG signal segments are merged and recorded as trainDataSet, with a data dimension of N*S*C, where N is the data volume, S is the data volume of each sample, and C is the number of signal channels, C = 1, 2…12.

[0040] Furthermore, in step (2), the labels of the training data are represented by 0 to 8 to represent eight heartbeat types and other types. Different numbers are marked according to the marked heartbeat labels. The marked range is the segment from the starting position U to the ending position J of the heartbeat. The lowest inflection point is found in the 100ms range to the left as the U point, and the lowest inflection point is found in the 100ms range to the right as the J point. If not found, the 100ms position on the left is used as the U point, and the 100ms position on the right is used as the J point. Other areas outside the U point to the J point are marked as other types. Each ECG signal segment obtains a label sequence of S points, which are summarized and recorded as trainLabelSet (N*S*1).

[0041] Furthermore, in step (3), the operation steps of model construction and training are as follows:

[0042] (3-1) Figure 2 As shown, three parallel convolutional neural network modules are used, denoted as Block1, Block2, and Block3. Each block consists of four layers of neural networks, and the output dimensions of each layer are 8, 16, 32, and 64, respectively, and the convolution kernels are 15, 11, 7, and 5, respectively. The three blocks use different expansion rates. The expansion rate of Block1 is 1, the expansion rate of Block2 is 2, 4, 8, and 16, and the expansion rate of Block3 is 4, 8, 16, and 32. The output results of Block1, Block2, and Block3 are connected to obtain features with an output dimension of 64*3=192. The module composed of three parallel convolutional neural networks is denoted as CnnBlock. The weight result of CnnBlock is obtained through the SENet module, and then the weight result is multiplied by CnnBlock, and the result is output after two layers of fully connected layers and activation functions.

[0043] (3-2) The training labels are encoded using one-hot encoding. The dimension of trainLabelSet(N*S*1) after encoding is N*S*H, where H is the number of classification types, H=9.

[0044] (3-3) Input the training data and test data into the model training in batches. During the training process, the model with the smallest loss value is continuously saved. If the loss value does not decrease after K times, the learning rate is dynamically adjusted. When the learning rate reaches the set minimum value and the loss value still does not decrease, the training is terminated and the best model saved is used as the final trained model.

[0045] In the step (4), Figure 3 As shown in the figure, the steps for applying the classification model are as follows:

[0046] (4-1) Resample the ECG signal to 200 Hz for preprocessing. Then segment it into data segments Seg with a length of S points. i , i = 0, 1, 2 ... L-1, L is the number of signal segments in the test set. In order to avoid the possibility that the sequential segmentation method may divide a heartbeat into two segments, the present invention adopts a segmentation method with a backoff of 2s. Signal segments Seg0 to Seg n-2 The starting position of the segmentation is stratIdx[i] = R*200, R = i*28, i = 0, 1, 2, 3...L-2, and the ending position is endIdx = startIdx+30*Fs. Considering the last segment Seg n-1 It may be less than 30s, so the endIdx of the last segment is set to the total signal length Lens-1, startIdx[L-1] = endIdx-30*Fs. All data segments are merged and recorded as testDataSet(L*S*C).

[0047] (4-2) Input testDataSet into the classification model of step (3), and output the prediction sequence preLabelSet with the dimension of L*S*H. The probability sequence corresponding to the i-th signal segment category j of preLabelSet is denoted as P ij (i=0,1,…,L-1; j=0,1…H-1), P ij The length of the sequence is S, and the value of each point represents the probability value of the prediction as category j, such as Figure 4 shown.

[0048] (4-3) Concatenate the prediction sequences by category. Considering that the rolled-back data will lead to repeated prediction results and the possible misjudgment of incomplete heart beats at the beginning and end, 1 second of prediction data is taken before and after the overlapping part. The middle 28 seconds are retained for each probability sequence, that is, the first 1 second and the last 1 second are removed. The first probability sequence only removes the last 1 second, and the last probability sequence only removes the first 1 second. H prediction sequences preSeq(Lens*H) of length Lens are obtained.

[0049] (4-4) The probability sequence of preSeq category j is Pj (j = 0, 1 ... Lens-1), and the points with probability values ​​greater than p in Pj are selected for retention, where p is the probability threshold, p = 0.5. Count the number of consecutive retained points Counts. If Counts>m, m is the set width threshold, m = 8, then mark the middle position between the starting point and the end point of the consecutive retained points as the position of the heartbeat of the corresponding category in the sequence, put the value of the position into the rLoc array, and put the corresponding heartbeat type into the rLabel array. Summarize all categories of preSeq according to the above method, and put the corresponding heartbeat position and heartbeat type into the corresponding array.

[0050] (4-5) The heartbeat type output result of each heartbeat corresponds to one of the eight categories described in step (1) of this method. If the same heartbeat is judged as multiple categories, the category with the larger number of consecutive retained points Counts in (4-4) is used as the final classification category. The same heartbeat here refers to the heartbeat with a position difference of two heartbeats within 150ms. Finally, the value of the rLoc array is converted to the sampling rate FsRaw of the original ECG signal, and the conversion formula is: rLock = int (rLoc*FsRaw / 200+0.5).

[0051] The embodiments described above have provided a detailed explanation of the technical solution of the present invention, which can accurately identify normal heart beats, supraventricular premature beats, ventricular premature beats, fusion of ventricular premature beats and normal heart beats, bundle block, supraventricular escape beats, ventricular escape beats, and other arrhythmia beats in the automatic monitoring system of the dynamic electrocardiogram.

[0052] The contents described in the embodiments of this specification are merely enumerations of implementation forms of the inventive concept and are for illustrative purposes only. The protection scope of the present invention should not be considered to be limited to the specific forms described in this embodiment, and the protection scope of the present invention also extends to equivalent technical means that can be thought of by ordinary technicians in this field based on the inventive concept.

Claims

1. A multi-lead arrhythmia detection method based on semantic segmentation, characterized in that: The method comprises the following steps: (1) Obtaining training data: Select ECG signals from an ECG signal database with existing heartbeat labels as a training data set. The data set must contain at least eight categories: normal heartbeat, supraventricular premature beat, ventricular premature beat, fusion of ventricular premature beat and normal heartbeat, bundle branch block, supraventricular escape beat, ventricular escape beat, and questionable heartbeat. The ECG signals are uniformly sampled and filtered. The preprocessed ECG signals are segmented into fixed segments of S points one by one, and the fused segmented data are used as training data. Each segment of the training data set contains at least one of the above-mentioned heartbeat types. (2) Calibrate data labels: Label the training data set point by point. According to the heartbeat position, obtain the starting point U and the ending point J of the heartbeat. Mark the points between U and J as the corresponding heartbeat labels, and mark other areas as other types. For each fixed segment of the ECG signal, obtain a label sequence of S points, and merge all label sequences as training labels. (3) Model construction and training: The model consists of three parallel dilated convolution modules and a SENet module. The labels of the training set are one-hot encoded and input into the model training in batches together with the training set. After multiple trainings, if the loss no longer decreases, the best model is retained and the training ends. (4) Application of classification model: Segment the ECG signal that needs to be classified into data segments of length S points and merge them as a test data set. Then input the test data set into the classification model obtained in step (3), output the probability sequence corresponding to the data segment, select points greater than the probability threshold and retain them, count the width of the continuous retained points, and if it is greater than the set width threshold, mark the center position of the continuous retained points as the position of the heartbeat, and the corresponding type is marked as the type of the heartbeat; In step (1), the steps for obtaining training data are as follows: (1-1) The training data set is an ECG signal database with existing heartbeat type labels. The database source is not limited, the number of signal channels is not limited, and it can be single-lead or multi-lead. At the same time, the database must be labeled according to the heartbeat, and at least contain eight types of heartbeat labels: normal heartbeat, supraventricular premature beat, ventricular premature beat, fusion of ventricular premature beat and normal heartbeat, bundle block, supraventricular escape beat, ventricular escape beat, and questionable. (1-2) The ECG signals in the data set are uniformly resampled to 200Hz and band-pass filtered with a band-pass frequency of [0.67~40Hz]. The pre-processed signals are segmented into S fixed ECG signal segments, S=Fs*T, Fs is the sampling rate, T is the time, T=30s, and all ECG signal segments are merged and recorded as trainDataSet. The data dimension is N*S*C, where N is the data volume, S is the data volume of each sample, and C is the number of signal channels, C=1,2…12; In step (3), the operation steps of model construction and training are as follows: (3-1) Three parallel convolutional neural network modules are used, denoted as Block1, Block2, and Block3. Each block consists of four layers of neural networks. The output dimensions of each layer are 8, 16, 32, and 64, respectively. The convolution kernels are 15, 11, 7, and 5, respectively. The three blocks use different expansion rates. The expansion rate of Block1 is 1, the expansion rate of Block2 is 2, 4, 8, and 16, and the expansion rate of Block3 is 4, 8, 16, and 32. The output results of Block1, Block2, and Block3 are connected to obtain features with an output dimension of 64*3=192. The module composed of three parallel convolutional neural networks is denoted as CnnBlock. CnnBlock is passed through the SENet module to obtain the weight result, and then the weight result is multiplied by CnnBlock. After passing through two fully connected layers and activation functions, the result is output; (3-2) The training labels are encoded using one-hot encoding. The dimension of trainLabelSet(N*S*1) after encoding is N*S*H, where H is the number of classification types, H=9; (3-3) The training data and test data are input into the model training in batches. During the training process, the model with the smallest loss value is continuously saved. If the loss value does not decrease after K times, the learning rate is dynamically adjusted until the learning rate reaches the set minimum value. If the loss value still does not decrease, the training is terminated and the best model is saved as the final trained model.

2. The multi-lead arrhythmia detection method based on semantic segmentation as claimed in claim 1, characterized in that: In the step (2), the labels of the training data are represented by 0 to 8 to represent eight heartbeat types and other types. Different numbers are marked according to the marked heartbeat labels. The marked range is the segment from the starting position U to the ending position J of the heartbeat. The R peak value marked in the electrocardiogram signal is taken as the center. The lowest inflection point is searched for in the range of 100 ms to the left as the U point, and the lowest inflection point is searched for in the range of 100 ms to the right as the J point. If not found, the position of 100 ms to the left is taken as the U point, and the position of 100 ms to the right is taken as the J point. Other areas outside the U point to the J point are marked as other types. Each electrocardiogram signal segment obtains a label sequence of S points, which are summarized and recorded as trainLabelSet(N*S*1).

3. The multi-lead arrhythmia detection method based on semantic segmentation as claimed in claim 1, characterized in that: In step (4), the operation steps of applying the classification model are as follows: (4-1) The ECG signal to be classified is resampled to 200 Hz, preprocessed, and then segmented into data segments Seg with a length of S points. i , i=0,1,2…L-1, L is the number of signal segments in the test set. To avoid the possibility that the sequential segmentation method may divide a heart beat into two segments, a 2s backoff segmentation method is used. The signal segments Seg0~Seg n-2 The starting position of the segmentation is stratIdx[i] = R*200, R=i*28, i=0,1,2,3…L-2, and the ending position is endIdx=startIdx+30*Fs, considering the last segment Seg n-1 It may be less than 30s, so the endIdx of the last segment is set to the total signal length Lens-1, startIdx[L-1] = endIdx-30*Fs, merge all data segments and record them as testDataSet(L*S*C); (4-2) Input testDataSet into the classification model of step (3), and output the prediction sequence preLabelSet with the dimension of L*S*H. The probability sequence corresponding to the i-th signal segment category j of preLabelSet is recorded as P ij (i=0,1,…,L-1;j=0,1…H-1), P ij The sequence length is S, and the value of each point represents the probability value of being predicted as category j; (4-3) The prediction sequences are concatenated by category. Considering that the back-off data will lead to repeated prediction results and the possible misjudgment of incomplete heart beats at the beginning and the end, 1s of prediction data are taken before and after the overlapping part. The middle 28s are retained for each probability sequence, that is, the first 1s and the last 1s are removed. The first probability sequence only removes the last 1s, and the last probability sequence only removes the first 1s, and H prediction sequences preSeq(Lens*H) with a length of Lens are obtained; (4-4) The probability sequence of preSeq category j is Pj (j=0,1…Lens-1). Select the points with probability values ​​greater than p in Pj and keep them. p is the probability threshold, p=0.

5. Count the number of consecutive retained points Counts. If Counts>m, m is the set width threshold, m=8, then mark the middle position between the starting point and the end point of the consecutive retained points as the position of the heartbeat of the corresponding category in the sequence, put the value of the position into the rLoc array, and put the corresponding heartbeat type into the rLabel array. Summarize all categories of preSeq, and put the corresponding heartbeat position and heartbeat type into the corresponding array. (4-5) The heartbeat type output result of each heartbeat corresponds to one of the eight categories described in step (1) of this method. If the same heartbeat is judged to be in multiple categories, the category with the larger number of consecutive retained points Counts in (4-4) is used as the final classification category. The same heartbeat here refers to the heartbeats whose position difference between two heartbeats is within 150ms. Finally, the value of the rLoc array is converted to the sampling rate FsRaw of the original ECG signal. The conversion formula is: rLock = int(rLoc*FsRaw / 200+0.5).

Citation Information

Patent Citations

  • Arrhythmia heart beat classification method based on multi-scale convolutional neural network

    CN108932452A

  • Dynamic electrocardiogram heart beat classification method based on gradient boosting decision tree

    CN109303559A

  • Electrocardiogram signal R wave detection method and device

    CN111110228A

  • Electrocardiosignal classification model training method, electrocardiosignal classifying method and apparatus

    WO2021179712A1