ECG signal classification model training method, device and terminal equipment
Through the ECG classification model training method, binary vector annotation and multi-scale fusion processing are used to solve the problem of time-consuming and labor-intensive interpretation of ECG signals manually, improve the accuracy and efficiency of ECG classification, and realize the automatic identification of ECG signals Category features.
Patent Information
- Application Number
- CN202110826799.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-21
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2041-07-21
AI Technical Summary
Manual interpretation of ECG signals is time-consuming and labor-intensive, and requires high demands on medical staff. It is difficult for the existing technology to effectively improve the accuracy and efficiency of ECG signals classification.
A training method for ECG classification model is proposed. By obtaining the ECG training set, binary vector annotation is determined and normalized, the classification model is trained using encoding modules, decoding modules and delivery modules, including dense block units and multi-scale Fusion processing reduces feature extraction error and gradient vanishing problems.
The training speed and accuracy of the ECG signal classification model are improved, so that the model can automatically identify the ECG signal categories, simplify the calculation of loss function, and reduce the impact of ECG signal quality and feature extraction error on classification.
Smart Images

Figure CN113317800B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electrocardiogram detection, and in particular to an electrocardiogram signal classification model training method, device and terminal equipment. Background Art
[0002] As an important information reflecting the patient's vital signs, ECG signals have been widely used to diagnose various heart abnormalities. They can also be used to predict the morbidity and mortality of cardiovascular diseases. In the early stages of heart abnormalities, correct diagnosis can increase the chances of successful treatment. However, manual interpretation of ECG signals is time-consuming and labor-intensive, and places high demands on medical staff. Summary of the invention
[0003] In view of the above problems, the present application proposes a method, apparatus and terminal device for training an electrocardiogram signal classification model.
[0004] This application proposes a method for training an electrocardiogram signal classification model, the method comprising:
[0005] Get the ECG signal training set;
[0006] Determining a corresponding binary vector label according to the characteristics of each ECG signal sample in the ECG signal training set, and performing normalization processing on each ECG signal sample to determine each standard ECG signal sample to obtain a standard ECG signal sample with a binary vector label;
[0007] The pre-constructed ECG signal classification model is trained using the standard ECG signal samples with binary vector annotations until the loss function corresponding to the ECG signal classification model converges.
[0008] The ECG signal classification model training method described in the present application, wherein the corresponding binary vector label is determined according to the characteristics of each ECG signal sample in the ECG signal training set, comprises:
[0009] Determine the heart beat type corresponding to each QRS wave in each ECG signal sample;
[0010] Marking each QRS wave in each electrocardiogram signal sample with the heartbeat type corresponding to each QRS wave in each electrocardiogram signal sample and marking the signal other than the QRS wave in each electrocardiogram signal sample as a heartbeat transition type to obtain an initial mark of each electrocardiogram signal sample;
[0011] Convert the initial label of each ECG signal sample into a binary vector annotation.
[0012] The electrocardiogram signal classification model training method described in the present application, the heartbeat types include sinus beat, ventricular beat, supraventricular beat, left bundle branch block beat and right bundle branch block beat.
[0013] The ECG signal classification model training method described in the present application, the ECG signal classification model includes multiple encoding modules, multiple decoding modules, a transmission module and a classification module, and the number of the encoding modules and the number of the decoding modules are the same;
[0014] The multiple encoding modules are used to downsample the standard ECG signal samples to obtain a first feature vector, the transfer module is used to perform multi-scale fusion processing on the first feature vector to obtain a second feature vector, the multiple decoding modules are used to upsample the second feature vector to obtain a third feature vector, and the classification module is used to output the type of the ECG signal according to the third feature vector.
[0015] In the ECG signal classification model training method described in the present application, each encoding module and each decoding module includes a dense block unit, and the dense block unit includes a batch normalization layer, an activation layer, a one-dimensional convolution layer, a discard layer, and a connection layer;
[0016] The dense block unit is used to perform standardization processing, activation processing, one-dimensional convolution processing and discard processing on the feature vector of the input electrocardiogram signal sample in sequence by using a batch standardization layer, an activation layer, a one-dimensional convolution layer and a discard layer to obtain a standard feature vector;
[0017] The connection layer is used to connect the feature vector input to the dense block unit and the standard feature vector to obtain an enhanced feature vector.
[0018] The ECG signal classification model training method described in the present application, the transfer module includes multiple maximum pooling layers with different pooling kernels, multiple first convolutional layers, multiple upsampling layers, a connection layer and a second convolutional layer;
[0019] The feature vector output by each maximum pooling layer is input into the corresponding first convolutional layer, and the feature vector output by each first convolutional layer is input into the corresponding upsampling layer;
[0020] The connection layer is used to connect the feature vectors output by multiple upsampling layers;
[0021] The second convolutional layer is used to perform convolution processing on the feature vector output by the connection layer.
[0022] The present application proposes a device for training an electrocardiogram signal classification model, the device comprising:
[0023] An acquisition module is used to acquire an ECG signal training set;
[0024] A labeling module, used to determine a corresponding binary vector label according to the characteristics of each ECG signal sample in the ECG signal training set;
[0025] A normalization module, used for performing normalization processing on each ECG signal sample to determine each standard ECG signal sample;
[0026] The training module is used to train the ECG signal classification model using each standard ECG signal sample annotated with a binary vector until the loss function corresponding to the ECG signal classification model converges.
[0027] The present application also proposes an ECG signal classification method, which obtains an ECG signal to be classified, and determines the category of the ECG signal to be classified using an ECG signal classification model that has been trained to meet the standards using the ECG signal classification model training method described in the present application.
[0028] The present application also proposes a terminal device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program runs on the processor, it executes the electrocardiogram signal classification model training method or the electrocardiogram signal classification method described in the present application.
[0029] The present application also proposes a readable storage medium storing a computer program, which, when running on a processor, executes the electrocardiogram signal classification model training method or the electrocardiogram signal classification method described in the present application.
[0030] The present application determines the corresponding binary vector labeling according to the characteristics of each ECG signal sample in the ECG signal training set, and normalizes each ECG signal sample to determine each standard ECG signal sample to obtain a standard ECG signal sample with a binary vector labeling. The use of the binary vector labeling as the category label of the ECG signal sample not only facilitates the recognition of the ECG signal classification model, but also makes the calculation of the loss function corresponding to the ECG signal classification model simpler, thereby improving the training speed of the ECG signal classification model. In addition, the ECG signal classification model training method disclosed in the present application is used to train the ECG signal classification model so that the ECG signal classification model that meets the training standards can automatically determine the category of the ECG signal to be classified. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solution of the present invention, the following will briefly introduce the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be regarded as limiting the scope of protection of the present invention. In each of the drawings, similar components are numbered similarly.
[0032] Figure 1 A schematic diagram showing a flow chart of an electrocardiogram signal classification model training method proposed in an embodiment of the present application;
[0033] Figure 2An electrocardiogram proposed in an embodiment of the present application is shown;
[0034] Figure 3 A schematic diagram of a binary vector labeling method proposed in an embodiment of the present application is shown;
[0035] Figure 4 A schematic diagram of the structure of a dense block unit proposed in an embodiment of the present application is shown;
[0036] Figure 5 A schematic diagram of the structure of a transmission module proposed in an embodiment of the present application is shown;
[0037] Figure 6 A schematic diagram of the structure of an electrocardiogram signal classification model proposed in an embodiment of the present application is shown;
[0038] Figure 7 A structural schematic diagram of an electrocardiogram signal classification model training device proposed in an embodiment of the present application is shown.
[0039] Description of main component symbols:
[0040] 10- ECG signal classification model training device; 11- acquisition module; 12- labeling module; 13- normalization module; 14- training module. DETAILED DESCRIPTION
[0041] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0042] The components of the embodiments of the present invention generally described and shown in the drawings herein may be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0043] Hereinafter, the terms "including", "having" and their cognates, which may be used in various embodiments of the present invention, are intended only to indicate specific features, numbers, steps, operations, elements, components or combinations of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components or combinations of the foregoing items or adding the possibility of one or more features, numbers, steps, operations, elements, components or combinations of the foregoing items.
[0044] Furthermore, the terms “first”, “second”, “third”, etc. are merely used for distinguishing descriptions and are not to be understood as indicating or implying relative importance.
[0045] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present invention belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present invention.
[0046] The ECG signal classification model training method disclosed in the present application is used to train the ECG signal classification model so that the ECG signal classification model that meets the training standards can automatically determine the category of the ECG signal to be classified.
[0047] When training the ECG signal classification model, the corresponding binary vector label is determined according to the characteristics of each ECG signal sample in the ECG signal training set, and each ECG signal sample is normalized to determine each standard ECG signal sample to obtain a standard ECG signal sample with a binary vector label. Using the binary vector label as the category label of the ECG signal sample not only facilitates the recognition of the ECG signal classification model, but also makes the calculation of the loss function corresponding to the ECG signal classification model simpler, thereby improving the training speed of the ECG signal classification model.
[0048] The ECG signal classification model disclosed in the present application includes multiple encoding modules, multiple decoding modules, a transfer module and a classification module, and the number of the encoding modules and the decoding modules is the same; each encoding module and each decoding module includes a dense block unit, and the dense block unit includes a batch normalization layer, an activation layer, a one-dimensional convolution layer, a discard layer and a connection layer; the transfer module includes multiple maximum pooling layers with different pooling kernels, multiple first convolution layers, multiple upsampling layers, a connection layer and a second convolution layer.
[0049] On the one hand, the present application replaces the artificial extraction of ECG features by the traditional algorithm through the encoding module, thereby effectively reducing the impact of ECG signal quality and feature extraction errors on the accuracy of heartbeat detection and heartbeat classification; on the other hand, the dense block units in each encoding module and each decoding module can reduce gradient vanishing or gradient explosion, and also make the loss function corresponding to the ECG signal classification model easier to converge, and the connection layer of the dense block unit is used to connect the feature vector input to the dense block unit and the standard feature vector to obtain an enhanced feature vector, thereby enhancing the transmission of data features; the transmission module has the characteristics of multi-scale fusion, which can combine the feature vectors of encoding and decoding at different scales, and reduce the impact of ECG signal feature extraction errors on the accuracy of heartbeat classification.
[0050] Example 1
[0051] An embodiment of the present application, such as Figure 1 As shown, a method for training an electrocardiogram signal classification model is proposed, including S100, S200 and S300.
[0052] S100: Obtain an electrocardiogram signal training set.
[0053] The ECG signal training set includes multiple ECG signal samples, each ECG signal sample includes a predetermined number of voltage signals, the voltage signals in each ECG signal sample are collected according to a predetermined collection frequency, and the voltage signals in each ECG signal sample are arranged in sequence according to the collection time. Figure 2 In the electrocardiogram shown, the horizontal axis represents the time axis and the vertical axis represents the voltage. The electrocardiogram is composed of voltage signals collected in real time.
[0054] S200: Determine a corresponding binary vector label according to the characteristics of each ECG signal sample in the ECG signal training set, and perform normalization processing on each ECG signal sample to determine each standard ECG signal sample to obtain a standard ECG signal sample with a binary vector label.
[0055] It can be understood that S200 includes two steps of determining the corresponding binary vector labeling according to the characteristics of each ECG signal sample in the ECG signal training set and normalizing each ECG signal sample. There is no order between these two steps and they can be executed simultaneously or sequentially.
[0056] Furthermore, the ECG signal classification model can classify and identify heartbeat types including sinus beats, ventricular beats, supraventricular beats, left bundle branch block beats, and right bundle branch block beats.
[0057] Exemplary, such as Figure 3 As shown, a binary vector labeling method is proposed, which includes the following steps:
[0058] S210: Determine the heartbeat type corresponding to each QRS wave in each electrocardiogram signal sample.
[0059] QRS is an electrocardiogram term that represents a wave. Every time the heart beats, an electrical impulse is generated, forming a complete waveform, including P wave, QS wave and T wave. Each ECG signal sample includes multiple QRS waves.
[0060] The criteria for determining a sinus beat are upright P waves in leads I, II, V3 to V6, and inverted P waves in lead aVR; the PP interval difference is <120ms, and the PR interval is ≥120ms. The criteria for determining a ventricular heartbeat are the early appearance of a wide and deformed QRS wave, without a related P wave before it, and a QRS duration ≥120ms; the criteria for determining a supraventricular heartbeat are the early appearance of a P' wave, whose morphology is different from the sinus P wave in the same lead, and the P wave is often followed by a supraventricular QRS-T wave; the criteria for determining a left bundle branch block are a normal P wave, a QRS duration of more than 110ms, a wide R wave in leads V5, V6, I, and aVL, without a preceding q wave, and the T wave is in the opposite direction to the main QRS wave; the criteria for determining a right bundle branch block are a QRS duration of more than 120ms, rSR', rsR' or a wide and notched R wave in lead V1, widened S waves in leads I, V5, and V6, and a normal premature P wave.
[0061] S220: Mark each QRS wave in each ECG signal sample with the heartbeat type corresponding to each QRS wave in each ECG signal sample and mark the signal except the QRS wave in each ECG signal sample as a heartbeat transition type to obtain an initial mark for each ECG signal sample.
[0062] Exemplarily, the sinus beat can be recorded as B1, the ventricular beat can be recorded as B2, the supraventricular beat can be recorded as B3, the left bundle branch block beat can be recorded as B4, the right bundle branch block beat can be recorded as B5, and other transition parts of the signal can be recorded as B6. Furthermore, the initial mark of each ECG signal sample can be represented by at least one mark among B1, B2, B3, B4, B5 and B6. For example, the initial mark of each ECG signal sample is L = [B6, B6...B6, B1, B1,...B1, B6, B6, B6].
[0063] S230: Convert the initial label of each ECG signal sample into a binary vector label.
[0064] For example, B1 can be represented as 000001, B2 can be represented as 000010, B3 can be represented as 000100, B4 can be represented as 001000, B5 can be represented as 010000, and B6 can be represented as 100000. A binary vector of an ECG signal sample initially labeled L = [B6, B6, B1, B1, B6] is labeled as
[0065] It can be understood that using binary vector annotations as category labels for ECG signal samples not only facilitates the recognition of the ECG signal classification model, but also makes the calculation of the loss function corresponding to the ECG signal classification model simpler, thereby improving the training speed of the ECG signal classification model.
[0066] For example, for an ECG signal training set X = {x1, x2, ... xn} ∈ R m×n The following formula can be used for normalization:
[0067]
[0068] Where n is the total number of ECG signal samples in an ECG signal training set, m is the length of each ECG signal sample, X.mean is the mean of all voltage values in the ECG signal training set, and X.std is the standard deviation of all voltage values in the ECG signal training set.
[0069] S300: Using the standard ECG signal samples with binary vector annotations to train a pre-constructed ECG signal classification model until a loss function corresponding to the ECG signal classification model converges.
[0070] Exemplarily, the loss function corresponding to the ECG signal classification model can be a cross entropy loss function, and the training algorithm can be the best one from SGD algorithm, RMSprop algorithm, Adagrad algorithm, Adadelta algorithm, Adam algorithm, Adamax algorithm, and Nadam algorithm.
[0071] The ECG signal training set can be randomly divided into an ECG signal training subset, an ECG signal test subset and an ECG signal verification subset according to the total number of ECG signal samples. The ECG signal training subset is input into a pre-built ECG signal classification model for training, and then the ECG signal classification model is verified and the hyperparameters in the ECG signal classification model are adjusted through the ECG signal verification subset, and the optimal ECG signal classification model is obtained through repeated training; finally, the ECG signal is tested through the ECG signal test subset.
[0072] Furthermore, in order to prevent overfitting during the training process, an early termination method can be adopted. For example, when the loss function of the ECG signal classification model has a loss value that is less than a threshold for a predetermined number of consecutive changes, the training can be terminated early.
[0073] Furthermore, the main verification methods include Holdout verification, K-fold cross validation and Leave-one verification. Holdout verification can quickly find an ECG signal classification model that meets the predetermined goal, but it is not necessarily the best model. K-fold cross validation can more accurately find the optimal ECG signal classification model compared with Holdout, but the number of training and testing is too large and time-consuming. Leave-one verification is an extreme K-fold verification, which is mainly used when the sample size is small and single. The above verification methods can be selected according to actual conditions.
[0074] When training the ECG signal classification model, this embodiment determines the corresponding binary vector label according to the characteristics of each ECG signal sample in the ECG signal training set, and performs normalization processing on each ECG signal sample to determine each standard ECG signal sample to obtain a standard ECG signal sample with a binary vector label. Using the binary vector label as the category label of the ECG signal sample not only facilitates the recognition of the ECG signal classification model, but also makes the calculation of the loss function corresponding to the ECG signal classification model simpler, thereby improving the training speed of the ECG signal classification model.
[0075] Example 2
[0076] In one embodiment of the present application, an electrocardiogram signal classification model is proposed, which includes multiple encoding modules, multiple decoding modules, a transmission module and a classification module, and the number of encoding modules and decoding modules is the same.
[0077] Multiple encoding modules are used to downsample the standard ECG signal samples to obtain a first feature vector, the transfer module is used to perform multi-scale fusion processing on the first feature vector to obtain a second feature vector, the multiple decoding modules are used to upsample the second feature vector to obtain a third feature vector, and the classification module is used to output the type of the ECG signal according to the third feature vector.
[0078] By replacing the manual extraction of ECG features by the traditional algorithm with the encoding module, the impact of ECG signal quality and feature extraction errors on the accuracy of heartbeat detection and classification is effectively reduced.
[0079] Further, such as Figure 4As shown, each encoding module and each decoding module includes a dense block unit, and the dense block unit includes a batch normalization layer (Batch Normalization), an activation layer (Relu), a one-dimensional convolution layer (Conv1D), a discard layer (Dropout) and a connection layer (Concatenate).
[0080] The dense block unit is used to use the batch normalization layer (Batch Normalization), activation layer (Relu), one-dimensional convolution layer (Conv1D), and dropout layer to perform standard processing, activation processing, one-dimensional convolution processing, and dropout processing on the feature vector of the input ECG signal sample in turn to obtain a standard feature vector. Among them, the batch normalization layer (BatchNormalization) normalizes the data input to this layer by adjusting and scaling the activation value. In essence, it converts the data to a mean of 0 and a standard deviation of 1, which solves the impact of data of different scales on the neural network model. It can reduce the gradient disappearance or gradient explosion, and also makes the neural network easier to converge; the role of the one-dimensional convolution layer (Conv1D) is feature extraction; the main role of the dropout layer (Dropout) is to avoid overfitting of the ECG signal classification model.
[0081] The concatenation layer (Concatenate) is used to concatenate the feature vector input to the dense block unit with the standard feature vector to obtain an enhanced feature vector. The concatenation layer (Concatenate) can concatenate the feature vector input to the dense block unit with the standard feature vector to obtain an enhanced feature vector, thereby strengthening the transmission of data features.
[0082] Furthermore, the transfer module includes multiple maximum pooling layers (Maxpooling) with different pooling kernels, multiple first convolutional layers, multiple upsampling layers (UpSampling1D), a connection layer (Concatenate) and a second convolutional layer.
[0083] The feature vector output by each maximum pooling layer (Maxpooling) is input into the corresponding first convolution layer (Conv1D), and the feature vector output by each first convolution layer is input into the corresponding upsampling layer (UpSampling1D); the connection layer (Concatenate) is used to connect the feature vectors output by multiple upsampling layers (UpSampling1D); the second convolution layer is used to perform convolution processing on the feature vector output by the connection layer.
[0084] It can be understood that the second convolutional layer and each of the first convolutional layers can be a one-dimensional convolutional layer (Conv1D).
[0085] For example, see Figure 5 , showing a transfer module including four maximum pooling layers, four one-dimensional convolutional layers and four upsampling layers. The feature vector input to the transfer module is simultaneously input to four maximum pooling layers (Maxpooling) with different pooling kernels for downsampling, that is, encoding with different scales of dimensionality reduction, and then the feature vectors output by the four maximum pooling layers are respectively input to four one-dimensional convolutional layers, that is, feature extraction is performed according to data encoded at different scales, and then the feature vectors output by the four one-dimensional convolutional layers are input to the corresponding upsampling layer (UpSampling1D) for upsampling, that is, decoding the feature vectors of different scales respectively, and finally the output results of the four upsampling layers (UpSampling1D) are input to the connection layer (Concatenate), and then one-dimensional convolution is performed after being connected by the connection layer (Concatenate).
[0086] The transfer module combines the data features of encoding and decoding at different scales, fuses multi-scale information, and reduces the impact of data feature extraction errors on the accuracy of heartbeat classification.
[0087] Exemplary, such as Figure 6As shown in the figure, taking the ECG signal classification model including four encoding modules and four decoding modules as an example, the standard ECG signal samples with binary vector annotations are input into the ECG signal classification model as input data, and the forward propagation direction of the input data is encoding module I, encoding module II, encoding module III and encoding module IV in turn to obtain the first feature vector, and the first feature vector is then subjected to multi-scale fusion processing by the transfer module to obtain the second feature vector, and the second feature vector is sequentially passed through the decoding module IV (in the decoding module IV, the output of the upsampling layer (UpSampling1D) of the decoding module IV is connected with the output of the cropping layer (Cropping1D) in the encoding module IV through the combined layer (Combine), and then sequentially passed through the discard layer (Dropout) and the one-dimensional convolution layer (Conv1D) to be input into the dense block unit of the decoding module IV), the decoding module III (in the decoding module III, the output of the upsampling layer (UpSampling1D) in the decoding module III is connected with the output of the cropping layer (Cropping1D) in the encoding module III through the combined layer (Combine), and then sequentially passed through the discard layer (Dropout) and the one-dimensional convolution layer (Conv1D) to be input into the dense block unit of the decoding module IV The output of the upsampling layer (UpSampling1D) in the decoding module II and the output of the cropping layer (Cropping1D) in the encoding module II are connected through a combined layer (Combine) and then passed through a discard layer (Dropout) and a one-dimensional convolution layer (Conv1D) to be input into the dense block unit of the decoding module III, the decoding module II (in the decoding module II, the output of the upsampling layer (UpSampling1D) in the decoding module II and the output of the cropping layer (Cropping1D) in the encoding module II are connected through a combined layer (Combine) and then passed through a discard layer (Dropout) and a one-dimensional convolution layer (Conv1D) to be input into the dense block unit of the decoding module II) and the decoding module I (in the decoding module I, the output of the upsampling layer (UpSampling1D) in the decoding module I and the output of the cropping layer (Cropping1D) in the encoding module I are connected through a combined layer (Combine) and then passed through a discard layer (Dropout) and a one-dimensional convolution layer (Conv1D) to be input into the dense block unit of the decoding module II) to obtain the third eigenvector, and the third eigenvector can be classified by the classification module (softmax) to output the type of the ECG signal.
[0088] Exemplarily, the classification module (softmax) can output the type of ECG signal as Y=[B6, B6…B6, B1, B1,…B1, B6, B6, B6]. Furthermore, through Y=[B6, B6…B6, B1, B1,…B1, B6, B6, B6], we can obtain {QRSs[s], QRSe[s], QRStype[s], s}, where QRSs[] is the starting point of s QRS heartbeats, QRSe[] is the end point of s QRS heartbeats, QRStype[] is the type of the corresponding QRS heartbeat, and s is the number of heartbeats.
[0089] Example 3
[0090] An embodiment of the present application, such as Figure 7 As shown, a device 10 for training an electrocardiogram signal classification model is proposed, comprising: an acquisition module 11 , a labeling module 12 , a normalization module 13 and a training module 14 .
[0091] An acquisition module 11 is used to acquire an ECG signal training set; a labeling module 12 is used to determine a corresponding binary vector label according to the characteristics of each ECG signal sample in the ECG signal training set; a normalization module 13 is used to normalize each ECG signal sample to determine each standard ECG signal sample; a training module 14 is used to train the ECG signal classification model using each standard ECG signal sample with a binary vector label until the loss function corresponding to the ECG signal classification model converges.
[0092] Furthermore, the method of determining the corresponding binary vector labeling according to the characteristics of each ECG signal sample in the ECG signal training set includes: determining the heartbeat type corresponding to each QRS wave in each ECG signal sample; marking each QRS wave in each ECG signal sample with the heartbeat type corresponding to each QRS wave in each ECG signal sample and marking the signal other than the QRS wave in each ECG signal sample as a heartbeat transition type to obtain an initial labeling of each ECG signal sample; and converting the initial labeling of each ECG signal sample into a binary vector labeling.
[0093] Furthermore, the heartbeat types include sinus beat, ventricular beat, supraventricular beat, left bundle branch block beat and right bundle branch block beat.
[0094] Furthermore, the ECG signal classification model includes multiple encoding modules, multiple decoding modules, a transfer module and a classification module, and the number of the encoding modules and the decoding modules is the same; the multiple encoding modules are used to downsample the standard ECG signal samples to obtain a first feature vector, the transfer module is used to perform multi-scale fusion processing on the first feature vector to obtain a second feature vector, the multiple decoding modules are used to upsample the second feature vector to obtain a third feature vector, and the classification module is used to output the type of the ECG signal according to the third feature vector.
[0095] Furthermore, each encoding module and each decoding module includes a dense block unit, which includes a batch normalization layer, an activation layer, a one-dimensional convolution layer, a discard layer and a connection layer; the dense block unit is used to use the batch normalization layer, the activation layer, the one-dimensional convolution layer, and the discard layer to sequentially perform normalization processing, activation processing, one-dimensional convolution processing and discard processing on the feature vector of the input electrocardiogram signal sample to obtain a standard feature vector; the connection layer is used to connect the feature vector input to the dense block unit and the standard feature vector to obtain an enhanced feature vector.
[0096] Furthermore, the transfer module includes multiple maximum pooling layers with different pooling kernels, multiple first convolutional layers, multiple upsampling layers, a connection layer and a second convolutional layer; the feature vector output by each maximum pooling layer is input into the corresponding first convolutional layer, and the feature vector output by each first convolutional layer is input into the corresponding upsampling layer; the connection layer is used to connect the feature vectors output by multiple upsampling layers; the second convolutional layer is used to perform convolution processing on the feature vector output by the connection layer.
[0097] The ECG signal classification model training device 10 disclosed in this embodiment is used to execute the ECG signal classification model training method described in the above embodiment through the coordinated use of an acquisition module 11, a labeling module 12, a normalization module 13 and a training module 14. The implementation scheme and beneficial effects involved in the above embodiment are also applicable in this embodiment and will not be repeated here.
[0098] It can be understood that the present application also discloses an ECG signal classification method, including obtaining an ECG signal to be classified, and determining the category of the ECG signal to be classified using an ECG signal classification model that has been trained to meet the standards using the ECG signal classification model training method described in the present application.
[0099] It can be understood that the present application also discloses a terminal device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program runs on the processor, it executes the electrocardiogram signal classification model training method described in the present application or the electrocardiogram signal classification method described in the present application.
[0100] It can be understood that the present application also discloses a readable storage medium storing a computer program, which, when running on a processor, executes the ECG signal classification model training method or the ECG signal classification method described in the present application.
[0101] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or the flow chart, and the combination of boxes in the structure diagram and / or the flow chart, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0102] In addition, the functional modules or units in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0103] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned readable storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0104] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A method for training an electrocardiogram signal classification model, characterized in that: The method comprises: Get the ECG signal training set; Determining a corresponding binary vector label according to the characteristics of each ECG signal sample in the ECG signal training set, and performing normalization processing on each ECG signal sample to determine each standard ECG signal sample to obtain a standard ECG signal sample with a binary vector label; Using the standard ECG signal samples with binary vector annotations to train a pre-built ECG signal classification model until a loss function corresponding to the ECG signal classification model converges; The electrocardiogram signal classification model includes a plurality of encoding modules, a plurality of decoding modules, a transmission module and a classification module, and the number of the encoding modules and the number of the decoding modules are the same; The multiple encoding modules are used to downsample the standard ECG signal samples to obtain a first feature vector, the transfer module is used to perform multi-scale fusion processing on the first feature vector to obtain a second feature vector, the multiple decoding modules are used to upsample the second feature vector to obtain a third feature vector, and the classification module is used to output the type of the ECG signal according to the third feature vector; each encoding module and each decoding module includes a dense block unit, and the dense block unit includes a batch normalization layer, an activation layer, a one-dimensional convolution layer, a discard layer and a connection layer; The dense block unit is used to perform standardization processing, activation processing, one-dimensional convolution processing and discard processing on the feature vector of the input electrocardiogram signal sample in sequence by using a batch standardization layer, an activation layer, a one-dimensional convolution layer and a discard layer to obtain a standard feature vector; The connection layer is used to connect the feature vector input to the dense block unit and the standard feature vector to obtain an enhanced feature vector; The transfer module includes a plurality of maximum pooling layers with different pooling kernels, a plurality of first convolutional layers, a plurality of upsampling layers, a connection layer and a second convolutional layer; The feature vector output by each maximum pooling layer is input into the corresponding first convolutional layer, and the feature vector output by each first convolutional layer is input into the corresponding upsampling layer; The connection layer is used to connect the feature vectors output by multiple upsampling layers; The second convolutional layer is used to perform convolution processing on the feature vector output by the connection layer.
2. The electrocardiogram signal classification model training method according to claim 1, characterized in that: The step of determining a corresponding binary vector label according to the characteristics of each electrocardiogram signal sample in the electrocardiogram signal training set includes: Determine the heart beat type corresponding to each QRS wave in each ECG signal sample; Marking each QRS wave in each electrocardiogram signal sample with the heartbeat type corresponding to each QRS wave in each electrocardiogram signal sample and marking the signal other than the QRS wave in each electrocardiogram signal sample as a heartbeat transition type to obtain an initial mark of each electrocardiogram signal sample; Convert the initial label of each ECG signal sample into a binary vector annotation.
3. The electrocardiogram signal classification model training method according to claim 2, characterized in that: The heartbeat types include sinus beats, ventricular beats, supraventricular beats, left bundle branch block beats and right bundle branch block beats.
4. A device for training an electrocardiogram signal classification model, characterized in that: The device comprises: An acquisition module is used to acquire an ECG signal training set; A labeling module, used to determine a corresponding binary vector label according to the characteristics of each ECG signal sample in the ECG signal training set; A normalization module, used for performing normalization processing on each ECG signal sample to determine each standard ECG signal sample; A training module, used for training the ECG signal classification model using each standard ECG signal sample with binary vector annotation until the loss function corresponding to the ECG signal classification model converges; The electrocardiogram signal classification model includes a plurality of encoding modules, a plurality of decoding modules, a transmission module and a classification module, and the number of the encoding modules and the number of the decoding modules are the same; The multiple encoding modules are used to downsample the standard ECG signal samples to obtain a first feature vector, the transfer module is used to perform multi-scale fusion processing on the first feature vector to obtain a second feature vector, the multiple decoding modules are used to upsample the second feature vector to obtain a third feature vector, and the classification module is used to output the type of the ECG signal according to the third feature vector; each encoding module and each decoding module includes a dense block unit, and the dense block unit includes a batch normalization layer, an activation layer, a one-dimensional convolution layer, a discard layer and a connection layer; The dense block unit is used to perform standardization processing, activation processing, one-dimensional convolution processing and discard processing on the feature vector of the input electrocardiogram signal sample in sequence by using a batch standardization layer, an activation layer, a one-dimensional convolution layer and a discard layer to obtain a standard feature vector; The connection layer is used to connect the feature vector input to the dense block unit and the standard feature vector to obtain an enhanced feature vector; The transfer module includes a plurality of maximum pooling layers with different pooling kernels, a plurality of first convolutional layers, a plurality of upsampling layers, a connection layer and a second convolutional layer; The feature vector output by each maximum pooling layer is input into the corresponding first convolutional layer, and the feature vector output by each first convolutional layer is input into the corresponding upsampling layer; The connection layer is used to connect the feature vectors output by multiple upsampling layers; The second convolutional layer is used to perform convolution processing on the feature vector output by the connection layer.
5. A method for classifying electrocardiogram signals, characterized in that: An electrocardiogram signal to be classified is obtained, and a category of the electrocardiogram signal to be classified is determined using an electrocardiogram signal classification model that has been trained to meet the standards using the electrocardiogram signal classification model training method according to any one of claims 1 to 3.
6. A terminal device, characterized in that: It comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is run on the processor, it executes the electrocardiogram signal classification model training method according to any one of claims 1 to 3 or the electrocardiogram signal classification method according to claim 5.
7. A readable storage medium, characterized in that: It stores a computer program, which, when running on a processor, executes the electrocardiogram signal classification model training method according to any one of claims 1 to 3 or the electrocardiogram signal classification method according to claim 5.
