Self-attention sleep system and method based on polymorphic sleep data fusion

Through the self-attention sleep system fusion with polymorphic sleep data, the problem that traditional technology cannot accurately identify the sleep stage, achieving accurate identification of the sleep stage and accurate evaluation of the sleep quality.

CN119792762AActive Publication Date: 2025-04-11SICHUAN TOURISM UNIV

Patent Information

Application Number
CN202411861848.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-04-11
Estimated Expiration
2044-12-17

AI Technical Summary

Technical Problem

Traditional techniques cannot accurately identify and classify different sleep stages when identifying sleep stages, resulting in inaccurate evaluation results.

Method used

The self-attention sleep system with polymorphic sleep data fusion is adopted to realize accurate sleep staging and quality evaluation of EEG and EOG signals through modules such as data acquisition, signal preprocessing, frequency division multiplexing, feature extraction, model training and sleep staging.

Benefits of technology

The system can more accurately identify and classify different sleep stages, provide more accurate feedback on sleep quality, and help users improve sleep quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119792762A_ABST
    Figure CN119792762A_ABST
Patent Text Reader

Abstract

The invention discloses a polymorphic sleep data fusion self-attention sleep system and method. The system comprises a data acquisition module which is responsible for acquiring environmental data and physiological data of a user; the signal preprocessing module is used for performing segmentation, normalization and de-noising processing on the collected EEG and EOG signals; the frequency division multiplexing module is used for decomposing the preprocessed signal frame into a plurality of narrowband signals by using a frequency division multiplexing technology; the feature extraction module is used for extracting features from the decomposed narrowband signals; the model training module is used for training a model by utilizing the feature set; the sleep staging module is used for performing real-time or offline sleep staging through the trained model; the sleep quality evaluation module is used for calculating a sleep quality index based on a sleep staging result; the correlation analysis module is used for performing correlation analysis on the relationship between different sleep stages and the sleep quality indexes to generate a quality evaluation model; and the early warning system module is used for setting an early warning threshold value according to the sleep quality evaluation result and the quality evaluation model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of plateau sleep, and in particular to a self-attention sleep system and method for polymorphic sleep data fusion. Background Art

[0002] Sleep is a basic activity necessary for organisms and has an important impact on health and quality of life. Good sleep helps restore physical strength, consolidate memory, regulate emotions, etc. In modern society, people's attention to sleep quality is increasing, and the demand for personalized and precise sleep solutions is surging.

[0003] Traditional technologies often use rough methods when identifying sleep stages, such as simple threshold judgment or template matching. These methods cannot accurately identify and classify different sleep stages, resulting in inaccurate evaluation results. Therefore, a self-attention sleep system and method for polymorphic sleep data fusion is proposed. Summary of the invention

[0004] The purpose of the present invention is to solve the problem in the prior art that traditional technical solutions cannot accurately identify and classify different sleep stages when identifying sleep stages, resulting in inaccurate evaluation results, and to propose a self-attention sleep system and method for polymorphic sleep data fusion.

[0005] In order to achieve the above object, the present invention adopts the following technical solutions:

[0006] Self-attention sleep system with polymorphic sleep data fusion, including:

[0007] Data acquisition module: responsible for collecting environmental data and user's physiological data, the physiological data includes EEG (electroencephalogram) and EOG (electrooculogram) signals, and the EEG (electroencephalogram) and EOG (electrooculogram) signals are transmitted to the signal preprocessing module.

[0008] Signal preprocessing module: The collected EEG and EOG signals are segmented, normalized and denoised, and the preprocessed signals are passed to the frequency division multiplexing (FDM) module.

[0009] Frequency Division Multiplexing (FDM) module: The preprocessed signal frame is decomposed into multiple narrowband signals using frequency division multiplexing (FDM) technology. The narrowband signals contain different frequency components in the original signal. The decomposed narrowband signals are passed to the feature extraction module.

[0010] Feature extraction module: extracts features from the decomposed narrowband signal, such as non-stationary measure (MNS), energy and Hjorth parameter, etc. The features constitute a feature set and are passed to the model training module and the sleep staging module.

[0011] Model training module: The model is trained using the feature set. The trained model is used in the sleep staging module to perform sleep staging on the input EEG and EOG signals.

[0012] Sleep staging module: performs real-time or offline sleep staging on the input EEG and EOG signals through a trained model, and outputs the results of the sleep stages, which reflect the sleep status in different time periods. The results are passed to the sleep quality evaluation module for calculating the sleep quality index.

[0013] Sleep quality evaluation module: Based on the results of sleep staging, sleep quality indicators such as sleep efficiency, number of awakenings and REM sleep ratio are calculated. The sleep quality indicators are used in the early warning system module to set the early warning threshold and trigger the early warning mechanism.

[0014] Correlation analysis module: Conduct correlation analysis on the relationship between different sleep stages and sleep quality indicators, determine the association between different physiological parameters, and generate a quality evaluation model based on the analysis results and sleep quality monitoring data.

[0015] Early warning system module: Set the early warning threshold according to the sleep quality evaluation results and the quality evaluation model, and trigger the early warning mechanism when the sleep quality is lower than the threshold.

[0016] The above technical solution further includes:

[0017] Further, the frequency division multiplexing (FDM) module uses frequency division multiplexing (FDM) technology to decompose the preprocessed signal frame into multiple narrowband signals, specifically in the following steps:

