Training method of waveform recognition model, and method, device and equipment for recognizing electrocardiographic waveform

文档序号:1837382 发布日期:2021-11-16 浏览:6次 中文

阅读说明:本技术 波形识别模型的训练、心电波形识别方法、装置及设备 (Training method of waveform recognition model, and method, device and equipment for recognizing electrocardiographic waveform ) 是由 刘志伟 廖锐 刘禄 任丽 任善多 王海永 张春龙 于 2021-08-06 设计创作,主要内容包括:本申请实施例公开了波形识别模型的训练、心电波形识别方法、装置及设备,训练方法包括:获取各采样点带有波形分类结果标签的心电波形信号。根据心电波形信号长度和预设长度确定样本划分数量。将心电波形信号的长度区间内生成的n个随机数分别作为第一时刻点,从心电波形信号中截取第一时刻点到距离第一时刻点预设长度的第二时刻点之间的波形信号作为训练样本波形信号。将其输入包括特征提取子模型和分类子模型的波形识别模型中,获得输出的各采样点预测分类结果。基于各采样点预测分类结果和各采样点对应的波形分类结果标签,对波形识别模型进行训练。相比于现有训练样本,训练样本波形信号的数据量增加,能够提高波形识别模型的识别准确率。(The embodiment of the application discloses a method, a device and equipment for training a waveform recognition model and recognizing an electrocardiographic waveform, wherein the training method comprises the following steps: and acquiring the electrocardiographic waveform signals of each sampling point with the waveform classification result labels. And determining the number of sample divisions according to the length of the electrocardiographic waveform signal and a preset length. Respectively taking n random numbers generated in the length interval of the electrocardiogram waveform signal as first time points, and intercepting a waveform signal between the first time point and a second time point which is away from the first time point by a preset length from the electrocardiogram waveform signal as a training sample waveform signal. Inputting the sampling points into a waveform identification model comprising a feature extraction submodel and a classification submodel to obtain the output prediction classification result of each sampling point. And training the waveform recognition model based on the prediction classification result of each sampling point and the waveform classification result label corresponding to each sampling point. Compared with the existing training sample, the data size of the waveform signal of the training sample is increased, and the identification accuracy of the waveform identification model can be improved.)

1. A method for training a waveform recognition model, the method comprising:

acquiring an electrocardiographic waveform signal, wherein each sampling point of the electrocardiographic waveform signal corresponds to a label of a waveform classification result;

calculating the number of sample divisions according to the length of the electrocardiographic waveform signal and a preset length, wherein the number of sample divisions is greater than the ratio of the length of the electrocardiographic waveform signal to the preset length;

generating n random numbers within a length interval of the electrocardiographic waveform signal, wherein n is a positive integer and n is the number of sample divisions;

respectively taking the n random numbers as first time points, and intercepting a waveform signal between the first time point and a second time point which is away from the first time point by a preset length from the electrocardiographic waveform signal to be used as a training sample waveform signal;

inputting the training sample waveform signal into a waveform recognition model to obtain a prediction classification result of each sampling point of the training sample waveform signal output by the waveform recognition model, wherein the waveform recognition model comprises a feature extraction sub-model and a classification sub-model;

and training the waveform recognition model according to the predicted classification result of each sampling point of the training sample waveform signal and the label of the waveform classification result corresponding to each sampling point of the training sample waveform signal, so as to obtain the trained waveform recognition model.

2. The method of claim 1, wherein the calculating the number of sample divisions from the length of the electrocardiographic waveform signal and a preset length comprises:

calculating the difference between the length of the electrocardiographic waveform signal and a preset length to obtain a first numerical value;

calculating the quotient of the first numerical value and the random sampling step length to obtain a second numerical value;

and rounding the second numerical value to obtain the number of divided samples.

3. The method of claim 2, further comprising:

and if the first value is less than zero, the electrocardiographic waveform signal is acquired again.

4. The method of claim 2, further comprising:

determining the electrocardiographic waveform signal as a training sample waveform signal if the first value is equal to zero.

5. The method of claim 1, wherein the feature extraction submodel is a Unet network architecture and the classification submodel is a conditional random field CRF model;

the inputting the training sample waveform signal into a waveform recognition model to obtain a prediction classification result of each sampling point of the training sample waveform signal output by the waveform recognition model includes:

inputting the training sample waveform signal into a feature extraction submodel to obtain a feature vector of each sampling point of the training sample waveform signal output by the feature extraction submodel;

and inputting the characteristic vector of each sampling point of the training sample waveform signal into a classification submodel, and obtaining a prediction classification result of each sampling point of the training sample waveform signal output by the classification submodel.

6. The method of claim 1, wherein after acquiring the electrocardiographic waveform signal, the method further comprises:

and performing wavelet transformation and standardization processing on the electrocardiographic waveform signal to obtain the electrocardiographic waveform signal again.

7. A method of electrocardiographic waveform identification, the method comprising:

acquiring an electrocardiosignal to be identified, and intercepting at least one input waveform signal with a preset length from the electrocardiosignal to be identified;

inputting the input waveform signal into a waveform recognition model, and obtaining a waveform classification result of each sampling point in the input waveform signal output by the waveform recognition model, wherein the waveform recognition model is obtained by training according to the training method of the electrocardiographic waveform recognition model according to any one of claims 1-6.

8. An apparatus for training a waveform recognition model, the apparatus comprising:

the device comprises a first acquisition unit, a second acquisition unit and a processing unit, wherein the first acquisition unit is used for acquiring an electrocardiographic waveform signal, and each sampling point of the electrocardiographic waveform signal corresponds to a label of a waveform classification result;

a calculating unit configured to calculate a number of sample divisions according to a length of the electrocardiographic waveform signal and a preset length, the number of sample divisions being greater than a ratio of the length of the electrocardiographic waveform signal to the preset length;

