Automatic atrial fibrillation signal detection method in electrocardiogram abnormal signals

文档序号:724559 发布日期:2021-04-20 浏览:28次 中文

阅读说明:本技术 一种心电图异常信号中的房颤信号自动检测方法 (Automatic atrial fibrillation signal detection method in electrocardiogram abnormal signals ) 是由 王英龙 石京京 舒明雷 刘辉 陈超 于 2020-12-23 设计创作,主要内容包括:一种心电图异常信号中的房颤信号自动检测方法,通将一维的心电信号经过短时傅里叶变换转变为二维形式,适用于深度残差收缩网络对输入信号的要求。使用注意力机制同时改进残差深度网络和Relu激活函数,通过注意力机制注意到不重要的特征,通过软阈值函数将它们设置为零,可以加强深度神经网络提取有用特征的能力,提高房颤信号的检测精度。同时通过注意力机制对Relu激活函数进行改进,可以提高DRSN模型对房颤信号识别的准确率。通过注意力机制的ReLu,可以提高DRSN模型识别的准确率。(An automatic detection method for atrial fibrillation signals in abnormal electrocardiogram signals is characterized in that one-dimensional electrocardiogram signals are converted into a two-dimensional form through short-time Fourier transform, and the method is suitable for requirements of a deep residual contraction network on input signals. The residual depth network and the Relu activation function are improved simultaneously by using an attention mechanism, unimportant features are noticed by the attention mechanism, and the unimportant features are set to be zero by a soft threshold function, so that the capability of the depth neural network for extracting useful features can be enhanced, and the detection accuracy of atrial fibrillation signals is improved. Meanwhile, the Relu activation function is improved through an attention mechanism, and the accuracy of the DRSN model in atrial fibrillation signal identification can be improved. By means of the ReLu of the attention mechanism, the accuracy of DRSN model identification can be improved.)

1. An automatic detection method for atrial fibrillation signals in abnormal electrocardiogram signals is characterized by comprising the following steps:

a) cutting the original electrocardiosignal f (t) to form n data x with Ns section;

b) the cardiac signal is represented as X { (X)(0),y(0)),(x(1),y(1)),···,(x(m-1),y(m-1)) Integrating the data to form a data set X with tag signals, where X(i)∈Rn,x(i)Is the ith data x, i is more than or equal to 0 and less than or equal to m-1, RnFor the nth sliced data, y(i)E {0,1,2} is a label, y(i)When the input electrocardiosignal is a normal signal, y is expressed as 0(i)1 represents that the input electrocardiosignal is an atrial fibrillation signal, y(i)2, the input electrocardiosignal is expressed as a normal signal and is other abnormal signals or noise signals;

c) Carrying out short-time Fourier transform operation on an original electrocardiosignal, determining the frequency and the phase of a sine wave in a certain area of electrocardio data, and then carrying out frequency spectrum conversion processing to convert the electrocardiosignal into an image;

d) matching the image with corresponding data labeling information, using the labeled image as the input of a depth residual shrinkage network, loading the image to a convolution layer of the depth residual shrinkage network, and performing convolution processing on the image;

e) establishing a residual error construction module, wherein the residual error construction module comprises two BN layers, two ReLU layers, two convolution layers, an identity map and a sub-network, the sub-network is used for adaptively setting a threshold value, the sub-network sequentially comprises a global mean pooling layer, a full connection layer, a ReLU layer, a full connection layer and a Sigmoid function, absolute values of all characteristics of input images are solved, then a global mean pooling and average characteristic diagram is obtained after the absolute values of all characteristics of the input images pass through the global mean pooling layer of the sub-network, the global mean pooling and average characteristic diagram is input into the two full connection layers to obtain scaling parameters, the scaling parameters are normalized to be between zero and one through the Sigmoid function, and the average value of the normalized absolute values of the scaling parameters multiplied by the normalized image is used as the threshold value;

f) carrying out soft thresholding on each characteristic channel of the image by using a threshold value;

g) standardizing the image processed in the step f), and converting the value distribution of each characteristic into standard normal distribution with the mean value of 0 and the variance of 1 to avoid gradient disappearance;

