CN108113665B - A method for automatic noise reduction of ECG signals - Google Patents

A method for automatic noise reduction of ECG signals Download PDF

Info

Publication number
CN108113665B
CN108113665B CN201711339403.9A CN201711339403A CN108113665B CN 108113665 B CN108113665 B CN 108113665B CN 201711339403 A CN201711339403 A CN 201711339403A CN 108113665 B CN108113665 B CN 108113665B
Authority
CN
China
Prior art keywords
ecg signal
value
reserve pool
network
matrix
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711339403.9A
Other languages
Chinese (zh)
Other versions
CN108113665A (en
Inventor
刘秀玲
张杰烁
熊鹏
刘明
李鑫
王洪瑞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hebei University
Original Assignee
Heibei University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Heibei University filed Critical Heibei University
Priority to CN201711339403.9A priority Critical patent/CN108113665B/en
Publication of CN108113665A publication Critical patent/CN108113665A/en
Application granted granted Critical
Publication of CN108113665B publication Critical patent/CN108113665B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/24Detecting, measuring or recording bioelectric or biomagnetic signals of the body or parts thereof
    • A61B5/316Modalities, i.e. specific diagnostic methods
    • A61B5/318Heart-related electrical modalities, e.g. electrocardiography [ECG]
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/24Detecting, measuring or recording bioelectric or biomagnetic signals of the body or parts thereof
    • A61B5/316Modalities, i.e. specific diagnostic methods
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/72Signal processing specially adapted for physiological signals or for diagnostic purposes
    • A61B5/7203Signal processing specially adapted for physiological signals or for diagnostic purposes for noise prevention, reduction or removal
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/72Signal processing specially adapted for physiological signals or for diagnostic purposes
    • A61B5/7235Details of waveform analysis

Landscapes

  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Engineering & Computer Science (AREA)
  • Surgery (AREA)
  • General Health & Medical Sciences (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Heart & Thoracic Surgery (AREA)
  • Medical Informatics (AREA)
  • Molecular Biology (AREA)
  • Physics & Mathematics (AREA)
  • Animal Behavior & Ethology (AREA)
  • Pathology (AREA)
  • Public Health (AREA)
  • Veterinary Medicine (AREA)
  • Signal Processing (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physiology (AREA)
  • Psychiatry (AREA)
  • Cardiology (AREA)
  • Measurement And Recording Of Electrical Phenomena And Electrical Characteristics Of The Living Body (AREA)

Abstract

本发明公开了一种心电信号的自动降噪算法,其处理过程是:A)建立回声状态网络并初始化;B)获取人体心电信号并在此基础上构建训练集;C)利用基于递归最小二乘法的在线训练算法训练回声状态网络,获得训练好的回声状态网络;D)构建测试集,将测试集输入训练好的回声状态网络,得到干净的心电信号。经本发明方法的处理,去噪后的干净心电信号不但有效滤除噪声,且恢复了心电信号低频特征波,保留了心电信号的有效信息。

Figure 201711339403

The invention discloses an automatic noise reduction algorithm for ECG signals. The processing process is: A) establishing an echo state network and initializing; B) acquiring human body ECG signals and constructing a training set on this basis; C) using recursion-based The online training algorithm of the least squares method trains the echo state network and obtains the trained echo state network; D) constructs a test set, and inputs the test set into the trained echo state network to obtain a clean ECG signal. After being processed by the method of the present invention, the clean ECG signal after denoising not only effectively filters out noise, but also restores the low-frequency characteristic wave of the ECG signal and retains the effective information of the ECG signal.

Figure 201711339403

Description

一种心电信号自动降噪方法A method for automatic noise reduction of ECG signals

技术领域technical field

本发明涉及心电信号自动检测与分析方法,具体的说是一种心电信号自动降噪方法。The invention relates to a method for automatic detection and analysis of electrocardiographic signals, in particular to an automatic noise reduction method for electrocardiographic signals.

背景技术Background technique

心血管疾病已成为人们健康的头号杀手,具有着高发病率、高致残率、高死亡率。其中,心电信号的低频成分对心血管疾病的智能诊断十分很重要,如其低频成分之一的ST段,代表着心室除极结束后、心室复极开始的一段时间内的电位变化情况,是诊断心肌缺血的重要指标。但与此同时,心电信号本身具有生物电信号的共性:幅值微弱、低频、阻抗大、随机性等,这些特点使得心电信号在采集过程中极易受到各种噪声的干扰。尤其在如今远程医疗背景下,心电信号采集时的噪声呈现了更为复杂特征,从而极易导致心电信号的低频部分被复杂噪声淹没,有效信息丢失的现象发生。Cardiovascular disease has become the number one killer of people's health, with high morbidity, disability and mortality. Among them, the low-frequency components of the ECG signal are very important for the intelligent diagnosis of cardiovascular diseases. For example, the ST segment, one of the low-frequency components, represents the potential change in a period of time after the end of ventricular depolarization and the beginning of ventricular repolarization. An important indicator for the diagnosis of myocardial ischemia. However, at the same time, the ECG signal itself has the common characteristics of the bioelectric signal: weak amplitude, low frequency, large impedance, randomness, etc. These characteristics make the ECG signal extremely susceptible to various noise interference during the acquisition process. Especially in the current telemedicine background, the noise during ECG signal acquisition presents more complex characteristics, which can easily cause the low-frequency part of the ECG signal to be overwhelmed by complex noise, and the phenomenon of loss of effective information occurs.

