A sleep state monitoring method based on GM-GP algorithm

By combining the GM model and the GP model and introducing a hybrid memory enhancement network, the problem of insufficient multimodal signal processing and sleep staging accuracy in the prior art is solved, and high-precision and real-time sleep state monitoring is achieved.

CN119377900BActive Publication Date: 2025-03-28BEIJING TIANTAN HOSPITAL AFFILIATED TO CAPITAL MEDICAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411965739.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-03-28
Estimated Expiration
2044-12-30

AI Technical Summary

Technical Problem

Existing sleep monitoring technologies are difficult to achieve efficient multimodal signal processing and accurate sleep staging, especially when facing different sampling rates and noise interference, and it is difficult to reflect changes in sleep state in real time.

Method used

The sleep state monitoring method based on the GM-GP algorithm is adopted, and multimodal signals are collected in real time and preprocessed, and the EEG signals are separated for nonlinear feature extraction. The dynamic changes in the sleep stage are captured using the GM model, and the sleep staging is optimized through the GP model. At the same time, a hybrid memory enhancement network was introduced to predict the time series trend.

Benefits of technology

It significantly improves the accuracy of sleep staging, ensures the real-time and continuity of sleep state monitoring, and improves the stability and reliability of overall monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119377900B_ABST
    Figure CN119377900B_ABST
Patent Text Reader

Abstract

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, so as to capture 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, so as to ensure the real-time and continuity of sleep state monitoring, and improve the stability and reliability of the overall monitoring.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of intelligent health monitoring, and in particular to a sleep state monitoring method based on a GM-GP algorithm. Background Art

[0002] As people pay more and more attention to healthy living, sleep quality, as an important indicator of individual health status, has become a hot issue in scientific research and health 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. At present, the mainstream methods of sleep state monitoring include multimodal analysis technologies based on physiological signals such as electroencephalogram (EEG), electrocardiogram (ECG), and respiratory signals. However, traditional sleep monitoring methods mostly rely on a single or a few physiological signals. For example, only using EEG signals for sleep staging is more accurate, but it has high requirements on signal quality and is easily affected by noise. In addition, existing signal processing and classification algorithms often have deficiencies in accuracy and real-time performance when dealing with complex dynamic changes during sleep. Therefore, how to improve the accuracy of sleep state monitoring, especially in the identification and staging of different sleep stages, has become a key issue in current research.

[0003] Existing sleep monitoring technology can provide users with sleep status information to a certain extent, but there are still some limitations. First, the fusion and processing of multimodal signals is a major challenge. Traditional signal processing methods often find it difficult to achieve efficient preprocessing and feature extraction when faced with physiological signals with different sampling rates and noise interference, resulting in low accuracy of monitoring results. Secondly, existing sleep staging algorithms, such as classification methods based on machine learning algorithms such as support vector machines (SVM) or random forests, can distinguish different sleep stages to a certain extent, but due to their limited modeling capabilities for time series features, it is difficult to capture the potential dynamic trends during sleep. In addition, the existing technology is often difficult to reflect the changes in sleep status in real time during long-term sleep monitoring, and lacks continuity and trend prediction of sleep status, resulting in poor timeliness and stability of monitoring results. Therefore, it is crucial to develop a monitoring method that can efficiently process multimodal physiological signals and accurately capture the dynamic changes in sleep status to improve the accuracy and intelligence level of sleep monitoring. Summary of the invention

[0004] In view of the above existing problems, the present invention is proposed.

[0005] Therefore, the present invention provides a sleep state monitoring method based on the GM-GP algorithm to solve the problem in the prior art that it is difficult to reflect the changes in the sleep state in real time.

[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0007] In a first aspect, the present invention provides a sleep state monitoring method based on the GM-GP algorithm, which comprises collecting multimodal signals in real time through a physiological signal acquisition device and performing preprocessing;

[0008] Separate the EEG signal from the preprocessed multimodal signal, perform nonlinear feature extraction, and calculate its correlation dimension;

[0009] The correlation dimension of the EEG signal is input into the GM model for modeling to capture the dynamic change characteristics of different sleep stages;

[0010] The changing characteristics of different sleep stages are input into the GP model for classification, and the correlation dimension of EEG signals is combined to optimize the accuracy of sleep staging;

[0011] Introducing a hybrid memory-enhanced network to predict the trend of time series of EEG signals and multimodal signals;

[0012] Based on the prediction results of the hybrid memory-augmented network and the optimized sleep staging results, the proportion and amount of time the user spends in different sleep stages are detected in real time;

[0013] The correlation dimension of the EEG signal is input into the GM model for modeling to capture the dynamic change characteristics of different sleep stages. The specific steps are:

[0014] The time series is constructed using the correlation dimension calculated from the EEG signal;

[0015] Performing cumulative generation operation on the correlation dimension time series to obtain a cumulative generation sequence;

[0016] Based on the cumulative generation sequence, the GM model is used to make a preliminary prediction of the cumulative generation sequence at future moments;

[0017] The cumulative generation sequence of the preliminary prediction is restored to the original correlation dimension prediction value through the inverse cumulative generation operation, and the preliminary correlation dimension prediction sequence is output;

[0018] Feedforward neural network is used to modify the preliminary correlation dimension prediction sequence;