h) loading the image processed in the step g) into an excitation layer, wherein an activation function used in the excitation layer is an improved ReLU function, and the improved ReLU function is a coefficient with the scaling parameter a normalized by the Sigmoid function in the step e) as a negative number in the activation function, namely, the scaling parameter a is obtained by a formulaCalculating a ReLU function;

i) performing global mean pooling on the image processed in the step h), and calculating a mean value from each channel of the image;

j) and (3) inputting the image processed in the step i) through a full connection layer, and calculating a final result through a preset softmax classifier.

2. The method for automatically detecting atrial fibrillation signals in abnormal electrocardiogram signals according to claim 1, wherein the method comprises the steps of: in the step a), the original electrocardiosignals are segmented by taking the frequency of 250Hz as a standard to form data x with a section of 5s, and 1250 points are total.

3. The method for automatically detecting atrial fibrillation signals in abnormal electrocardiogram signals according to claim 1, wherein the method comprises the steps of: in step c), a Hamming window is used as a moving window function for processing the electrocardiosignals, the window size is 128samples, and the Hamming window is obtained by a formulaPerforming short-time Fourier transform operation on the one-dimensional electrocardiogram data to obtain short-time Fourier transform Y (w, u), and calculating the Y (w, u) branch through a formula E (w, u) ═ Y (w, u) & ltLimax & gt2And calculating to obtain an energy spectrum display E (w, u) of the short-time Fourier transform, wherein g (t-u) is a moving window function, t and u are time variables, t is more than or equal to 0 and less than or equal to 5, w is a signal frequency, E is an irrational number, and j is a negative variable.

4. The method for automatically detecting atrial fibrillation signals in abnormal electrocardiogram signals according to claim 1, wherein the method comprises the steps of: the deep residual shrinkage network in the step d) comprises an input layer, a convolution layer, 4 residual construction modules, a batch standardization layer, a ReLU activation function, a global mean pooling layer and a fully-connected output layer, wherein the size of an inner core of the convolution layer is set to be 5 x 5, the convolution layer is provided with 16 hidden units, and the step length is 2.

5. The method for automatically detecting atrial fibrillation signals in abnormal electrocardiogram signals according to claim 1, wherein the method comprises the steps of: in step g) according to the formulaCalculating the average value u, n is the total number of input data xiFor the ith data point, by formulaCalculating the variance σ2By the formulaCalculating to obtain a normalized resultε is a constant.

6. The method for automatically detecting atrial fibrillation signals in abnormal electrocardiogram signals according to claim 1, wherein the method comprises the steps of: the input dimension of the image in step j) is 256 x 1250 and the resulting output dimension is 4 x 1.

7. The method for automatically detecting atrial fibrillation signals in abnormal signals of electrocardiogram according to claim 1, wherein the step j) is followed by the following steps:

k) calculating the error of the soft thresholded value in the step f) by using a cross entropy loss function, if the error is smaller than a threshold value y, executing l), if the error is larger than the threshold value y, executing back propagation of the depth residual shrinkage network, and setting the cross entropy loss threshold value y to be 0.05;

l) optimizing DRSN model parameters using Adam optimization, performing step m) if the model has converged, and performing step d) if the model has not converged;

m) storing DRSN model parameters and ending the operation.

Technical Field

The invention relates to the technical field of deep learning and signal processing, in particular to an automatic atrial fibrillation signal detection method in an electrocardiogram abnormal signal.

Background

Atrial Fibrillation (AF) is a typical persistent arrhythmia and is of great importance for accurate identification of atrial fibrillation. The manifestation of Atrial Fibrillation (AF) in ECG signals is characterized by the disappearance of P-waves or absolute irregularity of RR intervals. The atrial fibrillation abnormity detection method used at present is mainly a waveform characteristic-based atrial fibrillation abnormity detection method, but due to the fact that waveform characteristics need to be manually extracted, P waves are not easy to detect and the like, the atrial fibrillation detection accuracy is general, and efficiency is low. Meanwhile, the waveform characteristic-based atrial fibrillation abnormality detection method needs enough rhythm information, so that a relatively long-time electrocardiogram signal needs to be acquired, and the real-time atrial fibrillation detection requirement is difficult to meet in practice.

Researchers have attempted to identify and detect atrial fibrillation signals using deep neural networks, and studies have shown that there is a strong correlation between the accuracy of the identification of atrial fibrillation abnormalities by electrocardiography and the number of layers in the deep neural networks. Because the common method is based on the resting data modeling, the test data is less, and the method is difficult to be applied to dynamic electrocardiosignals; more importantly, the rhythm information in the short-time electrocardiosignals is limited, and the detection of the abnormal atrial fibrillation from the short-time electrocardiosignals is still a challenge.

Disclosure of Invention

In order to overcome the defects of the technology, the invention provides a method for detecting and classifying atrial fibrillation (atrial fibrillation) signals in electrocardiogram abnormal signals by using a short-time Fourier transform and a depth residual contraction network. The technical scheme adopted by the invention for overcoming the technical problems is as follows:

an automatic detection method for atrial fibrillation signals in abnormal electrocardiogram signals comprises the following steps:

a) cutting the original electrocardiosignal f (t) to form n data x with Ns section;

b) the cardiac signal is represented as X { (X)(0),y(0)),(x(1),y(1)),···,(x(m-1),y(m-1)) Integrating the data to form a data set X with tag signals, where X(i)∈Rn,x(i)Is the ithData x, 0 ≤ i ≤ m-1, RnFor the nth sliced data, y(i)E {0,1,2} is a label, y(i)When the input electrocardiosignal is a normal signal, y is expressed as 0(i)1 represents that the input electrocardiosignal is an atrial fibrillation signal, y(i)2, the input electrocardiosignal is a normal signal and is other abnormal signals or noise signals;

c) carrying out short-time Fourier transform operation on an original electrocardiosignal, determining the frequency and the phase of a sine wave in a certain area of electrocardio data, and then carrying out frequency spectrum conversion processing to convert the electrocardiosignal into an image;

d) matching the image with corresponding data labeling information, using the labeled image as the input of a depth residual shrinkage network, loading the image to a convolution layer of the depth residual shrinkage network, and performing convolution processing on the image;

e) establishing a residual error construction module, wherein the residual error construction module comprises two BN layers, two ReLU layers, two convolution layers, an identity map and a sub-network, the sub-network is used for adaptively setting a threshold value, the sub-network sequentially comprises a global mean pooling layer, a full connection layer, a ReLU layer, a full connection layer and a Sigmoid function, absolute values of all characteristics of input images are solved, then a global mean pooling and average characteristic diagram is obtained after the absolute values of all characteristics of the input images pass through the global mean pooling layer of the sub-network, the global mean pooling and average characteristic diagram is input into the two full connection layers to obtain scaling parameters, the scaling parameters are normalized to be between zero and one through the Sigmoid function, and the average value of the normalized absolute values of the scaling parameters multiplied by the normalized image is used as the threshold value;

f) carrying out soft thresholding on each characteristic channel of the image by using a threshold value;

g) standardizing the image processed in the step f), and converting the value distribution of each characteristic into standard normal distribution with the mean value of 0 and the variance of 1 to avoid gradient disappearance;

h) loading the image processed in the step g) into an excitation layer, wherein an activation function used in the excitation layer is a modified ReLU function which is normalized through the Sigmoid function in the step e)The scaling parameter a being a coefficient of a negative number in the activation function, i.e. by formulaCalculating a ReLU function;

i) performing global mean pooling on the image processed in the step h), and calculating a mean value from each channel of the image;

j) and (3) inputting the image processed in the step i) through a full connection layer, and calculating a final result through a preset softmax classifier.

Further, in the step a), the original electrocardiosignals are segmented by taking the frequency of 250Hz as a standard, so that data x with a segment of 5s are formed, and 1250 points are total.

Further, in step c), a Hamming window is used as a moving window function for processing the electrocardiosignals, the window size is 128samples, and the formula is usedPerforming short-time Fourier transform operation on the one-dimensional electrocardiogram data to obtain short-time Fourier transform Y (w, u), and calculating the Y (w, u) branch through a formula E (w, u) ═ Y (w, u) & ltLimax & gt2And calculating to obtain an energy spectrum display E (w, u) of the short-time Fourier transform, wherein g (t-u) is a moving window function, t and u are time variables, t is more than or equal to 0 and less than or equal to 5, w is a signal frequency, E is an irrational number, and j is a negative variable.

Further, the deep residual shrinking network in the step d) includes an input layer, a convolution layer, 4 residual building modules, a batch normalization, a ReLU activation function, a global mean pooling layer, and a fully-connected output layer, the kernel size of the convolution layer is set to 5 × 5, the convolution layer has 16 hidden units, and the step length is 2. Further, step g) according to the formulaCalculating the average value u, n is the total number of input data xiFor the ith data point, by formulaCalculating varianceσ2By the formulaCalculating to obtain a normalized resultε is a constant.

Further, the input dimension of the image in step j) is 256 × 1250, and the resulting output dimension is 4 × 1.

Further, the step j) is followed by the following steps:

k) calculating the error of the soft thresholded value in the step f) by using a cross entropy loss function, if the error is smaller than a threshold value y, executing l), if the error is larger than the threshold value y, executing back propagation of the depth residual shrinkage network, and setting the cross entropy loss threshold value y to be 0.05;

l) optimizing DRSN model parameters using Adam optimization, performing step m) if the model has converged, and performing step d) if the model has not converged;

m) storing DRSN model parameters and ending the operation.

The invention has the beneficial effects that: the method is suitable for the requirements of a depth residual shrinkage network on input signals by converting one-dimensional electrocardiosignals into a two-dimensional form through short-time Fourier transform. The residual depth network and the Relu activation function are improved simultaneously by using an attention mechanism, unimportant features are noticed by the attention mechanism, and the unimportant features are set to be zero by a soft threshold function, so that the capability of the depth neural network for extracting useful features can be enhanced, and the detection accuracy of atrial fibrillation signals is improved. Meanwhile, the Relu activation function is improved through an attention mechanism, and the accuracy of the DRSN model in atrial fibrillation signal identification can be improved. By means of the ReLu of the attention mechanism, the accuracy of DRSN model identification can be improved.

Drawings

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

FIG. 2 is a flow chart of the deep residual shrinkage network of the present invention;

in the figure, 1.

Detailed Description

The invention will be further explained with reference to fig. 1 and 2.

An automatic detection method for atrial fibrillation signals in abnormal electrocardiogram signals comprises the following steps:

a) firstly, segmenting data, and because the length of an original electrocardio-western signal is uncontrollable and the data loading requirement is difficult to meet, in order to facilitate the data loading into a model, segmenting the original electrocardio-signal f (t) to form n data x with one segment of Ns.

b) The cardiac signal is represented as X { (X)(0),y(0)),(x(1),y(1)),···,(x(m-1),y(m-1)) Integrating the data to form a data set X with tag signals, where X(i)∈Rn,x(i)Is the ith data x, i is more than or equal to 0 and less than or equal to m-1, RnFor the nth sliced data, y(i)E {0,1,2} is a label, y(i)When the input electrocardiosignal is a normal signal, y is expressed as 0(i)1 represents that the input electrocardiosignal is an atrial fibrillation signal, y(i)2, the input electrocardiosignal is a normal signal and is other abnormal signals or noise signals. The data is finally integrated to form a data set with the tag signal.

c) The method comprises the steps of carrying out short-time Fourier transform operation on an original electrocardiosignal, determining the frequency and the phase of a sine wave in a certain area of electrocardio data, and then carrying out frequency spectrum conversion processing to convert the electrocardiosignal into an image. The short-time fourier transform can convert time-domain information into a two-dimensional time-frequency representation by the local frequency and phase of the signal changing with time, and display the frequency-domain change of the signal in a window function.

d) And matching the image with corresponding data labeling information, using the labeled image as the input of the depth residual error shrinkage network, loading the image to a convolution layer of the depth residual error shrinkage network, and performing convolution processing on the image.

e) Establishing a residual constructing module, wherein the residual constructing module comprises two BN layers (Batch Normalization), two ReLU layers (Rectifier Linear Unit activation function), two convolution layers (conditional layer), Identity mapping (Identity) and a sub-network, the sub-network is used for adaptively setting the threshold value, the sub-network sequentially comprises a global mean pooling layer, a full connection layer, a ReLU layer, a full connection layer and a Sigmoid function, calculating absolute values of all features of the input image, obtaining global mean pooling and average feature maps after passing through a global mean pooling layer of a sub-network, inputting the global mean pooling and average feature maps into two full-connection layers to obtain scaling parameters, and regulating the scaling parameter to be between zero and one through a Sigmoid function, and multiplying the regulated scaling parameter by the average value of the absolute values of the images to be used as a threshold value.

