Method for predicting abnormal type of electrocardiowave based on ResNet-Xgboost model

文档序号:56089 发布日期:2021-10-01 浏览:11次 中文

阅读说明:本技术 一种基于ResNet-Xgboost模型预测心电波异常类型的方法 (Method for predicting abnormal type of electrocardiowave based on ResNet-Xgboost model ) 是由 杨晓磊 郭自强 程保喜 李晓萌 薛时伦 刘卫军 张刚 于 2021-05-31 设计创作,主要内容包括:本发明一种基于ResNet-Xgboost模型预测心电波异常类型的方法,属于心电波异常类型预测技术领域;所要解决的技术问题为:提供一种基于ResNet-Xgboost模型预测心电波异常类型的方法的改进;解决上述技术问题采用的技术方案为:包括如下步骤:构建8导联心电图数据集;构建能够捕捉不同导联间相似性的ResNet结构的深度神经网络模型,并输出深度特征;根据领域知识和专家经验,构造常用的基于心电波的衍生特征作为人工构造特征;将深度特征和人工构造特征进行特征拼接后作为输入,构建多标签Xgboost预测模型;对于一个新的8导联心电图数据,先输入深度神经网络模型,得到深度特征,与人工特征拼接后输入训练好的Xgboost预测模型,预测患某种疾病的概率;本发明应用于心电波异常预测。(The invention discloses a method for predicting an abnormal type of an electrocardiowave based on a ResNet-Xgboost model, belonging to the technical field of predicting the abnormal type of the electrocardiowave; the technical problem to be solved is as follows: an improvement of a method for predicting an abnormal type of an electrocardiograph wave based on a ResNet-Xgboost model is provided; the technical scheme for solving the technical problems is as follows: the method comprises the following steps: constructing an 8-lead electrocardiogram data set; constructing a deep neural network model of a ResNet structure capable of capturing the similarity between different leads, and outputting depth characteristics; constructing commonly used derived features based on the electrocardiowaves as artificial construction features according to domain knowledge and expert experience; performing feature splicing on the depth features and the artificial construction features to be used as input, and constructing a multi-label Xgboost prediction model; for a new 8-lead electrocardiogram data, firstly inputting a deep neural network model to obtain a depth characteristic, splicing the depth characteristic with an artificial characteristic, and then inputting a trained Xgboost prediction model to predict the probability of suffering from a certain disease; the method is applied to the prediction of the abnormal electrocardiowave.)

1. A method for predicting an abnormal type of an electrocardiograph wave based on a ResNet-Xgboost model is characterized in that: the method comprises the following steps:

the method comprises the following steps: constructing an 8-lead electrocardiogram data set;

step two: constructing a deep neural network model of a ResNet structure capable of capturing the similarity between different leads, and outputting depth characteristics;

step three: constructing commonly used derived features based on the electrocardiowaves as artificial construction features according to domain knowledge and expert experience;

step four: performing feature splicing on the depth features and the artificial construction features to be used as input, and constructing a multi-label Xgboost prediction model;

step five: for a new 8-lead electrocardiogram data, firstly inputting a deep neural network model to obtain a depth characteristic, splicing the depth characteristic with an artificial characteristic, and then inputting a trained Xgboost prediction model to predict the probability of suffering from a certain disease.

2. The method of claim 1 for predicting the type of an abnormal electrocardiographic wave based on the ResNet-Xgboost model, wherein:

the second step is specifically as follows: learning the feature expression from the 8-lead electrocardiogram matrix, and splicing the outputs of the penultimate layer and the last layer of the ResNet network to be used as a depth feature variable.

3. The method of claim 2, wherein the method for predicting the type of an abnormal electrocardiographic wave based on the ResNet-Xgboost model comprises:

the ResNet network specifically comprises an input layer, a convolutional layer, a first ResNet building block, a second ResNet building block, a reconstruction layer, a pooling layer and an output layer;

an input layer: arranging an electrocardiogram into a two-dimensional matrix of 5000 x 8;

and (3) rolling layers: the convolution kernel size is 50 x 1, the number of filters is 32, and the step size is 2;

building block of the first ResNet: the method comprises a main road and identity mapping, wherein the main road comprises 3 layers: the method comprises the following steps of (1) carrying out batch standardization on a processing layer, a linear correction unit layer, convolution layers with convolution kernel size of 15 x 1, filter number of 32 and step length of 2, carrying out identity mapping, enabling the identity mapping to be consistent with the output shape of a main trunk after the identity mapping passes through the step length of 2, adding the two layers, and repeating the operation for two times in sequence;

second building block of ResNet: the method comprises a main road and identity mapping, wherein the main road comprises 3 layers: the method comprises the following steps of (1) carrying out batch standardization on a processing layer, a linear correction unit layer, convolution layers with convolution kernel size of 5 x 1, filter number of 32 and step length of 2, carrying out identity mapping, enabling the identity mapping to be consistent with the output shape of a main trunk after the identity mapping passes through the step length of 2, adding the two layers, and repeating the operation for two times in sequence;

a reconstruction layer: converting the output of the second ResNet building block into two-dimensional data;

a pooling layer: converting the output of the reconstruction layer into a one-dimensional vector by taking an average mode;

an output layer: the model represents the real label of the sample during training, and the model represents the prediction probability of a certain advanced sample on each disease type during prediction.

4. The method of claim 1 for predicting the type of an abnormal electrocardiographic wave based on the ResNet-Xgboost model, wherein:

the multi-label Xgboost prediction model in step four specifically comprises Xgboost prediction models for 20 cardiac diseases, wherein one Xgboost model is trained for each disease.

5. The method of claim 1 for predicting the type of an abnormal electrocardiographic wave based on the ResNet-Xgboost model, wherein: the fifth step is specifically as follows: after deep neural network training is completed, a training sample is predicted, the probabilities of the output of the pooling layer and the output of the output layer are spliced, features derived by artificial experience are combined to serve as the input of a machine learning model, and an XgBoost model is trained for each disease.

Technical Field

The invention discloses a method for predicting an abnormal type of an electrocardiowave based on a ResNet-Xgboost model, belonging to the technical field of methods for predicting the abnormal type of the electrocardiowave.

Background

An Electrocardiogram (ECG) is an important tool for assisting doctors in diagnosing heart-related diseases, and paper electrocardiograms are generally used in hospitals at present, and the possible heart diseases are judged mainly by artificial experiences. A complete ECG waveform is recorded for a complete heartbeat, which generally consists of P wave, QRS wave, T wave, U wave, P-R period, and Q-T period, as shown in detail in FIG. one. With the development of information technology, there is now a mature method for converting paper ECG into voltage signal and storing electrocardiographic wave signal in the form of two-dimensional matrix, which provides a solid data base for intelligent diagnosis by Ai technology.

Before the ResNet network is proposed, it is generally believed that the accuracy of a deeper network is higher, a shallow network is assumed to be constructed, and a higher accuracy is achieved on a certain prediction problem, theoretically, after a plurality of network layers with constant changes are naturally deepened behind the current network, the performance of the obtained deep network is equivalent to that of the shallow network, and the problem of accuracy reduction cannot occur. However, experiments show that the model accuracy rate is inverted u-shaped when the number of layers with constant change is increased, namely, the accuracy rate is increased continuously and starts to be reduced greatly after reaching a maximum value. The ResNet adds a quick link and down-sampling building block in a network structure, so that the degradation problem can be well solved, and the model prediction precision is improved.

The tree model does not need any hypothesis on the structure and distribution of data, can capture the interaction between variables, wherein XGboost is a promotion algorithm under a boosting framework, improves the implementation process of GBDT, greatly improves the running speed and efficiency of the model, is widely applied to some open machine learning competitions, and obtains better results.

Lieger (2012) detects atrial fibrillation signals in a single lead electrocardiogram using a first order difference QRST detection algorithm and an adaptive f-wave number detection algorithm; the Rochengsi (2018) identifies the atrial fibrillation by using the relevant indexes of the poincare graph distribution of atrial fibrillation signals and identifies the ventricular premature beats by using the CONCOR clustering algorithm; liu Na (2019) predicts the probability of suffering from atrial fibrillation by using four traditional machine learning algorithms of a support vector machine, K nearest neighbors, a decision tree and a random forest. However, the above algorithms or studies are only studies on abnormal cardiac wave signals of certain heart diseases, and only artificial empirical structural features are used to perform probability prediction by using a conventional statistical method or machine learning algorithm.

Disclosure of Invention

In order to overcome the defects in the prior art, the invention aims to solve the technical problems that: an improvement is provided for a method of predicting an abnormal type of an electrocardiograph wave based on a ResNet-Xgboost model.

In order to solve the technical problems, the invention adopts the technical scheme that: a method for predicting an abnormal type of an electrocardiograph wave based on a ResNet-Xgboost model comprises the following steps:

the method comprises the following steps: constructing an 8-lead electrocardiogram data set;

step two: constructing a deep neural network model of a ResNet structure capable of capturing the similarity between different leads, and outputting depth characteristics;

step three: constructing commonly used derived features based on the electrocardiowaves as artificial construction features according to domain knowledge and expert experience;

step four: performing feature splicing on the depth features and the artificial construction features to be used as input, and constructing a multi-label Xgboost prediction model;

step five: for a new 8-lead electrocardiogram data, firstly inputting a deep neural network model to obtain a depth characteristic, splicing the depth characteristic with an artificial characteristic, and then inputting a trained Xgboost prediction model to predict the probability of suffering from a certain disease.

The second step is specifically as follows: learning the feature expression from the 8-lead electrocardiogram matrix, and splicing the outputs of the penultimate layer and the last layer of the ResNet network to be used as a depth feature variable.

The ResNet network specifically comprises an input layer, a convolutional layer, a first ResNet building block, a second ResNet building block, a reconstruction layer, a pooling layer and an output layer;

an input layer: arranging an electrocardiogram into a two-dimensional matrix of 5000 x 8;

and (3) rolling layers: the convolution kernel size is 50 x 1, the number of filters is 32, and the step size is 2;

building block of the first ResNet: the method comprises a main road and identity mapping, wherein the main road comprises 3 layers: the method comprises the following steps of (1) carrying out batch standardization on a processing layer, a linear correction unit layer, convolution layers with convolution kernel size of 15 x 1, filter number of 32 and step length of 2, carrying out identity mapping, enabling the identity mapping to be consistent with the output shape of a main trunk after the identity mapping passes through the step length of 2, adding the two layers, and repeating the operation for two times in sequence;

second building block of ResNet: the method comprises a main road and identity mapping, wherein the main road comprises 3 layers: the method comprises the following steps of (1) carrying out batch standardization on a processing layer, a linear correction unit layer, convolution layers with convolution kernel size of 5 x 1, filter number of 32 and step length of 2, carrying out identity mapping, enabling the identity mapping to be consistent with the output shape of a main trunk after the identity mapping passes through the step length of 2, adding the two layers, and repeating the operation for two times in sequence;

a reconstruction layer: converting the output of the second ResNet building block into two-dimensional data;

a pooling layer: converting the output of the reconstruction layer into a one-dimensional vector by taking an average mode;

an output layer: the model represents the real label of the sample during training, and the model represents the prediction probability of a certain advanced sample on each disease type during prediction.

The multi-label Xgboost prediction model in step four specifically comprises Xgboost prediction models for 20 cardiac diseases, wherein one Xgboost model is trained for each disease.

The fifth step is specifically as follows: after deep neural network training is completed, a training sample is predicted, the probabilities of the output of the pooling layer and the output of the output layer are spliced, features derived by artificial experience are combined to serve as the input of a machine learning model, and an XgBoost model is trained for each disease.

Compared with the prior art, the invention has the beneficial effects that: compared with the prior art which only aims at one heart disease, the method for predicting the abnormal type of the cardiac wave based on the ResNet-Xgboost model considers 20 common heart diseases and has wider application range.