a generating unit configured to generate n random numbers within a length section of the electrocardiographic waveform signal, where n is a positive integer and n is the number of sample divisions;

an intercepting unit, configured to respectively use the n random numbers as first time points, and intercept, from the electrocardiographic waveform signal, a waveform signal between the first time point and a second time point that is a preset length away from the first time point, as a training sample waveform signal;

the input unit is used for inputting the training sample waveform signal into a waveform recognition model to obtain a prediction classification result of each sampling point of the training sample waveform signal output by the waveform recognition model, and the waveform recognition model comprises a feature extraction sub-model and a classification sub-model;

and the training unit is used for training the waveform recognition model according to the predicted classification result of each sampling point of the training sample waveform signal and the label of the waveform classification result corresponding to each sampling point of the training sample waveform signal to obtain the trained waveform recognition model.

9. An electrocardiographic waveform identifying apparatus, the apparatus comprising:

the acquisition unit is used for acquiring the electrocardiosignals to be identified and intercepting at least one input waveform signal with a preset length from the electrocardiosignals to be identified.

An input unit, configured to input the input waveform signal into a waveform recognition model, and obtain a waveform classification result of each sampling point in the input waveform signal output by the waveform recognition model, where the waveform recognition model is obtained by training according to the training method of the electrocardiographic waveform recognition model according to any one of claims 1-6.

10. An apparatus for training a waveform recognition model, comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the method of training a waveform recognition model according to any one of claims 1-6 when executing the computer program.

11. An electrocardiographic waveform identifying apparatus, comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, when executing the computer program, implementing the electrocardiographic waveform identification method of claim 7.

12. A computer-readable storage medium having stored therein instructions which, when run on a terminal device, cause the terminal device to perform a method of training a waveform recognition model according to any one of claims 1-6, or to perform a method of electrocardiographic waveform recognition according to claim 7.

Technical Field

The application relates to the field of data processing, in particular to a training method, an electrocardiographic waveform recognition device and equipment of a waveform recognition model.

Background

The electrocardiographic waveform signal is a waveform signal representing the beating condition of the heart of the patient generated by monitoring the beating process of the heart of the patient. The waveform of the electrocardiographic waveform signal is identified based on the waveform identification model, and the waveform in the electrocardiographic waveform signal can be determined. Based on the identified waveforms in the electrocardiographic waveform signals, a physician can analyze the cardiovascular health of the patient.

At present, the requirement on the identification accuracy of the waveform identification model is higher and higher. However, a large amount of training data is required to train a waveform recognition model with high accuracy. The data quantity of the existing data set with complete labels is not enough to support a waveform recognition model with high training accuracy.

Disclosure of Invention

In view of this, embodiments of the present application provide a method, an apparatus, and a device for training a waveform recognition model and identifying an electrocardiographic waveform, which are used to enhance sample data size and improve the identification accuracy of the waveform recognition model.

In order to solve the above problem, the technical solution provided by the embodiment of the present application is as follows:

a method of training a waveform recognition model, the method comprising:

acquiring an electrocardiographic waveform signal, wherein each sampling point of the electrocardiographic waveform signal corresponds to a label of a waveform classification result;

calculating the number of sample divisions according to the length of the electrocardiographic waveform signal and a preset length, wherein the number of sample divisions is greater than the ratio of the length of the electrocardiographic waveform signal to the preset length;

generating n random numbers within a length interval of the electrocardiographic waveform signal, wherein n is a positive integer and n is the number of sample divisions;

respectively taking the n random numbers as first time points, and intercepting a waveform signal between the first time point and a second time point which is away from the first time point by a preset length from the electrocardiographic waveform signal to be used as a training sample waveform signal;

inputting the training sample waveform signal into a waveform recognition model to obtain a prediction classification result of each sampling point of the training sample waveform signal output by the waveform recognition model, wherein the waveform recognition model comprises a feature extraction sub-model and a classification sub-model;

and training the waveform recognition model according to the predicted classification result of each sampling point of the training sample waveform signal and the label of the waveform classification result corresponding to each sampling point of the training sample waveform signal, so as to obtain the trained waveform recognition model.

In one possible implementation, the calculating the number of sample divisions according to the length of the electrocardiographic waveform signal and a preset length includes:

calculating the difference between the length of the electrocardiographic waveform signal and a preset length to obtain a first numerical value;

calculating the quotient of the first numerical value and the random sampling step length to obtain a second numerical value;

and rounding the second numerical value to obtain the number of divided samples.

In one possible implementation, the method further includes:

and if the first value is less than zero, the electrocardiographic waveform signal is acquired again.

In one possible implementation, the method further includes:

determining the electrocardiographic waveform signal as a training sample waveform signal if the first value is equal to zero.

In a possible implementation manner, the feature extraction submodel is of a Unet network structure, and the classification submodel is of a conditional random field CRF model;

the inputting the training sample waveform signal into a waveform recognition model to obtain a prediction classification result of each sampling point of the training sample waveform signal output by the waveform recognition model includes:

inputting the training sample waveform signal into a feature extraction submodel to obtain a feature vector of each sampling point of the training sample waveform signal output by the feature extraction submodel;

and inputting the characteristic vector of each sampling point of the training sample waveform signal into a classification submodel, and obtaining a prediction classification result of each sampling point of the training sample waveform signal output by the classification submodel.

In one possible implementation, after acquiring the electrocardiographic waveform signal, the method further includes:

and performing wavelet transformation and standardization processing on the electrocardiographic waveform signal to obtain the electrocardiographic waveform signal again.

A method of electrocardiographic waveform identification, the method comprising:

