Patent Description:
An electrocardiogram (ECG) signal is a comprehensive reflection of electrical activities of numerous cardiac myocytes of a heart. Under a normal circumstance, cardiac myocytes of a sinoatrial node, an atrium, and a ventricle are depolarized in turn to form a heartbeat containing a signal segment of P, QRS, and T waves, and a plurality of heartbeats are combined to form an ECG signal segment. A premature ventricular beat is a heartbeat formed by depolarization of the ventricle due to an early electric impulse from an ectopic rhythm point of any part of the ventricle or a ventricular septum before an impulse of the sinoatrial node reaches the ventricle. It is very important to screen out all premature ventricular beats from a long-time ECG signal segment when determining a patient's condition, but this is time-consuming and labor-intensive. Therefore, it is of significance to screen out the premature ventricular beat from the ECG signal by using a computer. However, an electric shock can be generated from many positions in the heart, heartbeat shapes displayed in different electric shock positions are different, and there is a lot of interference. Therefore, during heartbeat classification, it is almost impossible to find all patterns and data of the premature ventricular beat and "other" types of heartbeats to train a deep learning model, which is easy to cause incorrect determination of a heartbeat type.

<CIT> discloses method and apparatus for recognizing premature ventricular beat based on an improved convolutional neural network, which includes: pretreating an electrocardiosignal; truncating the electrocardiosignal as several heartbeat sequences, extracting RR spacing between each heartbeat and the prior heartbeat; calculating kurtosis value and deviation value of each heartbeat sequence; and recognizing heartbeat by inputting the heartbeat sequences, RR spacing, kurtosis value and deviation value into the improved convolutional neural network, to determine whether the heartbeat belongs to premature ventricular beat.

In order to resolve the shortcomings in the prior art, the present disclosure provides a method and model for training a convolutional neural network based on sample distribution improvement.

The present disclosure resolves the technical problems with following technical solutions:
A method for training a convolutional neural network based on sample distribution improvement includes following steps:.

Preferably, according to the method for training a convolutional neural network based on sample distribution improvement, the lead-II heartbeat signal is sampled at a frequency of <NUM> and filtered by a <NUM> to <NUM> Butterworth bandpass filter.

Preferably, according to the method for training a convolutional neural network based on sample distribution improvement, each heartbeat signal is an ECG signal from <NUM> before an R wave peak to <NUM> after the R wave peak.

Preferably, according to the method for training a convolutional neural network based on sample distribution improvement, the convolutional neural network model based on sample distribution improvement includes <NUM> network layers, namely, layers <NUM> to <NUM> and a classifier, where layers <NUM> to <NUM> each include a convolutional layer and a pooling layer, and use a LeakyReLU activation function; the convolutional layer in the layer <NUM> contains <NUM> kernels with a size of <NUM> each, and both a stride and a kernel size of the pooling layer in the layer <NUM> are <NUM>; the convolutional layer in the layer <NUM> contains <NUM> kernels with a size of <NUM> each, and both a stride and a kernel size of the pooling layer in the layer <NUM> are <NUM>; the convolutional layer in the layer <NUM> contains <NUM> kernels with a size of <NUM> each, and both a stride and a kernel size of the pooling layer in the layer <NUM> are <NUM>; the convolutional layer in the layer <NUM> contains <NUM> kernels with a size of <NUM> each, and both a stride and a kernel size of the pooling layer in the layer <NUM> are <NUM>; the convolutional layer in the layer <NUM> contains <NUM> kernels with a size of <NUM> each, and both a stride and a kernel size of the pooling layer in the layer <NUM> are <NUM>; the convolutional layer in the layer <NUM> contains <NUM> kernels with a size of <NUM> each; the layer <NUM> is an input layer of a bidirectional long short term memory network layer, a quantity of neurons in the layer <NUM> is consistent with a quantity of output characteristics of the layer <NUM>, and the bidirectional long short term memory network layer outputs <NUM> neurons in total, namely <NUM> neurons output forward and <NUM> neurons output backward; the layer <NUM> is an attention mechanism layer, which receives an output of the layer <NUM>; and the layer <NUM> is a fully connected layer, which receives an output of the layer <NUM> and outputs <NUM> neurons.

Preferably, according to the method for training a convolutional neural network based on sample distribution improvement, a=<NUM>, b=<NUM>, and when an output value of the convolutional neural network model based on sample distribution improvement is greater than <NUM>, a heartbeat of an unknown type is considered as a premature ventricular beat; or when an output value is less than or equal to <NUM>, a heartbeat of an unknown type is considered as the non-premature ventricular heartbeat signal.

The present disclosure has following beneficial effects:
According to the method and model for training a convolutional neural network based on sample distribution improvement in the present disclosure, an average value xavg, a maximum value xMAX, a minimum value xMIN, a peak xF, and a kurtosis value xQ of a heartbeat are calculated in advance, and whether the values satisfy conditions is determined to screen a sample. When heartbeat data satisfies less than three of xavg - <NUM>σavg < xavg < xavg + <NUM>σavg, xMAX - <NUM>σMAX < xMAX < xMAX + <NUM>σMAX, xMIN - <NUM>σMIN < xMIN < xMIN + <NUM>σMIN, xF - <NUM>σF, < xF < xF + 3σF, and xQ - <NUM>σQ < xQ < xQ + <NUM>σQ, it is considered that training data used by the model does not conform to sample distribution, and a heartbeat signal failing to satisfy this requirement is eliminated, so as to reduce misjudgment of a heartbeat type.

The technical solutions of the present disclosure are described in further detail below with reference to the drawings and embodiments.

It should be noted that the embodiments in the present disclosure and features in the embodiments may be combined with each other in a non-conflicting situation.

The technical solutions of the present disclosure will be described in detail below with reference to the drawings. As shown in <FIG>, a method for training a convolutional neural network based on sample distribution improvement according to an embodiment includes following steps.

Step S31: Enough lead-II heartbeat signals are collected from a marked <NUM>-lead ECG signal to form an initial dataset, where the lead-II heartbeat signals include a premature ventricular heartbeat signal and a non-premature ventricular heartbeat signal that each account for half of a total quantity of lead-II heartbeat signals; and a tag of the premature ventricular heartbeat signal is set to a, and a tag of the non-premature ventricular heartbeat signal is set to b.

Step S32: Statistics is taken on all heartbeat data in the collected dataset to obtain an average value, a maximum value, a minimum value, a peak, and a kurtosis value of each piece of heartbeat data to form an average value array A VG={a1, a2, a3,. , aN}, a maximum value array MAX={m1, m2, m3,. , mN}, a minimum value array MIN={c1, c2,. , cN}, a peak array F={f1, f2,. , fN}, and a kurtosis value array Q={q1, q2,. , qN}, and then average values and standard deviations of the average value array, the maximum value array, the minimum value array, the peak array, and the kurtosis value array are calculated, which are denoted as xavg, σavg, xMAX, σMAX, xMIN, σMIN, xF, σF, xQ, and σQ respectively.

Step S33: Whether following conditions are satisfied is determined for all heartbeat data in each piece of data: xavg - <NUM>σavg < xavg < xavg + <NUM>σavg, xMAX - <NUM>σMAX < xMAX < xMAX + <NUM>σMAX, xMIN - 3σMIN < xMIN < xMIN + <NUM>σMIN, xF - <NUM>σF < xF < xF + <NUM>σF, and xQ - <NUM>σQ < xQ < xQ + <NUM>σQ, a number of the conditions satisfied is obtained, and heartbeat data satisfying less than three of the above conditions in initial data is eliminated to form a new heartbeat dataset.

Step S34: Step S32 is repeated until a heartbeat dataset does not change, and the heartbeat dataset is used as training data.

Step S35: The training data and a corresponding tag are input to a convolutional neural network for training, to obtain a convolutional neural network model based on sample distribution improvement.

The lead-II heartbeat signal in step S31 is sampled at a frequency of <NUM> and filtered by a <NUM> to <NUM> Butterworth bandpass filter. The sampling frequency of the lead-II heartbeat signal needs to be adjusted to <NUM> first if it is not <NUM>. Each heartbeat signal is an ECG signal from <NUM> before an R wave peak to <NUM> after the R wave peak.

The convolutional neural network model based on sample distribution improvement includes <NUM> network layers, namely, layers <NUM> to <NUM> and a classifier. Layers <NUM> to <NUM> each include a convolutional layer and a pooling layer, and use a LeakyReLU activation function. The convolutional layer in the layer <NUM> contains <NUM> kernels with a size of <NUM> each, and both a stride and a kernel size of the pooling layer in the layer <NUM> are <NUM>. The convolutional layer in the layer <NUM> contains <NUM> kernels with a size of <NUM> each, and both a stride and a kernel size of the pooling layer in the layer <NUM> are <NUM>. The convolutional layer in the layer <NUM> contains <NUM> kernels with a size of <NUM> each, and both a stride and a kernel size of the pooling layer in the layer <NUM> are <NUM>. The convolutional layer in the layer <NUM> contains <NUM> kernels with a size of <NUM> each, and both a stride and a kernel size of the pooling layer in the layer <NUM> are <NUM>. The convolutional layer in the layer <NUM> contains <NUM> kernels with a size of <NUM> each, and both a stride and a kernel size of the pooling layer in the layer <NUM> are <NUM>. The convolutional layer in the layer <NUM> contains <NUM> kernels with a size of <NUM> each. The layer <NUM> is an input layer of a bidirectional long short term memory network layer, a quantity of neurons in the layer <NUM> is consistent with a quantity of output characteristics of the layer <NUM>, and the bidirectional long short term memory network layer outputs <NUM> neurons in total, namely <NUM> neurons output forward and <NUM> neurons output backward. The layer <NUM> is an attention mechanism layer, which receives an output of the layer <NUM>. The layer <NUM> is a fully connected layer, which receives an output of the layer <NUM> and outputs <NUM> neurons.

Values of a and b may be set to <NUM> and <NUM> respectively. When an output value of the convolutional neural network model based on sample distribution improvement is greater than <NUM>, a heartbeat of an unknown type is considered as a premature ventricular beat; or when an output value is less than or equal to <NUM>, a heartbeat of an unknown type is considered as the non-premature ventricular heartbeat signal.

A convolutional neural network model is obtained through training by using the above-mentioned method for training a convolutional neural network. The convolutional neural network model can be used by performing the following steps:.

Values of a and b may be set to <NUM> and <NUM> respectively. In step S4, when the output value of the convolutional neural network model based on sample distribution improvement is greater than <NUM>, the heartbeat of the unknown type is considered as the premature ventricular beat; or when the output value is less than or equal to <NUM>, the heartbeat of the unknown type is considered as the non-premature ventricular heartbeat signal. The technical scope of the present disclosure is subjected to the scope of the claims, and is not limited to the content of the specification.

Those skilled in the art should understand that the embodiments of the present disclosure may be provided as a method, a system, or a computer program product. Therefore, the present disclosure may use a form of hardware only embodiments, software only embodiments, or embodiments with a combination of software and hardware. Moreover, the present disclosure may be in a form of a computer program product that is implemented on one or more computer-usable storage media (including but not limited to a magnetic disk memory, a CD-ROM, an optical memory, and the like) that include computer-usable program code.

The present disclosure is described with reference to the flowcharts and/or block diagrams of the method, the device (system), and the computer program product according to the embodiments of the present disclosure. It should be understood that computer program instructions may be used to implement each process and/or each block in the flowcharts and/or the block diagrams and a combination of a process and/or a block in the flowcharts and/or the block diagrams. These computer program instructions may be provided for a general-purpose computer, a dedicated computer, an embedded processor, or a processor of another programmable data processing device to generate a machine, such that the instructions executed by a computer or a processor of another programmable data processing device generate an apparatus for implementing a specific function in one or more processes in the flowcharts and/or in one or more blocks in the block diagrams.

Claim 1:
A method for training a convolutional neural network based on sample distribution improvement, comprising following steps:
a collection step (S31) of collecting enough lead-II heartbeat signals from a marked <NUM>-lead electrocardiogram signal to form an initial dataset, wherein the lead-II heartbeat signals comprise a premature ventricular heartbeat signal and a non-premature ventricular heartbeat signal that each account for half of a total quantity of lead-II heartbeat signals; and setting a tag of the premature ventricular heartbeat signal to a, and a tag of the non-premature ventricular heartbeat signal to b;
a statistics step (S32) of taking statistics on all heartbeat data in the collected dataset to obtain an average value, a maximum value, a minimum value, a peak, and a kurtosis value of each piece of heartbeat data to form an average value array AVG={a1, a2, a3, ..., aN}, a maximum value array MAX={m1, m2, m3, ..., mN}, a minimum value array MIN={c1, c2, ..., cN}, a peak array F={f1, f2, ..., fN}, and a kurtosis value array Q={q1, q2, ..., qN}, and then calculating average values and standard deviations of the average value array, the maximum value array, the minimum value array, the peak array, and the kurtosis value array, which are denoted as xavg, σavg, xMAX, σMAX, xMIN, σMIN, xF, σF, xQ, and σQ respectively;
an elimination step (S33) of determining whether following conditions are met for all heartbeat data in each piece of data: xavg - <NUM>σavg < xavg < xavg + <NUM>σavg, xMAX - <NUM>σMAX < xMAX < xMAX + <NUM>σMAX, xMIN - <NUM>σMIN < xMIN < xMIN + <NUM>σMIN, xF - <NUM>σF < xF < xF + <NUM>σF, and xQ - <NUM>σQ < xQ < xQ + <NUM>σQ, obtaining a number of the conditions satisfied, and eliminating heartbeat data satisfying less than three of the above conditions in initial data to form a new heartbeat dataset;
a repetition step (S34) of repeating the statistics step (S32) until a heartbeat dataset does not change, and using the heartbeat dataset as training data; and
an input step (S35) of inputting the training data and a corresponding tag to a convolutional neural network for training, to obtain a convolutional neural network model based on sample distribution improvement.