[0018] Determine frequency band division: The core of FDM technology is to divide the signal in the frequency domain, that is, to divide the entire frequency band into multiple narrow bands, determine the frequency range of each narrow band, and the interval between the narrow bands. The division of the narrow band is determined according to the spectral characteristics of the signal and application requirements.

[0019] Use filter banks to perform frequency band decomposition: After determining the frequency band division, use filter banks to perform frequency band decomposition on the preprocessed signal frame. The filter bank contains multiple filters, each of which corresponds to a narrow band and has a frequency response that matches the narrow band. The formula for frequency band decomposition can be expressed as

[0020] X FB,i,k (f) = H k (f)·X i (f)

[0021] Among them, X i (f) represents the spectrum of the i-th signal frame, H k(f) represents the frequency response of the kth filter, X FB,i,k (f) represents the spectrum of the narrowband signal obtained after the i-th signal frame passes through the k-th filter.

[0022] Extracting narrowband signals: After being processed by the filter bank, each signal frame is decomposed into multiple narrowband signals, which are extracted by performing an inverse Fourier transform (IFFT) on the filtered spectrum. The formula for extracting narrowband signals can be expressed as:

[0023] x FB,i,k (t) = IFFT{X FB,i,k (f)}

[0024] Among them, X FB,i,k (f) represents the spectrum of the narrowband signal obtained after the i-th signal frame passes through the k-th filter, x FB,i,k (t) represents the representation of the corresponding narrowband signal in the time domain.

[0025] Furthermore, the sleep staging module performs real-time or offline sleep staging on the input EEG and EOG signals through the trained model, specifically in the following steps:

[0026] Sleep segmentation: accept a multivariate sequence of sleep stages S = (s1, s2, ..., s L ) data, output a predicted label sequence, any sleep stage is defined as Where n is the number of samples in a sleep stage, C is the number of channels in the sleep stage, and each stage corresponds to a label in Σ = {W, N1, N2, N3, REM}, where W represents wakefulness, REM represents rapid eye movement, N1 represents non-rapid eye movement 1, N2 represents non-rapid eye movement 2, and N3 represents non-rapid eye movement 3. The corresponding relationship is f θ :x→y, θ represents the network including all parameters, then the label sequence is P = (f θ (s1),f θ (s2),…,f θ (s L )).

[0027] Physiological parameter collection: Collect physiological parameters related to sleep, including EEG, EOG, EMG, respiration, blood oxygen, body temperature, etc.

[0028] Environmental factors record: record the relevant factors of the sleeping environment, such as temperature, humidity, air pressure, radiation, pollutants and daytime, etc.

[0029] Data preprocessing: Preprocess the collected physiological parameters and environmental factors data, including multi-scale analysis, multi-modal fusion, etc.

[0030] Feature extraction and enhancement: Extract features that have an important impact on sleep behavior, and process them through multi-scale convolution kernels and feature enhancement to improve the expressiveness of the features.

[0031] Multi-head self-attention layer processing: The extracted features are processed and analyzed using a multi-head self-attention mechanism to capture the dependencies between features.

[0032] Segment classifier judgment: Use the segment classifier to classify the processed features and determine the category to which each sleep stage belongs.

[0033] Loss function evaluation: Calculate the loss function value between the classification result and the true label to evaluate the performance of the model.

[0034] Furthermore, based on the result of sleep staging, the sleep quality evaluation module calculates the sleep quality index, specifically in the following steps:

[0035] Segmentation label word embedding representation: Use word embedding representation to convert segmentation labels into vector representations. Segmentation labels are identifiers for segmenting the sleep process (such as non-rapid eye movement, rapid eye movement, etc.). Word embedding representation is a technique for converting discrete labels into continuous vector space for processing in machine learning models. Through word embedding representation, segmentation labels can be converted into vectors with semantic information, thereby better capturing the characteristics of the sleep process.

[0036] Multi-head self-attention weighted sequence mode: Use multi-head self-attention mechanism to extract important features in sleep behavior sequences and assign weights to these features.

[0037] Multi-head attention fusion: The outputs of multiple heads are fused, and the final fusion result is obtained by splicing or averaging the outputs of multiple heads.

[0038] Rating classifier: The fusion result is used as the input of the rating classifier to predict the sleep quality level. The sleep quality level (such as good, medium, poor, etc.) is predicted based on the input features (such as sleep efficiency, number of awakenings, REM sleep ratio, etc.).

[0039] Loss Function Evaluation: Use the loss function and backpropagation to train the rating classifier to accurately predict the sleep quality rating.

[0040] Furthermore, the multi-head self-attention weighting of the sequence pattern comprises the following specific steps:

[0041] Computes a matrix representation of the query Q, key K, and value V.

[0042] The relevance score between each query and all keys is calculated using the dot-product attention mechanism.

[0043] The relevance scores are softmax normalized to obtain the attention weight for each query.

[0044] The values ​​are weighted summed using the attention weights to get the weighted output.

[0045] Furthermore, the correlation analysis module performs a correlation analysis on the relationship between different sleep stages and sleep quality indicators, specifically in the following steps:

[0046] Collect data: Collect data on different sleep stages and physiological parameters.

[0047] Data cleaning: Clean the collected data to remove outliers, missing values ​​or duplicate data.

[0048] Calculation of correlation coefficients: Pearson's correlation coefficient was used to calculate the correlation coefficients between different physiological parameters.

[0049] The calculation formula is

[0050]

[0051] Among them, x i and i They represent the values ​​of the two variables at the i-th observation value, and represent the means of the two variables.