目前常用的方法有三种:第一种,经验模态分解(EMD)是提取固有模态函数(IMF)从而对含噪ECG信号进行了降噪,结果可以去除95%的高斯白噪声。然而,EMD并不能分离出与ECG信号频率相似的信号。因此,这种降噪方法有可能从信号将P波和T波滤除,从而导致误诊。第二种,主成分分析(PCA)和独立成分分析(ICA)都是用于从非高斯噪声信号中寻找独立的源信号的盲源分离技术,对于带内滤波有着明显的优势。但其模型对于含噪ECG信号的细微变化十分敏感,并不太适用ECG信号中含有较为复杂的噪声的情况。第三种,小波去噪方法在去除高频噪声方面取得了不错的结果,但其小波基的选择及阈值的设定是需要通过大量的实验来确定,且对最终滤波效果有直接的影响。由此可见,已有算法在降噪过程中容易丢失心电信号的有效低频信息,影响医生的判断。There are three commonly used methods: the first, empirical mode decomposition (EMD) is to extract the intrinsic mode function (IMF) to denoise the noisy ECG signal, and the result can remove 95% of the Gaussian white noise. However, EMD is not able to separate out signals with frequencies similar to ECG signals. Therefore, this noise reduction method has the potential to filter the P and T waves from the signal, leading to misdiagnosis. Second, Principal Component Analysis (PCA) and Independent Component Analysis (ICA) are both blind source separation techniques used to find independent source signals from non-Gaussian noise signals, which have obvious advantages for in-band filtering. However, its model is very sensitive to the subtle changes of the noisy ECG signal, and is not suitable for the situation that the ECG signal contains more complex noise. The third, wavelet denoising method has achieved good results in removing high-frequency noise, but the selection of the wavelet base and the setting of the threshold need to be determined through a large number of experiments, and have a direct impact on the final filtering effect. It can be seen that the existing algorithms tend to lose the effective low-frequency information of the ECG signal during the noise reduction process, which affects the doctor's judgment.

发明内容SUMMARY OF THE INVENTION

本发明的目的是提供一种电信号自动降噪算法,以在实现心电信号降噪的同时保留低频特征波,克服已有算法在降噪过程中容易丢失心电信号的有效低频信息的问题。The purpose of the present invention is to provide an automatic noise reduction algorithm for electrical signals, so as to retain the low-frequency characteristic wave while realizing the noise reduction of the ECG signal, and overcome the problem that the effective low-frequency information of the ECG signal is easily lost in the noise reduction process of the existing algorithm. .

本发明的目的是这样实现的:The object of the present invention is achieved in this way:

一种心电信号的自动降噪算法,包括以下几个步骤:An automatic noise reduction algorithm for ECG signals, including the following steps:

A)建立回声状态网络并初始化;A) establish the echo state network and initialize;

B)获取人体心电信号并在此基础上构建训练集;B) Obtain human ECG signals and build a training set on this basis;

C)利用基于递归最小二乘法的在线训练算法训练回声状态网络,获得并保存训练好的回声状态网络;C) utilize the online training algorithm based on recursive least squares to train the echo state network, obtain and save the trained echo state network;

D)以训练集之后紧邻的心电信号构建测试集,将测试集输入训练好的回声状态网络,得到干净的心电信号。D) Construct a test set with the ECG signal immediately after the training set, and input the test set into the trained echo state network to obtain a clean ECG signal.

所述的心电信号的自动降噪算法,步骤A)包括初始化权值矩阵和网络参数初始化设定,其中:The automatic noise reduction algorithm of described electrocardiogram, step A) comprises initialization weight matrix and network parameter initialization setting, wherein:

①初始化权值矩阵过程是:① The process of initializing the weight matrix is:

将输入单元与储备池内部连接的权值矩阵Win和储备池内部神经元连接权值矩阵W随机初始化,使之都服从均匀分布;Randomly initialize the weight matrix W in that connects the input unit to the inside of the reserve pool and the weight matrix W of the neuron connection inside the reserve pool, so that they all obey a uniform distribution;

将输出单元与储备池的连接权值矩阵Wback、储备池与输出单元连接权值矩阵Wout初始化为零矩阵;Initialize the connection weight matrix W back of the output unit and the reserve pool and the connection weight matrix W out of the reserve pool and the output unit to a zero matrix;

②网络参数初始化设定过程是:②The network parameter initialization setting process is as follows:

输入神经元个数设定为4,输出神经元个数设定为1,储备池中神经元个数设定为N=1000±300;The number of input neurons is set to 4, the number of output neurons is set to 1, and the number of neurons in the reserve pool is set to N=1000±300;

储备池稀疏程度SD=m/N,其中,m是储备池中相互连接的神经元个数,SD取值范围为1~5%;The sparsity of the reserve pool SD=m/N, where m is the number of interconnected neurons in the reserve pool, and the SD value ranges from 1 to 5%;

储备池谱半径SR的取值根据在0~1范围内以0.1为步长进行调试,以结果最优时所对应的SR值为最终取值,SR=max{abs(W的特征值)};The value of the spectral radius SR of the reserve pool is debugged according to the step size of 0.1 in the range of 0 to 1, and the SR value corresponding to the optimal result is the final value, SR=max{abs(eigenvalue of W)} ;

储备池输入单元尺度IS的取值为在-1~1范围内以0.01为步长进行调试,以结果最优时所对应的IS值为最终取值。The value of the input unit scale IS of the reserve pool is in the range of -1 to 1 for debugging with a step size of 0.01, and the IS value corresponding to the optimal result is the final value.

所述的心电信号的自动降噪算法,步骤B)具体过程如下:The automatic noise reduction algorithm of described electrocardiogram, step B) concrete process is as follows:

①从所获取的人体心电信号数据中截取若干连续心拍x(n),n=1,2,…,M,M=55±2,然后以当前时刻的含噪心电信号x(n)、其上一时刻的含噪心电信号x(n-1)、当前时刻的含噪心电信号的一阶导数x′(n)、当前时刻的含噪心电信号的二阶导数x″(n)构成回声状态网络的输入信号xr(n),表示为

Figure BDA0001508031120000021
①Intercept several consecutive heartbeats x(n), n=1, 2,..., M, M=55±2 from the acquired human ECG signal data, and then use the noise-containing ECG signal x(n) at the current moment , the noisy ECG signal x(n-1) at the previous moment, the first derivative x′(n) of the noisy ECG signal at the current moment, and the second derivative x″ of the noisy ECG signal at the current moment (n) The input signal x r (n) that constitutes the echo state network, expressed as
Figure BDA0001508031120000021

定义当前时刻的含噪心电信号x(n)所对应的干净心拍数据为d(n);Define the clean heartbeat data corresponding to the noisy ECG signal x(n) at the current moment as d(n);

由xr(n)与d(n)组成训练集(xr(n),d(n),n=1,2,…,M);A training set consisting of xr (n) and d(n) ( xr (n), d(n), n=1, 2,...,M);

②定义

Figure BDA0001508031120000031
其中g(·)为输出神经元激活函数,选为恒等函数,即输出神经元为一个线性神经元,该函数中,矩阵v(n)定义为
Figure BDA0001508031120000032
Figure BDA0001508031120000033
其中r(n)为储备池状态变量;②Definition
Figure BDA0001508031120000031
Among them, g( ) is the activation function of the output neuron, which is selected as the identity function, that is, the output neuron is a linear neuron. In this function, the matrix v(n) is defined as
Figure BDA0001508031120000032
Figure BDA0001508031120000033
where r(n) is the state variable of the reserve pool;

③定义误差e(n)=d(n)-y(n)。③Define error e(n)=d(n)-y(n).

所述的心电信号的自动降噪算法,步骤C)具体过程是:The automatic noise reduction algorithm of described electrocardiogram, step C) concrete process is:

①选定网络的储备池状态变量初始值为0,即r(0)=0,训练集(xr(n),d(n),n=1,2,…,M)中的样本xr(n)经过Win,d(n)经过Wback分别加到储备池中,利用公式r(n)=(1-α)[f(W·r(n-1)+Win·u(n)+Wback·d(n))]+α·r(n-1)进行储备池状态变量r(n)的更新;① The initial value of the reserve pool state variable of the selected network is 0, that is, r(0)=0, the sample x in the training set (x r (n), d(n), n=1, 2, ..., M) r (n) passes through W in , d(n) passes through W back and is added to the reserve pool respectively, using the formula r(n)=(1-α)[f(W·r(n-1)+W in ·u (n)+W back d(n))]+α r(n-1) to update the state variable r(n) of the reserve pool;

其中f(·)为储备池神经元激活函数,选为非线性的tanh(·)函数;where f( ) is the activation function of the neurons in the reserve pool, which is selected as the nonlinear tanh( ) function;

u(n)=ψ(n-1)·v(n),ψ(n)为v(n)的相关系数矩阵并通过公式

Figure BDA0001508031120000034
Figure BDA0001508031120000035
来进行更新,其中,
Figure BDA0001508031120000036
λ为遗忘因子,其取值在0.95~1范围以0.0001为步长进行调试,以结果最优时λ值为最终取值,ψ(0)=δ·I,I为单位矩阵,δ为一个极小的正数,其取值在0~0.001范围内以0.00001为步长调试,以结果最优时δ值为最终取值;u(n)=ψ(n-1)·v(n), ψ(n) is the correlation coefficient matrix of v(n) and is obtained by formula
Figure BDA0001508031120000034
Figure BDA0001508031120000035
to update, where,
Figure BDA0001508031120000036
λ is the forgetting factor, and its value is in the range of 0.95 to 1 with 0.0001 as the step for debugging. When the result is optimal, the λ value is the final value, ψ(0)=δ·I, I is the identity matrix, and δ is a A very small positive number, its value is in the range of 0 to 0.001, with 0.00001 as the step for debugging, and the final value of δ when the result is optimal;

α为遗忘率,其取值在0~1范围内以0.1的步长进行调试,以结果最优时的α值为最终取值;α is the forgetting rate, and its value is in the range of 0 to 1 for debugging with a step size of 0.1, and the α value when the result is optimal is the final value;

②根据公式Wout(n)=Wout(n-1)+k(n)·e(n)进行输出权重Wout的更新;② Update the output weight W out according to the formula W out (n)=W out (n-1)+k(n)·e(n);

③通过更新Wout(n)和r(n)使y(n)逼近干净ECG信号d(n),使误差e(n)能够近似于0,得到训练完成的回声状态网络。③ By updating W out (n) and r (n), y(n) is approximated to the clean ECG signal d(n), so that the error e(n) can be approximated to 0, and the trained echo state network is obtained.

所述的心电信号的自动降噪算法,步骤D)具体过程是:The automatic noise reduction algorithm of described electrocardiogram, step D) concrete process is:

以构建训练集时所截取的M个心拍之后紧邻的T个心拍构建测试集,测试集(Xr(n),n=1,2,…,T,T=200±10),其中,

Figure BDA0001508031120000037
即其包含当前时刻的心电信号X(n)、其上一个心电信号X(n-1)、其一阶导数X′(n)和二阶导数X″(n);The test set is constructed by using the T heart beats immediately after the M heart beats intercepted when constructing the training set, the test set (X r (n), n=1, 2,..., T, T=200±10), wherein,
Figure BDA0001508031120000037
That is, it contains the current ECG signal X(n), the previous ECG signal X(n-1), its first derivative X'(n) and second derivative X"(n);