[0019] By analyzing the modified correlation dimension prediction sequence and its changing rate, the dynamic change characteristics of different sleep stages are captured.

[0020] As a preferred solution of the sleep state monitoring method based on the GM-GP algorithm of the present invention, wherein: the multimodal signal is collected in real time by the physiological signal collection device and preprocessed, and the specific steps are:

[0021] The physiological signal acquisition device acquires and transmits multimodal signals to the computing device in real time through the transmission interface;

[0022] The computing device synchronizes signals of different sampling rates by downsampling and upsampling;

[0023] For the synchronized signal, a bandpass filter is used to remove high-frequency noise and low-frequency drift, and a notch filter is used to eliminate power frequency interference;

[0024] The denoised signal was subjected to baseline drift correction through a high-pass filter and Z-score normalization;

[0025] The standardized multimodal signals are windowed and integrated into a unified multimodal signal matrix.

[0026] As a preferred solution of the sleep state monitoring method based on the GM-GP algorithm of the present invention, wherein: the EEG signal is separated from the pre-processed multimodal signal, and nonlinear feature extraction is performed, and its correlation dimension is calculated, and the specific steps are:

[0027] Use FIR filter to filter the multimodal signal matrix, retain the EEG signal frequency band, and output the EEG signal;

[0028] The delay time is selected based on the average mutual information method, and the embedding dimension is determined by the pseudo nearest neighbor algorithm to embed the one-dimensional EEG signal into the m-dimensional phase space.

[0029] In the phase space, the Euclidean distance between the reconstructed vectors is calculated, and the correlation integral is generated through the correlation integral formula;

[0030] The correlation dimension of the EEG signal was estimated by linear fitting the correlation integral and the distance threshold on a logarithmic scale.

[0031] As a preferred solution of the sleep state monitoring method based on the GM-GP algorithm of the present invention, wherein: the feedforward neural network is used to correct the preliminary correlation dimension prediction sequence, and the specific steps are:

[0032] The initial correlation dimension prediction sequence is used as the input of the feedforward neural network, and the historical real correlation dimension sequence is used as the supervision signal to train the feedforward neural network;

[0033] The weights and biases of the feedforward neural network are updated incrementally by minimizing the mean squared error, while using an optimizer to accelerate the convergence process.

[0034] The preliminary prediction values ​​of the GM model are input into the trained neural network, and the corrected correlation dimension prediction sequence is output.

[0035] As a preferred solution of the sleep state monitoring method based on the GM-GP algorithm of the present invention, the change characteristics of different sleep stages are input into the GP model for classification, and the accuracy of sleep staging is optimized in combination with the correlation dimension of the EEG signal. The specific steps are:

[0036] Extract key features from the correlation dimension prediction sequence generated by the GM model;

[0037] Integrate the extracted key features into a feature matrix ;

[0038] The feature matrix X is used as the input of the GP model, the labels are set to different sleep stages, and the training dataset is constructed as the target output;

[0039] Divide the dataset into training and testing sets;

[0040] In the GP model, the RBF kernel function is selected as the covariance function;

[0041] Using the training data set, optimize the hyperparameters in the GP model through maximum likelihood estimation;

[0042] After training is completed, the GP model is used to predict the test data set to obtain the output distribution of each input sample;

[0043] For each test sample, calculate the posterior probability that it belongs to each category, and select the category with the largest posterior probability as the final classification result;

[0044] The correlation dimension of the EEG signal is used as the input feature and added to the feature matrix X;

[0045] Based on the new feature matrix X, retrain the GP model to optimize the classification ability of the model.

[0046] As a preferred solution of the sleep state monitoring method based on the GM-GP algorithm described in the present invention, the hybrid memory enhancement network is introduced to perform trend prediction on the time series of EEG signals and multimodal signals, and the specific steps are as follows:

[0047] After preprocessing, the collected EEG signals and multimodal signals are formed into a time series tensor , the expression is:

[0048] ;

[0049] in, represents the length of the time series, represents the feature dimension, represents the set of real numbers;

[0050] The input tensor Through the bidirectional temporal convolutional network, the local pattern of the time series is captured, and the forward and backward dependencies of the time series are processed through bidirectional convolution to output the convolution features. The expression is:

[0051] ;

[0052] in, is the time step The convolutional features of is the forward convolution kernel, is the backward convolution kernel, is the bias term, is the window size of the convolution kernel, represents the index of the convolution kernel, Represents a time series tensor In time step The characteristic vector of Represents a time series tensor In time step The eigenvector of

[0053] Use short-term memory units and combine them with a time gating mechanism to process convolutional features , output short-term memory state ;

[0054] In short-term memory Introduce long-term memory units on the memory layer to generate long-term memory states ;

[0055] Introducing a recursive attention mechanism to adaptively weight the importance of a specific time step in the time series and output the weighted output state;

[0056] Based on the weighted output state, the trend prediction model is constructed by combining the output of short-term memory, long-term memory and recursive attention to generate the time step The predicted value of , the expression is:

[0057] ;

[0058] in, Indicates The attention weights for time steps, represents the loss function of the trend prediction model, represents the partial derivative, Represents the hidden state of the long-term memory unit Find the gradient of the loss function, Represents adjusting the weight of the long-term memory unit in the memory mechanism;

[0059] Optimize trend prediction and construct the loss function of the trend prediction model by combining mean square error, time series smoothness constraint and attention weight regularization term. , the expression is:

[0060] ;

[0061] in, Represents the normalized term Represents the time step The predicted value of Represents the time step The true value of represents the hyperparameter that controls the weight of the smoothness constraint term in the loss function, Represents the time step The predicted value of represents the difference between the predicted values ​​at adjacent time steps, represents the hyperparameter that controls the weight of the attention weight regularization term, represents the attention weight regularization term.

[0062] As a preferred solution of the sleep state monitoring method based on the GM-GP algorithm of the present invention, wherein: the prediction result based on the hybrid memory enhancement network and the optimized sleep staging result detects the time proportion and amount of the user in different sleep stages in real time, and the specific steps are as follows:

[0063] Each time step generated The predicted value of Corresponds to a sleep stage label;

[0064] The sleep stage labels are segmented and analyzed using a sliding window mechanism. In each sliding window, the number of occurrences of different sleep stages is counted, and their time share in the entire window is calculated.

[0065] As the sliding window moves, the start time and end time of the current sleep stage are recorded for each time step, and the duration is calculated;

[0066] Setting a minimum duration threshold and filtering out valid sleep stage duration segments;

[0067] Long-term sleep data is used for trend analysis to calculate the proportion of sleep stage time of users over multiple nights and analyze its long-term change trend.

[0068] In a second aspect, the present invention provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: when the computer program is executed by the processor, any step of the sleep state monitoring method based on the GM-GP algorithm as described in the first aspect of the present invention is implemented.

[0069] In a third aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, any step of the sleep state monitoring method based on the GM-GP algorithm as described in the first aspect of the present invention is implemented.

[0070] The beneficial effects of the present invention are as follows: by combining the advantages of the GM model and the GP model, the present invention can accurately capture the dynamic changes of different stages during sleep and significantly improve the accuracy of sleep staging. In addition, the hybrid memory enhancement network is used to predict the trend of multimodal physiological signals, which ensures the real-time and continuity of sleep state monitoring and improves the stability and reliability of the overall monitoring. BRIEF DESCRIPTION OF THE DRAWINGS

[0071] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0072] Figure 1 This is a flow chart of the sleep state monitoring method based on the GM-GP algorithm in Example 1.

[0073] Figure 2 This is a flow chart for calculating the correlation dimension in Example 1. DETAILED DESCRIPTION

[0074] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings.

[0075] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0076] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.

[0077] Example 1, reference Figure 1 and Figure 2, which is the first embodiment of the present invention, and provides a sleep state monitoring method based on the GM-GP algorithm, comprising the following steps:

[0078] S1. Collect multimodal signals in real time through physiological signal acquisition equipment and perform preprocessing.

[0079] Furthermore, the physiological signal acquisition device collects and transmits multimodal signals (such as EEG, ECG, GSR, etc.) to the computing device in real time through a transmission (such as USB, Bluetooth or Wi-Fi) interface;

[0080] Specifically, physiological signal acquisition equipment includes electroencephalogram (EEG), electrocardiogram (ECG) and galvanic skin response (GSR).

[0081] It should be noted that to ensure the accuracy of signal acquisition, the acquisition equipment needs to be calibrated, and the electrodes should be placed according to standard positions (such as the 10-20 system of EEG) to ensure the reliability and consistency of the signal. The transmission delay during the acquisition process should be controlled at the millisecond level as much as possible to ensure the real-time nature of the data.

[0082] The computing device unifies the sampling rate by downsampling (e.g., downsampling ECG from 1000Hz to 256Hz) and upsampling (e.g., upsampling GSR from 10Hz to 256Hz), and synchronizes the signals with different sampling rates. This ensures that all modal signals have consistent time resolution on the same time axis, which is convenient for subsequent processing. Resampling uses linear interpolation or other interpolation methods to ensure smooth transition of the signal.

[0083] For the synchronized signal, a bandpass filter is used to remove high-frequency noise and low-frequency drift, and a notch filter is used to eliminate power frequency interference;

[0084] 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 processing EEG signals, it is very important to preserve the phase information of the signal.

[0085] The denoised signal was subjected to baseline drift correction through a high-pass filter and Z-score normalization;

[0086] It should be noted that the denoised signal refers to a signal that has been subjected to bandpass filtering and notch filtering.

[0087] The standardized multimodal signals are subjected to window processing (where each window is set to a certain length and overlapped) and integrated into a unified multimodal signal matrix;

[0088] Among them, the purpose of windowing is to divide the continuous time series signal into blocks of fixed length to facilitate subsequent feature extraction and analysis.

[0089] S2. Separate the EEG signal from the preprocessed multimodal signal, perform nonlinear feature extraction, and calculate its correlation dimension.

[0090] Furthermore, the multimodal signal matrix is ​​filtered using an FIR filter to remove non-EEG signal frequency components, retain the EEG signal frequency band (0.5 Hz-50 Hz), and output the EEG signal;

[0091] The delay time is selected based on the average mutual information method, the embedding dimension is determined by the pseudo nearest neighbor algorithm, and the one-dimensional EEG signal is embedded in the m-dimensional phase space.

[0092] Here, m represents the dimension in the phase space, which is usually determined by some algorithm (such as the pseudo nearest neighbor algorithm).

[0093] In the phase space, the Euclidean distance between the reconstructed vectors is calculated, and the correlation integral is generated through the correlation integral formula to describe the distance distribution of the point pairs in the reconstructed space;

[0094] The correlation dimension of EEG is estimated by linear fitting of the correlation integral and the distance threshold on a logarithmic scale, which is the main nonlinear feature of EEG.

[0095] S3. Input the correlation dimension of the EEG signal into the GM model for modeling to capture the dynamic change characteristics of different sleep stages.

[0096] Furthermore, the correlation dimension calculated from EEG signals is used to construct a time series to reflect the change of correlation dimension over time;

[0097] It should be noted that the correlation dimension can be calculated by methods such as the Grassberger-Procaccia algorithm. Its value usually reflects the chaos of the signal. The larger the value, the higher the signal complexity.

[0098] Performing the cumulative generation operation (AGO) on the correlation dimension time series, the cumulative generation sequence is obtained, which provides the basis for the subsequent grey model;

[0099] The purpose of cumulative generation is to reduce randomness so that the GM model applied subsequently can better fit the trend of the data.

[0100] Based on the cumulative generation sequence, the GM model is used to make a preliminary prediction of the cumulative generation sequence at future moments;

[0101] The cumulative generation sequence of the preliminary prediction is restored to the original correlation dimension prediction value through the inverse cumulative generation operation, and the preliminary correlation dimension prediction sequence is output;

[0102] It should be noted that the inverse accumulation generation operation ensures that the data recovered from the accumulation sequence still maintains the dimension and physical meaning of the original correlation dimension time series.

[0103] The feedforward neural network is used to correct the preliminary correlation dimension prediction sequence. The specific steps are as follows:

[0104] The initial correlation dimension prediction sequence is used as the input of the feedforward neural network, and the historical real correlation dimension sequence is used as the supervision signal to train the feedforward neural network;

[0105] The weights and biases of the feedforward neural network are gradually updated by minimizing the mean squared error, while using an optimizer (such as Adam) to speed up the convergence process;

[0106] The preliminary prediction values ​​of the GM model are input into the trained neural network, and the corrected correlation dimension prediction sequence is output.

[0107] Here, "trained neural network" refers to the network model that uses an optimizer (such as Adam) to iteratively update the network's weights and bias parameters through the training process, and finally makes the loss function (such as mean square error, MSE) converge or minimize.

[0108] Preferably, the introduction of the feedforward neural network enables the model to capture the nonlinear dynamic changes in the EEG signals, making up for the shortcomings of the GM model; wherein the input of the feedforward neural network is the preliminary prediction value of the GM model, and the output is a corrected correlation dimension prediction sequence, and this corrected correlation dimension prediction sequence better captures the nonlinear changes in the EEG signals.

[0109] By analyzing the modified correlation dimension prediction sequence and its change rate, the dynamic change characteristics of different sleep stages are captured. The specific implementation steps are as follows:

[0110] Firstly, the preliminary correlation dimension prediction sequence is corrected through a feedforward neural network, and the corrected correlation dimension time series is output, which can better capture the complex nonlinear changes in the EEG signals and serve as the input data for the next step.

[0111] Secondly, after obtaining the corrected correlation dimension time series, the correlation dimension values ​​at adjacent time points are differentially calculated to calculate the rate of change of the correlation dimension.

[0112] It should be noted that the rate of change indicates the speed of change of the time series at each moment, providing a basis for subsequent trend analysis and stage division.

[0113] Considering the adverse effects of noise in EEG signals on the calculation of the rate of change, it is necessary to smooth the rate of change sequence; specifically, through the denoising algorithm, the main trend of the rate of change can be retained and small random fluctuations can be filtered out, thereby obtaining a more representative rate of change sequence.

[0114] Feature extraction is performed on the smoothed rate of change sequence. By analyzing the overall trend and fluctuation of the rate of change, key statistical features that can reflect the changes in sleep stages are extracted. These features will be used to identify different EEG signal states, such as the average level of the rate of change, the amplitude of fluctuation, etc.

[0115] According to the extracted statistical characteristics of the rate of change, the dynamic changes of the EEG signal are divided into stages. Combined with the characteristic performance of different sleep stages, the modified correlation dimension sequence is divided into various sleep stages, such as light sleep, deep sleep and rapid eye movement, through a classification method based on rules or machine learning.

[0116] S4. Input the changing characteristics of different sleep stages into the GP model for classification, and optimize the accuracy of sleep staging by combining the correlation dimension of EEG signals.

[0117] Furthermore, key features are extracted from the correlation dimension prediction sequence generated by the GM model;

[0118] The key features include: the instantaneous rate of change of the correlation dimension; the local maximum and minimum values ​​in the time series of the correlation dimension; the mean and variance of the correlation dimension in different time windows; the autocorrelation characteristics of the time series of the correlation dimension;

[0119] Integrate the extracted key features into a feature matrix , the expression is:

[0120] ;

[0121] ;

[0122] in, Represents different characteristics, is the total number of features, An index variable representing a feature;

[0123] The feature matrix X is used as the input of the GP (Gaussian process) model, and the labels are set to different sleep stages (e.g., awake, REM, NREM1, NREM2, and NREM3, etc.) as the target output to construct a training dataset;

[0124] Furthermore, in order to improve the classification ability, it is preferred to introduce the nonlinear characteristics (correlation dimension) of the EEG signal so that the training data set contains richer dynamic change information, which will significantly improve the GP model's ability to distinguish different sleep stages. At the same time, the robustness of the classification is further enhanced by combining multimodal signals (such as ECG and respiratory signals). This feature construction method is different from the traditional linear feature extraction method and can better capture the complex nonlinear dynamic characteristics in the EEG signal.

[0125] Divide the dataset into training and testing sets;

[0126] In the GP model, the RBF kernel function (radial basis function) is selected as the covariance function;

[0127] Preferably, the RBF kernel can well capture the nonlinear relationship between the correlation dimension features and the sleep stages.

[0128] Using the training dataset, the hyperparameters in the GP model (such as the length scale l of the kernel function and the noise term) are optimized through maximum likelihood estimation (MLE).

[0129] After training is completed, the GP model is used to predict the test data set to obtain the output distribution of each input sample;

[0130] Since the GP model has Bayesian properties, it can not only give predicted values ​​but also uncertainty estimates.

[0131] For each test sample, calculate the posterior probability that it belongs to each category, and select the category with the largest posterior probability as the final classification result;

[0132] It should be noted that selecting the category with the maximum posterior probability as the final classification result specifically means that:

[0133] For each test sample , use the trained GP model for prediction;

[0134] The output of the GP model for each sample is a posterior probability distribution, that is, the model calculates the probability that the sample belongs to each possible category (for example, awake, REM, NREM1, NREM2, NREM3, etc.).

[0135] Assume that categories (i.e. different sleep stages), the model will output a length of The posterior probability vector of is expressed as:

[0136] ;

[0137] in, Representation sample Belongs to category The probability of represents the index of the category, Indicates the total number of categories;

[0138] In the obtained posterior probability vector, find the probability with the largest value, that is, the category that the model believes the sample is most likely to belong to.

[0139] The specific operation is to select the category with the largest posterior probability The expression is:

[0140] ;

[0141] in, Represents the search for the posterior probability ;

[0142] The category with the largest posterior probability found in step As the final predicted category of the test sample, that is, the final classification result.

[0143] The correlation dimension of the EEG signal is taken as an independent input feature and added to the feature matrix middle;

[0144] Based on the new feature matrix, the GP model is retrained to optimize the classification ability of the model.

[0145] S5. Introduce a hybrid memory-enhanced network to predict the trend of time series of EEG signals and multimodal signals.

[0146] Furthermore, the collected EEG signals and multimodal signals are preprocessed to form a time series tensor , the expression is:

[0147] ;

[0148] in, represents the length of the time series, represents the feature dimension, represents the set of real numbers;

[0149] The input tensor Through the bidirectional temporal convolutional network, the local pattern of the time series is captured, and the forward and backward dependencies of the time series are processed through bidirectional convolution to output the convolution features. The expression is:

[0150] ;

[0151] in, is the time step The convolutional features of is the forward convolution kernel, is the backward convolution kernel, is the bias term, is the window size of the convolution kernel, represents the index of the convolution kernel, Represents a time series tensor In time step The characteristic vector of Represents a time series tensor In time step The eigenvector of

[0152] Use short-term memory units and combine them with a time gating mechanism to process convolutional features , output short-term memory state ;

[0153] In short-term memory Introduce long-term memory units on the memory layer to generate long-term memory states ;

[0154] Introducing a recursive attention mechanism to adaptively weight the importance of a specific time step in the time series and output the weighted output state;

[0155] Based on the weighted output state, the trend prediction model is constructed by combining the output of short-term memory, long-term memory and recursive attention to generate the time step The predicted value of , the expression is:

[0156] ;

[0157] in, Indicates The attention weights for time steps, represents the loss function of the trend prediction model, represents the partial derivative, Represents the hidden state of the long-term memory unit Find the gradient of the loss function, Represents adjusting the weight of the long-term memory unit in the memory mechanism;

[0158] It should be noted that It can be regarded as a trainable weight matrix, which is specifically used to weight the gradient information of the long-term memory state based on the loss function during the update process of the long-term memory state. Its generation process can be divided into the following steps:

[0159] During the model initialization phase, It can be generated by:

[0160] Random initialization: Usually a random distribution (such as Xavier initialization or He initialization) is used to initialize Initialization is performed to ensure the stability of model training.

[0161] During the training process, will be updated through back propagation. Specifically, the model uses the following process to Adjusting long-term memory state:

[0162] For each time step , in the long-term memory state After that, the model will be based on the loss function Compute the gradient for this time step.

[0163] Then, the gradient Will A weighted combination is performed to generate an adjusted output.

[0164] In each round of training, It is updated together with other model parameters through the back-propagation algorithm. Specifically, the loss function is based on the error term Compute the gradient of the entire model and propagate the update to all parameters, including .

[0165] During the test phase, the model no longer performs backpropagation, so the gradient of the loss function is not calculated. However, during the prediction process, An optimized weight has been obtained through training, which will be directly used to adjust the final output of the long-term memory state.

[0166] In the trend prediction formula, although the gradient is no longer calculated in the test phase, it can be regarded as a weighted matrix for post-adjustment of the output of long-term memory to improve the prediction performance of the model.

[0167] Optimize trend prediction and construct the loss function of the trend prediction model by combining mean square error (MSE), time series smoothness constraint and attention weight regularization term , the expression is:

[0168] in, represents the normalization term, which is used to average the error. Represents the time step The predicted value of Represents the time step The true value of represents the hyperparameter that controls the weight of the smoothness constraint term in the loss function, Represents the time step The predicted value of It represents the difference between the predicted values ​​of adjacent time steps and is used to measure the smoothness of the time series. If the difference between the predicted values ​​of adjacent time steps is too large, the time series may not be smooth enough. represents the hyperparameter that controls the weight of the attention weight regularization term, represents the attention weight regularization term.

[0169] It should be noted that the 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, where the attention weight It is calculated based on the input tensor and memory state. The specific steps are as follows:

[0170] Recursive attention mechanisms usually combine input features and hidden states to calculate attention weights.

[0171] Assume that at the current time step , and we already have: input features (output from short-term memory unit); long-term memory state .

[0172] Define an attention score function to measure the importance of each time step. This score function is usually expressed as a linear combination or nonlinear transformation of the input features and memory state.

[0173] Through the attention score function, the recursive attention mechanism calculates the attention weight of each time step At the same time, in order to ensure that the attention weight forms a probability distribution at each time step, it needs to be normalized by the softmax function;

[0174] Attention weights at all time steps after normalization Satisfy the normalization condition;

[0175] Calculated attention weights For short-term memory and long-term memory states Weighted, generating the output of the recursive attention mechanism

[0176] 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. This regularization term affects the attention weights of each time step. A square penalty is applied to ensure a more even distribution of attention.

[0177] S7. Based on the prediction results of the hybrid memory-augmented network and the optimized sleep staging results, the proportion and amount of time the user spends in different sleep stages are detected in real time.

[0178] Furthermore, each time step generated The predicted value of Corresponds to a sleep stage label ;

[0179] in, Indicates 5 different sleep stages.

[0180] For sleep stage labels, a sliding window mechanism is used for segmented processing and analysis to ensure real-time monitoring of the user's sleep status at different time periods;

[0181] At the same time, in each sliding window, the number of occurrences of different sleep stages (such as N1, N2, N3, REM, WAKE) is counted, and their proportion of time in the entire window is calculated;

[0182] As the sliding window moves, for each time step, the start time and end time of the current sleep stage are recorded, and the duration is calculated;

[0183] Setting a minimum duration threshold (e.g., the minimum duration of deep sleep stage N3 can be set to 20 minutes) and filtering out valid sleep stage duration segments;

[0184] It should be noted that when setting the "minimum duration threshold", the main purpose is to filter out short, invalid sleep stage switches and ensure that only meaningful, continuous sleep stages are analyzed. This setting needs to be based on existing sleep research and physiological laws to ensure that the detected sleep stages are consistent with the actual sleep cycle characteristics. The following are specific considerations and steps for setting the minimum duration threshold:

[0185] First, we can set thresholds based on physiological laws. Different sleep stages (such as N1, N2, N3, REM, and WAKE) have different durations in a normal sleep cycle. We can set thresholds based on the typical durations of these stages:

[0186] N1 (light sleep): The N1 stage is usually short, with a duration of about 1-7 minutes. Therefore, the minimum duration threshold can be set to 1-2 minutes to prevent short transition periods from being mistakenly identified as valid light sleep stages.

[0187] N2 (medium sleep): The N2 stage lasts longer, usually between 10-25 minutes. Therefore, the minimum duration threshold can be set to 5-10 minutes to avoid mistaking momentary N2 switches for full sleep segments.

[0188] N3 (Deep Sleep): The deep sleep stage is very important and usually lasts longer. To ensure that true deep sleep is detected, the minimum duration threshold is usually set at 20 minutes. If this stage lasts too short, the user may not have truly entered deep sleep.

[0189] REM (Rapid Eye Movement) sleep: REM stages usually fluctuate between 10-60 minutes, and become longer, especially in the second half of the night. Therefore, the minimum duration threshold can be set at 10 minutes to avoid mistaking brief awakenings or light activity for REM sleep.

[0190] WAKE: The WAKE stage is usually a short period of awakening, especially micro-awakening at night. The minimum duration threshold can be set to 1 to 2 minutes to filter out occasional, very short awake states.

[0191] Secondly, it can be adjusted based on personalization. Although physiological laws provide a general threshold range, each user's sleep habits and health conditions may be different. In order to improve the accuracy of detection, personalization can be adjusted based on the user's long-term sleep data:

[0192] Dynamically adjust thresholds: By analyzing the user's sleep data over multiple nights, the average duration of each sleep stage can be calculated, and the minimum duration threshold can be dynamically adjusted based on the result. For example, if a user's average duration of stage N3 is short, the minimum threshold can be appropriately lowered.

[0193] In actual operation, the steps for setting the minimum duration threshold can be as follows: Initialize the threshold: Initialize the threshold by referring to the standard values ​​in sleep studies, such as 1-2 minutes (N1), 5-10 minutes (N2), 20 minutes (N3), 10 minutes (REM), and 1-2 minutes (WAKE) mentioned above; Real-time detection: Monitor the start and end time of each sleep stage within the sliding window. When it is detected that the duration of a sleep stage is lower than the set threshold, the stage will be marked as an "invalid stage" and will not be included in the final statistical results; Threshold adjustment: Over time, these minimum duration thresholds can be automatically adjusted based on the user's long-term sleep pattern. For example, if the user's deep sleep duration is always short for a period of time, the threshold of the N3 stage can be appropriately lowered.

[0194] It should be noted that the minimum duration threshold should not be set too high, otherwise some valid sleep stages may be missed. For example, if the threshold for stage N3 is set to 30 minutes, some shorter but still meaningful deep sleep segments may be missed. Therefore, the threshold setting should try to balance accuracy and sensitivity.

[0195] In order to further improve the accuracy of setting the threshold, other physiological signals (such as heart rate, breathing rate, electromyography, etc.) can be combined to assist in determining whether a certain stage is a valid sleep stage. For example, when the EEG signal shows that the user is in stage N3, but the heart rate and breathing rate show that the user is still in a high activity state, this stage can be considered as invalid deep sleep.

[0196] It should also be noted that sleep stages are: different sleep stages (N1, N2, N3, REM) usually have their own typical durations. For example, stage N3 (deep sleep) usually lasts longer, while stage N1 (light sleep) is usually shorter.

[0197] Valid duration means that the duration of each sleep stage must exceed a preset minimum duration threshold to be considered valid. This threshold is to avoid mistaking short, instantaneous sleep stage switches (such as quickly switching from light sleep to deep sleep and then switching back to light sleep) for complete sleep stages.

[0198] Invalid sleep stages mean that if a sleep stage lasts for less than the set threshold, it will be considered invalid, and may just be a transition or short-term fluctuation between sleep stages, without sufficient physiological significance. These invalid stages will not be counted in the statistics and will not be used in the calculation of time proportion.

[0199] Long-term sleep data is used for trend analysis to calculate the proportion of sleep stage time of users over multiple nights and analyze its long-term change trend.

[0200] This embodiment also provides a computer device, which is suitable for the sleep state monitoring method based on the GM-GP algorithm, including: a memory and a processor; the memory is used to store computer executable instructions, and the processor is used to execute computer executable instructions to implement the sleep state monitoring method based on the GM-GP algorithm proposed in the above embodiment.

[0201] The computer device may be a terminal, and the computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used 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 the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covered on the display screen, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.