[0052] Interpretation of correlation coefficients: Interpret the degree of association between different physiological parameters based on the range of correlation coefficients (usually between -1 and 1). Values ​​close to 1 or -1 indicate strong correlation, while values ​​close to 0 indicate weak correlation or no correlation.

[0053] Draw a scatter plot: Use a scatter plot to visualize the relationship between different physiological parameters. The points in the scatter plot represent the observed values, and the distribution of the points can intuitively reflect the correlation between the variables.

[0054] Draw a heat map: For multiple physiological parameters, use a heat map to display the correlation coefficient matrix between the physiological parameters. The color depth in the heat map indicates the strength of the correlation coefficient.

[0055] Feature selection: Based on the results of correlation analysis, physiological parameters that have a significant impact on sleep quality are selected as features for model training.

[0056] Model training: Use the selected features to train the sleep quality assessment model.

[0057] Model evaluation: Evaluate the performance of the model through cross-validation or test set, and tune the model based on the evaluation results.

[0058] Furthermore, the early warning system module sets an early warning threshold according to the sleep quality evaluation result and the quality rating model, and the specific steps are:

[0059] Determine early warning indicators: Determine the physiological parameters or sleep quality indicators that serve as the basis for early warning. These indicators should be able to accurately reflect the user's sleep quality and have a certain degree of sensitivity and specificity. For example, specific frequency components in electroencephalogram (EEG), amplitude changes in electro-oculogram (EOG), variability in heart rate (HR), stability of respiratory rate (RR), and sleep efficiency can be selected as early warning indicators.

[0060] Collect historical data: Collect a large amount of historical data, including sleep quality monitoring data and corresponding physiological parameter values ​​of different users. These data will be used to analyze the relationship between various indicators and sleep quality and determine reasonable warning thresholds.

[0061] Data preprocessing and feature extraction: Preprocess historical data, including data cleaning, missing value processing, outlier detection, etc., to ensure the accuracy and reliability of the data. Then, extract features from the preprocessed data, which will be used for subsequent analysis and modeling.

[0062] Correlation analysis and causal inference: accept the quality evaluation model generated by the correlation analysis and causal inference of the relationship between different sleep stages and sleep quality indicators based on the correlation analysis module.

[0063] Determine the warning threshold: Based on the sleep quality evaluation results and the quality evaluation model, determine the warning threshold. The calculation formula of the warning threshold is:

[0064] T=μ+kσ

[0065] Among them, T represents the warning threshold, μ represents the mean of the corresponding indicator in the historical data, σ represents the standard deviation, and k represents the coefficient set according to the quality evaluation model.

[0066] Verification and optimization: Through cross-validation, simulation experiments and other methods, the set warning thresholds are verified and optimized to ensure that the warning system can have a low false alarm rate and missed alarm rate while ensuring accuracy.

[0067] A method for a self-attention sleep system with polymorphic sleep data fusion, comprising the following steps:

[0068] Data collection: Collect environmental data and the user's physiological data, including EEG (electroencephalogram) and EOG (electrooculogram) signals.

[0069] Signal preprocessing: The collected EEG and EOG signals are divided into non-overlapping frames, the non-overlapping frames are normalized to eliminate the dimensional differences between different signals, and denoising is performed to ensure the accuracy and reliability of the signals.

[0070] Frequency Division Multiplexing (FDM): The pre-processed signal frame is decomposed into multiple narrowband signals using frequency division multiplexing (FDM) technology.

[0071] Feature extraction: Extract features from the decomposed narrowband signal, such as measure of nonstationarity (MNS), energy, and Hjorth parameter, which can reflect the dynamic and statistical characteristics of the signal.

[0072] Model training: The extracted feature sets are used to train different machine learning models. Different machine learning models identify and classify different sleep stages, such as wakefulness, non-rapid eye movement (NREM), and rapid eye movement (REM).

[0073] Sleep staging: Use different machine learning models to perform real-time or offline sleep staging on the collected environmental data and the user's physiological data to monitor the user's sleep stages.

[0074] Sleep quality evaluation: Based on the results of sleep staging, sleep quality indicators such as sleep efficiency, number of awakenings and REM sleep ratio are calculated.

[0075] Correlation analysis: Conduct causal analysis on the relationship between different sleep stages and sleep quality indicators, explore the association between different physiological parameters, identify factors that affect sleep quality, including physiological factors (EEG, EOG, etc.) and environmental factors (temperature, humidity, etc.), classify the identified influencing factors to better understand their impact, and generate a quality evaluation model based on the classification results and sleep quality monitoring data to evaluate the user's sleep quality.

[0076] Early warning system: Set an early warning threshold based on the sleep quality evaluation results and the quality evaluation model. When the sleep quality is lower than the threshold, the early warning mechanism is triggered to remind the user or doctor to intervene.

[0077] The present invention has the following beneficial effects:

[0078] In the present invention, the signal is decomposed into multiple narrowband signals through frequency division multiplexing (FDM) technology, and combined with feature extraction methods such as non-stationarity measurement, energy, Hjorth parameters, etc., different sleep stages can be more accurately identified and classified. This refined processing enables the system to provide users with more accurate sleep quality feedback. BRIEF DESCRIPTION OF THE DRAWINGS

[0079] Figure 1A system block diagram of the self-attention sleep system and method for polymorphic sleep data fusion proposed by the present invention;