将测试集(Xr(n),n=1,2,…,T)中的Xr(n)输入训练完成的回声状态网络,网络输出干净心电信号Y(n)。Input X r (n) in the test set (X r (n), n=1, 2, . . . , T) into the trained echo state network, and the network outputs a clean ECG signal Y (n).

经本发明方法的处理,去噪后的干净心电信号不但有效滤除噪声,且恢复了心电信号低频特征波,保留了心电信号的有效信息。After being processed by the method of the present invention, the clean ECG signal after denoising not only effectively filters out noise, but also restores the low-frequency characteristic wave of the ECG signal and retains the effective information of the ECG signal.

附图说明Description of drawings

图1是本发明方法实施过程流程图。Fig. 1 is a flow chart of the implementation process of the method of the present invention.

图2是回声状态网络结构示意图。Figure 2 is a schematic diagram of an echo state network structure.

图3是人体心电信号波形结构示意图。FIG. 3 is a schematic diagram of the waveform structure of the human ECG signal.

图4是滤波前含噪心电信号图。Figure 4 is a graph of a noisy ECG signal before filtering.

图5是滤波后干净心电信号图。Figure 5 is a graph of the clean ECG signal after filtering.

具体实施方式Detailed ways

本实施例在Intel Xeon CPU E5-2697@2.70GHz,内存为128.00GB,Win7,64位操作系统的计算机中实现,整个心电信号自动分类算法采用Matlab语言实现。This embodiment is implemented in a computer with Intel Xeon CPU E5-2697@2.70GHz, memory of 128.00GB, Win7, 64-bit operating system, and the entire ECG signal automatic classification algorithm is implemented in Matlab language.

结合图1,本发明的实施过程如下:In conjunction with Fig. 1, the implementation process of the present invention is as follows:

A)建立回声状态网络(Echo State Network,ESN):A) Establish an Echo State Network (ESN):

①、初始化权值矩阵:①, initialize the weight matrix:

随机初始化输入单元与储备池内部连接的权值矩阵Win和储备池内部神经元连接权值矩阵W,并且使其都服从均匀分布;Randomly initialize the weight matrix W in that the input unit is connected to the interior of the reserve pool and the weight matrix W that connect the neurons inside the reserve pool, and make them all obey a uniform distribution;

输出单元与储备池的连接权值矩阵Wback、储备池与输出单元连接权值矩阵Wout初始化为零矩阵;The connection weight matrix W back of the output unit and the reserve pool, and the connection weight matrix W out of the reserve pool and the output unit are initialized to a zero matrix;

②、参数设定:②, parameter setting:

ESN的输入神经元个数设定为4,输出神经元个数设定为1,储备池中的神经元的个数即储备池规模N=1000;The number of input neurons of ESN is set to 4, the number of output neurons is set to 1, and the number of neurons in the reserve pool is the size of the reserve pool N=1000;

ESN的储备池稀疏程度SD按公式SD=m/N计算得到,其中,m是储备池中相互连接的神经元个数,本例中将m取为m=20,则SD=2%;The sparse degree SD of the ESN’s reserve pool is calculated according to the formula SD=m/N, where m is the number of interconnected neurons in the reserve pool. In this example, m is taken as m=20, then SD=2%;

储备池谱半径SR定义为SR=max{abs(W的特征值)},由于当SR<1时,ESN才具有回声状态性质,本例中SR取值根据0~1范围内以0.1为步长进行调试,结果最优时取为SR=0.4;The spectral radius SR of the reserve pool is defined as SR=max{abs(eigenvalue of W)}. Since the ESN has the property of echo state only when SR<1, the value of SR in this example is based on the range of 0 to 1 in steps of 0.1 Debugging is carried out for a long time, and the optimal result is taken as SR=0.4;

定义WS为一个随机生成的服从均匀分布的稀疏程度为SD的稀疏矩阵,则储备池内部神经元连接权值矩阵W=SR·WS,以保证W的谱半径为SR;Define W S as a randomly generated sparse matrix with a uniform distribution and a sparse degree of SD, then the neuron connection weight matrix in the reserve pool W = SR · W S to ensure that the spectral radius of W is SR;

储备池输入单元尺度IS是输入信号连接至储备池之前需要相乘的一个尺度因子,通过输入信号与其相乘,从而将输入信号变换至储备池神经元激活函数的输入范围内,神经元激活函数输入范围为[-1,1],本例中IS的取值在-1~1范围内以0.01为步长进行调试,结果最优时IS=[0.01;0.01;0.9;0.8];The input unit scale IS of the reserve pool is a scale factor that needs to be multiplied before the input signal is connected to the reserve pool. By multiplying the input signal with it, the input signal is transformed into the input range of the neuron activation function of the reserve pool. The neuron activation function The input range is [-1, 1]. In this example, the value of IS is in the range of -1 to 1 and is debugged with a step size of 0.01. When the result is optimal, IS=[0.01; 0.01; 0.9; 0.8];

B)以250Hz的采集频率采集人体心电原始信号,其波形结构如图3所示,并存储为TXT文档的数据形式,然后用Matlab软件将以TXT文档存储的心电原始信号数据读取到电脑中,作为原始心电信号,如图4所示,构建训练集:B) Collect the original ECG signal of the human body with the acquisition frequency of 250Hz, and its waveform structure is shown in Figure 3, and store it in the data form of the TXT file, and then use Matlab software to read the original ECG signal data stored in the TXT file into In the computer, as the original ECG signal, as shown in Figure 4, a training set is constructed:

定义xr(n)为ESN的输入信号,其是从原始心电信号截取连续的M=55个心拍x(n),n=1,2,…,55,以当前时刻的含噪心电信号x(n)、其上一时刻的含噪心电信号x(n-1)、当前时刻的含噪心电信号的一阶导数x′(n)、当前时刻的含噪心电信号的二阶导数x″(n)构成,表示为

Figure BDA0001508031120000051
为一个N×4的矩阵;定义与当前心拍相应的干净心拍数据为d(n);由xr(n)与d(n)组成训练集(xr(n),d(n),n=1,2,…,55)。Define x r (n) as the input signal of ESN, which is to intercept M=55 consecutive heartbeats x(n), n=1, 2, . . . , 55 from the original ECG signal. The signal x(n), the noisy ECG signal x(n-1) at the previous moment, the first derivative x′(n) of the noisy ECG signal at the current moment, the The second derivative x″(n) is formed, which is expressed as
Figure BDA0001508031120000051
is an N×4 matrix; the clean heartbeat data corresponding to the current heartbeat is defined as d(n); the training set is composed of xr (n) and d(n) ( xr (n),d(n),n =1,2,...,55).

定义

Figure BDA0001508031120000052
其中g(·)为输出神经元激活函数,选为恒等函数,即输出神经元为一个线性神经元,该函数中,矩阵v(n)定义为
Figure BDA0001508031120000053
其中r(n)为储备池的状态变量,diag(IS)表示以IS为对角线生成一个对角矩阵;definition
Figure BDA0001508031120000052
Among them, g( ) is the activation function of the output neuron, which is selected as the identity function, that is, the output neuron is a linear neuron. In this function, the matrix v(n) is defined as
Figure BDA0001508031120000053
Among them, r(n) is the state variable of the reserve pool, and diag(IS) means that a diagonal matrix is generated with IS as the diagonal;

定义误差e(n)=d(n)-y(n);Definition error e(n)=d(n)-y(n);

C)利用基于递归最小二乘法的在线训练算法训练回声状态网络:C) Using the online training algorithm based on recursive least squares to train the echo state network:

①选定网络的储备池的状态变量初始值为0,即r(0)=0,训练集(xr(n),d(n),n=1,2,…,55)中的样本xr(n)经过Win,d(n)经过Wback分别加到储备池中,利用公式r(n)=(1-α)[f(W·r(n-1)+Win·u(n)+Wback·d(n))]+α·r(n-1)进行储备池状态r(n)的更新:①The initial value of the state variable of the reserve pool of the selected network is 0, that is, r(0)=0, the samples in the training set (x r (n), d(n), n=1, 2, ..., 55) x r (n) passes through W in , and d(n) passes through W back to be added to the reserve pool respectively, using the formula r(n)=(1-α)[f(W·r(n-1)+W in · u(n)+W back d(n))]+α r(n-1) to update the reserve pool state r(n):

其中f(·)为储备池神经元激活函数,由于网络进行建模时需要较强的非线性,选为非线性的tanh(·)函数;Among them, f( ) is the activation function of the neurons in the reserve pool. Since the network needs strong nonlinearity for modeling, it is selected as the nonlinear tanh( ) function;

该函数中u(n)=ψ-1(n-1)·v(n),ψ(n)为v(n)的相关系数矩阵的逆矩阵并通过下式来进行更新:In this function, u(n)=ψ -1 (n-1)·v(n), ψ(n) is the inverse matrix of the correlation coefficient matrix of v(n) and is updated by the following formula:

Figure BDA0001508031120000061
其中,
Figure BDA0001508031120000062
λ为遗忘因子,定义为一个范围为0.95<λ<1的常数,其取值以0.0001为步长,进行调试,以结果最优时λ值为最终取值,本例中取λ=0.9999,ψ(0)=δ-1·I,I为单位矩阵,δ为一个极小的正数,其取值范围为0~0.001,以0.00001为步长调试,以结果最优(即训练集中的输入信号再放进网络中,得到的y(n)与d(n)的误差近似于0时)时δ值为最终取值,本例中取δ=0.00172;
Figure BDA0001508031120000061
in,
Figure BDA0001508031120000062
λ is the forgetting factor, which is defined as a constant in the range of 0.95 < λ < 1. Its value takes 0.0001 as the step size, and is debugged. When the result is optimal, the λ value is the final value. In this example, λ = 0.9999, ψ(0)=δ -1 ·I, I is the identity matrix, δ is a very small positive number, its value range is 0~0.001, and the step size is 0.00001 for debugging, and the result is the best (that is, the When the input signal is put into the network again, and the obtained error between y(n) and d(n) is approximately 0), the δ value is the final value, in this example, δ=0.00172;

该函数中α为遗忘率,被定义为一个小于1的正数,取值范围为0~1,以0.1的步长进行调试,以结果最优时的α值为最终取值,本例中取值为α=0.8。In this function, α is the forgetting rate, which is defined as a positive number less than 1. The value ranges from 0 to 1. The debugging is performed with a step size of 0.1. The final value is the α value when the result is optimal. In this example The value is α=0.8.

②根据公式Wout(n)=Wout(n-1)+k(n)·e(n)进行输出权重Wout的更新。② The output weight W out is updated according to the formula W out (n)=W out (n-1)+k(n)·e(n).

③通过更新Wout(n)和r(n)使y(n)逼近干净ECG信号d(n),使误差e(n)能够近似于0,得到并保存训练完好的回声状态网络。③ By updating W out (n) and r (n), y(n) is approximated to the clean ECG signal d(n), so that the error e(n) can be approximated to 0, and the well-trained echo state network is obtained and saved.

当y(n)逼近于d(n)时,即误差e(n)近似于0,网络为稳定状态,保存训练好的回状态网络即可用于心电信号去噪。When y(n) is close to d(n), that is, the error e(n) is close to 0, the network is in a stable state, and the trained back-to-state network can be used for ECG signal denoising.

