Movatterモバイル変換


[0]ホーム

URL:


CN119377900B - A sleep state monitoring method based on GM-GP algorithm - Google Patents

A sleep state monitoring method based on GM-GP algorithm
Download PDF

Info

Publication number
CN119377900B
CN119377900BCN202411965739.6ACN202411965739ACN119377900BCN 119377900 BCN119377900 BCN 119377900BCN 202411965739 ACN202411965739 ACN 202411965739ACN 119377900 BCN119377900 BCN 119377900B
Authority
CN
China
Prior art keywords
time
signals
sleep
sequence
model
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
CN202411965739.6A
Other languages
Chinese (zh)
Other versions
CN119377900A (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.)
Beijing Tiantan Hospital
Original Assignee
Beijing Tiantan Hospital
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 Beijing Tiantan HospitalfiledCriticalBeijing Tiantan Hospital
Priority to CN202411965739.6ApriorityCriticalpatent/CN119377900B/en
Publication of CN119377900ApublicationCriticalpatent/CN119377900A/en
Application grantedgrantedCritical
Publication of CN119377900BpublicationCriticalpatent/CN119377900B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

Translated fromChinese

本发明公开了一种基于GM‑GP算法的睡眠状态监测方法,涉及智能健康监测技术领域,包括,通过生理信号采集设备实时采集多模态信号,并进行预处理;从预处理后的多模态信号中分离出脑电信号,并进行非线性特征提取,计算其关联维数;将脑电信号的关联维数输入到GM模型中进行建模,捕捉不同睡眠阶段的动态变化特征;引入混合记忆增强网络,对脑电信号及多模态信号的时间序列进行趋势预测;基于混合记忆增强网络的预测结果和优化后的睡眠分期结果,实时检测用户在不同睡眠阶段的时间比例和数量;本发明采用混合记忆增强网络对多模态生理信号进行趋势预测,保证了睡眠状态监测的实时性和连续性,提升了整体监测的稳定性和可靠性。

The invention discloses a sleep state monitoring method based on GM-GP algorithm, which relates to the technical field of intelligent health monitoring, including: real-time acquisition of multimodal signals by physiological signal acquisition equipment, and preprocessing; separation of electroencephalogram signals from the preprocessed multimodal signals, and nonlinear feature extraction, and calculation of their correlation dimension; inputting the correlation dimension of the electroencephalogram signals into a GM model for modeling, and capturing the dynamic change characteristics of different sleep stages; introducing a hybrid memory enhancement network, and performing trend prediction on the time series of electroencephalogram signals and multimodal signals; based on the prediction results of the hybrid memory enhancement network and the optimized sleep staging results, real-time detection of the time proportion and quantity of the user in different sleep stages; the invention adopts a hybrid memory enhancement network to perform trend prediction on the multimodal physiological signals, thereby ensuring the real-time and continuity of sleep state monitoring, and improving the stability and reliability of the overall monitoring.

Description