[0080] Figure 2 This is a flow chart of the self-attention sleep system and method for polymorphic sleep data fusion proposed by the present invention. DETAILED DESCRIPTION

[0081] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0082] See also Figure 1-Figure 2 As shown, the present invention is a self-attention sleep system for polymorphic sleep data fusion, comprising:

[0083] Data acquisition module: responsible for collecting environmental data and user's physiological data, the physiological data includes EEG (electroencephalogram) and EOG (electrooculogram) signals, and the EEG (electroencephalogram) and EOG (electrooculogram) signals are transmitted to the signal preprocessing module.

[0084] Signal preprocessing module: The collected EEG and EOG signals are segmented, normalized and denoised, and the preprocessed signals are passed to the frequency division multiplexing (FDM) module.

[0085] Frequency Division Multiplexing (FDM) module: The preprocessed signal frame is decomposed into multiple narrowband signals using frequency division multiplexing (FDM) technology. The narrowband signals contain different frequency components in the original signal. The decomposed narrowband signals are passed to the feature extraction module.

[0086] Feature extraction module: extracts features from the decomposed narrowband signal, such as non-stationary measure (MNS), energy and Hjorth parameter, etc. The features constitute a feature set and are passed to the model training module and the sleep staging module.

[0087] Model training module: The model is trained using the feature set. The trained model is used in the sleep staging module to perform sleep staging on the input EEG and EOG signals.

[0088] Sleep staging module: performs real-time or offline sleep staging on the input EEG and EOG signals through a trained model, and outputs the results of the sleep stages, which reflect the sleep status in different time periods. The results are passed to the sleep quality evaluation module for calculating the sleep quality index.

[0089] Sleep quality evaluation module: Based on the results of sleep staging, sleep quality indicators such as sleep efficiency, number of awakenings and REM sleep ratio are calculated. The sleep quality indicators are used in the early warning system module to set the early warning threshold and trigger the early warning mechanism.

[0090] Correlation analysis module: Conduct correlation analysis on the relationship between different sleep stages and sleep quality indicators, determine the association between different physiological parameters, and generate a quality evaluation model based on the analysis results and sleep quality monitoring data.

[0091] Early warning system module: Set the early warning threshold according to the sleep quality evaluation results and the quality evaluation model, and trigger the early warning mechanism when the sleep quality is lower than the threshold.

[0092] In one embodiment, for the above frequency division multiplexing (FDM) module, the frequency division multiplexing (FDM) module uses frequency division multiplexing (FDM) technology to decompose the pre-processed signal frame into multiple narrowband signals, specifically in the following steps:

[0093] Determine frequency band division: The core of FDM technology is to divide the signal in the frequency domain, that is, to divide the entire frequency band into multiple narrow bands, determine the frequency range of each narrow band, and the interval between the narrow bands. The division of the narrow band is determined according to the spectral characteristics of the signal and application requirements.

[0094] Use filter banks to perform frequency band decomposition: After determining the frequency band division, use filter banks to perform frequency band decomposition on the preprocessed signal frame. The filter bank contains multiple filters, each of which corresponds to a narrow band and has a frequency response that matches the narrow band. The formula for frequency band decomposition can be expressed as

[0095] X FB,i,k (f) = H k (f)·X i (f)

[0096] Among them, X i (f) represents the spectrum of the i-th signal frame, H k (f) represents the frequency response of the kth filter, X FB,i,k (f) represents the spectrum of the narrowband signal obtained after the i-th signal frame passes through the k-th filter.

[0097] Extracting narrowband signals: After being processed by the filter bank, each signal frame is decomposed into multiple narrowband signals, which are extracted by performing an inverse Fourier transform (IFFT) on the filtered spectrum. The formula for extracting narrowband signals can be expressed as:

[0098] x FB,i,k (t) = IFFT{X FB,i,k (f)}

[0099] Among them, X FB,i,k (f) represents the spectrum of the narrowband signal obtained after the i-th signal frame passes through the k-th filter, x FB,i,k (t) represents the representation of the corresponding narrowband signal in the time domain.

[0100] Suppose we have a composite signal containing multiple frequency components, and we want to decompose it into multiple narrowband signals using FDM technology.

[0101] Determine the frequency band division: Determine the frequency range and interval of each narrow band based on the spectrum characteristics of the composite signal and application requirements.

[0102] Band decomposition using filter banks: Design and apply filter banks to perform band decomposition on the preprocessed signal. Each filter corresponds to a narrowband and has a frequency response that matches the narrowband. Extract narrowband signals: Perform an inverse Fourier transform on the filtered spectrum to extract the representation of each narrowband signal in the time domain.

[0103] Subsequent processing: Perform subsequent processing steps such as noise removal and feature extraction on the extracted narrowband signal.

[0104] In one embodiment, for the above sleep staging module, the sleep staging module performs real-time or offline sleep staging on the input EEG and EOG signals through a trained model, and the specific steps are:

[0105] Sleep segmentation: accept a multivariate sequence of sleep stages S = (s1, s2, ..., s L ) data, output a predicted label sequence, any sleep stage is defined as Where n is the number of samples in a sleep stage, C is the number of channels in the sleep stage, and each stage corresponds to a label in Σ=W, N1, N2, N3, REM}, where W represents wakefulness, REM represents rapid eye movement, N1 represents non-rapid eye movement 1, N2 represents non-rapid eye movement 2, and N3 represents non-rapid eye movement 3. The corresponding relationship is f θ :x→y, θ represents the network including all parameters, then the label sequence is P = (f θ (s1),f θ (s2),…,f θ (s L )).