D)验证:D) Verify:

以构建训练集时所截取的55个心拍之后紧邻的T=200个心拍构建测试集,测试集(Xr(n),n=1,2,…,200),其中,

Figure BDA0001508031120000063
即其包含当前时刻的心电信号X(n)、其上一个心电信号X(n-1)、其一阶导数X′(n)和二阶导数X″(n);The test set is constructed with T=200 heartbeats immediately after the 55 heartbeats intercepted when constructing the training set, and the test set is ( Xr (n), n=1,2,...,200), wherein,
Figure BDA0001508031120000063
That is, it contains the current ECG signal X(n), the previous ECG signal X(n-1), its first derivative X'(n) and second derivative X"(n);

将测试集(Xr(n),n=1,2,…,200)中的Xr(n)输入训练完成的回声状态网络,网络输出干净心电信号Y(n),如图5所示。Input X r (n) in the test set (X r (n), n=1, 2,..., 200) into the echo state network after training, and the network outputs a clean ECG signal Y (n), as shown in Figure 5 Show.

从以上处理结果可以看出,含噪心电信号(如图4)与正常心电信号波形(图2)相对比可看出,在噪声的干扰下心电信号低频特征波T波和P波严重失真,经本发明方法的处理,去噪后的干净心电信号(如图5)不但有效滤除噪声,且恢复了心电信号低频特征波,保留了心电信号的有效信息。It can be seen from the above processing results that the noise-containing ECG signal (as shown in Figure 4) is compared with the normal ECG signal waveform (as shown in Figure 2). Distortion, processed by the method of the present invention, the clean ECG signal after denoising (as shown in Figure 5) not only effectively filters out the noise, but also restores the low-frequency characteristic wave of the ECG signal and retains the effective information of the ECG signal.

Claims (1)