acquiring an electrocardiosignal to be identified, and intercepting at least one input waveform signal with a preset length from the electrocardiosignal to be identified;

and inputting the input waveform signal into a waveform recognition model to obtain a waveform classification result of each sampling point in the input waveform signal output by the waveform recognition model, wherein the waveform recognition model is obtained by training according to the training method of the electrocardiogram waveform recognition model.

A training apparatus for a waveform recognition model, the apparatus comprising:

the device comprises a first acquisition unit, a second acquisition unit and a processing unit, wherein the first acquisition unit is used for acquiring an electrocardiographic waveform signal, and each sampling point of the electrocardiographic waveform signal corresponds to a label of a waveform classification result;

a calculating unit configured to calculate a number of sample divisions according to a length of the electrocardiographic waveform signal and a preset length, the number of sample divisions being greater than a ratio of the length of the electrocardiographic waveform signal to the preset length;

a generating unit configured to generate n random numbers within a length section of the electrocardiographic waveform signal, where n is a positive integer and n is the number of sample divisions;

an intercepting unit, configured to respectively use the n random numbers as first time points, and intercept, from the electrocardiographic waveform signal, a waveform signal between the first time point and a second time point that is a preset length away from the first time point, as a training sample waveform signal;

the input unit is used for inputting the training sample waveform signal into a waveform recognition model to obtain a prediction classification result of each sampling point of the training sample waveform signal output by the waveform recognition model, and the waveform recognition model comprises a feature extraction sub-model and a classification sub-model;

and the training unit is used for training the waveform recognition model according to the predicted classification result of each sampling point of the training sample waveform signal and the label of the waveform classification result corresponding to each sampling point of the training sample waveform signal to obtain the trained waveform recognition model.

An electrocardiographic waveform identification device, the device comprising:

the acquisition unit is used for acquiring the electrocardiosignals to be identified and intercepting at least one input waveform signal with a preset length from the electrocardiosignals to be identified.

And the input unit is used for inputting the input waveform signal into a waveform recognition model to obtain a waveform classification result of each sampling point in the input waveform signal output by the waveform recognition model, and the waveform recognition model is obtained by training according to the training method of the electrocardiogram waveform recognition model.

A training apparatus of a waveform recognition model, comprising: the training method comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein when the processor executes the computer program, the training method of the waveform recognition model is realized.

An electrocardiographic waveform identifying apparatus comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, when executing the computer program, implementing an electrocardiographic waveform identification method as described above.

A computer-readable storage medium having stored therein instructions which, when run on a terminal device, cause the terminal device to perform a training method of a waveform recognition model as described above, or to perform an electrocardiographic waveform recognition method as described above.

Therefore, the embodiment of the application has the following beneficial effects:

the embodiment of the application provides a method, a device and equipment for training a waveform recognition model and recognizing an electrocardiographic waveform. And after acquiring the electrocardio waveform signals of each sampling point with the waveform classification result labels, performing data enhancement on the electrocardio waveform signals. Specifically, the number n of sample divisions is determined according to the length of the electrocardiographic waveform signal and a preset length. The preset length is the length of an input signal of the waveform recognition model. And generating n random numbers in the length interval of the electrocardiogram waveform signal, and taking first time points corresponding to the n random numbers as initial time points of the n training sample waveform signals respectively. And intercepting a waveform signal between a first time point and a second time point which is away from the first time point by a preset length from the electrocardiographic waveform signal to be used as a training sample waveform signal. And further, inputting each training sample waveform signal into the waveform recognition model to obtain a prediction classification result of each sampling point of the training sample waveform signal output by the waveform recognition model. The waveform identification model comprises a feature extraction submodel and a classification submodel. And training the waveform recognition model according to the predicted classification result of each sampling point of the training sample waveform signal and the label of the waveform classification result corresponding to each sampling point of the training sample waveform signal, so as to obtain the trained waveform recognition model. Because the training sample waveform signals input into the waveform recognition model are n training sample waveform signals obtained by data enhancement, compared with the existing labeled data set, the method has the advantages that the generated training sample data amount is increased, and the recognition accuracy of the waveform recognition model after training is improved.

Drawings

Fig. 1 is a schematic diagram of an example scenario provided in an embodiment of the present application;

fig. 2 is a flowchart of a training method of a waveform recognition model according to an embodiment of the present application;

FIG. 3 is a block diagram of a waveform identification model provided in an embodiment of the present application;

fig. 4 is a schematic diagram of a pnet network structure provided in an embodiment of the present application;

FIG. 5 is a schematic diagram of a conditional random field CRF model structure provided by an embodiment of the present application;

fig. 6 is a flowchart for acquiring a training sample waveform signal according to an embodiment of the present application;

fig. 7 is a flowchart of an electrocardiographic waveform identification method according to an embodiment of the present application;

fig. 8 is a schematic structural diagram of a training apparatus for a waveform recognition model according to an embodiment of the present application;

fig. 9 is a schematic structural diagram of an electrocardiographic waveform recognition apparatus according to an embodiment of the present application.

Detailed Description

In order to make the aforementioned objects, features and advantages of the present application more comprehensible, embodiments accompanying the drawings are described in detail below.

In order to facilitate understanding of the technical solutions provided in the present application, the following description will be made on the background related to the present application.

The electrocardiographic waveform signal is a waveform signal representing the beating condition of the heart of the patient generated by monitoring the beating process of the heart of the patient. Since the waveform based on the electrocardiographic waveform signal can analyze the health condition of the patient, accurate identification of the waveform in the electrocardiographic waveform signal is important. If a waveform identification model with high accuracy is to be trained to identify the waveform in the electrocardiographic waveform signal, a large amount of training sample data is needed. However, the amount of training sample data of the currently known data set labeled completely is small, and is not enough to support a waveform recognition model with high training accuracy.

Based on this, the embodiment of the application provides a method, a device and equipment for training a waveform recognition model and recognizing an electrocardiographic waveform. In order to facilitate understanding of the training method of the waveform recognition model provided in the embodiment of the present application, the following description is made with reference to a scenario example shown in fig. 1. Referring to fig. 1, the figure is a schematic diagram of a framework of an exemplary application scenario provided in an embodiment of the present application.

And acquiring the electrocardiographic waveform signals of which the sampling points correspond to the waveform classification result labels. And calculating the number n of sample divisions according to the length of the electrocardiographic waveform signal and a preset length. The preset length is the length of an input signal of the waveform recognition model. The number n of sample divisions is the number of training sample waveform signals that need to be acquired.

After the number n of sample divisions is determined, n random numbers are generated within the length interval of the electrocardiographic waveform signal. The time points corresponding to the n random numbers are all first time points. And taking the n first time points as the starting time of the n training sample waveform signals respectively. Based on the first time point, a waveform signal between the first time point and a second time point which is away from the first time point by a preset length is intercepted from the electrocardiographic waveform signal to be used as a training sample waveform signal. Thereby, n training sample waveform signals are obtained.

And respectively inputting the n acquired training sample waveform signals into a waveform recognition model, and outputting a prediction classification result of each sampling point in the training sample waveform signals.

In addition, because each sampling point in the electrocardiographic waveform signal corresponds to a label of a waveform classification result, after the training sample waveform signal is determined, the label of the waveform classification result corresponding to each sampling point in the training sample waveform signal can be obtained. And training the waveform recognition model based on the predicted classification result of each sampling point in the training sample waveform signal output by the waveform recognition model and the label of the waveform classification result corresponding to each sampling point in the training sample waveform signal to obtain the trained waveform recognition model.

Those skilled in the art will appreciate that the block diagram shown in fig. 1 is only one example in which embodiments of the present application may be implemented. The scope of applicability of the embodiments of the present application is not limited in any way by this framework.

Based on the above description, the following describes in detail the training method of the waveform recognition model provided in the present application with reference to the drawings.

Referring to fig. 2, fig. 2 is a flowchart of a training method of a waveform recognition model according to an embodiment of the present application. The training method of the waveform recognition model can be executed by a terminal device. As shown in fig. 2, the waveform identification method includes S201 to S206:

s201: acquiring an electrocardio waveform signal, wherein each sampling point of the electrocardio waveform signal corresponds to a label of a waveform classification result.

The electrocardiographic waveform signal is a waveform signal containing information related to the heart beat obtained by monitoring the heart beat. Each patient corresponds to a respective electrocardiographic waveform signal, and the electrocardiographic waveform signals corresponding to a plurality of patients can form an electrocardiographic waveform signal set.

And labeling each electrocardiographic waveform signal, and determining that each sampling point of the electrocardiographic waveform signal corresponds to a label of a waveform classification result. And applying the label of the waveform classification result to the training process of the subsequent waveform recognition model.

After acquiring the electrocardiographic waveform signal, wavelet transformation and standardization processing can be performed on the electrocardiographic waveform signal corresponding to the waveform classification result label at each sampling point, and the electrocardiographic waveform signal is obtained again. It is understood that the retrieved electrocardiographic waveform signal is an electrocardiographic waveform signal after being subjected to wavelet transform and normalization processing.

As an example, the wavelet transform employs Daubechies wavelet transform algorithm; normalization was done using z-score.

When the method is specifically implemented, firstly, wavelet decomposition and wavelet reconstruction are carried out on the electrocardio waveform signals by using a Daubechies wavelet transform algorithm, filtering processing and denoising processing on the electrocardio waveform signals are realized, and the low-noise electrocardio waveform signals are obtained. Secondly, normalizing the electrocardio waveform signal with low noise by using z-score to obtain the electrocardio waveform signal again.

The electrocardiogram waveform signal has a large number of signal peaks and abrupt change signals, for example, Q point, R point and S point in the electrocardiogram waveform signal all belong to signal peaks, and wide QRS, ST segment depression and the like belong to abrupt change signals, and the signal peaks and abrupt change signals are helpful for waveform identification. Therefore, the electrocardio waveform signals are filtered and denoised by using Daubechies wavelet transform to obtain low-noise electrocardio waveform signals, so that effective signal peaks and sudden change signals in the electrocardio waveform signals can be protected.

In addition, z-score normalization (also known as positive-score normalization) is a normalization based on the mean and standard deviation of a low-noise electrocardiographic waveform signal. Due to the different sampling frequencies, each heartbeat in an electrocardiographic waveform signal has hundreds to thousands of data points. For an electrocardiographic waveform signal containing thousands of heart beats, the total data point number is hundreds of thousands to millions, and in consideration of the calculation speed of the standardization algorithm, the z-score algorithm is selected to standardize the electrocardiographic waveform signal so as to improve the standardization speed and obtain the electrocardiographic waveform signal again.

S202: and calculating the number of sample divisions according to the length of the electrocardiographic waveform signal and a preset length.

And after acquiring the electrocardiographic waveform signals of which the sampling points correspond to the waveform classification result labels, calculating the sample division quantity according to the length of the electrocardiographic waveform signals and the preset length. The preset length is the length of an input signal of the waveform recognition model. The number of sample divisions is the number of training sample waveform signals, which are used to train the waveform recognition model. After the number of sample divisions is determined, the electrocardiographic waveform signal can be divided into a number of training sample waveform signals of a preset length.