Sleep state monitoring method based on GM-GP algorithm
Technical Field
The invention relates to the technical field of intelligent health monitoring, in particular to a sleep state monitoring method based on a GM-GP algorithm.
Background
With the increasing attention of people to healthy life, sleep quality is an important index for measuring the health condition of individuals, and has become a hot spot problem in the fields of scientific research and medical care. The continuous development of sleep state monitoring technology has made it possible to monitor and analyze sleep in real time in daily life through non-invasive devices. Currently, the mainstream mode of sleep state monitoring includes multi-modal analysis techniques based on physiological signals such as electroencephalogram signals (EEG), electrocardiographic signals (ECG), respiratory signals, and the like. However, the conventional sleep monitoring method relies on a single or a few physiological signals, for example, only using brain signals to perform sleep stage, and the method is accurate, but has high requirement on signal quality and is easy to be interfered by noise. In addition, the existing signal processing and classifying algorithms often have the defects of precision and real-time performance when processing complex dynamic changes in the sleeping process. Therefore, how to improve the accuracy of sleep state monitoring, especially in terms of the identification and staging of different sleep stages, is a key issue in current research.
Existing sleep monitoring techniques are capable of providing sleep state information to a certain extent for users, but still suffer from some limitations. First, the fusion and processing of multi-modal signals is a great challenge. The traditional signal processing method is difficult to realize efficient preprocessing and feature extraction when facing physiological signals with different sampling rates and noise interference, so that the accuracy of a monitoring result is low. Secondly, the existing sleep stage algorithm, such as a classification method based on a machine learning algorithm such as a Support Vector Machine (SVM) or a random forest, can distinguish different sleep stages to a certain extent, but is difficult to capture potential dynamic change trend in the sleep process due to limited modeling capability of time sequence characteristics. In addition, in the long-time sleep monitoring of the prior art, the change of the sleep state is often difficult to reflect in real time, and the continuity and trend prediction of the sleep state are lacked, so that the timeliness and stability of the monitoring result are poor. Therefore, developing a monitoring method which can process multimode physiological signals with high efficiency and can accurately capture the dynamic change of sleep state is important for improving the accuracy and the intelligent level of sleep monitoring.
Disclosure of Invention
The present invention has been made in view of the above-described problems occurring in the prior art.
Therefore, the invention provides a sleep state monitoring method based on a GM-GP algorithm, which solves the problem that the change of the sleep state is difficult to reflect in real time in the prior art.
In order to solve the technical problems, the invention provides the following technical scheme:
In a first aspect, the invention provides a sleep state monitoring method based on a GM-GP algorithm, which includes acquiring a multi-modal signal in real time through a physiological signal acquisition device, and performing preprocessing;
separating an electroencephalogram signal from the preprocessed multi-mode signal, extracting nonlinear characteristics, and calculating the correlation dimension;
Inputting the correlation dimension of the electroencephalogram signals into a GM model for modeling, and capturing dynamic change characteristics of different sleep stages;
Inputting the change characteristics of different sleep stages into a GP model for classification, and optimizing the accuracy of sleep stages by combining the correlation dimension of the electroencephalogram signals;
Introducing a hybrid memory enhancement network to predict trend of the time sequence of the electroencephalogram signals and the multi-mode signals;
Detecting the time proportion and the number of the users in different sleep stages in real time based on the prediction result of the hybrid memory enhanced network and the optimized sleep stage result;
The relevant dimension of the electroencephalogram signals is input into a GM model for modeling, the dynamic change characteristics of different sleep stages are captured, the specific steps are,
Constructing a time sequence by using the correlation dimension calculated by the electroencephalogram signals;
Performing accumulation generation operation on the associated dimension time sequence to obtain an accumulation generation sequence;
Based on the accumulation generation sequence, preliminary prediction is carried out on the accumulation generation sequence at the future moment through a GM model;
the accumulation of the preliminary prediction is carried out to generate a sequence, the sequence is restored to the original association dimension predicted value through the inverse accumulation generation operation, and the preliminary association dimension predicted sequence is output;
correcting the preliminary association dimension prediction sequence by adopting a feedforward neural network;
and capturing dynamic change characteristics of different sleep stages by analyzing the corrected association dimension prediction sequence and the change rate thereof.
As an optimal scheme of the sleep state monitoring method based on the GM-GP algorithm, the invention comprises the steps of acquiring the multi-mode signals in real time through physiological signal acquisition equipment, preprocessing, specifically,
The physiological signal acquisition equipment acquires and transmits the multi-mode signals to the computing equipment in real time through the transmission interface;
the computing device synchronizes signals with different sampling rates through downsampling and upsampling;
removing high-frequency noise and low-frequency drift from the synchronized signals by using a band-pass filter, and eliminating power frequency interference by using a notch filter;
the de-noised signals are subjected to baseline drift correction through a high-pass filter, and Z-score standardization is carried out;
and carrying out windowing processing on the standardized multi-mode signals, and integrating the standardized multi-mode signals into a uniform multi-mode signal matrix.
As a preferable scheme of the sleep state monitoring method based on the GM-GP algorithm, the invention separates the brain electrical signals from the preprocessed multi-mode signals, carries out nonlinear feature extraction, calculates the correlation dimension thereof, specifically comprises the steps of,
Filtering the multi-mode signal matrix by using an FIR filter, reserving an electroencephalogram signal frequency band, and outputting an electroencephalogram signal;
Selecting delay time based on an average mutual information method, determining an embedding dimension through a pseudo nearest neighbor algorithm, and embedding one-dimensional electroencephalogram signals into an m-dimensional phase space;
in the phase space, calculating Euclidean distance between reconstruction vectors, and generating a correlation integral through a correlation integral formula;
The correlation dimension of the electroencephalogram signal is estimated by linear fitting on a logarithmic scale of the correlation integral and the distance threshold.
As an optimal scheme of the sleep state monitoring method based on the GM-GP algorithm, the method adopts a feedforward neural network to correct a preliminary association dimension prediction sequence, specifically comprises the following steps of,
Taking the preliminary correlation dimension prediction sequence as input of the feedforward neural network, and training the feedforward neural network by taking the historical real correlation dimension sequence as a supervision signal;
Gradually updating the weight and bias of the feedforward neural network by minimizing the mean square error, and simultaneously using an optimizer to accelerate the convergence process;
And inputting the preliminary predicted value of the GM model into a trained neural network, and outputting a corrected association dimension predicted sequence.
As a preferable scheme of the sleep state monitoring method based on the GM-GP algorithm, the invention inputs the change characteristics of different sleep stages into the GP model for classification, and optimizes the accuracy of sleep stages by combining the correlation dimension of the electroencephalogram signals, specifically comprises the following steps,
Extracting key features from the associated dimension prediction sequence generated by the GM model;
integrating the extracted key features into a feature matrix;
The feature matrix X is used as GP model input, the labels are set to different sleep stages, and a training data set is constructed as target output;
Dividing the data set into a training set and a testing set;
In the GP model, an RBF kernel function is selected as a covariance function;
optimizing the hyper-parameters in the GP model by maximum likelihood estimation using the training dataset;
after training, predicting a test data set by using a GP model to obtain output distribution of each input sample;
For each test sample, calculating the posterior probability of each category, and selecting the category with the maximum posterior probability as the final classification result;
Taking the correlation dimension of the electroencephalogram signals as an input characteristic, and adding the input characteristic into a characteristic matrix X;
based on the new feature matrix X, the GP model is retrained, and the classification capacity of the model is optimized.
As an optimal scheme of the sleep state monitoring method based on the GM-GP algorithm, the invention introduces a hybrid memory enhancement network to conduct trend prediction on time sequences of electroencephalogram signals and multi-mode signals, and comprises the following specific steps of,
Preprocessing the acquired EEG signals and the multi-mode signals to form a time sequence tensorThe expression is:
;
Wherein,The length of the time series is indicated,The dimensions of the features are represented and,Representing a real set;
will input tensorCapturing a local mode of the time sequence through a bidirectional time convolution network, and processing front-back dependence output convolution characteristics of the time sequence through bidirectional convolution, wherein the expression is as follows:
;
Wherein,Is a time stepIs characterized by the convolution characteristics of (a),As a convolution kernel in the forward direction,As a backward convolution kernel,As a result of the bias term,For the window size of the convolution kernel,An index representing the convolution kernel,Representing time series tensorsAt time stepIs used for the feature vector of (a),Representing time series tensorsAt time stepIs a feature vector of (1);
processing convolution characteristics by adopting a short-term memory unit and combining a time gating mechanismOutputting the short-term memory state;
In a short-term memory stateIntroducing long-term memory cells on the memory layer of (C) to generate long-term memory state;
Introducing a recursive attention mechanism, adaptively weighting the importance of a specific time step in a time sequence, and outputting a weighted output state;
Based on the weighted output states, a trend prediction model is built by combining the output of short-term memory, long-term memory and recursive attention, and a time step is generatedPredicted value of (2)The expression is:
;
Wherein,Represent the firstThe attention weight of the individual time steps,A loss function representing a trend prediction model,Represents the partial derivative of the derivative,Representing hidden state of long-term memory cellThe gradient of the loss function is found and,Representing the adjustment of the weights of the long-term memory units in the memory mechanism;
Optimizing trend prediction, and simultaneously constructing a loss function of a trend prediction model by combining a mean square error, a time sequence smoothness constraint and an attention weight regularization termThe expression is:
;
Wherein,Representing normalized termsRepresenting time stepsIs used to determine the predicted value of (c),Representing time stepsIs used to determine the true value of (a),A hyper-parameter representing the weight of the smoothness constraint term in the control loss function,Representing time stepsIs used to determine the predicted value of (c),Representing the difference between the predicted values of adjacent time steps,A hyper-parameter representing the weight of the control attention weight regularization term,Representing an attention weight regularization term.
As an optimal scheme of the sleep state monitoring method based on the GM-GP algorithm, the method comprises the steps of detecting the time proportion and the number of different sleep stages of a user in real time based on a prediction result of a hybrid memory enhanced network and an optimized sleep stage result,
Each time step to be generatedPredicted value of (2)A sleep stage label;
The sleep stage labels are subjected to sectional processing and analysis by adopting a sliding window mechanism, and meanwhile, the occurrence times of different sleep stages are counted in each sliding window, and the time proportion of the sleep stages in the whole window is calculated;
Recording the starting time and the ending time of the current sleep stage for each time step along with the movement of the sliding window, and calculating the duration;
setting a minimum duration threshold and screening out valid sleep stage duration periods;
And carrying out trend analysis by using the long-term sleep data to calculate the sleep stage time proportion of the user at a plurality of nights, and analyzing the long-term change trend of the user.
In a second aspect, the invention provides a computer device comprising a memory and a processor, the memory storing a computer program, wherein the computer program, when executed by the processor, implements any step of the sleep state monitoring method based on the GM-GP algorithm according to the first aspect of the invention.
In a third aspect, the present invention provides a computer readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements any step of the GM-GP algorithm-based sleep state monitoring method according to the first aspect of the present invention.
The invention has the beneficial effects that by combining the advantages of the GM model and the GP model, the invention can accurately capture the dynamic changes of different stages in the sleeping process, and remarkably improves the sleeping stage precision. In addition, the mixed memory enhanced network is adopted to conduct trend prediction on the multi-mode physiological signals, so that the real-time performance and the continuity of sleep state monitoring are guaranteed, and the stability and the reliability of overall monitoring are improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a sleep state monitoring method based on GM-GP algorithm in embodiment 1.
Fig. 2 is a flowchart for calculating the correlation dimension in embodiment 1.
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 and 2, is a first embodiment of the present invention, and this embodiment provides a sleep state monitoring method based on GM-GP algorithm, including the following steps:
S1, acquiring multi-mode signals in real time through physiological signal acquisition equipment, and preprocessing.
Further, the physiological signal acquisition device acquires and transmits the multi-mode signals (such as EEG, ECG, GSR and the like) to the computing device in real time through a transmission (such as USB, bluetooth or Wi-Fi) interface;
Specifically, the physiological signal acquisition device includes an electroencephalogram signal acquisition device (EEG), an electrocardiograph signal acquisition device (ECG), and a galvanic skin response acquisition device (GSR);
It should be noted that to ensure accuracy of signal acquisition, the acquisition device needs to be calibrated and the electrodes should be placed in a standard location (e.g., 10-20 system of EEG) to ensure reliability and consistency of the signals. The transmission delay in the acquisition process should be controlled to be as high as millisecond level as possible so as to ensure the real-time property of the data.
The computing device synchronizes signals with different sampling rates through uniform sampling rates of downsampling (for example, downsampling an ECG from 1000Hz to 256 Hz) and upsampling (for example, upsampling a GSR from 10Hz to 256 Hz), so that all modal signals have consistent time resolution on the same time axis, subsequent processing is facilitated, and linear interpolation or other interpolation methods are adopted for resampling to ensure smooth transition of the signals;
removing high-frequency noise and low-frequency drift from the synchronized signals by using a band-pass filter, and eliminating power frequency interference by using a notch filter;
It should be noted that the design of these filters should take into account the phase response to avoid phase distortion of the signal, especially when EEG signal processing, it is important to preserve the phase information of the signal.
The de-noised signals are subjected to baseline drift correction through a high-pass filter, and Z-score standardization is carried out;
it should be noted that the denoised signal refers to a signal that has been subjected to bandpass filtering and notch filtering.
Windowing the standardized multi-mode signals (wherein each window is set to a certain length and overlapped) and integrating the standardized multi-mode signals into a unified multi-mode signal matrix;
The purpose of the windowing process is to divide the continuous time series signal into blocks of fixed length, which facilitate subsequent feature extraction and analysis.
S2, separating the electroencephalogram signals from the preprocessed multi-mode signals, extracting nonlinear characteristics, and calculating the correlation dimension.
Further, an FIR filter is used for filtering the multi-mode signal matrix, non-electroencephalogram signal frequency components are removed, an electroencephalogram signal frequency band (0.5 Hz-50 Hz) is reserved, and an electroencephalogram signal EEG is output;
Selecting delay time based on an average mutual information method, determining an embedding dimension through a pseudo nearest neighbor algorithm, and embedding one-dimensional EEG (electroencephalogram) into an m-dimensional phase space;
Where m represents the dimension in the phase space, typically determined by some algorithm, such as a pseudo-nearest neighbor algorithm.
In the phase space, calculating Euclidean distance between reconstruction vectors, and generating a correlation integral through a correlation integral formula, wherein the correlation integral is used for describing the distance distribution condition of point pairs in the reconstruction space;
The correlation dimension of the EEG is estimated as the main nonlinear feature of the EEG by linear fitting on the logarithmic scale of the correlation integral and the distance threshold.
S3, inputting the correlation dimension of the electroencephalogram signals into a GM model for modeling, and capturing dynamic change characteristics of different sleep stages.
Furthermore, the correlation dimension calculated by the electroencephalogram signals is utilized to construct a time sequence for reflecting the change of the correlation dimension along with time;
It should be noted that the association dimension may be calculated by the Grassberger-Procaccia algorithm or the like. The magnitude of the value generally reflects the chaos of the signal, and the larger the value is, the higher the signal complexity is.
Performing Accumulation Generation Operation (AGO) on the associated dimension time sequence to obtain an accumulation generation sequence, and providing a basis for a subsequent gray model;
The purpose of the accumulation generation is to reduce randomness, so that a GM model applied subsequently can better fit the trend of the data.
Based on the accumulation generation sequence, preliminary prediction is carried out on the accumulation generation sequence at the future moment through a GM model;
the accumulation of the preliminary prediction is carried out to generate a sequence, the sequence is restored to the original association dimension predicted value through the inverse accumulation generation operation, and the preliminary association dimension predicted sequence is output;
It should be noted that the inverse accumulation generation operation ensures that the data recovered from the accumulation sequence still maintains the dimensionality and physical meaning of the original associated-dimensionality time series.
The feedforward neural network is adopted to correct the preliminary association dimension prediction sequence, and the specific steps are that,
Taking the preliminary correlation dimension prediction sequence as input of the feedforward neural network, and training the feedforward neural network by taking the historical real correlation dimension sequence as a supervision signal;
Gradually updating the weights and biases of the feedforward neural network by minimizing the mean square error, and simultaneously using an optimizer (e.g., adam) to accelerate the convergence process;
And inputting the preliminary predicted value of the GM model into a trained neural network, and outputting a corrected association dimension predicted sequence.
The "trained neural network" refers to a network model in which the weight and bias parameters of the network are iteratively updated by a training process using an optimizer (e.g., adam) to eventually converge or minimize a loss function (e.g., mean square error, MSE).
Preferably, the introduction of the feedforward neural network enables the model to capture nonlinear dynamic changes in the electroencephalogram signals and make up for the defects of the GM model, wherein the input of the feedforward neural network is a preliminary predicted value of the GM model, and the output is a corrected association dimension predicted sequence, and the corrected association dimension predicted sequence better captures the nonlinear changes in the electroencephalogram signals.
The dynamic change characteristics of different sleep stages are captured by analyzing the corrected associated dimension prediction sequence and the change rate thereof, and the specific implementation steps are as follows:
firstly, a preliminary association dimension prediction sequence is corrected through a feedforward neural network, and a corrected association dimension time sequence is output, wherein the sequence can better capture complex nonlinear changes in an electroencephalogram signal and is used as input data of the next step.
And secondly, after the corrected association dimension time sequence is obtained, calculating the change rate of the association dimension by carrying out differential operation on the association dimension values of adjacent time points.
It should be noted that the rate of change represents the rate of change of the time series at each moment, providing a basis for subsequent trend analysis and phase division.
The method has the advantages that the method can keep the main trend of the change rate through a denoising algorithm, filter out tiny random fluctuation and obtain a more representative change rate sequence.
And extracting the characteristics of the smoothed change rate sequence. By analyzing the overall trend and fluctuation of the rate of change, key statistical features that can reflect sleep stage changes are extracted. These features will be used to identify different electroencephalogram signal states such as average level of rate of change, fluctuation amplitude, etc.
And according to the extracted change rate statistical characteristics, carrying out phase division on the dynamic change of the electroencephalogram signals. And combining the characteristic expression of different sleep stages, and dividing the corrected association dimension sequence into dynamic change characteristics of different sleep stages such as a shallow sleep stage, a deep sleep stage, a rapid eye movement stage and the like through a classification method based on rules or machine learning.
S4, inputting the change characteristics of different sleep stages into the GP model for classification, and optimizing the accuracy of sleep stages by combining the correlation dimension of the electroencephalogram signals.
Further, key features are extracted from the associated dimension prediction sequence generated by the GM model;
the key features comprise instantaneous change rate of the associated dimension, local maximum and minimum values in the time sequence of the associated dimension, associated dimension mean values and variances in different time windows, autocorrelation features of the time sequence of the associated dimension;
integrating the extracted key features into a feature matrixThe expression is:
;
;
Wherein,Which are indicative of the various features,As a total number of features,Index variables representing features;
inputting the feature matrix X as a GP (Gaussian process) model, setting the labels to different sleep stages (such as wakefulness, REM, NREM1, NREM2, NREM3 and the like), and constructing a training data set as target output;
Furthermore, in order to improve the classifying capability, preferably, the nonlinear characteristics (association dimension) of the electroencephalogram signals are introduced, so that the training data set contains richer dynamic change information, and the classifying capability of the GP model on different sleep stages is obviously improved. Meanwhile, the robustness of classification is further enhanced by combining multi-modal signals (such as electrocardio signals and respiratory signals). The feature construction method is different from the traditional linear feature extraction mode, and can better capture complex nonlinear dynamics characteristics in the electroencephalogram signals.
Dividing the data set into a training set and a testing set;
In the GP model, an RBF kernel function (radial basis function) is selected as the covariance function;
preferably, the RBF core is capable of capturing well the nonlinear relationship between the associated dimensional features and the sleep stages.
Optimizing hyper-parameters (such as length scale of kernel/and noise term) in the GP model by Maximum Likelihood Estimation (MLE) using the training dataset;
after training, predicting a test data set by using a GP model to obtain output distribution of each input sample;
since the GP model has bayesian properties, it can give not only predicted values but also uncertainty estimates.
For each test sample, calculating the posterior probability of each category, and selecting the category with the maximum posterior probability as the final classification result;
It should be noted that, the category with the maximum posterior probability is selected as the final classification result, specifically,
For each test samplePredicting by using the trained GP model;
The GP model's output for each sample is a posterior probability distribution, i.e., the model will calculate for each possible class (e.g., awake, REM, NREM1, NREM2, NREM3, etc.) the probability that the sample belongs to that class.
Assuming that there isThe model outputs a model of length of each category (i.e., different sleep stages)The posterior probability vector of (a) has the expression:
;
Wherein,Representing a sampleBelongs to the category ofIs a function of the probability of (1),An index representing the category of the object is presented,Representing the total number of categories;
And finding out the probability with the largest value in the obtained posterior probability vector, namely the class which the model considers the sample most likely belongs to.
The specific operation is to select the category with the maximum posterior probabilityThe expression is:
;
Wherein,Representing the search results in posterior probabilities;
Maximum class of posterior probability found in stepAs the final predicted class of the test sample, i.e., the final classification result.
The correlation dimension of the EEG signal is used as an independent input feature and added into a feature matrixIn (a) and (b);
based on the new feature matrix, the GP model is retrained, and the classification capacity of the model is optimized.
S5, introducing a hybrid memory enhancement network to predict trend of the time sequences of the electroencephalogram signals and the multi-mode signals.
Further, the acquired electroencephalogram (EEG) signals and the multi-modal signals are preprocessed to form time series tensorsThe expression is:
;
Wherein,The length of the time series is indicated,The dimensions of the features are represented and,Representing a real set;
will input tensorCapturing a local mode of the time sequence through a bidirectional time convolution network, and processing front-back dependence output convolution characteristics of the time sequence through bidirectional convolution, wherein the expression is as follows:
;
Wherein,Is a time stepIs characterized by the convolution characteristics of (a),As a convolution kernel in the forward direction,As a backward convolution kernel,As a result of the bias term,For the window size of the convolution kernel,An index representing the convolution kernel,Representing time series tensorsAt time stepIs used for the feature vector of (a),Representing time series tensorsAt time stepIs a feature vector of (1);
processing convolution characteristics by adopting a short-term memory unit and combining a time gating mechanismOutputting the short-term memory state;
In a short-term memory stateIntroducing long-term memory cells on the memory layer of (C) to generate long-term memory state;
Introducing a recursive attention mechanism, adaptively weighting the importance of a specific time step in a time sequence, and outputting a weighted output state;
Based on the weighted output states, a trend prediction model is built by combining the output of short-term memory, long-term memory and recursive attention, and a time step is generatedPredicted value of (2)The expression is:
;
Wherein,Represent the firstThe attention weight of the individual time steps,A loss function representing a trend prediction model,Represents the partial derivative of the derivative,Representing hidden state of long-term memory cellThe gradient of the loss function is found and,Representing the adjustment of the weights of the long-term memory units in the memory mechanism;
it should be noted that,Can be regarded as a trainable weight matrix, and is specially used for weighting and adjusting the gradient information of the long-term memory state based on the loss function in the updating process of the long-term memory state. The generation process can be divided into the following steps:
In the initialization phase of the model,The generation may be by:
Random initialization-pairs typically using random distribution (e.g., xavier initialization or He initialization)And initializing to ensure the stability of model training.
In the course of the training process, the user can perform,Updates will be made by back propagation. Specifically, the model is utilized by the following processAdjust long-term memory state:
For each time stepIn obtaining long-term memory stateThe model will then be based on the loss functionThe gradient of this time step is calculated.
Then, gradientWill be associated withAnd performing weighted combination to generate an adjusted output.
In each of the training cycles of the training device,Will be updated along with other model parameters by the back propagation algorithm. Specifically, the loss function will be based on the error termCalculate gradients of the entire model and propagate updates to all parameters, including
During the test phase, the model is no longer counter-propagating, and therefore the gradient of the loss function is not calculated. But during the course of the prediction process,The training has resulted in an optimized weight that can be used directly to adjust the final output of the long-term memory state.
In the trend prediction formula, although the gradient is not calculated any more in the test stage, the model can be regarded as a weighting matrix for post-adjusting the output of the long-term memory, so as to improve the prediction performance of the model.
Optimizing trend prediction, and simultaneously combining Mean Square Error (MSE), time sequence smoothness constraint and attention weight regularization term to construct a loss function of a trend prediction modelThe expression is:
Wherein,Represents the normalized term, used to average the error,Representing time stepsIs used to determine the predicted value of (c),Representing time stepsIs used to determine the true value of (a),A hyper-parameter representing the weight of the smoothness constraint term in the control loss function,Representing time stepsIs used to determine the predicted value of (c),Representing the difference between the predictors of adjacent time steps, for measuring the smoothness of the time series, which may not be smooth enough if the difference between the predictors of adjacent time steps is too large,A hyper-parameter representing the weight of the control attention weight regularization term,Representing an attention weight regularization term.
It should be noted that a recursive attention mechanism is used to dynamically weight each time step in the time series to highlight the importance of different time steps in the prediction, wherein the attention weightsIs calculated based on the input tensor and the memory state, and comprises the following specific steps:
Recursive attention mechanisms typically combine input features and hidden states to calculate attention weights.
Assume that at the current time stepAt the same time have input features(Output from short-term memory cell), long-term memory state
An attention scoring function is defined for measuring the importance of each time step. This scoring function is typically expressed as a linear combination of input features and memory states or a nonlinear transformation
The recursive attention mechanism calculates the attention weight of each time step by means of an attention scoring function. Meanwhile, normalization is carried out through a softmax function to ensure that the attention weight forms a probability distribution on each time step;
Attention weights at all time steps after normalizationSatisfying the normalization condition;
Calculated attention weightFor short-term memory statesAnd long-term memory stateWeighting, generating an output of a recursive attention mechanism
In order to prevent the model from over-relying on the attention weights of certain time steps, the recursive attention mechanism introduces a regularization term. The regularization term's attention weight for each time stepSquare penalty is performed to ensure a more uniform distribution of attention.
S7, detecting the time proportion and the number of the users in different sleep stages in real time based on the prediction result of the hybrid memory enhanced network and the optimized sleep stage result.
Further, each time step to be generatedPredicted value of (2)Corresponding to sleep stage label;
Wherein,5 Different sleep stages are shown.
The sleep stage labels are subjected to sectional processing and analysis by adopting a sliding window mechanism, so that the sleep state of a user is ensured to be monitored in real time in different time periods;
meanwhile, in each sliding window, counting the occurrence times of different sleep stages (such as N1, N2, N3, REM and WAKE) and calculating the time duty ratio of the sleep stages in the whole window;
along with the movement of the sliding window, recording the starting time and the ending time of the current sleep stage for each time step, and calculating the duration;
Setting a minimum duration threshold (e.g., the minimum duration of the deep sleep stage N3 may be set to 20 minutes) and screening for a valid sleep stage duration period;
It should be noted that when setting the "minimum duration threshold", the main purpose is to filter out transient, ineffective sleep stage handovers, ensuring that only meaningful, consecutive sleep stages are analyzed. This setting needs to ensure that the detected sleep stage corresponds to the actual sleep cycle characteristics based on existing sleep studies and physiological laws. The following are specific considerations and steps for setting the minimum duration threshold:
first, thresholds may be set based on physiological laws, with various sleep stages (e.g., N1, N2, N3, REM, and WAKE) having different durations during the normal sleep cycle. We can set the threshold according to the typical duration of these phases:
N1 (light sleep) N1 phase is generally relatively short, with a duration of typically around 1-7 minutes. Thus, the minimum duration threshold may be set to 1-2 minutes to prevent a brief transitional period from being erroneously identified as a valid light sleep stage.
N2 (moderate sleep) N2 phase is longer in duration, typically between 10-25 minutes. Thus, the minimum duration threshold may be set to 5-10 minutes to avoid misunderstanding the instantaneous N2 switch as a complete sleep segment.
N3 (deep sleep) the deep sleep stage is very important and its duration is usually long. To ensure that a true deep sleep is detected, the minimum duration threshold is typically set to 20 minutes. If the period duration is too short, the user may not actually go into deep sleep.
REM (rapid eye movement sleep) the REM phase typically fluctuates within 10-60 minutes, especially during the latter half of the night, which is gradually prolonged. Thus, the minimum duration threshold may be set to 10 minutes to avoid misinterpreting brief arousals or mild activity as REM sleep.
WAKE phase is typically a brief period of arousal, especially nocturnal arousal. The minimum duration threshold may be set to 1-2 minutes to filter out sporadic, extremely short awake states.
Second, although physiological laws provide a universal threshold range, sleep habits and health conditions may vary for each user, based on personalized adjustments. In order to improve the detection accuracy, personalized adjustment can be performed according to long-term sleep data of the user:
dynamically adjusting the threshold by analyzing the user's sleep data over multiple nights, the average duration of each sleep stage can be calculated, and dynamically adjusting the minimum duration threshold based on the results. For example, if the average duration of the N3 phase for one user is short, the minimum threshold may be suitably lowered.
In practice, the step of setting the minimum duration threshold may be by initializing the threshold by referencing standard values in the sleep study, such as 1-2 minutes (N1), 5-10 minutes (N2), 20 minutes (N3), 10 minutes (REM), 1-2 minutes (WAKE), as mentioned above, and real-time detection by monitoring the start time and end time of each sleep stage within a sliding window. When a sleep stage duration is detected to be below a set threshold, the stage is marked as an "invalid stage" and the final statistics are not taken into account, the threshold is adjusted such that over time, these minimum duration thresholds may be automatically adjusted based on the user's long-term sleep mode. For example, if the user's deep sleep duration is always short for some period of time, the threshold for the N3 phase may be suitably lowered.
It should be noted that the minimum duration threshold is not set too high, which may otherwise lead to missed detection of certain valid sleep stages. For example, if the threshold for the N3 phase is set to 30 minutes, some shorter but still meaningful deep sleep segments may be missed. Therefore, the threshold should be set to balance accuracy and sensitivity as much as possible.
To further increase the accuracy of setting the threshold, other physiological signals (e.g., heart rate, respiratory rate, electromyographic signals, etc.) may be combined to assist in determining whether a stage is a valid sleep stage. For example, when the brain electrical signal shows that the user is in stage N3, but the heart rate and respiratory rate show that the user is still in a higher activity state, this stage may be considered ineffective deep sleep.
It should also be noted that sleep stages refer to different sleep stages (N1, N2, N3, REM) typically having respective typical durations. For example, the N3 (deep sleep) phase typically lasts longer, while the N1 (light sleep) phase is typically shorter.
The effective duration means that the duration of each sleep stage must exceed a preset minimum duration threshold in order to be considered effective. This threshold is to avoid misunderstanding a brief, momentary sleep stage shift (e.g., a fast shift from light sleep to deep sleep and back to light sleep) as a complete sleep stage.
Invalid sleep stages means that if a certain sleep stage is of a duration shorter than a set threshold value, it is considered invalid and may simply be a transition or a short fluctuation between sleep stages without sufficient physiological significance. These invalid phases are not counted nor used for the calculation of the time scale.
And carrying out trend analysis by using the long-term sleep data to calculate the sleep stage time proportion of the user at a plurality of nights, and analyzing the long-term change trend of the user.
The embodiment also provides computer equipment, which is suitable for the condition of the sleep state monitoring method based on the GM-GP algorithm and comprises a memory and a processor, wherein the memory is used for storing computer executable instructions, and the processor is used for executing the computer executable instructions to realize the sleep state monitoring method based on the GM-GP algorithm.
The computer device may be a terminal comprising a processor, a memory, a communication interface, a display screen and input means connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless mode can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
The present embodiment also provides a storage medium having a computer program stored thereon, which when executed by a processor implements the sleep state monitoring method based on GM-GP algorithm as proposed in the above embodiment, and the storage medium may be implemented by any type of volatile or non-volatile storage device or combination thereof, such as a static random access Memory (Static Random Access Memory, SRAM for short), an electrically erasable Programmable Read-Only Memory (ELECTRICALLY ERASABLE PROGRAMMABLE READ-Only Memory, EEPROM for short), an erasable Programmable Read-Only Memory (Erasable Programmable Read Only Memory, EPROM for short), a Programmable Read-Only Memory (ROM for short), a magnetic Memory, a flash Memory, a magnetic disk, or an optical disk.
In summary, the invention can accurately capture the dynamic changes of different stages in the sleeping process by combining the advantages of the GM model and the GP model, and remarkably improves the sleeping stage precision. In addition, the mixed memory enhanced network is adopted to conduct trend prediction on the multi-mode physiological signals, so that the real-time performance and the continuity of sleep state monitoring are guaranteed, and the stability and the reliability of overall monitoring are improved.
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.