[0106] A user's sleep is divided into a deep sleep stage in the first half of the night and a light sleep and REM sleep stage in the second half of the night.

[0107] Physiological parameter collection: Collect physiological parameters related to sleep, including EEG, EOG, EMG, respiration, blood oxygen, body temperature, etc.

[0108] During sleep, the system records the user's brain wave changes, eye movements, muscle activity, breathing rate, blood oxygen saturation, and body temperature fluctuations.

[0109] Environmental factors record: record the relevant factors of the sleeping environment, such as temperature, humidity, air pressure, radiation, pollutants and daytime, etc.

[0110] When the user is sleeping, the ambient humidity is maintained at around 50%, the temperature is appropriate, the air pressure is stable, the radiation and pollutant levels are within a safe range, and the daytime information indicates that the user is in sleep time at night.

[0111] Data preprocessing: Preprocess the collected physiological parameters and environmental factors data, including multi-scale analysis, multi-modal fusion, etc.

[0112] The system performs multi-scale analysis on physiological signals such as EEG and EOG to capture the characteristics of different frequency components. At the same time, it performs multi-modal fusion of environmental factors and physiological parameters to form more comprehensive sleep data.

[0113] Feature extraction and enhancement: Extract features that have an important impact on sleep behavior, and process them through multi-scale convolution kernels and feature enhancement to improve the expressiveness of the features.

[0114] The system extracts features such as respiratory rate variability and blood oxygen saturation fluctuations from the preprocessed data, and enhances these features through product kernel transformation to make them better reflect changes in sleep behavior.

[0115] Multi-head self-attention layer processing: The extracted features are processed and analyzed using a multi-head self-attention mechanism to capture the dependencies between features.

[0116] The multi-head self-attention layer can capture the correlation between respiratory rate and blood oxygen saturation, as well as the changing trends of these features over different time periods.

[0117] Segment classifier judgment: Use the segment classifier to classify the processed features and determine the category to which each sleep stage belongs.

[0118] The segmentation classifier divides the user's sleep process into different stages based on the extracted features and the results of the multi-head self-attention layer, and gives the duration and quality evaluation of each stage.

[0119] Loss function evaluation: Calculate the loss function value between the classification result and the true label to evaluate the performance of the model.

[0120] By calculating the error between the sleep stage output by the classifier and the actual sleep stage, the loss function value is obtained. The smaller the value, the better the performance of the model.

[0121] In one embodiment, for the above sleep quality evaluation module, based on the result of sleep staging, the sleep quality evaluation module calculates the sleep quality index, specifically in the following steps:

[0122] Segmentation label word embedding representation: Use word embedding representation to convert segmentation labels into vector representations. Segmentation labels are identifiers for segmenting the sleep process (such as non-rapid eye movement, rapid eye movement, etc.). Word embedding representation is a technique for converting discrete labels into continuous vector space for processing in machine learning models. Through word embedding representation, segmentation labels can be converted into vectors with semantic information, thereby better capturing the characteristics of the sleep process.

[0123] Multi-head self-attention weighted sequence mode: Use multi-head self-attention mechanism to extract important features in sleep behavior sequences and assign weights to these features.

[0124] Multi-head attention fusion: The outputs of multiple heads are fused, and the final fusion result is obtained by splicing or averaging the outputs of multiple heads.

[0125] Rating classifier: The fusion result is used as the input of the rating classifier to predict the sleep quality level. The sleep quality level (such as good, medium, poor, etc.) is predicted based on the input features (such as sleep efficiency, number of awakenings, REM sleep ratio, etc.).

[0126] Loss Function Evaluation: Use the loss function and backpropagation to train the rating classifier to accurately predict the sleep quality rating.

[0127] In one embodiment, for the multi-head self-attention weighting of the above sequence pattern, the multi-head self-attention weighting of the sequence pattern comprises the following specific steps:

[0128] Computes a matrix representation of the query Q, key K, and value V.

[0129] The relevance score between each query and all keys is calculated using the dot-product attention mechanism.

[0130] The relevance scores are softmax normalized to obtain the attention weight for each query.

[0131] The values ​​are weighted summed using the attention weights to get the weighted output.

[0132] In one embodiment, for the above correlation analysis module, the correlation analysis module performs correlation analysis on the relationship between different sleep stages and sleep quality indicators, specifically, the following steps:

[0133] Collect data: Collect data on different sleep stages and physiological parameters.

[0134] Data cleaning: Clean the collected data to remove outliers, missing values ​​or duplicate data.

[0135] Calculation of correlation coefficients: Pearson's correlation coefficient was used to calculate the correlation coefficients between different physiological parameters.

[0136] The calculation formula is

[0137]

[0138] Among them, x i and i They represent the values ​​of the two variables at the i-th observation value, and represent the means of the two variables.

[0139] Interpretation of correlation coefficients: Interpret the degree of association between different physiological parameters based on the range of correlation coefficients (usually between -1 and 1). Values ​​close to 1 or -1 indicate strong correlation, while values ​​close to 0 indicate weak correlation or no correlation.

[0140] Draw a scatter plot: Use a scatter plot to visualize the relationship between different physiological parameters. The points in the scatter plot represent the observed values, and the distribution of the points can intuitively reflect the correlation between the variables.

[0141] Draw a heat map: For multiple physiological parameters, use a heat map to display the correlation coefficient matrix between the physiological parameters. The color depth in the heat map indicates the strength of the correlation coefficient.