f) And soft thresholding each characteristic channel of the image by using a threshold value.

g) Standardizing the image processed in the step f), and converting the value distribution of each characteristic into standard normal distribution with the mean value of 0 and the variance of 1 to avoid gradient disappearance;

h) loading the image processed in the step g) into an excitation layer, wherein an activation function used in the excitation layer is an improved ReLU function, and the improved ReLU function is a coefficient with the scaling parameter a normalized by the Sigmoid function in the step e) as a negative number in the activation function, namely, the scaling parameter a is obtained by a formulaThe ReLU function is calculated. The reason for selecting the improved ReLU function is that the function is a piecewise linear function, the convergence speed is much faster than Sigmoid and tanh, and the calculation amount is small.

i) Performing global mean pooling on the image processed in the step h), and calculating a mean value from each channel of the image. The global mean pooling can reduce the weight number of the fully connected output layers, so that the phenomenon of overfitting caused by feature redundancy can be effectively reduced.

j) And (3) inputting the image processed in the step i) through a full connection layer, and calculating a final result through a preset softmax classifier.

The method is suitable for the requirements of a depth residual shrinkage network on input signals by converting one-dimensional electrocardiosignals into a two-dimensional form through short-time Fourier transform. The residual depth network and the Relu activation function are improved simultaneously by using an attention mechanism, unimportant features are noticed by the attention mechanism, and the unimportant features are set to be zero by a soft threshold function, so that the capability of the depth neural network for extracting useful features can be enhanced, and the detection accuracy of atrial fibrillation signals is improved. Meanwhile, the Relu activation function is improved through an attention mechanism, and the accuracy of the DRSN model in atrial fibrillation signal identification can be improved. By means of the ReLu of the attention mechanism, the accuracy of DRSN model identification can be improved.

Further, in the step a), the original electrocardiosignals are segmented by taking the frequency of 250Hz as a standard, so that data x with a segment of 5s are formed, and 1250 points are total.

Further, in step c), a Hamming window is used as a moving window function for processing the electrocardiosignals, the window size is 128samples, and the formula is usedPerforming short-time Fourier transform operation on the one-dimensional electrocardiogram data to obtain short-time Fourier transform Y (w, u), and calculating the Y (w, u) branch through a formula E (w, u) ═ Y (w, u) & ltLimax & gt2And calculating to obtain an energy spectrum display E (w, u) of the short-time Fourier transform, wherein g (t-u) is a moving window function, t and u are time variables, t is more than or equal to 0 and less than or equal to 5, w is a signal frequency, E is an irrational number, and j is a negative variable. By multiplying the moving window function by the electrocardiographic signal g (t-u), operations such as windowing and translation near u can be realized.

Further, the deep residual shrinking network in the step d) includes an input layer, a convolution layer, 4 residual building modules, a batch normalization, a ReLU activation function, a global mean pooling layer, and a fully-connected output layer, the kernel size of the convolution layer is set to 5 × 5, the convolution layer has 16 hidden units, and the step length is 2. Further, step g) according to the formulaCalculating the average value u, n is the total number of input data xiFor the ith data point, by formulaCalculating the variance σ2By the formulaCalculating to obtain a normalized resultε is a constant.

Further, the input dimension of the image in step j) is 256 × 1250, and the resulting output dimension is 4 × 1.

Further, the step j) is followed by the following steps:

k) calculating the error of the soft thresholded value in the step f) by using a cross entropy loss function, if the error is smaller than a threshold value y, executing l), if the error is larger than the threshold value y, executing back propagation of the depth residual shrinkage network, and setting the cross entropy loss threshold value y to be 0.05;

l) optimizing DRSN model parameters using Adam optimization, performing step m) if the model has converged, and performing step d) if the model has not converged;

m) storing DRSN model parameters and ending the operation.

10页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种采集动物脑电信号的装置

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!