It should be noted that, in a common manner, the training sample size of the electrocardiographic waveform signal is determined to be a ratio of the length of the electrocardiographic waveform signal to a preset length, and the length of the electrocardiographic waveform signal can be understood as the number of sampling points corresponding to the electrocardiographic waveform signal. The sample division number in the embodiment of the application needs to be larger than the training sample number of the common electrocardiogram waveform signal, namely the sample division number needs to be larger than the ratio of the length of the electrocardiogram waveform signal to the preset length, so that the total data volume of the training sample is determined to be enhanced, and the identification accuracy of the waveform identification model after training is improved.

In one possible implementation manner, an embodiment of the present application provides a specific implementation manner of calculating the number of sample divisions according to the length of the electrocardiographic waveform signal and a preset length, including:

calculating the difference between the length of the electrocardiographic waveform signal and a preset length to obtain a first numerical value;

calculating the quotient of the first numerical value and the random sampling step length to obtain a second numerical value;

and rounding the second numerical value to obtain the number of divided samples.

It is understood that the smaller the random sampling step size, the larger the second value, the larger the number of sample divisions, and the greater the similarity of the waveform signals of the adjacent training samples. Therefore, an appropriate random sampling step size is selected to achieve the total data enhancement of the training samples and the similarity of the waveform signals of the adjacent training samples cannot be too large. As an example, the random sampling step size may be determined according to a sampling frequency of the electrocardiographic waveform signal. For example, the random sampling step size is one twentieth of the sampling frequency. As another example, the random sampling step size may be determined empirically.

It should be noted that, according to the magnitude of the first value, it may be determined whether the electrocardiographic waveform signal is capable of performing sample division of the electrocardiographic waveform signal. When the first value is larger than zero and the length of the electrocardiographic waveform signal is larger than a preset length (namely the length of the input signal of the waveform recognition model), determining that the electrocardiographic waveform signal can be subjected to sample division, wherein the number of the sample division is larger than or equal to 1. If the first value is equal to zero, i.e. the length of the electrocardiographic waveform signal is equal to the preset length, the electrocardiographic waveform signal is determined as the training sample waveform signal, and the number of sample divisions is 1. That is, the first value is required to be greater than or equal to zero on the premise that the number of sample divisions is obtained.

If the first value is smaller than zero and the length of the electrocardiographic waveform signal is smaller than the preset length, the electrocardiographic waveform signal is obtained again, that is, the tagged electrocardiographic waveform signal of another patient is obtained again, and S202 is executed again to obtain the training sample waveform signal meeting the sample dividing condition.

In addition, the embodiment of the present application provides a proving process for the above-mentioned embodiment of calculating the number of sample divisions according to the length of the electrocardiographic waveform signal and the preset length, so as to prove that the embodiment can achieve data enhancement of the training samples, and for the proving process, please refer to the following text.

S203: n random numbers are generated within a length interval of the electrocardiographic waveform signal, where n is a positive integer and n is a sample division number.

After the number of sample divisions is determined, n random numbers are generated within a length interval of the electrocardiographic waveform signal, wherein n is a positive integer and n is the number of sample divisions.

The time point corresponding to each random number can be used as the starting time point of a training sample waveform signal.

As an example, n random numbers are generated in an interval from zero to a target length by subtracting a preset length from the length of the electrocardiographic waveform signal as the target length.

S204: and respectively taking the n random numbers as first time points, and intercepting a waveform signal between the first time point and a second time point which is away from the first time point by a preset length from the electrocardiographic waveform signal to be used as a training sample waveform signal.

And taking the time points corresponding to the n random numbers as first time points. Each first time point is a starting time point of each training sample waveform signal. And intercepting a waveform signal between a first time point and a second time point which is away from the first time point by a preset length from the electrocardiographic waveform signal to be used as a training sample waveform signal. The training sample waveform signal satisfies the input signal length of the waveform recognition model.

Due to the randomness of the random numbers, the acquired n training sample waveform signals can more objectively represent the whole electrocardiogram waveform signal.

S205: inputting the training sample waveform signal into a waveform recognition model to obtain a prediction classification result of each sampling point of the training sample waveform signal output by the waveform recognition model, wherein the waveform recognition model comprises a feature extraction sub-model and a classification sub-model.

And sequentially inputting the n training sample waveform signals into the waveform recognition model to train the waveform recognition model. Taking a training sample waveform signal as an example, inputting the training sample waveform signal into a waveform recognition model, and obtaining a prediction classification result of each sampling point of the training sample waveform signal output by the waveform recognition model.

In specific implementation, the waveform recognition model comprises a feature extraction submodel and a classification submodel. The feature extraction submodel is used for extracting features of input training sample waveform signals, inputting the result features into the classification submodel after the extracted result features are obtained, classifying each sampling point in the training sample waveform signals, and obtaining the prediction classification result of each sampling point of the training sample waveform signals.

In a possible implementation manner, an embodiment of the present application provides a specific implementation manner that a training sample waveform signal is input into a waveform recognition model to obtain a prediction classification result of each sampling point of the training sample waveform signal output by the waveform recognition model, including:

inputting the training sample waveform signal into a feature extraction submodel to obtain a feature vector of each sampling point of the training sample waveform signal output by the feature extraction submodel;

and inputting the characteristic vector of each sampling point of the training sample waveform signal into the classification submodel to obtain a prediction classification result of each sampling point of the training sample waveform signal output by the classification submodel.

It will be appreciated that the resulting features output by the feature extraction submodel are represented by feature vectors.

In a possible implementation manner, the feature extraction sub-model is a Unet network structure, and the classification sub-model is a conditional random field CRF model. Referring to fig. 3, fig. 3 is a structural diagram of a waveform identification model provided in an embodiment of the present application. As shown in fig. 3, if the obtained training Sample waveform signal is Sample _ i, which includes k sampling points { Element _1, Element _ 2. Inputting the training Sample waveform signal Sample _ i into a Unet network structure for feature extraction, and obtaining feature vectors { T _1, T _2,. and T _ k }, wherein each element in the feature vectors is a feature vector corresponding to each sampling point. And inputting the feature vectors into a CRF model for classification to obtain a prediction classification result { Label _1, Label _2,. and Label _ k } corresponding to each sampling point.

Specifically, referring to fig. 4, fig. 4 is a schematic diagram of a pnet network structure provided in the embodiment of the present application. If k is 288, as shown in FIG. 4. The input of the Unet network structure needs to be firstly subjected to 4-layer down-sampling, and the down-sampling process is the process of feature extraction. The length of the training sample waveform signal is 288 sampling points, and the input layer size of the Unet network structure is 288 × 1, and 288 sampling points are represented by 288. The input of the Unet network structure is subjected to convolution processing and rectification linearization of a 'conv 32, Relu' module twice, so that the input characteristic is extracted, and the result characteristic is obtained. Wherein, conv 32 in the 'conv 32, Relu' module represents that convolution processing is carried out, and 32 represents 32 convolution kernels; relu denotes a rectifying linear unit, which may also be referred to as an excitation function. Then, the downsampling process is performed through a "maxpol 2" module, wherein "maxpol 2" indicates that 2 times of pooling is performed. The above operations are repeated 3 times, that is, after 4 times of down-sampling, the left half of the structure of the Unet network shown in fig. 4 is completed.

And after the result characteristics obtained by the last downsampling are subjected to convolution processing and rectification linearization by the up conv 32 and Relu modules, the current result characteristics are obtained. Wherein, up conv 32 represents performing convolution processing. The result feature at this time is further up-sampled 4 times. In the process of up-sampling each layer, the result features obtained by down-sampling of the corresponding layer and the current result features need to be input into a "concat" module for feature splicing. Wherein "concat" indicates that feature splicing is performed. And performing convolution processing and rectification linearization twice by a 'conv 32, Relu' module. After that, the convolution processing and rectification linearization are carried out by the "up conv 32, Relu" module. In the last upsampling, after convolution processing and rectification linearization of a 'conv 32, Relu' module are carried out twice, the extracted feature vector is obtained. In fig. 4, the size of the output layer of the Unet network structure is 288 × 16, 288 indicates the length of the training sample waveform signal, and 16 indicates the feature dimension corresponding to the sampling point in the waveform signal. It should be noted that, in fig. 4, each parameter in the Unet network structure is obtained through experiments.

Referring to FIG. 5, FIG. 5 is a schematic diagram of a conditional random field CRF model structure according to an embodiment of the present application. After the feature vectors are obtained, the feature vectors are input into a CRF model shown in fig. 5 for classification, and a prediction classification result { Label _1, Label _ 2.., Label _ k }, where k is 288, corresponding to each sampling point is obtained.

The waveform recognition model composed of the Unet model and the CRF model has the advantages of high accuracy and high speed of the Unet model, has the advantages of less input limit and strong tolerance of the CRF model, and is an algorithm model with strong learning capability.

S206: and training the waveform recognition model according to the predicted classification result of each sampling point of the training sample waveform signal and the label of the waveform classification result corresponding to each sampling point of the training sample waveform signal, so as to obtain the trained waveform recognition model.

Because each sampling point in the electrocardiographic waveform signal corresponds to a label of a waveform classification result, after the training sample waveform signal is determined, the label of the waveform classification result corresponding to each sampling point in the training sample waveform signal can be obtained.

And training the waveform recognition model based on the predicted classification result of each sampling point in the training sample waveform signal output by the waveform recognition model and the label of the waveform classification result corresponding to each sampling point in the training sample waveform signal to obtain the trained waveform recognition model.

As an example, labels for which each sampling point in the electrocardiographic waveform signal corresponds to a waveform classification result include eight kinds of P, PQ, QR, RS, SJ, JT, T, D, and the like. Wherein, P, PQ, JT, T and D respectively represent the interval between P wave, PR segment, ST segment, T wave and two adjacent heart beats. QR, RS and SJ collectively represent QRS complex intervals. It is understood that the above labels can be refined or generalized according to the requirement, and the category number of the labels is not limited herein.

The embodiment of the application provides a training method of a waveform recognition model. And after acquiring the electrocardio waveform signals of each sampling point with the waveform classification result labels, performing data enhancement on the electrocardio waveform signals. Specifically, the number n of sample divisions is determined according to the length of the electrocardiographic waveform signal and a preset length. The preset length is the length of an input signal of the waveform recognition model. And generating n random numbers in the length interval of the electrocardiogram waveform signal, and taking first time points corresponding to the n random numbers as initial time points of the n training sample waveform signals respectively. And intercepting a waveform signal between a first time point and a second time point which is away from the first time point by a preset length from the electrocardiographic waveform signal to be used as a training sample waveform signal. And further, inputting each training sample waveform signal into the waveform recognition model to obtain a prediction classification result of each sampling point of the training sample waveform signal output by the waveform recognition model. The waveform identification model comprises a feature extraction submodel and a classification submodel. And training the waveform recognition model according to the predicted classification result of each sampling point of the training sample waveform signal and the label of the waveform classification result corresponding to each sampling point of the training sample waveform signal, so as to obtain the trained waveform recognition model. The training sample waveform signals input into the waveform recognition model are n training sample waveform signals obtained by data enhancement, so that the training sample data amount of the waveform recognition model is increased, and the recognition accuracy of the waveform recognition model after training is improved.

In addition, the embodiment of the present application further provides a proving process that the sample number enhancement can be achieved by calculating the number of sample divisions according to the length of the electrocardiographic waveform signal and the preset length, which is specifically as follows:

determining an electrocardiographic waveform signal as the ith data segment with H Hz sampling frequency and x data segment lengthiThe preset length is set as l, the random sampling step length is s, the number of sample divisions is represented by n, and n is calculated by the following formula:

wherein, the middle brackets represent rounding.

Correspondingly, the quantity n of samples of the electrocardiographic waveform signal is obtained in a common way1The calculation formula of (2) is as follows:

therefore, the sample increment is n-n by the data enhancement method in S202-S204 provided by the embodiment of the application1

And (3) proving that: due to the fact thatSuppose thatObviously, xiL is more than s, s is more than 0, and f (x)i) 0 is n > n1Sufficient conditions of (2). So as to only f (x)i) Is a monotonically increasing function, the appropriate x can be foundiSo that

First, f (x) is provedi) Is a monotonically increasing function:

according to the conditions l > s, s >0I.e. f (x)i) Is a monotonically increasing function.

Further, only x needs to be solvedi,st.f(xi)=0:

As a result of this, the number of the,i.e. only the length of the data segment, i.e. the length of the electrocardiographic waveform signal, is requiredThen the number of sample divisions obtained using the data enhancement method of S202-S204 provided in the present application may be greater than the number n of training samples of the electrocardiographic waveform signal obtained in the conventional manner1

For example, the length of the electrocardiographic waveform signal is 2500 sampling points, the sampling frequency is 250HZ, the preset length is 256 sampling points, and the random sampling step size is 10. I.e. xi=2500,H=250,l=256,s=10。

ThenTherefore, the number of samples can be increased by using the data enhancement method provided by the embodiment of the application.

Furthermore, it is possible to provide a liquid crystal display device,

it can be seen that the number of samples is increased by 224-9-215.

Based on the above, the method for acquiring the training sample waveform signal in S202-S204 provided in the embodiment of the present application is a data enhancement method, which can increase the sample data size and is helpful to improve the recognition accuracy of the waveform recognition model.

In one possible implementation, the embodiment of the present application provides a specific process for acquiring a training sample waveform signal. Referring to fig. 6, fig. 6 is a flowchart for acquiring a training sample waveform signal according to an embodiment of the present application.

As shown in fig. 6, a data set is acquired that includes a plurality of data segments, each data segment being an electrocardiographic waveform signal. And setting a preset length, wherein the preset length is the length of an input signal of the waveform recognition model.

Taking the ith data segment as an example, the difference di between the ith data segment and the preset length is calculated, and di is xi-l.

And judging whether di is larger than or equal to 0, if not, discarding the data segment which does not meet the input signal length of the waveform identification model, and processing the (i + 1) th data segment.

If di ≧ 0 is satisfied, it is determined that the ith data segment can be divided. Further, whether di satisfies the condition that di is 0 or not is judged, if di is 0, the ith data segment just satisfies the input signal length of the waveform recognition model, and the ith data segment can be used as a training sample waveform signal. If not, determining that di is greater than 0, and dividing the obtained samples to obtain the number of divided samples which is greater than or equal to 1. Based on this, the number n of sample divisions into which the ith data segment is to be divided is calculated, where s is a random sampling step. After the number n is determined, n random numbers r1, … …, rn are generated between [0, di ]. And taking r1 and … … rn as initial sampling points of the n training sample waveform signals, and determining the n training sample waveform signals as (r1, r1+ l), … …, (rn, rn + l) according to the preset length l.

Thus, the process of "acquiring training samples" of the ith data segment is completed. And traversing all the data segments, performing the above operations, and forming a sample set by all the training sample waveform signals obtained from all the data segments. Training a waveform recognition model based on the sample set. Based on the above process, the obtained sample set increases the amount of training sample data of the waveform recognition model, which is helpful for improving the recognition accuracy of the waveform recognition model after training.

The embodiment of the application also provides an electrocardiographic waveform identification method. Referring to fig. 7, fig. 7 is a flowchart of an electrocardiographic waveform identification method according to an embodiment of the present application. As shown in fig. 7, the electrocardiographic waveform identifying method includes:

s701: acquiring an electrocardiosignal to be identified, and intercepting at least one input waveform signal with a preset length from the electrocardiosignal to be identified.

The preset length is the length of an input signal of the waveform recognition model.

S702: inputting the input waveform signal into a waveform recognition model, and obtaining a waveform classification result of each sampling point in the input waveform signal output by the waveform recognition model, wherein the waveform recognition model is obtained by training according to the training method of the electrocardiogram waveform recognition model in any one embodiment.

And inputting the input waveform signal into the waveform recognition model to obtain a waveform classification result of each sampling point in the input waveform signal, wherein the waveform classification result corresponds to the type of the label set in the waveform recognition model training process. That is, if the tag includes eight kinds of P, PQ, QR, RS, SJ, JT, T, D, etc. The waveform classification result of each sampling point in the input waveform signal obtained by the waveform identification model is the above eight results.

It can be understood that, based on the waveform identification model with high identification accuracy, the obtained waveform classification result of each sampling point in the incoming waveform signal is more accurate.

Based on the training method of the waveform recognition model provided by the embodiment of the method, the embodiment of the application also provides a training device of the waveform recognition model. The training device of the waveform recognition model will be described with reference to the accompanying drawings.

Referring to fig. 8, fig. 8 is a schematic structural diagram of a training apparatus for a waveform recognition model according to an embodiment of the present application. As shown in fig. 8, the training apparatus for the waveform recognition model includes:

a first obtaining unit 801, configured to obtain an electrocardiographic waveform signal, where each sampling point of the electrocardiographic waveform signal corresponds to a tag of a waveform classification result;

a calculating unit 802, configured to calculate a number of sample divisions according to a length of the electrocardiographic waveform signal and a preset length, where the number of sample divisions is greater than a ratio of the length of the electrocardiographic waveform signal to the preset length;

