Disclosure of Invention
The present invention has been made in view of the above-described problems occurring in the prior art.
The invention provides a biological feedback equipment data processing method based on artificial intelligence, which solves the problems that the traditional HRV analysis is interfered by breathing rhythm coupling, signal distortion is caused by frequency domain filtering, the multi-sensor scheme increases the hardware burden, and a linear model cannot analyze a dynamic nonlinear coupling relation.
In order to solve the technical problems, the invention provides the following technical scheme:
the embodiment of the invention provides a biological feedback equipment data processing method based on artificial intelligence, which comprises the following steps of,
Step S1, acquiring an electrocardiosignal and a respiratory signal of a user, wherein the respiratory signal is generated by a chest and abdomen motion sensor or from the electrocardiosignal based on periodic fluctuation characteristic estimation;
Step S2, converting the electrocardiosignal into an RR interval sequence, inputting the RR interval sequence into a variation self-encoder for latent space decomposition to obtain a latent space representation comprising a respiratory rhythm component and a nerve regulation component;
step S3, orthogonalizing the latent space representation to enable the respiratory rhythm component and the nerve regulation component to be in an orthogonalization relationship in the latent space;
step S4, reconstructing RR interval sequences without breathing coupling based on orthogonalized latent space representation;
And S5, calculating frequency domain characteristic parameters according to the reconstructed RR interval sequence, and outputting the frequency domain characteristic parameters to a visual interface of the biofeedback equipment.
As a preferable scheme of the artificial intelligence-based data processing method of the biofeedback device, the respiratory signal estimation and generation step further comprises the following steps:
performing adaptive sliding window Fourier transform on the RR interval sequence, and extracting amplitude variation characteristics of a frequency band of 0.1-0.3 Hz;
An analog respiratory waveform is generated based on the amplitude variation characteristic as an alternative input to the respiratory signal.
As a preferable scheme of the artificial intelligence-based data processing method of the biofeedback equipment, the invention comprises the following steps of:
constructing a latent variable subspace of the respiratory rhythm component and a latent variable subspace of the neuromodulation component;
The distribution of the respiratory rhythm component subspaces is constrained by an countermeasure training to match the time-dependent characteristics of the respiratory signal.
As a preferred scheme of the artificial intelligence-based data processing method of the biofeedback equipment, in the step S2, the RR interval sequence and the potential space decomposition are generated in the following way:
Detecting R wave peak on original electrocardiosignal x (t) by using Pan-Tompkins algorithm to obtain peak time sequence And calculates RR intervals: Wherein, the Represents the (n+1) th R peak time,Indicating the nth R-peak time, RR n indicating the nth RR interval;
The { RR n } is normalized to construct a column vector RR= [ RR 1,RR2,…,RRN]T, wherein RR represents the input RR interval sequence column vector, N represents the sequence length, and the sequence length is sent to a variable self-encoder (VAE) encoder to obtain a latent space representation: Wherein z ε R d represents the latent space ensemble vector, The representation of the encoder map is made,Is a parameter thereof;
Dividing z into respiratory rhythm component subspace and neuromodulation component subspace in dimension:
Wherein z r represents a respiratory rhythm subspace vector, the dimension d r,an represents a neuromodulation subspace vector, the dimension d n, d represents a total latent space dimension, and R represents a real set;
introducing countermeasure training, defining the countermeasure loss as:
Wherein L adv denotes the contrast training loss, Representing a desire for a sample x r of real breathing characteristics,Representing the expectation of the encoder output respiratory vector z r, a φ (·) representing the challenge-discriminator map, Φ being the discriminator parameter, x r representing the representation of the real respiratory signal in the feature domain, z r representing the encoder generated respiratory subspace vector;
The encoder and the discriminator pass through:
The distribution of z r is aligned stepwise with the distribution of x r.
As a preferable scheme of the artificial intelligence-based data processing method of the biofeedback equipment, the orthogonalization processing step comprises the following steps:
calculating the principal component direction of the respiratory rhythm component in the latent space;
and applying orthogonal projection constraint to the nerve modulation component so that an included angle between the nerve modulation component and the principal component direction is not smaller than 80 degrees.
As a preferable scheme of the artificial intelligence-based data processing method of the biofeedback equipment, in the step S3, the step of the latent space orthogonalization processing is as follows:
Calculating a covariance matrix of the breathing rhythm subspace vector set, wherein the formula is C r=Cov(zr), A covariance matrix representing a respiratory subspace vector z r, cov (·) being a covariance operator;
On the basis, principal component analysis is solved to obtain a principal direction vector u of the breathing subspace:
Wherein, the Representing principal component direction vectors, |v| representing the euclidean norm of vector v;
orthographic projection is carried out on the nerve regulation component vector to obtain an orthogonalized vector:
z' n=zn-(uTzn) u, wherein, Representing the normalized neuromodulation vector, u Tzn representing the vector inner product;
Defining an orthogonal penalty term:
Lorth=max(0,|uTzn|-|zn|cos(80°)),
Wherein, L orth represents the loss of orthogonality penalty, max (·) is the maximum operator, z n represents the Euclidean norm of the neuromodulation vector, cos (80 °) represents the cosine value of 80 degrees;
This incorporates an overall training penalty to suppress inter-subspace overlap.
As a preferable scheme of the artificial intelligence-based data processing method of the biofeedback device, in the step S3, orthogonal projection constraint is applied to the nerve modulation component, specifically:
The included angle between the defined vectors is:
Wherein, the A principal component direction vector representing a breathing subspace,Representing a neuromodulation component vector, |·| representing an euclidean norm, arccos (·) being an inverse cosine function, θ being the angle between the vectors;
The geometric constraint condition is written as θ being greater than or equal to 80 °, which is equivalent to:
Wherein cos (80 °) represents a cosine value of 80 °;
in practical training, a soft constraint penalty term is employed:
wherein, L orth is the loss of orthogonality penalty, max (·) is the maximum operator;
the threshold setting logic comprises that in HRV analysis, 80 degrees correspond to cosine values of about 0.1736, subspace high separation is guaranteed, nerve characteristics are not weakened too much, too small cosine threshold can cause unstable training, too large cosine threshold is insufficient in separation, 80 degrees are balance points of performance and robustness in experience, and in different individuals or application scenes, 80 degrees can be used as initial values, and fine adjustment can be performed according to verification set performance.
As a preferable scheme of the artificial intelligence-based data processing method of the biofeedback equipment, the method comprises the following steps of:
and carrying out frequency domain correction on the reconstructed RR interval sequence, specifically dynamically restraining a power density value of an overlapping region of the reconstructed RR interval sequence and a respiratory estimated frequency band within 0.04-0.15Hz of an LF frequency band.
As a preferable scheme of the artificial intelligence-based data processing method of the biofeedback equipment, the method further comprises the step of dynamically adjusting:
Monitoring the frequency drift amount of a respiratory signal, and triggering the parameter of the variation self-encoder to be finely adjusted on line when the frequency drift amount exceeds a preset threshold;
The online fine tuning employs an unsupervised loss function that updates model weights based only on the latent spatial orthogonality constraints of the current input signal.
As a preferred scheme of the artificial intelligence-based data processing method of the biofeedback equipment, the method is deployed on edge computing equipment and specifically comprises the following steps:
compiling the variation self-encoder and the orthogonalization processing step into a lightweight inference engine, wherein the lightweight inference engine performs model compression through structured pruning and 8-bit integer quantization;
And carrying out streaming processing on the RR interval sequence through a memory mapping technology, wherein the memory mapping technology is based on a DMA controller of target edge equipment to carry out zero copy data transmission.
The method has the advantages that accurate decoupling of the breathing rhythm and the autonomic nerve regulation signals is achieved in a nonlinear characteristic space through a latent space orthogonal decomposition mechanism, the problem of HRV low-frequency-band information loss caused by traditional frequency domain filtering is avoided, the breathing component estimation based on a variation self-encoder does not need to depend on an external sensor, hardware cost and user load are reduced, meanwhile, stability of long-term analysis is guaranteed through dynamic orthogonal constraint and an on-line fine tuning mechanism, the self-adaptive individual breathing mode difference and frequency drift are guaranteed, a lightweight compiling and streaming processing technology in edge deployment enables a complex model to run on low-power equipment in real time, the defect of redundancy of traditional self-adaptive algorithm calculation is overcome, and robustness and system applicability of breathing interference suppression are remarkably improved on the premise that the physiological significance of the HRV is maintained.
Detailed Description
In order that the above-recited objects, features and advantages of the present invention will become more readily apparent, a more particular description of the invention will be rendered by reference to specific embodiments thereof which are illustrated in the appended drawings.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, but the present invention may be practiced in other ways other than those described herein, and persons skilled in the art will readily appreciate that the present invention is not limited to the specific embodiments disclosed below.
Further, reference herein to "one embodiment" or "an embodiment" means that a particular feature, structure, or characteristic can be included in at least one implementation of the invention. The appearances of the phrase "in one embodiment" in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments.
Embodiment 1, referring to fig. 1, this embodiment provides a biofeedback data processing method based on artificial intelligence, including:
Step S1, acquiring an electrocardiosignal and a respiratory signal of a user, wherein the respiratory signal is generated by a chest and abdomen motion sensor or from the electrocardiosignal based on periodic fluctuation characteristic estimation;
the step of generating an estimate of the respiratory signal further comprises:
performing adaptive sliding window Fourier transform on the RR interval sequence, and extracting amplitude variation characteristics of a frequency band of 0.1-0.3 Hz;
Generating an analog respiratory waveform based on the amplitude variation characteristics as a surrogate input for the respiratory signal;
Step S2, converting electrocardiosignals into RR interval sequences, inputting the RR interval sequences into a variation self-encoder for latent space decomposition to obtain a latent space representation containing respiratory rhythm components and nerve regulation components;
The step of latent spatial decomposition of the variant self-encoder comprises:
constructing a latent variable subspace of the respiratory rhythm component and a latent variable subspace of the neuromodulation component;
Constraining the distribution of the respiratory rhythm component subspace to match the time-dependent features of the respiratory signal by countermeasure training;
in step S2, the manner of generating the RR interval sequence and the latent space decomposition is as follows:
Detecting R wave peak on original electrocardiosignal x (t) by using Pan-Tompkins algorithm to obtain peak time sequence And calculates RR intervals: Wherein, the Represents the (n+1) th R peak time,Indicating the nth R-peak time, RR n indicating the nth RR interval;
The { RR n } is normalized to construct a column vector RR= [ RR 1,RR2,…,RRN]T, wherein RR represents the input RR interval sequence column vector, N represents the sequence length, and the sequence length is sent to a variable self-encoder (VAE) encoder to obtain a latent space representation: Wherein z ε R d represents the latent space ensemble vector, The representation of the encoder map is made,Is a parameter thereof;
Dividing z into respiratory rhythm component subspace and neuromodulation component subspace in dimension:
Wherein z r represents a respiratory rhythm subspace vector, the dimension d r,zn represents a neuromodulation subspace vector, the dimension d n, d represents a total latent space dimension, and R herein represents a real set, different from RR;
introducing countermeasure training, defining the countermeasure loss as:
Wherein L adv denotes the contrast training loss, Representing a desire for a sample x r of real breathing characteristics,Representing the expectation of the encoder output respiratory vector z r, a φ (·) representing the challenge-discriminator map, Φ being the discriminator parameter, x r representing the representation of the real respiratory signal in the feature domain, z r representing the encoder generated respiratory subspace vector;
The encoder and the discriminator pass through:
Gradually aligning the z r distribution with the x r distribution;
step S3, orthogonalizing the latent space representation to enable the respiratory rhythm component and the nerve regulation component to be in an orthogonalization relationship in the latent space;
The orthogonalization processing step includes:
calculating the principal component direction of the respiratory rhythm component in the latent space;
applying orthogonal projection constraint to the nerve regulation component to ensure that the included angle between the nerve regulation component and the direction of the main component is not less than 80 degrees;
In step S3, the step of the latent space orthogonalization processing is as follows:
Calculating a covariance matrix of the breathing rhythm subspace vector set, wherein the formula is C r=Cov(zr), A covariance matrix representing a respiratory subspace vector z r, cov (·) being a covariance operator;
On the basis, principal component analysis is solved to obtain a principal direction vector u of the breathing subspace:
Wherein, the Representing principal component direction vectors, |v| representing the euclidean norm of vector v;
orthographic projection is carried out on the nerve regulation component vector to obtain an orthogonalized vector:
z' n=zn-(uTzn) u, wherein, Representing the normalized neuromodulation vector, u Tzn representing the vector inner product;
Defining an orthogonal penalty term:
Lorth=max(0,|uTzn|-|zn|cos(80°)),
Wherein, L orth represents the loss of orthogonality penalty, max (·) is the maximum operator, z n represents the Euclidean norm of the neuromodulation vector, cos (80 °) represents the cosine value of 80 degrees;
this incorporates an overall training penalty to suppress inter-subspace overlap;
in step S3, orthographic projection constraints are applied to the neuromodulation components, specifically:
The included angle between the defined vectors is:
Wherein, the A principal component direction vector representing a breathing subspace,Representing a neuromodulation component vector, |·| representing an euclidean norm, arccos (·) being an inverse cosine function, θ being the angle between the vectors;
The geometric constraint condition is written as θ being greater than or equal to 80 °, which is equivalent to:
Wherein cos (80 °) represents a cosine value of 80 °;
in practical training, a soft constraint penalty term is employed:
wherein, L orth is the loss of orthogonality penalty, max (·) is the maximum operator;
The threshold setting logic comprises that in HRV analysis, 80 degrees correspond to cosine values of about 0.1736, so that subspace high separation is ensured, nerve characteristics are not weakened too much, the fact that the training is unstable is caused by too small cosine threshold, separation is insufficient if too large cosine threshold, and 80 degrees are balance points of performance and robustness in experience;
Specifically, the geometric constraint directly limits the minimum included angle between the nerve regulation component and the main breathing direction in the latent space, ensures that the nerve regulation component and the main breathing direction have obvious separation degree in the high-dimensional space through the upper bound of cosine values, and compared with a method of punishing after pure projection, the soft constraint introduces an angle threshold, so that the filtering effect between subspaces is more interpretable, and due to the adoption of a continuous punishment function, the loss is smooth in the training process, the convergence stability of a model is improved, the 80-degree threshold not only meets the decoupling requirement of HRV signals, but also reserves the fine fluctuation information of nerve regulation, and provides purer RR interval reconstruction results which are rich in physiological significance for the subsequent frequency domain feature extraction;
step S4, reconstructing RR interval sequences without breathing coupling based on orthogonalized latent space representation;
s5, calculating frequency domain characteristic parameters according to the reconstructed RR interval sequence, and outputting the frequency domain characteristic parameters to a visual interface of biofeedback equipment;
the calculating step of the frequency domain characteristic parameter comprises the following steps:
Carrying out frequency domain correction on the reconstructed RR interval sequence, specifically dynamically restraining a power density value of an overlapping region of an estimated frequency band and respiration in an LF frequency band of 0.04-0.15 Hz;
in step S5, the mode of performing frequency domain correction on the reconstructed RR interval sequence is as follows:
Performing power spectrum estimation, wherein the formula is P (f) =welch (RR ') (f), wherein RR' represents a reconstructed RR interval column vector, P (f) represents a power spectrum density function of the RR interval column vector, welch (·) represents a Welch spectrum estimation operator adopting an overlapping window and averaging method, and f represents frequency;
Defining a low frequency band and a respiratory overlap region [ f LF,low,fLF,high ]:
[fLF,low,fLF,high]=[0.04,0.15]Hz,
Fovl=[fr-δ,fr+δ]∩[fLF,low,fLF,high],
Wherein f LF,low and f LF,high represent the lower and upper frequency bands, respectively, f r represents the current estimated respiratory frequency, and δ represents the respiratory frequency drift half-window width;
Constructing a suppression mask function expressed as:
If F e F ovl, H (F) =0, otherwise H (F) =1,
Wherein H (F) is a frequency rejection mask function, which is completely rejected when the frequency falls within the breath and low frequency band overlap region F ovl, otherwise the original power is preserved;
Performing power spectrum correction, wherein the correction formula is P corr (f) =H (f) P (f), and P corr (f) is a corrected power spectrum density function;
Calculating low band correction power P LF:
wherein P LF represents the low-band power corrected for biofeedback;
The suppression rules and band selection logic include:
the low frequency band 0.04,0.15 Hz reflects the sympatho-parasympathetic balance, and is therefore the target power calculation interval,
The respiratory frequency band is usually 0.1-0.3Hz and fluctuates with the respiratory depth and the respiratory rate, and the respiratory frequency f r and the drift half-window width delta thereof can be estimated in real time and can be set as the standard deviation of the respiratory frequency sliding windowOr an empirical value of 0.01Hz, dynamically constructing an overlapping region F ovl, ensuring that the inhibition rule can adapt to individual respiratory variation;
The hard threshold mask is adopted to finish power zero setting, so that the influence of residual respiration peaks on LF power is avoided, and the method ensures the simplicity of calculation and the real-time requirement while retaining non-respiration components;
specifically, the mechanism ensures that all power peaks possibly generated by respiratory coupling are dynamically removed in a low-frequency band range, so that purer neuromodulation indexes are provided for subsequent biofeedback;
the data processing method of the biofeedback device further comprises a dynamic adjustment step:
Monitoring the frequency drift amount of the respiratory signal, and triggering the parameter of the variation self-encoder to be finely adjusted on line when the frequency drift amount exceeds a preset threshold;
the online fine tuning adopts an unsupervised loss function, and model weights are updated only based on the potential space orthogonality constraint of the current input signal;
the data processing method of the biofeedback device is deployed on the edge computing device and specifically comprises the following steps:
Compiling the variation self-encoder and the orthogonalization processing step into a lightweight inference engine, wherein the lightweight inference engine performs model compression through structured pruning and 8-bit integer quantization;
And carrying out streaming processing on the RR interval sequence by a memory mapping technology, wherein the memory mapping technology is based on the DMA controller of the target edge device to carry out zero copy data transmission.
It should be noted that the above embodiments are only for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that the technical solution of the present invention may be modified or substituted without departing from the spirit and scope of the technical solution of the present invention, which is intended to be covered in the scope of the claims of the present invention.