In the prior art, characteristics are constructed manually based on independent single leads, and the correlation among different leads is ignored.

In the prior art, the model-entering characteristics are derived only by manual experience, the number of the characteristics is limited, and effective information can be missed.

Drawings

The invention is further described below with reference to the accompanying drawings:

FIG. 1 is a one-time complete ECG waveform;

FIG. 2 is a flow chart of a prediction method of the present invention;

fig. 3 is a block diagram of a ResNet network according to the present invention.

Detailed Description

As shown in fig. 1 to 3, the method for predicting the type of an abnormal cardiac wave based on the ResNet-Xgboost model of the present invention comprises the following steps:

the method comprises the following steps: constructing an 8-lead electrocardiogram data set;

step two: constructing a deep neural network model of a ResNet structure capable of capturing the similarity between different leads, and outputting depth characteristics;

step three: constructing commonly used derived features based on the electrocardiowaves as artificial construction features according to domain knowledge and expert experience;

step four: performing feature splicing on the depth features and the artificial construction features to be used as input, and constructing a multi-label Xgboost prediction model;

step five: for a new 8-lead electrocardiogram data, firstly inputting a deep neural network model to obtain a depth characteristic, splicing the depth characteristic with an artificial characteristic, and then inputting a trained Xgboost prediction model to predict the probability of suffering from a certain disease.

The second step is specifically as follows: learning the feature expression from the 8-lead electrocardiogram matrix, and splicing the outputs of the penultimate layer and the last layer of the ResNet network to be used as a depth feature variable.

The ResNet network specifically comprises an input layer, a convolutional layer, a first ResNet building block, a second ResNet building block, a reconstruction layer, a pooling layer and an output layer;

an input layer: arranging an electrocardiogram into a two-dimensional matrix of 5000 x 8;

and (3) rolling layers: the convolution kernel size is 50 x 1, the number of filters is 32, and the step size is 2;

building block of the first ResNet: the method comprises a main road and identity mapping, wherein the main road comprises 3 layers: the method comprises the following steps of (1) carrying out batch standardization on a processing layer, a linear correction unit layer, convolution layers with convolution kernel size of 15 x 1, filter number of 32 and step length of 2, carrying out identity mapping, enabling the identity mapping to be consistent with the output shape of a main trunk after the identity mapping passes through the step length of 2, adding the two layers, and repeating the operation for two times in sequence;

second building block of ResNet: the method comprises a main road and identity mapping, wherein the main road comprises 3 layers: the method comprises the following steps of (1) carrying out batch standardization on a processing layer, a linear correction unit layer, convolution layers with convolution kernel size of 5 x 1, filter number of 32 and step length of 2, carrying out identity mapping, enabling the identity mapping to be consistent with the output shape of a main trunk after the identity mapping passes through the step length of 2, adding the two layers, and repeating the operation for two times in sequence;

a reconstruction layer: converting the output of the second ResNet building block into two-dimensional data;

a pooling layer: converting the output of the reconstruction layer into a one-dimensional vector by taking an average mode;

an output layer: the model represents the real label of the sample during training, and the model represents the prediction probability of a certain advanced sample on each disease type during prediction.

The multi-label Xgboost prediction model in step four specifically comprises Xgboost prediction models for 20 cardiac diseases, wherein one Xgboost model is trained for each disease.

The fifth step is specifically as follows: after deep neural network training is completed, a training sample is predicted, the probabilities of the output of the pooling layer and the output of the output layer are spliced, features derived by artificial experience are combined to serve as the input of a machine learning model, and an XgBoost model is trained for each disease.