Claims (9)

CN202411965739.6A2024-12-302024-12-30 A sleep state monitoring method based on GM-GP algorithmActiveCN119377900B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202411965739.6ACN119377900B (en)2024-12-302024-12-30 A sleep state monitoring method based on GM-GP algorithm

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202411965739.6ACN119377900B (en)2024-12-302024-12-30 A sleep state monitoring method based on GM-GP algorithm

Publications (2)

Publication NumberPublication Date
CN119377900A CN119377900A (en)2025-01-28
CN119377900Btrue CN119377900B (en)2025-03-28

Family

ID=94336081

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202411965739.6AActiveCN119377900B (en)2024-12-302024-12-30 A sleep state monitoring method based on GM-GP algorithm

Country Status (1)

CountryLink
CN (1)CN119377900B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN106682406A (en)*2016-12-122017-05-17西北工业大学Sleep state monitoring method based on GM-GP algorithm
CN116269212A (en)*2022-12-232023-06-23浙江工业大学 A multimodal sleep stage prediction method based on deep learning

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
WO2022031038A1 (en)*2020-08-042022-02-10주식회사 에이슬립Computing device for predicting sleep state on basis of data measured in sleep environment of user
CN119073924A (en)*2024-09-302024-12-06中国人民解放军联勤保障部队第九〇四医院 Automatic sleep staging method and system based on ResCNN-BiGRU

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN106682406A (en)*2016-12-122017-05-17西北工业大学Sleep state monitoring method based on GM-GP algorithm
CN116269212A (en)*2022-12-232023-06-23浙江工业大学 A multimodal sleep stage prediction method based on deep learning