[0202] This embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, the sleep state monitoring method based on the GM-GP algorithm proposed in the above embodiment is implemented; the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read Only Memory, referred to as EPROM), programmable read-only memory (Programmable Red-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic storage, flash memory, magnetic disk or optical disk.

[0203] In summary, by combining the advantages of the GM model and the GP model, the present invention can accurately capture the dynamic changes of different stages of sleep and significantly improve the accuracy of sleep staging. In addition, the hybrid memory-enhanced network is used to predict the trend of multimodal physiological signals, which ensures the real-time and continuity of sleep state monitoring and improves the stability and reliability of the overall monitoring.

[0204] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A sleep state monitoring method based on GM-GP algorithm, characterized in that: include, Collect multimodal signals in real time through physiological signal acquisition equipment and perform preprocessing; Separate the EEG signal from the preprocessed multimodal signal, perform nonlinear feature extraction, and calculate its correlation dimension; The correlation dimension of the EEG signal is input into the GM model for modeling to capture the dynamic change characteristics of different sleep stages; The changing characteristics of different sleep stages are input into the GP model for classification, and the correlation dimension of EEG signals is combined to optimize the accuracy of sleep staging; A hybrid memory-enhanced network is introduced to predict the trend of the time series of EEG signals and multimodal signals. The specific steps are as follows: After preprocessing, the collected EEG signals and multimodal signals are formed into a time series tensor ; The input tensor Through the bidirectional temporal convolutional network, the local pattern of the time series is captured, and the forward and backward dependencies of the time series are processed through bidirectional convolution to output convolution features; Use short-term memory units and combine them with a time gating mechanism to process convolutional features , output short-term memory state ; In short-term memory Introduce long-term memory units on the memory layer to generate long-term memory states ; Introducing a recursive attention mechanism to adaptively weight the importance of a specific time step in the time series and output the weighted output state; Based on the weighted output state, the trend prediction model is constructed by combining the output of short-term memory, long-term memory and recursive attention to generate the time step The predicted value of ; Optimize trend prediction and construct the loss function of the trend prediction model by combining mean square error, time series smoothness constraint and attention weight regularization term. ; Based on the prediction results of the hybrid memory-augmented network and the optimized sleep staging results, the proportion and amount of time the user spends in different sleep stages are detected in real time; The correlation dimension of the EEG signal is input into the GM model for modeling to capture the dynamic change characteristics of different sleep stages. The specific steps are: The time series is constructed using the correlation dimension calculated from the EEG signal; Performing cumulative generation operation on the correlation dimension time series to obtain a cumulative generation sequence; Based on the cumulative generation sequence, the GM model is used to make a preliminary prediction of the cumulative generation sequence at future moments; The cumulative generation sequence of the preliminary prediction is restored to the original correlation dimension prediction value through the inverse cumulative generation operation, and the preliminary correlation dimension prediction sequence is output; Feedforward neural network is used to modify the preliminary correlation dimension prediction sequence; By analyzing the modified correlation dimension prediction sequence and its changing rate, the dynamic change characteristics of different sleep stages are captured.

2. The sleep state monitoring method based on the GM-GP algorithm according to claim 1, characterized in that: The multimodal signals are collected in real time by the physiological signal collection device and preprocessed. The specific steps are: The physiological signal acquisition device acquires and transmits multimodal signals to the computing device in real time through the transmission interface; The computing device synchronizes signals of different sampling rates by downsampling and upsampling; For the synchronized signal, a bandpass filter is used to remove high-frequency noise and low-frequency drift, and a notch filter is used to eliminate power frequency interference; The denoised signal was subjected to baseline drift correction through a high-pass filter and Z-score normalization; The standardized multimodal signals are windowed and integrated into a unified multimodal signal matrix.

3. The sleep state monitoring method based on the GM-GP algorithm as claimed in claim 2, characterized in that: The EEG signal is separated from the pre-processed multimodal signal, and nonlinear feature extraction is performed to calculate its correlation dimension. The specific steps are: Use FIR filter to filter the multimodal signal matrix, retain the EEG signal frequency band, and output the EEG signal; The delay time is selected based on the average mutual information method, and the embedding dimension is determined by the pseudo nearest neighbor algorithm to embed the one-dimensional EEG signal into the m-dimensional phase space. In the phase space, the Euclidean distance between the reconstructed vectors is calculated, and the correlation integral is generated through the correlation integral formula; The correlation dimension of the EEG signal was estimated by linear fitting the correlation integral and the distance threshold on a logarithmic scale.

4. The sleep state monitoring method based on the GM-GP algorithm as claimed in claim 3, characterized in that: The feedforward neural network is used to correct the preliminary correlation dimension prediction sequence. The specific steps are: The initial correlation dimension prediction sequence is used as the input of the feedforward neural network, and the historical real correlation dimension sequence is used as the supervision signal to train the feedforward neural network; The weights and biases of the feedforward neural network are gradually updated by minimizing the mean squared error, while using an optimizer to speed up the convergence process; The preliminary prediction values ​​of the GM model are input into the trained neural network, and the corrected correlation dimension prediction sequence is output.

5. The sleep state monitoring method based on the GM-GP algorithm according to claim 4, characterized in that: The changing characteristics of different sleep stages are input into the GP model for classification, and the accuracy of sleep staging is optimized in combination with the correlation dimension of the EEG signal. The specific steps are: Extract key features from the correlation dimension prediction sequence generated by the GM model; Integrate the extracted key features into a feature matrix ; The feature matrix X is used as the input of the GP model, the labels are set to different sleep stages, and the training dataset is constructed as the target output; Divide the dataset into training and testing sets; In the GP model, the RBF kernel function is selected as the covariance function; Using the training data set, optimize the hyperparameters in the GP model through maximum likelihood estimation; After training is completed, the GP model is used to predict the test data set to obtain the output distribution of each input sample; For each test sample, calculate the posterior probability that it belongs to each category, and select the category with the largest posterior probability as the final classification result; The correlation dimension of the EEG signal is used as the input feature and added to the feature matrix X; Based on the new feature matrix X, retrain the GP model to optimize the classification ability of the model.

6. The sleep state monitoring method based on the GM-GP algorithm according to claim 5, characterized in that: The time series tensor , the expression is: ; in, represents the length of the time series, represents the feature dimension, represents the set of real numbers; The convolution feature is expressed as: ; in, is the time step The convolutional features of is the forward convolution kernel, is the backward convolution kernel, is the bias term, is the window size of the convolution kernel, represents the index of the convolution kernel, Represents a time series tensor In time step The characteristic vector of Represents a time series tensor In time step The eigenvector of The time step The predicted value of , the expression is: ; in, Indicates The attention weights for time steps, represents the loss function of the trend prediction model, represents the partial derivative, Represents the hidden state of the long-term memory unit Find the gradient of the loss function, Represents adjusting the weight of the long-term memory unit in the memory mechanism; The loss function of the trend prediction model is , the expression is: ; in, Represents the normalized term Represents the time step The predicted value of Represents the time step The true value of represents the hyperparameter that controls the weight of the smoothness constraint term in the loss function, Represents the time step The predicted value of represents the difference between the predicted values ​​at adjacent time steps, represents the hyperparameter that controls the weight of the attention weight regularization term, represents the attention weight regularization term.

7. The sleep state monitoring method based on the GM-GP algorithm according to claim 6, characterized in that: The prediction results based on the hybrid memory-enhanced network and the optimized sleep staging results are used to detect the time proportion and amount of the user in different sleep stages in real time. The specific steps are as follows: Each time step generated The predicted value of Corresponds to a sleep stage label; The sleep stage labels are segmented and analyzed using a sliding window mechanism. In each sliding window, the number of occurrences of different sleep stages is counted, and their time share in the entire window is calculated. As the sliding window moves, the start time and end time of the current sleep stage are recorded for each time step, and the duration is calculated; Setting a minimum duration threshold and filtering out valid sleep stage duration segments; Long-term sleep data is used for trend analysis to calculate the proportion of sleep stage time of users over multiple nights and analyze its long-term change trend.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the sleep state monitoring method based on the GM-GP algorithm described in any one of claims 1 to 7 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the sleep state monitoring method based on the GM-GP algorithm described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Sleep state monitoring method based on GM-GP algorithm

    CN106682406A

  • Multi-modal sleep stage prediction method based on deep learning

    CN116269212A