The method for predicting the abnormal type of the electrocardiowave based on the ResNet-Xgboost model aims at 8-lead electrocardiowave data with the sampling frequency of 500 HZ, the length of 10 seconds and the unit voltage of 4.88 microvolts, and constructs the ResNet-Xgboost model based on the 8-lead electrocardiogram inspection data to predict the abnormal type of the electrocardiowave; the 8-lead electrocardio-wave data comprises 2 limb leads, namely an I lead, an II lead and 6 chest leads, namely V1, V2, V3, V4, V5 and V6 leads. The cardiac electric waves output by different leads are the result of observing the heart beating from different directions, and can reflect the abnormal conditions of the heart in three-dimensional and multi-direction, the invention only considers 20 common heart diseases as labels, and the 20 heart diseases are shown in the following table 1:

table 120 heart disease types.

The invention combines a deep neural network with a machine learning algorithm and combines automatic derivative characteristics with artificial experience derivative characteristics to predict the probability of respectively suffering from 20 common diseases. The main idea is as follows: firstly, providing a deep neural network model of a ResNet structure capable of capturing the similarity between different leads, constructing a multi-label prediction model, learning characteristic expression from an 8-lead electrocardiogram matrix, and splicing the outputs of the penultimate layer and the last layer of the network to serve as a deep characteristic variable; secondly, constructing commonly used derivative features based on the electrocardiowaves according to domain knowledge and expert experience; finally, combining the above two characteristics, an Xgboost model is trained for each disease to predict the probability of developing the disease, and the flowchart is shown in FIG. 2.

The structure of the ResNet network proposed by the present invention is shown in detail in FIG. 3. Overall, there are 5 large layers, first the input layer, and a piece of electrocardiogram is regarded as a two-dimensional matrix of 5000 × 8; layer 1 is a convolutional layer with convolutional kernel size of 50 x 1, filter number of 32 and step size of 2; layer 2 is a first ResNet building block, the main road comprises 3 layers, a batch standardization processing layer, a linear correction unit layer and a convolution layer with convolution kernel size of 15 x 1, filter number of 32 and step length of 2, a side real curve is an identity mapping in the ResNet structure, is consistent with the output shape of the main road after step length of 2, and is added, and the steps are repeated for two times; layer 3 is a second ResNet building block, similar to layer 2, and is divided into a main channel and an identity mapping (identity mapping) part, wherein the main channel comprises a batch standardization processing layer, a linear correction unit layer and a convolution layer with convolution kernel size of 5 x 1, filter number of 32 and step size of 2, and the identity mapping layer is the same layer 2; layer 4 is a reconstruction layer that functions to convert the output of layer 3 into two-dimensional data; layer 5 is a pooling layer, and the output of layer 4 is converted into a one-dimensional vector by taking the average; and finally, an output layer is used, wherein the real label of the sample is represented during model training, and the prediction probability of a certain newly-entered sample on each disease type is represented during prediction.

After the deep neural network training is completed, the training samples are predicted, the output of the layer 5 and the output probability of the output layer are spliced, the characteristics derived by artificial experience are combined to be used as the input of a machine learning model, and an XgBoost model is trained for each disease.

When the method is applied, an electrocardiogram sample firstly passes through a ResNet network to obtain depth characteristics, then the depth characteristics are spliced with artificial characteristics, and then the XGboost model of each disease is respectively passed through to obtain the probability of the sample suffering from each disease.

Aiming at the problems that in the prior art, the characteristic variables are constructed only by using artificial experience and a large number of potential characteristics are omitted, the invention provides a deep neural network model of a resnet structure, which can capture the similarity between different leads, and the deep characteristic variables are automatically generated; aiming at the problems that the single heart disease type prediction is carried out only by using a statistical method or a traditional machine learning algorithm in the prior art, the operation efficiency and the model effect are poor, the XgBoost algorithm under the boosting framework is used, the model is constructed based on the depth characteristics and the artificial characteristics for prediction, and the prediction accuracy is high.

It should be noted that, regarding the specific structure of the present invention, the connection relationship between the modules adopted in the present invention is determined and can be realized, except for the specific description in the embodiment, the specific connection relationship can bring the corresponding technical effect, and the technical problem proposed by the present invention is solved on the premise of not depending on the execution of the corresponding software program.

Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

10页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:头戴式睡眠仪

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!