[0142] Feature selection: Based on the results of correlation analysis, physiological parameters that have a significant impact on sleep quality are selected as features for model training.

[0143] Model training: Use the selected features to train the sleep quality assessment model.

[0144] Model evaluation: Evaluate the performance of the model through cross-validation or test set, and tune the model based on the evaluation results.

[0145] Suppose we have a sleep dataset containing the following physiological parameters: electroencephalogram (EEG), electro-oculogram (EOG), electromyography (EMG), heart rate (HR), and respiratory rate (RR). Our goal is to analyze the correlation between these physiological parameters and sleep quality indicators (such as sleep efficiency, number of awakenings, etc.).

[0146] Data preparation: A dataset containing the above physiological parameters and sleep quality indicators is collected from sleep monitoring devices.

[0147] Correlation analysis: Using the Pearson correlation coefficient to calculate the correlation between each physiological parameter and the sleep quality index, we may find a strong positive correlation between EEG and sleep efficiency, and a weak negative correlation between HR and the number of awakenings.

[0148] Results visualization: Scatter plots are drawn to show the relationship between EEG and sleep efficiency, and heat maps are drawn to show the correlation coefficient matrix between all physiological parameters.

[0149] Optimize model training: Select EEG, EOG, and HR as features for model training, and use these features to train a machine learning algorithm to predict sleep quality indicators. Evaluate the performance of the model through cross-validation, and tune the model based on the evaluation results.

[0150] In one embodiment, for the above-mentioned early warning system module, the early warning system module sets the early warning threshold according to the sleep quality evaluation result and the quality rating model, and the specific steps are:

[0151] Determine early warning indicators: Determine the physiological parameters or sleep quality indicators that serve as the basis for early warning. These indicators should be able to accurately reflect the user's sleep quality and have a certain degree of sensitivity and specificity. For example, specific frequency components in electroencephalogram (EEG), amplitude changes in electro-oculogram (EOG), variability in heart rate (HR), stability of respiratory rate (RR), and sleep efficiency can be selected as early warning indicators.

[0152] Collect historical data: Collect a large amount of historical data, including sleep quality monitoring data and corresponding physiological parameter values ​​of different users. These data will be used to analyze the relationship between various indicators and sleep quality and determine reasonable warning thresholds.

[0153] Data preprocessing and feature extraction: Preprocess historical data, including data cleaning, missing value processing, outlier detection, etc., to ensure the accuracy and reliability of the data. Then, extract features from the preprocessed data, which will be used for subsequent analysis and modeling.

[0154] Correlation analysis and causal inference: accept the quality evaluation model generated by the correlation analysis and causal inference of the relationship between different sleep stages and sleep quality indicators based on the correlation analysis module.

[0155] Determine the warning threshold: Based on the sleep quality evaluation results and the quality evaluation model, determine the warning threshold. The calculation formula of the warning threshold is:

[0156] T=μ+kσ

[0157] Among them, T represents the warning threshold, μ represents the mean of the corresponding indicator in the historical data, σ represents the standard deviation, and k represents the coefficient set according to the quality evaluation model.

[0158] Verification and optimization: Through cross-validation, simulation experiments and other methods, the set warning thresholds are verified and optimized to ensure that the warning system can have a low false alarm rate and missed alarm rate while ensuring accuracy.

[0159] Assume that we selected heart rate variability (HRV) as one of the early warning indicators and collected sleep quality monitoring data and corresponding heart rate variability values ​​from 100 users. After data preprocessing and feature extraction, we calculated the mean and standard deviation of heart rate variability and set the coefficient k to 1.5.

[0160] According to the formula T = μ + kσ, we can calculate the warning threshold of heart rate variability. Assuming the mean μ is 50 milliseconds and the standard deviation σ is 10 milliseconds, the warning threshold T is:

[0161] T = 50 + 1.5 × 10 = 65 milliseconds

[0162] This means that when the user's heart rate variability exceeds 65 milliseconds, the early warning system will issue an abnormal warning.

[0163] A method for a self-attention sleep system with polymorphic sleep data fusion, comprising the following steps:

[0164] Data collection: Collect environmental data and the user's physiological data, including EEG (electroencephalogram) and EOG (electrooculogram) signals.

[0165] Signal preprocessing: The collected EEG and EOG signals are divided into non-overlapping frames, the non-overlapping frames are normalized to eliminate the dimensional differences between different signals, and denoising is performed to ensure the accuracy and reliability of the signals.

[0166] Frequency Division Multiplexing (FDM): The pre-processed signal frame is decomposed into multiple narrowband signals using frequency division multiplexing (FDM) technology.

[0167] Feature extraction: Extract features from the decomposed narrowband signal, such as measure of nonstationarity (MNS), energy, and Hjorth parameter, which can reflect the dynamic and statistical characteristics of the signal.

[0168] Model training: The extracted feature sets are used to train different machine learning models. Different machine learning models identify and classify different sleep stages, such as wakefulness, non-rapid eye movement (NREM), and rapid eye movement (REM).

[0169] Sleep staging: Use different machine learning models to perform real-time or offline sleep staging on the collected environmental data and the user's physiological data to monitor the user's sleep stages.

[0170] Sleep quality evaluation: Based on the results of sleep staging, sleep quality indicators such as sleep efficiency, number of awakenings and REM sleep ratio are calculated.