Also Published As

Publication numberPublication date
CN119377900A (en)2025-01-28

Similar Documents

PublicationPublication DateTitle
US12097032B2 (en)Machine differentiation of abnormalities in bioelectromagnetic fields
Cui et al.Automatic Sleep Stage Classification Based on Convolutional Neural Network and Fine‐Grained Segments
Li et al.Patient-specific seizure prediction from electroencephalogram signal via multichannel feedback capsule network
CN110944577A (en)Method and system for detecting blood oxygen saturation
CN117598712B (en) Abnormal discharge detection method, device, medium and equipment between epileptic seizures
CN111067503A (en)Sleep staging method based on heart rate variability
CN110706816A (en)Method and equipment for regulating sleep environment based on artificial intelligence
Hu et al.Semi-supervised learning for low-cost personalized obstructive sleep apnea detection using unsupervised deep learning and single-lead electrocardiogram
CN114190897B (en)Training method of sleep stage model, sleep stage method and device
EP4278351A1 (en)Speech-analysis based automated physiological and pathological assessment
CN119418952B (en)Non-contact sleep stage identification and structure analysis method and system
VeluguriDeep PPG: Improving Heart Rate Estimates with Activity Prediction
CN119400431A (en) A method for epileptic seizure prediction based on a lightweight deep statistical model
KR102650641B1 (en)Apparatus and method for predicting sleep state
CN119377900B (en) A sleep state monitoring method based on GM-GP algorithm
CN111278353A (en)Method and system for detecting vital sign signal noise
WO2022183999A1 (en)Evaluation of sleep data
CN114983436A (en) Electronic device for the identification of insomnia disorder based on awake resting-state EEG
Cossu et al.Adaptive and self-learning Bayesian filtering algorithm to statistically characterize and improve signal-to-noise ratio of heart-rate data in wearable devices
US20250275714A1 (en)Enhancing accuracy in wearable sleep trackers
CN120345870B (en)Non-contact sleep stage method and equipment
EP4517777A1 (en)Method for training a sleep-related event classification model
CN118177837B (en)Epileptic electroencephalogram data identification method and device based on multi-modal evidence learning
EP4613197A1 (en)Methods and devices for detecting the alertness of the human body
RU2756157C1 (en)Method for analysis of ballistocardiographic signal for detecting singular heart beats in real time

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp