A method for predicting and analyzing the correlation between ECG and EEG based on time-varying cycle units
By adopting a time-varying recurrent neural network based on time-varying recurrent units in ECG and EEG signal analysis, the problem of traditional models ignoring the variable characteristics of physiological neurons is solved, and more accurate prediction and analysis effects of ECG and EEG signal associations are achieved.
Patent Information
- Application Number
- CN202311540049.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-20
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2043-11-20
AI Technical Summary
When processing ECG and EEG signals, the traditional artificial neural network model ignores the variable characteristics of physiological neuron time constants, which leads to the inability to fully utilize the time information in the signal, which in turn affects the correlation prediction and analysis effect of ECG and EEG.
A time-varying recurrent neural network based on time-varying recurrent units is used to build a mathematical model and follow specific connection rules to build a neural network that can simulate changes in physiological time constants for correlation prediction and analysis of ECG and EEG.
It improves the accuracy and learning efficiency of the correlation prediction of ECG and EEG signals, can better simulate the electrophysiological activities of the heart and brain, fit the dynamic characteristics of EEG and ECG signals, and provide more accurate correlation analysis.
Smart Images

Figure CN117574956B_ABST
Abstract
Description
Technical field:
[0001] The invention relates to an ECG and EEG correlation prediction and analysis method based on time-varying cycle units. Background technology:
[0002] Electrocardiogram (ECG) and electroencephalogram (EEG) are two important physiological signals, which reflect the electrophysiological activities of the heart and brain respectively. Both signals play an important role in many medical applications, such as disease diagnosis, sleep research, neuroscience, etc. However, although both ECG and EEG reflect the electrophysiological activities of the body, the correlation between them is not obvious. This is mainly because the generation mechanisms of ECG and EEG signals are different and are affected by many complex factors.
[0003] In recent years, as artificial neural networks have performed well in various tasks, more and more studies have begun to explore their applications in ECG and EEG correlation prediction and analysis. However, traditional artificial neural network models often ignore the variable time constant characteristics of physiological neurons, which may not fully utilize the temporal information in the signals when processing ECG and EEG signals. Therefore, it is necessary to develop an ECG and EEG correlation prediction and analysis method based on time-varying recurrent units to accurately predict ECG and EEG, and provide a neural network tool for EEG and ECG correlation analysis. Summary of the invention:
[0004] The purpose of the present invention is to provide a method for predicting and analyzing the association between ECG and EEG based on a time-varying recurrent unit. A time-varying recurrent neural network is constructed using a novel time-varying recurrent unit, the network is trained to simultaneously predict ECG and EEG, and the association between EEG and ECG is analyzed using network connections.
[0005] To achieve the above object, the technical solution of the present invention is:
[0006] In a first aspect, the present invention provides a method for predicting and analyzing the association between ECG and EEG based on a time-varying cycle unit, the method comprising the following contents:
[0007] The mathematical model of the time-varying recurrent neural network is established as:
[0008]
[0009] where x i (t) is the hidden state of the i-th time-varying recurrent unit in the time-varying recurrent neural network at time t, x i (0) is the initial state, I i is the input of the i-th time-varying recurrent unit, w is the state connection weight, b is the input connection weight; g(·) is the S-shaped activation function; τ is Ii (t) corresponds to the time scale, τ0 is the initial time scale of the network, τ n is the time scale corresponding to the nth sampling point in the time window, that is, the time interval with the previous sampling point; f(·) is the physiological time constant curve, f(τ) is the physiological time constant corresponding to the time scale τ, I(t) is the input, t is the time; A is the input gain; p is the size of the time window; L = 76 is the total number of EEG and ECG leads, N = 5L, indicating that the number of time-varying recurrent units in the time-varying recurrent neural network is 5 times the total input; is the l-th output of the time-varying recurrent neural network, l is a natural number and 1≤l≤L; when l≤64, is the predicted value of EEG lead l, y l is the measurement value of EEG lead l; when 65≤l≤76, is the predicted value of ECG lead (1-64), y l is the measurement value of ECG lead (l-64);
[0010] The state connection weight w and the input connection weight b follow the following connection rules:
[0011] a) Nucleus rule: every five time-varying recurrent units form a recurrent unit nucleus corresponding to the EEG or ECG signal of one lead, and the time-varying recurrent neural units within the recurrent unit nucleus are fully connected;
[0012] b) Input rule: The EEG or ECG signal of one lead is only input into the first time-varying cycle unit in the cycle unit nucleus;
[0013] c) Inner connection rule: If the cycle unit nucleus A corresponds to a certain lead of EEG, and the cycle unit nucleus B corresponds to another lead of EEG, then there is only a connection between the second cycle time-varying unit of the cycle unit nucleus A and the second cycle time-varying unit of the cycle unit nucleus B; if the cycle unit nucleus A corresponds to ECG, and the cycle unit nucleus B corresponds to ECG, then there is only a connection between the second cycle time-varying unit of the cycle unit nucleus A and the second cycle time-varying unit of the cycle unit nucleus B;
[0014] d) External connection rule: If the cyclic unit nucleus A corresponds to a certain lead of the EEG, and the cyclic unit nucleus B corresponds to a certain lead of the ECG, then there is only a connection between the third cyclic time-varying unit of the cyclic unit nucleus A and the third cyclic time-varying unit of the cyclic unit nucleus B;
[0015] The first formula in the mathematical model of the time-varying recurrent neural network represents the computational model of the time-varying recurrent unit;
[0016] Create EEG and ECG time series datasets and train time-varying recurrent neural networks for ECG and EEG association prediction and analysis.
[0017] When constructing the time-varying cycle unit, the basic time constant is used as a variable and adjustable quantity, and the physiological time constant curve is satisfied. A Gaussian function is used as the physiological time constant curve, and the variable characteristic of the time constant is retained. The principle model of the time-varying cycle unit is obtained as follows:
[0018]
[0019] Where g(·) is the S-shaped activation function, f(·) is the physiological time constant curve, a bell-shaped function is used here, the function center is 0.1, the variance is 0.01, I(t) is the input, t is the time, x(t) is the hidden state of the time-varying recurrent unit, τ is the time scale corresponding to I(t); A is the input gain;
[0020] The general solution form of the linear differential equation is used as the closed-form solution of the integral result of the principle model, and the principle model is converted into a computational model of time-varying cyclic units.
[0021] Record the state connection weight w in the time-varying recurrent neural network, and the degree of correlation between EEG and ECG is expressed as follows:
[0022]
[0023] Among them, C(l EEG ,l ECG ) is the EEG first EEG The signal of the first lead is consistent with the ECG ECG The correlation between the signals of the leads, 1≤l EEG ≤64,1≤l ECG ≤12.
[0024] When the input in the input time recurrent neural network changes, the state connection weights are updated, and the correlation between the EEG and ECG under the current input is calculated according to the above correlation calculation method.
[0025] The loss function when training a time-varying recurrent neural network is:
[0026] Among them, LOSS represents loss, y l is the target output of the lth lead of the time-varying recurrent neural network, is the lth output of the time-varying recurrent neural network;
[0027] Training time-varying recurrent neural networks using error back-propagation and stochastic gradient descent algorithms.
[0028] In a second aspect, the present invention provides an ECG and EEG correlation prediction and analysis system based on time-varying cycle units, and the system executes the method described.
[0029] In a third aspect, the present invention provides an ECG and EEG correlation prediction and analysis system based on a time-varying cycle unit, the system comprising:
[0030] An ECG signal acquisition unit, used for acquiring an ECG signal;
[0031] An EEG signal acquisition unit, used for acquiring EEG signals;
[0032] A data storage unit, used for splicing and storing the data obtained by the ECG signal acquisition unit and the EEG signal acquisition unit at the same time in a manner of first the EEG signal and then the ECG signal;
[0033] Database, used to store EEG and ECG time series data sets;
[0034] The time-varying recurrent neural network is used to estimate the EEG and ECG values at the next moment and retain the state connection weights w in the time-varying recurrent neural network;
[0035] The correlation degree calculation model is used to calculate the correlation degree according to the first EEG The third time-varying cycle unit corresponding to the first EEG lead ECG The relationship between the state connection weights of the third time-varying recurrent unit corresponding to the ECG leads is used to obtain the degree of correlation between ECG and EEG.
[0036] Compared with the prior art, the present invention has the following beneficial effects:
[0037] (1) The present invention adopts a time-varying recurrent unit as the basic neural network unit, and uses regularized connections to build a time-varying recurrent neural network based on the time-varying recurrent unit. The network connection rules conform to the relationship between EEG and ECG signals, are more interpretable than full connections, and can improve the learning efficiency of the network. At the same time, the time-varying recurrent unit has a variable time constant, which can better simulate the electrophysiological activities of the heart and brain and more accurately fit the dynamic characteristics of EEG and ECG signals.
[0038] (2) The present invention proposes a new ECG and EEG signal correlation analysis indicator, (Cij), which is conducive to a better understanding of the possible correlation between ECG and EEG and is more in line with actual conditions. Description of the drawings:
[0039] Figure 1 Schematic diagram of the structure of the time-varying recurrent neural network in the present invention. Specific implementation method:
[0040] The present invention is further explained below in combination with examples and drawings, but this is not intended to limit the scope of protection of the present application.
[0041] The present invention provides a method for predicting and analyzing the association between ECG and EEG based on a time-varying cycle unit. The method includes the following contents: Step 1: constructing a time-varying cycle unit:
[0042] The basic time constant is taken as a variable and adjustable quantity, and satisfies the physiological time constant curve. The Gaussian function is used as the physiological time constant curve, the physiological neuron equation is simplified, and the variable characteristics of the time constant are retained. The principle model of the time-varying cyclic unit is obtained as follows:
[0043]
[0044] Where g(·) is the S-shaped activation function, f(·) is the physiological time constant curve, a bell-shaped function is used here, the function center is 0.1, the variance is 0.01, I(t) is the input, t is the time, x(t) is the hidden state of the time-varying recurrent unit, τ is the time scale corresponding to I(t), and A is the input gain.
[0045] The general solution form of the linear differential equation is used as the closed-form solution of the integral result of the principle model, and the principle model is converted into a computational model of a time-varying cyclic unit:
[0046]
[0047] Where τ is I i (t) corresponds to the time scale, τ0 is the initial time scale of the network, τ n is the time scale corresponding to the nth sampling point in the time window, that is, the time interval with the previous sampling point, which is set here as τ n ∈[0.1,0.11,0.111,...,0.1111111], which are responsible for the time constants of different time scales respectively; f(·) is the physiological time constant curve, f(τ) is the physiological time constant corresponding to the time scale τ, A is the input gain, and the size of the time window is p.
[0048] Step 2: Build a time-varying recurrent neural network based on the connection rules
[0049] The connection relationship complies with the time-varying recurrent neural network connection rules proposed based on the electrophysiological laws of EEG and ECG leads.
[0050] The mathematical model of the time-varying recurrent neural network is:
[0051]
[0052] where x i(t) is the hidden state of the i-th time-varying recurrent unit in the time-varying recurrent neural network at time t, x i (0) is the initial state, I i is the input of the i-th time-varying recurrent unit, w is the state connection weight, b is the input connection weight; g(·) is the S-shaped activation function; τ is I i (t) corresponds to the time scale, τ0 is the initial time scale of the network, τ n is the time scale corresponding to the nth sampling point in the time window, that is, the time interval with the previous sampling point; f(·) is the physiological time constant curve, f(τ) is the physiological time constant corresponding to the time scale τ, I(t) is the input, t is the time; A is the input gain; p is the size of the time window; L = 76 is the total number of EEG and ECG leads, N = 5L, indicating that the number of time-varying recurrent units in the time-varying recurrent neural network is 5 times the total input; is the l-th output of the time-varying recurrent neural network, l is a natural number and 1≤l≤L; when l≤64, is the predicted value of EEG lead l, y l is the measurement value of EEG lead l; when 65≤l≤76, is the predicted value of ECG lead (1-64), y l is the measurement value of ECG lead (l-64);
[0053] The state connection weight w and the input connection weight b follow the following connection rules:
[0054] a) Nucleus rule: every five time-varying recurrent units form a recurrent unit nucleus corresponding to the EEG or ECG signal of one lead, and the time-varying recurrent neural units within the recurrent unit nucleus are fully connected;
[0055] b) Input rule: The EEG or ECG signal of one lead is only input into the first time-varying cycle unit in the cycle unit nucleus;
[0056] c) Inner connection rule: If the cycle unit nucleus A corresponds to a certain lead of EEG, and the cycle unit nucleus B corresponds to another lead of EEG, then there is only a connection between the second cycle time-varying unit of the cycle unit nucleus A and the second cycle time-varying unit of the cycle unit nucleus B; if the cycle unit nucleus A corresponds to ECG, and the cycle unit nucleus B corresponds to ECG, then there is only a connection between the second cycle time-varying unit of the cycle unit nucleus A and the second cycle time-varying unit of the cycle unit nucleus B;
[0057] d) External connection rule: If cyclic unit nucleus A corresponds to a certain lead of EEG, and cyclic unit nucleus B corresponds to a certain lead of ECG, then there is only a connection between the third cyclic time-varying unit of cyclic unit nucleus A and the third cyclic time-varying unit of cyclic unit nucleus B.
[0058] The network output of the time-varying recurrent neural network is the predicted value at the next moment, which can be used for auxiliary diagnosis. Step 3: Training the time-varying recurrent neural network
[0059] Creating EEG and ECG time series datasets where n s is the number of data samples, 76 is the sum of the number of EEG leads and the number of ECG leads, and T is the data time length. The EEG and ECG signals of the first T-1 length in the data set are selected as the input of the time-varying recurrent neural network. The input of the qth sample is as follows:
[0060] U q =[u1 u2 … u 76 ] T
[0061] Among them, U q ∈R 76×(T-1) ,u l is the input of the lth lead of the time-varying recurrent neural network. When l≤64, u l is the EEG of lead l, when 65≤l≤76, u l is the ECG of the (l-64)th lead. The EEG and ECG signals of the last T-1 length in the data set are selected as the target output of the time-varying recurrent neural network. The target output of the qth sample is as follows:
[0062]
[0063] Among them, Y q ∈R 76×(T-1) ,y l is the target output of the lth lead of the time-varying recurrent neural network. When l≤64, y l is the EEG of lead l, when 65≤l≤76, y l It is the ECG of lead (l-64).
[0064] After obtaining the output of the time-varying recurrent neural network, calculate the loss Training time-varying recurrent neural networks using error back-propagation and stochastic gradient descent algorithms.
[0065] Step 4: Calculate the correlation between EEG and ECG signals
[0066] According to the l EEGThe third time-varying cycle unit corresponding to the first EEG lead ECG The relationship between the state connection weights of the third time-varying recurrent unit corresponding to the ECG leads is used to obtain the degree of correlation between ECG and EEG;
[0067] When calculating the correlation between EEG and ECG signals, the EEG and ECG signals to be tested are input into the trained time-varying recurrent neural network to obtain the state connection weights, which are recorded as the connection matrix. According to the values in the connection matrix, the correlation between EEG and ECG is calculated according to the following formula:
[0068]
[0069] Among them, C(l EEG ,l ECG ) is the EEG first EEG The signal of the first lead is consistent with the ECG ECG The correlation between the signals of the leads, 1≤l EEG ≤64,1≤l ECG ≤12.
[0070] Among them, 315=5*76.
[0071] If the correlation C between EEG and ECG is close to 1, it means that the two have a high degree of correlation, and only one of the signals can be selected for auxiliary analysis; if the correlation C is much smaller than 1, such as less than 0.5, it means that the correlation is weak, and both signals need to be considered for auxiliary analysis.
[0072] The present invention proves that the brain area of EEG and ECG electrocardiogram have physiological connections through the association prediction and analysis. The principle model of the time-varying cyclic unit is obtained by simplifying the equation of physiological neurons, retaining the variable characteristics of the time constant of physiological neurons, and constructing a time-varying recurrent neural network based on it. A time-varying recurrent neural network for association prediction of ECG and EEG is built based on the time-varying cyclic unit. The connection relationship between the nodes in the network complies with the time-varying recurrent neural network connection rules proposed based on the electrophysiological laws of EEG and ECG leads. The rules are aimed at the association prediction of ECG that complies with the 12-lead acquisition standard and the 64-lead EEG that complies with the 10-20 standard electrode position. Calculating the degree of association between ECG and EEG using the connection matrix in the recurrent neural network trained for ECG and EEG prediction tasks is a new form of association calculation.
[0073] Any matters not described in the present invention are applicable to the prior art.
Claims
1. A method for predicting and analyzing the association between ECG and EEG based on time-varying cycle units, characterized in that: The method includes the following: The mathematical model of the time-varying recurrent neural network is established as: where x i (t) is the hidden state of the i-th time-varying recurrent unit in the time-varying recurrent neural network at time t, x i (0) is the initial state, I i is the input of the i-th time-varying recurrent unit, w is the state connection weight, b is the input connection weight; g(·) is the S-shaped activation function; τ is I i (t) corresponds to the time scale, τ0 is the initial time scale of the network, τ n is the time scale corresponding to the nth sampling point in the time window, that is, the time interval with the previous sampling point; f(·) is the physiological time constant curve, f(τ) is the physiological time constant corresponding to the time scale τ, I(t) is the input, t is the time; A is the input gain; p is the size of the time window; L = 76 is the total number of EEG and ECG leads, N = 5L, indicating that the number of time-varying recurrent units in the time-varying recurrent neural network is 5 times the total input; is the l-th output of the time-varying recurrent neural network, l is a natural number and 1≤l≤L; when l≤64, is the predicted value of EEG lead l, y l is the measurement value of EEG lead l; when 65≤l≤76, is the predicted value of ECG lead (1-64), y l is the measurement value of ECG lead (l-64); The state connection weight w and the input connection weight b follow the following connection rules: a) Nucleus rule: every five time-varying recurrent units form a recurrent unit nucleus corresponding to the EEG or ECG signal of one lead, and the time-varying recurrent neural units within the recurrent unit nucleus are fully connected; b) Input rule: The EEG or ECG signal of one lead is only input into the first time-varying cycle unit in the cycle unit nucleus; c) Inner connection rule: If recurrent unit nucleus A corresponds to one lead of EEG and recurrent unit nucleus B corresponds to another lead of EEG, then there is only a connection between the second recurrent time-varying unit of recurrent unit nucleus A and the second recurrent time-varying unit of recurrent unit nucleus B; If cycle unit nucleus A corresponds to ECG and cycle unit nucleus B corresponds to ECG, then there is only a connection between the second cycle time-varying unit of cycle unit nucleus A and the second cycle time-varying unit of cycle unit nucleus B; d) External connection rule: If the cyclic unit nucleus A corresponds to a certain lead of the EEG, and the cyclic unit nucleus B corresponds to a certain lead of the ECG, then there is only a connection between the third cyclic time-varying unit of the cyclic unit nucleus A and the third cyclic time-varying unit of the cyclic unit nucleus B; The first formula in the mathematical model of the time-varying recurrent neural network represents the computational model of the time-varying recurrent unit; Create EEG and ECG time series datasets and train time-varying recurrent neural networks for ECG and EEG association prediction and analysis.
2. The method according to claim 1, characterized in that When constructing the time-varying cycle unit, the basic time constant is used as a variable and adjustable quantity, and the physiological time constant curve is satisfied. A Gaussian function is used as the physiological time constant curve, and the variable characteristic of the time constant is retained. The principle model of the time-varying cycle unit is obtained as follows: Where g(·) is the S-shaped activation function, f(·) is the physiological time constant curve, a bell-shaped function is used here, the function center is 0.1, the variance is 0.01, I(t) is the input, t is the time, x(t) is the hidden state of the time-varying recurrent unit, τ is the time scale corresponding to I(t); A is the input gain; The general solution form of the linear differential equation is used as the closed-form solution of the integral result of the principle model, and the principle model is converted into a computational model of time-varying cyclic units.
3. The method according to claim 1, characterized in that Record the state connection weight w in the time-varying recurrent neural network, and the degree of correlation between EEG and ECG is expressed as follows: Among them, C(l EEG ,l ECG ) is the EEG first EEG The signal of the first lead is consistent with the ECG ECG The correlation between the signals of the leads, 1≤l EEG ≤64,1≤l ECG ≤12.
4. The method according to claim 1, characterized in that: The loss function when training a time-varying recurrent neural network is: Among them, LOSS represents loss, y l is the target output of the lth lead of the time-varying recurrent network, is the lth output of the time-varying recurrent network; Training time-varying recurrent neural networks using error back-propagation and stochastic gradient descent algorithms.
5. An ECG and EEG correlation prediction and analysis system based on time-varying cycle units, characterized in that: The system executes the method according to any one of claims 1 to 4.
6. An ECG and EEG correlation prediction and analysis system based on time-varying cycle units, characterized in that: The system comprises: An ECG signal acquisition unit, used for acquiring an ECG signal; An EEG signal acquisition unit, used for acquiring EEG signals; A data storage unit, used for splicing and storing the data obtained by the ECG signal acquisition unit and the EEG signal acquisition unit at the same time in a manner of first the EEG signal and then the ECG signal; Database, used to store EEG and ECG time series data sets; The time-varying recurrent neural network is used to estimate the EEG and ECG values at the next moment and retain the state connection weights w in the time-varying recurrent neural network; The correlation degree calculation model is used to calculate the correlation degree according to the first EEG The third time-varying cycle unit corresponding to the first EEG lead ECG The relationship between the state connection weights of the third time-varying recurrent unit corresponding to the ECG leads is used to obtain the degree of correlation between ECG and EEG.
Citation Information
Patent Citations
Electroencephalogram signal processing method and training method and device of background electroencephalogram prediction model
CN114246594A
Device and method for denoising noise of electroencephalogram signal using series independent component analysis
KR1020160044641A