[0171] Correlation analysis: Conduct causal analysis on the relationship between different sleep stages and sleep quality indicators, explore the association between different physiological parameters, identify factors that affect sleep quality, including physiological factors (EEG, EOG, etc.) and environmental factors (temperature, humidity, etc.), classify the identified influencing factors to better understand their impact, and generate a quality evaluation model based on the classification results and sleep quality monitoring data to evaluate the user's sleep quality.

[0172] Early warning system: Set an early warning threshold based on the sleep quality evaluation results and the quality evaluation model. When the sleep quality is lower than the threshold, the early warning mechanism is triggered to remind the user or doctor to intervene.

[0173] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. The self-attention sleep system with polymorphic sleep data fusion is characterized by: include: Data acquisition module: responsible for collecting environmental data and user's physiological data, the physiological data includes EEG and EOG signals, and the EEG and EOG signals are transmitted to the signal preprocessing module; Signal preprocessing module: segmentation, normalization and denoising of the collected EEG and EOG signals are performed, and the preprocessed signals are passed to the frequency division multiplexing module; Frequency division multiplexing module: uses frequency division multiplexing technology to decompose the preprocessed signal frame into multiple narrowband signals, wherein the narrowband signals contain different frequency components in the original signal, and the decomposed narrowband signals are transmitted to the feature extraction module; Feature extraction module: extracts features from the decomposed narrowband signal, and the features constitute a feature set that is passed to the model training module and the sleep staging module; Model training module: Use the feature set to train the model. The trained model is used in the sleep staging module to perform sleep staging on the input EEG and EOG signals. Sleep staging module: performs real-time or offline sleep staging on the input EEG and EOG signals through the trained model, and outputs the results of the sleep stages, which reflect the sleep status in different time periods. The results are passed to the sleep quality evaluation module for calculating the sleep quality index; Sleep quality evaluation module: based on the results of sleep staging, calculate the sleep quality index, which is used in the early warning system module to set the early warning threshold and trigger the early warning mechanism; Correlation analysis module: performs correlation analysis on the relationship between different sleep stages and sleep quality indicators, determines the association between different physiological parameters, and generates a quality evaluation model based on the analysis results and sleep quality monitoring data; Early warning system module: Set the early warning threshold according to the sleep quality evaluation results and the quality evaluation model, and trigger the early warning mechanism when the sleep quality is lower than the threshold.

2. The self-attention sleep system with polymorphic sleep data fusion according to claim 1, characterized in that: The frequency division multiplexing module uses frequency division multiplexing technology to decompose the pre-processed signal frame into multiple narrowband signals, specifically: Determine frequency band division: determine the frequency range of each narrow band and the interval between the narrow bands, wherein the division of the narrow bands is determined according to the spectrum characteristics of the signal and the application requirements; Use filter banks to perform frequency band decomposition: After determining the frequency band division, use filter banks to perform frequency band decomposition on the preprocessed signal frame. The filter bank contains multiple filters, each of which corresponds to a narrow band and has a frequency response that matches the narrow band. The formula for frequency band decomposition can be expressed as X FB,i,k (f)=H k (f)·X i (f) Among them, X i (f) represents the spectrum of the i-th signal frame, H k (f) represents the frequency response of the kth filter, X FB,i,k (f) represents the spectrum of the narrowband signal obtained after the i-th signal frame passes through the k-th filter; Extracting narrowband signals: After being processed by the filter bank, each signal frame is decomposed into multiple narrowband signals, which are extracted by performing an inverse Fourier transform on the filtered spectrum. The formula for extracting narrowband signals can be expressed as x FB,i,k (t)=IFFT{X FB,i,k (f)} Among them, X FB,i,k (f) represents the spectrum of the narrowband signal obtained after the i-th signal frame passes through the k-th filter, x FB,i,k (t) represents the representation of the corresponding narrowband signal in the time domain.

3. The self-attention sleep system with polymorphic sleep data fusion according to claim 1, characterized in that: The sleep staging module performs real-time or offline sleep staging on the input EEG and EOG signals through the trained model. The specific steps are: Sleep segmentation: accept a multivariate sequence of sleep stages S = (s1, s2, ..., s L ) data, output a predicted label sequence, any sleep stage is defined as Where n is the number of samples in a sleep stage, C is the number of channels in the sleep stage, and each stage corresponds to a label in Σ = {W, N1, N2, N3, REM}, where W represents wakefulness, REM represents rapid eye movement, N1 represents non-rapid eye movement 1, N2 represents non-rapid eye movement 2, and N3 represents non-rapid eye movement 3. The corresponding relationship is: θ represents the network including all parameters, then the label sequence is P = (f θ (s1),f θ (s2),…,f θ (s L )); Physiological parameter collection: collect physiological parameters related to sleep; Environmental factors record: record the factors related to the sleeping environment; Data preprocessing: preprocess the collected physiological parameters and environmental factors data; Feature extraction and enhancement: Extract features that affect sleep behavior and process them through multi-scale convolution kernels and feature enhancement; Multi-head self-attention layer processing: The extracted features are processed and analyzed using the multi-head self-attention mechanism to capture the dependencies between features; Segment classifier judgment: Use the segment classifier to classify the processed features and determine the category to which each sleep stage belongs; Loss function evaluation: Calculate the loss function value between the classification result and the true label to evaluate the performance of the model.

4. The self-attention sleep system with polymorphic sleep data fusion according to claim 3, characterized in that: Based on the results of sleep staging, the sleep quality evaluation module calculates the sleep quality index, specifically in the following steps: Segment label word embedding representation: Use word embedding representation to convert segment labels into vector representation; Multi-head self-attention weighting for sequence mode: Use multi-head self-attention mechanism to extract important features in sleep behavior sequences and assign weights to these features; Multi-head attention fusion: fuse the outputs of multiple heads and obtain the final fusion result by splicing or averaging the outputs of multiple heads; Rating classifier: The fusion result is used as the input of the rating classifier to predict the sleep quality level; Loss Function Evaluation: Use the loss function and backpropagation to train the rating classifier to accurately predict the sleep quality rating.

5. The self-attention sleep system with polymorphic sleep data fusion according to claim 4, characterized in that: The multi-head self-attention weighting of the sequence pattern, the specific steps are: Compute the matrix representation of query Q, key K, and value V; Use the dot-product attention mechanism to calculate the relevance score between each query and all keys; Perform softmax normalization on the relevance score to obtain the attention weight of each query; The values ​​are weighted summed using the attention weights to get the weighted output.

6. The self-attention sleep system with polymorphic sleep data fusion according to claim 1, characterized in that: The correlation analysis module performs correlation analysis on the relationship between different sleep stages and sleep quality indicators, specifically in the following steps: Collect data: Collect data on different sleep stages and physiological parameters; Data cleaning: Clean the collected data to remove outliers, missing values ​​or duplicate data; Calculate the correlation coefficient: Use the Pearson correlation coefficient to calculate the correlation coefficient between different physiological parameters. The calculation formula is: Among them, x i and i They represent the values ​​of the two variables at the i-th observation value, and They represent the means of the two variables respectively; Interpretation of correlation coefficients: Based on the range of correlation coefficients, explain the degree of association between different physiological parameters. Values ​​close to 1 or -1 indicate strong correlation, while values ​​close to 0 indicate weak correlation or no correlation. Draw scatter plots: Use scatter plots to visualize the relationship between different physiological parameters; Draw a heat map: For multiple physiological parameters, use a heat map to display the correlation coefficient matrix between the physiological parameters. The color depth in the heat map indicates the strength of the correlation coefficient. Feature selection: Based on the results of correlation analysis, physiological parameters that have a significant impact on sleep quality are selected as features for model training; Model training: Use the selected features to train the sleep quality assessment model; Model evaluation: Evaluate the performance of the model through cross-validation or test set, and tune the model based on the evaluation results.

7. The self-attention sleep system with polymorphic sleep data fusion according to claim 1, characterized in that: The early warning system module sets the early warning threshold according to the sleep quality evaluation results and the quality rating model. The specific steps are: Determine early warning indicators: determine the physiological parameters or sleep quality indicators that serve as the basis for early warning; Collect historical data: Collect a large amount of historical data, including sleep quality monitoring data of different users and corresponding physiological parameter values; Data preprocessing and feature extraction: Preprocess the historical data, and then extract features from the preprocessed data; Correlation analysis and causal inference: accept the quality evaluation model generated by the correlation analysis and causal inference of the relationship between different sleep stages and sleep quality indicators based on the correlation analysis module; Determine the warning threshold: Based on the sleep quality evaluation results and the quality evaluation model, determine the warning threshold. The calculation formula of the warning threshold is: T=μ+kσ Among them, T represents the warning threshold, μ represents the mean of the corresponding indicator in the historical data, σ represents the standard deviation, and k represents the coefficient set according to the quality evaluation model; Verification and optimization: Verify and optimize the set warning thresholds.

8. The method of the self-attention sleep system of polymorphic sleep data fusion according to claim 1, characterized in that: The following steps are involved: Data collection: collecting environmental data and user's physiological data, the physiological data including EEG and EOG signals; Signal preprocessing: Segment the collected EEG and EOG signals into non-overlapping frames, normalize the non-overlapping frames, eliminate the dimensional differences between different signals, and perform denoising; Frequency division multiplexing: Use frequency division multiplexing technology to decompose the pre-processed signal frame into multiple narrowband signals; Feature extraction: extract features from the decomposed narrowband signal; Model training: Use the extracted feature sets to train different machine learning models, which can identify and classify different sleep stages; Sleep staging: Use different machine learning models to perform real-time or offline sleep staging on the collected environmental data and the user's physiological data to monitor the user's sleep stages; Sleep quality evaluation: Calculate sleep quality index based on the results of sleep staging; Correlation analysis: Conduct causal analysis on the relationship between different sleep stages and sleep quality indicators, explore the association between different physiological parameters, identify factors that affect sleep quality, including physiological factors and environmental factors, classify the identified influencing factors, and generate a quality evaluation model based on the classification results and sleep quality monitoring data to evaluate the user's sleep quality; Early warning system: Set an early warning threshold based on the sleep quality evaluation results and the quality evaluation model. When the sleep quality is lower than the threshold, the early warning mechanism is triggered to remind the user or doctor to intervene.

Citation Information

Patent Citations

  • Automatic sleep staging method, system and device and storage medium

    CN118986274A

  • Intelligent sleep monitoring blanket based on multi-modal physiological signal fusion and optimization method thereof

    CN119112105A

  • Device, method, and app for facilitating sleep

    US20200368491A1

Cited By

  • Sleep diagnosis system based on sleep language model

    CN121196483A

  • Sleep state real-time monitoring method and system

    CN121337270A

  • Medical-level electro-oculogram signal noise reduction filtering processing method and system

    CN121714290A