1.一种心电信号的自动降噪算法,其特征是,包括以下几个步骤:1. an automatic noise reduction algorithm of electrocardiogram, is characterized in that, comprises the following steps: A)建立回声状态网络并初始化;A) establish the echo state network and initialize; B)获取人体心电信号并在此基础上构建训练集;B) Obtain human ECG signals and build a training set on this basis; C)利用基于递归最小二乘法的在线训练算法训练回声状态网络,获得并保存训练好的回声状态网络;C) utilize the online training algorithm based on recursive least squares to train the echo state network, obtain and save the trained echo state network; D)以训练集之后紧邻的心电信号构建测试集,将测试集输入训练好的回声状态网络,得到干净的心电信号;D) construct a test set with the ECG signal immediately after the training set, and input the test set into the trained echo state network to obtain a clean ECG signal; 所述步骤A)包括初始化权值矩阵和网络参数初始化设定,其中:Described step A) includes initialization weight matrix and network parameter initialization setting, wherein: ①初始化权值矩阵过程是:① The process of initializing the weight matrix is: 将输入单元与储备池内部连接的权值矩阵Win和储备池内部神经元连接权值矩阵W随机初始化,使之都服从均匀分布;Randomly initialize the weight matrix W in that connects the input unit to the inside of the reserve pool and the weight matrix W of the neuron connection inside the reserve pool, so that they all obey a uniform distribution; 将输出单元与储备池的连接权值矩阵Wback、储备池与输出单元连接权值矩阵Wout初始化为零矩阵;Initialize the connection weight matrix W back of the output unit and the reserve pool and the connection weight matrix W out of the reserve pool and the output unit to a zero matrix; ②网络参数初始化设定过程是:②The network parameter initialization setting process is as follows: 输入神经元个数设定为4,输出神经元个数设定为1,储备池中神经元个数设定为N=1000±300;The number of input neurons is set to 4, the number of output neurons is set to 1, and the number of neurons in the reserve pool is set to N=1000±300; 储备池稀疏程度SD=m/N,其中,m是储备池中相互连接的神经元个数,SD取值范围为1~5%;The sparsity of the reserve pool SD=m/N, where m is the number of interconnected neurons in the reserve pool, and the SD value ranges from 1 to 5%; 储备池谱半径SR的取值根据在0~1范围内以0.1为步长进行调试,以结果最优时所对应的SR值为最终取值,SR=max{abs(W的特征值)};The value of the spectral radius SR of the reserve pool is debugged according to the step size of 0.1 in the range of 0 to 1, and the SR value corresponding to the optimal result is the final value, SR=max{abs(eigenvalue of W)} ; 储备池输入单元尺度IS的取值为在-1~1范围内以0.01为步长进行调试,以结果最优时所对应的IS值为最终取值;The value of the input unit scale IS of the reserve pool is in the range of -1 to 1, with a step size of 0.01 for debugging, and the IS value corresponding to the optimal result is the final value; 所述步骤B)具体过程如下:Described step B) concrete process is as follows: ①从所获取的人体心电信号数据中截取若干连续心拍x(n),n=1,2,…,M,M=55±2,然后以当前时刻的含噪心电信号x(n)、其上一时刻的含噪心电信号x(n-1)、当前时刻的含噪心电信号的一阶导数x′(n)、当前时刻的含噪心电信号的二阶导数x″(n)构成回声状态网络的输入信号xr(n),表示为
Figure FDA0002636917960000011
Figure FDA0002636917960000012
①Intercept several consecutive heartbeats x(n), n=1, 2,..., M, M=55±2 from the acquired human ECG signal data, and then use the noise-containing ECG signal x(n) at the current moment , the noisy ECG signal x(n-1) at the previous moment, the first derivative x′(n) of the noisy ECG signal at the current moment, and the second derivative x″ of the noisy ECG signal at the current moment (n) The input signal x r (n) that constitutes the echo state network, expressed as
Figure FDA0002636917960000011
Figure FDA0002636917960000012
定义当前时刻的含噪心电信号x(n)所对应的干净心拍数据为d(n);Define the clean heartbeat data corresponding to the noisy ECG signal x(n) at the current moment as d(n); 由xr(n)与d(n)组成训练集(xr(n),d(n),n=1,2,…,M);A training set consisting of xr (n) and d(n) ( xr (n), d(n), n=1, 2,...,M); ②定义
Figure FDA0002636917960000021
其中g(·)为输出神经元激活函数,选为恒等函数,即输出神经元为一个线性神经元,该函数中,矩阵v(n)定义为
Figure FDA0002636917960000022
Figure FDA0002636917960000023
其中r(n)为储备池状态变量,diag(IS)表示以IS为对角线生成一个对角矩阵;
②Definition
Figure FDA0002636917960000021
Among them, g( ) is the activation function of the output neuron, which is selected as the identity function, that is, the output neuron is a linear neuron. In this function, the matrix v(n) is defined as
Figure FDA0002636917960000022
Figure FDA0002636917960000023
Among them, r(n) is the state variable of the reserve pool, and diag(IS) means that a diagonal matrix is generated with IS as the diagonal;
③定义误差e(n)=d(n)-y(n);③Define error e(n)=d(n)-y(n); 所述步骤C)具体过程是:Described step C) concrete process is: ①选定网络的储备池状态变量初始值为0,即r(0)=0,训练集(xr(n),d(n),n=1,2,…,M)中的样本xr(n)经过Win,d(n)经过Wback分别加到储备池中,利用公式r(n)=(1-α)[f(W·r(n-1)+Win·u(n)+Wback·d(n))]+α·r(n-1)进行储备池状态变量r(n)的更新;① The initial value of the reserve pool state variable of the selected network is 0, that is, r(0)=0, the sample x in the training set (x r (n), d(n), n=1, 2, ..., M) r (n) passes through W in , d(n) passes through W back and is added to the reserve pool respectively, using the formula r(n)=(1-α)[f(W·r(n-1)+W in ·u (n)+W back d(n))]+α r(n-1) to update the state variable r(n) of the reserve pool; 其中f(·)为储备池神经元激活函数,选为非线性的tanh(·)函数;where f( ) is the activation function of the neurons in the reserve pool, which is selected as the nonlinear tanh( ) function; u(n)=ψ(n-1)·v(n),ψ(n)为v(n)的相关系数矩阵并通过公式
Figure FDA0002636917960000024
Figure FDA0002636917960000025
来进行更新,其中,
Figure FDA0002636917960000026
λ为遗忘因子,其取值在0.95~1范围以0.0001为步长进行调试,以结果最优时λ值为最终取值,ψ(0)=δ·I,I为单位矩阵,δ为一个极小的正数,其取值在0~0.001范围内以0.00001为步长调试,以结果最优时δ值为最终取值;
u(n)=ψ(n-1)·v(n), ψ(n) is the correlation coefficient matrix of v(n) and is obtained by formula
Figure FDA0002636917960000024
Figure FDA0002636917960000025
to update, where,
Figure FDA0002636917960000026
λ is the forgetting factor, and its value is in the range of 0.95 to 1 with 0.0001 as the step for debugging. When the result is optimal, the λ value is the final value, ψ(0)=δ·I, I is the identity matrix, and δ is a A very small positive number, its value is in the range of 0 to 0.001, with 0.00001 as the step for debugging, and the final value of δ when the result is optimal;
α为遗忘率,其取值在0~1范围内以0.1的步长进行调试,以结果最优时的α值为最终取值;α is the forgetting rate, and its value is in the range of 0 to 1 for debugging with a step size of 0.1, and the α value when the result is optimal is the final value; ②根据公式Wout(n)=Wout(n-1)+k(n)·e(n)进行输出权重Wout的更新;② Update the output weight W out according to the formula W out (n)=W out (n-1)+k(n)·e(n); ③通过更新Wout(n)和r(n)使y(n)逼近干净ECG信号d(n),使误差e(n)能够近似于0,得到训练完成的回声状态网络;③ By updating W out (n) and r (n), y(n) is approximated to the clean ECG signal d(n), so that the error e(n) can be approximated to 0, and the trained echo state network is obtained; 所述步骤D)具体过程是:Described step D) concrete process is: 以构建训练集时所截取的M个心拍之后紧邻的T个心拍构建测试集,测试集(Xr(n),n=1,2,…,T,T=200±10),其中,
Figure FDA0002636917960000027
即其包含当前时刻的心电信号X(n)、其上一个心电信号X(n-1)、其一阶导数X′(n)和二阶导数X″(n);
The test set is constructed by using the T heart beats immediately after the M heart beats intercepted when constructing the training set, the test set (X r (n), n=1, 2,..., T, T=200±10), wherein,
Figure FDA0002636917960000027
That is, it contains the current ECG signal X(n), the previous ECG signal X(n-1), its first derivative X'(n) and second derivative X"(n);
将测试集(Xr(n),n=1,2,…,T)中的Xr(n)输入训练完成的回声状态网络,网络输出干净心电信号Y(n)。Input X r (n) in the test set (X r (n), n=1, 2, . . . , T) into the trained echo state network, and the network outputs a clean ECG signal Y (n).
CN201711339403.9A 2017-12-14 2017-12-14 A method for automatic noise reduction of ECG signals Active CN108113665B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711339403.9A CN108113665B (en) 2017-12-14 2017-12-14 A method for automatic noise reduction of ECG signals

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711339403.9A CN108113665B (en) 2017-12-14 2017-12-14 A method for automatic noise reduction of ECG signals

Publications (2)

Publication Number Publication Date
CN108113665A CN108113665A (en) 2018-06-05
CN108113665B true CN108113665B (en) 2020-10-30

Family

ID=62229138

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711339403.9A Active CN108113665B (en) 2017-12-14 2017-12-14 A method for automatic noise reduction of ECG signals

Country Status (1)

Country Link
CN (1) CN108113665B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110169768A (en) * 2019-07-08 2019-08-27 河北大学 A kind of automatic noise-reduction method of electrocardiosignal
CN111209853B (en) * 2020-01-05 2023-02-03 天津大学 Optical fiber sensing vibration signal mode identification method based on AdaBoost-ESN algorithm
CN111860306B (en) * 2020-07-19 2024-06-14 陕西师范大学 Electroencephalogram signal denoising method based on width depth echo state network
CN112515637B (en) * 2020-12-02 2021-06-15 山东省人工智能研究院 Electrocardiosignal noise reduction method based on group sparsity characteristic
CN113456043B (en) * 2021-07-08 2023-05-26 军事科学院系统工程研究院卫勤保障技术研究所 Continuous blood pressure detection method and device
CN113729649B (en) * 2021-09-29 2024-05-14 重庆岱普科技有限责任公司 Cardiovascular and cerebrovascular disease recognition system based on echo state network
CN115105088B (en) * 2022-06-20 2023-03-14 山东省人工智能研究院 Improved electrocardiosignal denoising method based on wavelet domain sparse characteristic
CN115581465A (en) * 2022-11-21 2023-01-10 毕胜普生物科技有限公司 Coronary heart disease risk assessment method and device, and sudden cardiac death risk assessment method and system
CN116304777B (en) * 2023-04-12 2023-11-03 中国科学院大学 Adaptive ECG signal denoising method and system based on reference signal at rest

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104346517A (en) * 2013-08-02 2015-02-11 杨凤琴 Echo state network based prediction method and prediction device
CN104424507B (en) * 2013-08-28 2020-03-03 杨凤琴 Prediction method and prediction device of echo state network
CN104157293B (en) * 2014-08-28 2017-04-05 福建师范大学福清分校 The signal processing method of targeted voice signal pickup in a kind of enhancing acoustic environment
CN107049303A (en) * 2017-03-10 2017-08-18 哈尔滨工业大学 It is a kind of that the adaptive Fetal ECG signal extraction system and method led with many chests is led based on many abdomens
CN107145937A (en) * 2017-04-28 2017-09-08 河南科技大学 Time Series Prediction Method of Echo State Network Based on Elastic SCAD Penalty Function

Also Published As

Publication number Publication date
CN108113665A (en) 2018-06-05

Similar Documents

Publication Publication Date Title
CN108113665B (en) A method for automatic noise reduction of ECG signals
Seena et al. A review on feature extraction and denoising of ECG signal using wavelet transform
Nagendra et al. Application of wavelet techniques in ECG signal processing: an overview
Malghan et al. A review on ECG filtering techniques for rhythm analysis
Singh et al. ECG signal denoising based on empirical mode decomposition and moving average filter
Barhatte et al. Noise analysis of ECG signal using fast ICA
CN117158999B (en) A method and system for denoising EEG signals based on PPMCC and adaptive VMD
Kahankova et al. Fetal ECG extraction from abdominal ECG using RLS based adaptive algorithms
Butt et al. Denoising practices for electrocardiographic (ECG) signals: a survey
Tang et al. ECG de-noising based on empirical mode decomposition
Lu et al. Model-based ECG denoising using empirical mode decomposition
Ayat et al. ECG denoising using modulus maxima of wavelet transform
Tan et al. Best wavelet function identification system for ECG signal denoise applications
Aurobinda et al. R-peak detection of ECG using adaptive thresholding
Reddy et al. A fast iterative filtering method for efficient denoising of phonocardiogram signals
Khandait et al. ECG signal processing using classifier to analyses cardiovascular disease
Suchetha et al. Denoising and arrhythmia classification using EMD based features and neural network
Malhotra et al. A real time wavelet filtering for ECG baseline wandering removal
Li et al. A denoising framework for ECG signal preprocessing
Anapagamini et al. Hardware implementation of ECG denoising system using TMS320C6713 DSP processor
Wu et al. An unbiased linear artificial neural network with normalized adaptive coefficients for filtering noisy ECG signals
Cao et al. Denoising of ECG signal based on a comprehensive framework
Dembrani et al. Mixed Signal Filter Implementation and Performance Analysis based on Accuracy, Sensitivity and Specificity for Monitoring ECG Signal
Bhakuni et al. ECG signal spectral estimation and noise filtering
Gopal et al. A VLSI Architecture for Arrhythmia Detection using Mathematical Morphology and Wavelet Transform

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20241227

Address after: Room 269, 2nd Floor, Building 1, Suteng Zhongtai Technology Park, No. 16 Xianqiao Road, Zhongtai Street, Yuhang District, Hangzhou City, Zhejiang Province 311100

Patentee after: Hangzhou Humai Technology Co.,Ltd.

Country or region after: China

Address before: 071002 No. 54 East 180 Road, Hebei, Baoding

Patentee before: HEBEI University

Country or region before: China

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20250617

Address after: 071002 East Road, Hebei, Baoding No. 54

Patentee after: HEBEI University

Country or region after: China

Address before: Room 269, 2nd Floor, Building 1, Suteng Zhongtai Technology Park, No. 16 Xianqiao Road, Zhongtai Street, Yuhang District, Hangzhou City, Zhejiang Province 311100

Patentee before: Hangzhou Humai Technology Co.,Ltd.

Country or region before: China