a generating unit 803, configured to generate n random numbers within a length interval of the electrocardiographic waveform signal, where n is a positive integer and n is the number of sample divisions;

an intercepting unit 804, configured to respectively use the n random numbers as first time points, and intercept, from the electrocardiographic waveform signal, a waveform signal between the first time point and a second time point that is a preset length away from the first time point, as a training sample waveform signal;

an input unit 805, configured to input the training sample waveform signal into a waveform recognition model, and obtain a prediction classification result of each sampling point of the training sample waveform signal output by the waveform recognition model, where the waveform recognition model includes a feature extraction sub-model and a classification sub-model;

the training unit 806 is configured to train the waveform identification model according to the predicted classification result of each sampling point of the training sample waveform signal and a label of the waveform classification result corresponding to each sampling point of the training sample waveform signal, so as to obtain a trained waveform identification model.

In a possible implementation manner, the computing unit 802 includes:

the first calculating subunit is used for calculating the difference between the length of the electrocardiographic waveform signal and a preset length to obtain a first numerical value;

the second calculating subunit is used for calculating the quotient of the first numerical value and the random sampling step length to obtain a second numerical value;

and the rounding subunit is used for rounding the second numerical value to obtain the number of the divided samples.

In one possible implementation, the apparatus further includes:

a second obtaining unit, configured to obtain the electrocardiographic waveform signal again if the first value is smaller than zero.

In one possible implementation, the apparatus further includes:

a determining unit for determining the electrocardiographic waveform signal as a training sample waveform signal if the first value is equal to zero.

In a possible implementation manner, the feature extraction submodel is of a Unet network structure, and the classification submodel is of a conditional random field CRF model;

the input unit 805 includes:

the first input subunit is used for inputting the training sample waveform signal into a feature extraction submodel to obtain a feature vector of each sampling point of the training sample waveform signal output by the feature extraction submodel;

and the second input subunit is used for inputting the feature vectors of the sampling points of the training sample waveform signal into a classification submodel to obtain a prediction classification result of the sampling points of the training sample waveform signal output by the classification submodel.

In one possible implementation, the apparatus further includes:

and the processing unit is used for performing wavelet transformation and standardization processing on the electrocardiographic waveform signal after acquiring the electrocardiographic waveform signal to obtain the electrocardiographic waveform signal again.

In addition, an embodiment of the present application further provides a training device for a waveform recognition model, including: the training method comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein when the processor executes the computer program, the training method of the waveform recognition model according to any one of the embodiments is realized.

In addition, a computer-readable storage medium is provided, where instructions are stored, and when the instructions are executed on a terminal device, the terminal device is caused to perform the training method for a waveform recognition model according to any one of the above embodiments.

The embodiment of the application provides a training device and equipment of a waveform recognition model. And after acquiring the electrocardio waveform signals of each sampling point with the waveform classification result labels, performing data enhancement on the electrocardio waveform signals. Specifically, the number n of sample divisions is determined according to the length of the electrocardiographic waveform signal and a preset length. The preset length is the length of an input signal of the waveform recognition model. And generating n random numbers in the length interval of the electrocardiogram waveform signal, and taking first time points corresponding to the n random numbers as initial time points of the n training sample waveform signals respectively. And intercepting a waveform signal between a first time point and a second time point which is away from the first time point by a preset length from the electrocardiographic waveform signal to be used as a training sample waveform signal. And further, inputting each training sample waveform signal into the waveform recognition model to obtain a prediction classification result of each sampling point of the training sample waveform signal output by the waveform recognition model. The waveform identification model comprises a feature extraction submodel and a classification submodel. And training the waveform recognition model according to the predicted classification result of each sampling point of the training sample waveform signal and the label of the waveform classification result corresponding to each sampling point of the training sample waveform signal, so as to obtain the trained waveform recognition model. The training sample waveform signals input into the waveform recognition model are n training sample waveform signals obtained by data enhancement, so that the training sample data amount of the waveform recognition model is increased, and the recognition accuracy of the waveform recognition model after training is improved.

Based on the method for identifying the electrocardiographic waveform provided by the embodiment of the method, the embodiment of the application also provides an electrocardiographic waveform identification device. The electrocardiographic waveform identifying device will be described with reference to the drawings.

Referring to fig. 9, fig. 9 is a schematic structural diagram of an electrocardiographic waveform recognition apparatus according to an embodiment of the present application. As shown in fig. 9, the electrocardiographic waveform identifying apparatus includes:

the acquiring unit 901 is configured to acquire an electrocardiographic signal to be identified, and intercept at least one input waveform signal with a preset length from the electrocardiographic signal to be identified.

An input unit 902, configured to input the input waveform signal into a waveform recognition model, and obtain a waveform classification result of each sampling point in the input waveform signal output by the waveform recognition model, where the waveform recognition model is obtained by training according to the training method of the electrocardiographic waveform recognition model according to any one of the embodiments described above.

In addition, an embodiment of the present application further provides an electrocardiographic waveform identification device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, when executing the computer program, implementing the method of electrocardiographic waveform identification as in any one of the embodiments described above.

In addition, a computer-readable storage medium is provided, where instructions are stored, and when the instructions are executed on a terminal device, the terminal device is caused to perform the method for identifying an electrocardiographic waveform according to any one of the embodiments.

It should be noted that, in the present specification, the embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the system or the device disclosed by the embodiment, the description is simple because the system or the device corresponds to the method disclosed by the embodiment, and the relevant points can be referred to the method part for description.

It should be understood that in the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" for describing an association relationship of associated objects, indicating that there may be three relationships, e.g., "a and/or B" may indicate: only A, only B and both A and B are present, wherein A and B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of single item(s) or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.

It is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

23页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:睡眠指标监测方法、电子装置、装置及可读存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!