Sleep staging model training method based on non-wearable device data and application
By building a sleep staging model based on non-wearable devices and combining it with convolutional neural networks and bidirectional GRU models, the problems of incomplete signals and environmental interference in sleep staging caused by non-wearable devices are solved, achieving more accurate and stable sleep staging results and improving the accuracy and comfort of monitoring.
Patent Information
- Application Number
- CN202510740070.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-04
- Publication Date
- 2025-09-26
AI Technical Summary
Existing non-wearable sleep monitoring devices face problems such as incomplete signals, environmental interference, and insufficient generalization capabilities in sleep staging, resulting in uncertainty and low accuracy in monitoring results, especially in the identification of complex sleep stage transitions, making it difficult to accurately stage the sleep stage.
By synchronously collecting data from non-wearable devices and polysomnography, a reconstructed sleep dataset was constructed based on expert judgment. Convolutional neural networks and bidirectional GRU models were used to extract local features and temporal relationships. Data enhancement and label smoothing techniques were used for training, and the leave-one-out validation model was used to evaluate the model.
It achieves more accurate and stable sleep staging results, enhances the application potential of non-wearable devices in sleep analysis, and improves the robustness and comfort of the model.
Smart Images

Figure CN120708925A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of sleep staging, and relates to a sleep staging model training method based on non-wearable device data and its application. Background Art
[0002] Sleep is a vital human physiological function, with approximately one-third of our daily life spent asleep. However, many young people suffer from sleep disorders, and this rate is even higher among the elderly. Insufficient sleep can severely impact quality of life and may contribute to a variety of illnesses, including sleep apnea, depression, and Parkinson's disease. Therefore, objectively and effectively recording sleep data and accurately analyzing sleep stages are crucial for preventing sleep disorders.
[0003] Polysomnography (PSG) is the most commonly used and effective sleep assessment device in clinical practice. PSG monitors signals such as the electroencephalogram (EEG), electrocardiogram (ECG), electrooculogram (EOG), and electromyogram (EMG). These signals are recorded throughout the night and manually labeled and evaluated by experts. These signals have significant temporal characteristics, reflecting changes in physiological states during sleep. Therefore, effectively processing this temporal data is crucial in the study of automated sleep staging.
[0004] When processing time series data, researchers initially employed traditional time series analysis models such as hidden Markov models (HMMs), long short-term memory networks (LSTMs), and bidirectional long short-term memory networks (BiLSTMs). These models were able to capture temporal dependencies in the data, leading to initial success in automatic sleep staging. However, due to the high dimensionality and complex structure of PSG signal data, these models typically require feature extraction or data dimensionality reduction to avoid the risk of overfitting. However, this process can result in the loss of important information, limiting the model's performance.
[0005] In recent years, with the development of deep learning technology, researchers have introduced more complex models, such as convolutional neural networks (CNNs) and self-attention mechanisms, CNNs and LSTMs, and CNNs and BiLSTMs. These models have demonstrated stronger feature extraction capabilities and improved ability to capture temporal dependencies. Although these deep learning models have achieved significant results on PSG data, the complexity and high cost of PSG operations, as well as their significant impact on patient comfort, have limited their widespread application.
[0006] To overcome the limitations of wearable device monitoring technology, non-wearable sleep monitoring technology is gradually emerging. Smart beds, as a new non-wearable sleep monitoring solution, use built-in sensors to collect real-time vital sign data such as heart rate, respiratory rate, body movement, and bed exit, offering a more comfortable and convenient solution for sleep monitoring. However, compared to PSG, smart beds monitor a more limited range of variables, resulting in higher uncertainty in the information obtained. This uncertainty not only increases the difficulty of automatic sleep staging but also limits the accuracy of monitoring results, especially when identifying complex sleep stage transitions. Therefore, how to utilize the time-series vital sign data collected by smart beds to construct accurate and efficient sleep staging models has become a key issue in the clinical application of smart beds. Although some research has explored combining deep learning models such as CNNs and BiLSTMs with non-wearable device data, this area is still underdeveloped, particularly in processing multi-scale vital sign data and capturing detailed features of sleep stages. While the combination of CNNs and BiLSTMs has achieved some results in sleep data analysis, practical applications in conjunction with non-wearable device data still face challenges in effectively enhancing local feature extraction and improving the ability to capture temporal dependencies. Therefore, automatic sleep staging based on data from non-wearable devices (such as heart rate and respiratory rate) has become a new research direction. How to use deep neural networks to effectively analyze these data and perform accurate staging has become a key issue that needs to be solved urgently. Summary of the Invention
[0007] In order to overcome the shortcomings of the existing technology, the purpose of the present invention is to provide a sleep staging method and application based on non-wearable device data. By synchronously collecting PSG data and smart bed data from subjects, a sleep data set based on non-wearable device data is constructed. Expert judgment based on PSG is combined to assist in optimizing the accuracy of non-wearable device data, extract the implicit core features behind the non-wearable device data, and learn and train these deep features through the network to complete accurate sleep staging based on non-wearable device data. This effectively solves the problems of incomplete signals, environmental interference and insufficient generalization ability faced by non-wearable devices, thereby achieving more accurate and stable sleep staging results. At the same time, this sleep condition analysis model can improve the comfort and well-being of the subjects.
[0008] To achieve the above object, the present invention provides the following technical solutions:
[0009] According to a first aspect of the present disclosure, the present invention provides a sleep staging model training method based on non-wearable device data, comprising:
[0010] 1) Obtain full-night sleep data collected synchronously by non-wearable devices and polysomnography, and construct the original full-night sleep dataset of non-wearable devices and the control dataset of polysomnography;
[0011] 2) Construct a reconstructed sleep dataset required for sleep staging that combines expert opinions and non-wearable device data;
[0012] 3) Using convolutional neural networks (CNN, including multi-scale convolution) to extract local features and combining them with bidirectional GRU (BiGRU) to build a time series model;
[0013] 4) Training using reconstructed datasets, data augmentation, optimized parameters, label smoothing, and KL divergence loss functions;
[0014] 5) The trained model is evaluated using leave-one-out validation (LOO-CV).
[0015] Furthermore, we obtained the whole-night sleep data collected synchronously by non-wearable devices and polysomnography, and constructed the original whole-night sleep dataset of non-wearable devices and the control dataset of polysomnography:
[0016] The present invention uses a non-wearable device and a polysomnography (PSG) to synchronously collect the whole-night sleep data of 46 subjects. Through cooperation with cooperative medical institutions, the data collected include polysomnography data including wakefulness W, non-rapid eye movement stage I N1, stage II N2, stage III N3 and rapid eye movement REM, and data from smart bed devices including heart rate, respiratory rate, body movement and subject personal information such as height, weight, and gender. All subjects signed an informed consent form before participating in the study, and the research process strictly followed the ethical review requirements and was approved by the Ethics Committee of Huzhou Third People's Hospital (Approval No.: (2024) Lunshen No. (107)). The smart bed refers to a non-wearable device with integrated sensors that can monitor the user's heart rate, respiratory rate, body movement physiological characteristics in real time, and synchronously record the subject's height, weight, and gender personal information; the smart bed and the polysomnography (PSG) synchronously collect data as the input data source for the construction of the sleep data set.
[0017] Furthermore, we constructed a reconstructed sleep dataset required for sleep staging that combines expert opinions and non-wearable device data, including:
[0018] Sleep data is reconstructed based on the synchronously collected data from the polysomnography monitor and the smart bed. First, experts determine the various sleep stages of the subjects based on the staging results of the polysomnography monitor (according to the AASM standards), including wakefulness W, non-rapid eye movement stage I N1, non-rapid eye movement stage II N2, non-rapid eye movement stage III N3 and rapid eye movement REM. Then, by mapping these judgment results to the heart rate, respiratory rate and body movement physiological characteristics collected synchronously by the smart bed, as well as the subject's height, weight, and gender personal characteristics, the required reconstructed sleep data set based on non-wearable device data is constructed. In this process, all judgments and data mappings are strictly based on the professional judgment of the physician to ensure the accuracy and reliability of the reconstructed data set;
[0019] Furthermore, a convolutional neural network (CNN, including multi-scale convolution) is used to extract local features and a bidirectional GRU (BiGRU) is combined to build a time series model, including:
[0020] First, the data is z-score normalized to standardize the distribution of each feature and ensure that data of different dimensions are processed at the same scale. Next, the input end uses a feature extraction method based on convolutional neural networks to divide the full-night sleep data of the smart bed into non-overlapping 30-second time windows according to medical standards and timestamps. Since the smart bed data is sampled every 10 seconds, for the data of each 30-second time window, its label is the label of the last data point in the window, because changes in sleep state may occur at this time, and the label of the last data point can more accurately reflect the sleep stage of the time window. For each 30-second window, local features in the input time series data are extracted, and multi-scale convolution technology is introduced. Specifically, multiple convolution kernels of different sizes are deployed in parallel (the convolution kernel sizes are set to 1, 3, and 5) to efficiently extract feature information at different time scales, thereby comprehensively capturing local temporal changes in sleep data and enhancing the feature extraction ability and accuracy of the model;
[0021] Furthermore, training is performed using reconstructed datasets, data augmentation, optimized parameters, label smoothing, and KL divergence loss functions, including:
[0022] The MSC-BiGRU model (Multi-Scale Convolutional BiGRU Model, MSC-BiGRU for short) is used for feature extraction and time series modeling. The MSC-BiGRU model extracts local time series features of sleep data through multiple convolutional layers (convolution kernel sizes are 1, 3, and 5), and the convolution layer is followed by a ReLU activation function to enhance the feature expression capability. Next, the GRU (Gated Recurrent Unit) layer is used for time series modeling. The BiGRU model captures long-term dependencies by simultaneously processing forward and reverse time series information, effectively improving the accuracy of sleep staging. In order to enhance the learning ability of the model, 60-second and 90-second window data are used for data enhancement, and the original data is uniformly divided by timestamps in the data preprocessing stage. By expanding the training data set, the model can better capture the time series change patterns in sleep data and further improve the generalization ability of the model.
[0023] During the training process, label smoothing is used to optimize the loss function of the model. The smoothing coefficient is set to 0.1, and the true value of the label is smoothed into a probability distribution with a small deviation to reduce overfitting and improve the robustness of the model. The target label after label smoothing is calculated as follows: For each sample, the value of a certain category of the target label is adjusted to Among them, p t is the probability value of the true label (0 or 1); K is the total number of categories; e is the smoothing coefficient, for each sample, its label is the smoothed probability value.
[0024] The loss function uses the Kullback-Leibler (KL) divergence loss function. The KL divergence measures the difference between the predicted distribution of the model output and the smoothed label distribution. The specific expression of the loss function is: The model weights were adjusted by back-propagation algorithm with the Adam optimizer (learning rate was 0.0001) and trained using a batch size of 32 training data.
[0025] Through cross-validation and dynamic adjustment of learning strategies, overfitting is avoided and the model's generalization ability is improved. Finally, the model is evaluated using a test set, outputting multiple performance metrics including accuracy, F1 score, and Kappa coefficient to comprehensively evaluate the model's performance on the sleep staging task.
[0026] Furthermore, the trained model is evaluated using leave-one-out validation (LOO-CV), including:
[0027] The Leave-One-Out Cross Validation (LOO-CV) method is used, where one sample is selected at a time as the test set, and the remaining samples are used as the training set. This ensures that each sample can participate in the validation process as an independent test set, thereby comprehensively evaluating the generalization ability and robustness of the model. Leave-One-Out Cross Validation effectively reduces data bias and overfitting, ensuring the model's performance on unseen data. Through this cross-validation method, the model's parameter settings are further optimized, the model's prediction accuracy is improved, and its stability and reliability in practical applications are ensured.
[0028] According to a second aspect of the present disclosure, the present invention provides a sleep staging apparatus based on non-wearable device data, comprising: a non-wearable device for collecting physiological data of a subject, including heart rate, respiratory rate, and body movement;
[0029] The data preprocessing module is used to normalize and reconstruct the time window of the collected raw data to generate a data set suitable for input into the neural network;
[0030] A deep neural network module, including multiple convolutional layers and bidirectional GRU layers, is used to extract features from the processed data and perform sleep staging;
[0031] The training module is used to train the deep neural network model based on the existing labeled data set and adjust the network parameters;
[0032] The inference module is used to infer the real-time data of the subjects to be tested and output the whole-night sleep stage results;
[0033] The display and reporting module is used to visualize the staging results and generate reports.
[0034] According to a third aspect of the present disclosure, the present invention provides an electronic device comprising a processor and a memory; wherein the memory stores at least one instruction, which is loaded and executed by the processor to implement the above method.
[0035] According to a fourth aspect of the present disclosure, the present invention provides a computer-readable storage medium, wherein the storage medium stores at least one instruction, and the instruction is loaded and executed by a processor to implement the above method.
[0036] The technical solution provided by the present invention brings beneficial effects:
[0037] Given that existing non-wearable devices are not yet widely used for high-precision sleep staging, this method proposes an automatic sleep staging method based on multi-source physiological signal data collected by non-wearable devices and combined with a deep learning model. This method can effectively help doctors or researchers quickly and accurately perform sleep staging analysis. By using convolutional neural networks (CNNs) and bidirectional gated recurrent units (BiGRUs), this method can extract key physiological features from signals such as heart rate, respiratory rate, and body movement, thereby accurately classifying different sleep stages. Convolutional neural networks effectively extract local features from time series data, while BiGRUs capture bidirectional dependencies in time series, enabling the model to maintain high accuracy and robustness in the face of the diversity and complexity of non-wearable device data.
[0038] This method proposes an automatic sleep staging model based on a combination of convolutional neural networks (CNN) and bidirectional gated recurrent units (BiGRU). The CNN part is responsible for extracting local features from physiological signals collected by non-wearable devices, and is particularly important in capturing subtle changes in the signals. The BiGRU part further processes these features and can effectively capture bidirectional dependencies in time series, thereby improving the model's understanding and processing capabilities of time series data. This model successfully solves the challenges often encountered by traditional methods when dealing with incomplete signals or environmental noise, performs well in the accuracy and robustness of sleep staging, and significantly enhances the application potential of non-wearable device data in sleep analysis.
[0039] Other advantages, objectives, and features of the present invention will be described in detail in the following description and, to some extent, will be apparent to those skilled in the art upon examination of the following description or may be learned from practice of the present invention. The objectives and other advantages of the present invention may be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] To more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. Those skilled in the art can also derive other drawings based on these drawings without inventive effort.
[0041] Figure 1 1 is a flowchart illustrating an automatic sleep staging method for a non-wearable device based on a deep learning model according to an embodiment of the present disclosure.
[0042] Figure 21 is a schematic structural diagram of an automatic sleep staging apparatus for a non-wearable device based on a deep learning model according to an embodiment of the present disclosure.
[0043] Figure 3 1 is a schematic diagram of a model structure of a method for automatic sleep staging of a non-wearable device based on a deep learning model according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0044] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings in the examples of the present invention. Obviously, the implementation described is only a 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 making any creative efforts shall fall within the scope of protection of the present invention.
[0045] First embodiment
[0046] This embodiment provides a method for automatic sleep staging of non-wearable devices based on a deep learning model. The method can be implemented by an electronic device, which can be a terminal or a server. The execution process of the method for automatic sleep staging of non-wearable devices based on a deep learning model is as follows: Figure 1 As shown, the following steps are included:
[0047] S1, obtain sleep data based on non-wearable devices and build a full-night sleep dataset;
[0048] The study used non-wearable devices and polysomnography (PSG) to collect all-night sleep data from 46 subjects. Through cooperation with cooperative medical institutions, data from polysomnography (including wakefulness W, non-rapid eye movement (NREM) stage I N1, stage II N2, stage III N3, and rapid eye movement (REM)) and data from smart bed devices (including heart rate, respiratory rate, body movement, and personal information of the subjects, such as height, weight, and gender) were collected. All subjects signed informed consent forms before participating in the study, and the research process strictly followed the ethical review requirements and was approved by the Ethics Committee of Huzhou Third People's Hospital (Approval No.: (2024) Lunshen No. (107)). The smart bed refers to a non-wearable device with integrated sensors that can monitor the user's heart rate, respiratory rate, and body movement physiological characteristics in real time, and simultaneously record the subject's height, weight, and gender personal information; the smart bed and polysomnography (PSG) collect data synchronously as the input data source for the construction of the sleep dataset.
[0049] Specifically, the subjects' full-night sleep physiological signal data, including heart rate (HR), respiratory rate (BR), and body movement (BM), were collected through non-wearable devices (smart beds). After completing the data collection, the time windows were first divided into 30-second intervals according to common medical practices, and a unique number was assigned to each window. The sleep stage label for each window was determined using the majority voting method to ensure that when multiple samples exist, the label judgment results of these samples are combined to reduce the error that may be caused by a single judgment, thereby improving the accuracy and robustness of the final label. Secondly, the dataset was divided into subsets based on subject specificity to ensure that the training set and the test set are independent, thereby reflecting the practical significance of this research method. Finally, before model training, the data was standardized with zero mean and unit standard deviation. The specific formula for standardization is as follows:
[0050]
[0051] Where x is the original data point, μ is the mean of the data, and σ is the standard deviation of the data. Through this formula, the standardized data x′ will have a distribution with a mean of 0 and a standard deviation of 1, which helps to accelerate the training process of the model and improve the stability and performance of the model.
[0052] S2, build an automatic sleep staging model to obtain physiological characteristics during sleep;
[0053] Specifically, to achieve automatic sleep data staging, there are deficiencies in processing long-term dependencies and fine-grained features in time series data. Capturing multi-scale temporal dependencies is crucial in time series data modeling. Applying convolution kernels of different sizes to the same data yields different results, and the kernel size also determines the receptive field. This suggests that kernels of different sizes have varying perception capabilities across time scales. Therefore, this paper introduces multi-scale convolution technology, which uses multiple convolution kernels in parallel to efficiently extract multi-scale features at different time window scales. This method can simultaneously capture both fine-grained and longer-scale sequential dependencies, improving the model's perception of time series data. Three one-dimensional convolution kernels are used: 1×1, 1×3, and 1×5. The 1×1 kernel focuses on local information at the current moment, extracting the finest features; the 1×3 kernel covers the current moment and two preceding and succeeding time points, capturing short-term temporal patterns; and the 1×5 kernel covers more time steps, learning dependencies over a longer timeframe. By having these convolution kernels of different scales working in parallel, we can capture temporal patterns at different time scales, thereby improving the model's comprehensive understanding of the data. These multi-scale features are concatenated after the convolution operation to form a rich and diverse feature set, which is then passed to subsequent network layers for processing. In this way, the model not only accurately models the local features at each time point, but also integrates features at different scales to capture complex temporal dependencies in the data.
[0054] S3, train the automatic sleep staging model using the actual collected sleep data of the subjects and adjust the parameters of the network model.
[0055] Specifically, the core component of the constructed model is a multi-scale convolutional-bidirectional gated recurrent neural network (MSC-BiGRU). The BiGRU (Bidirectional Gated Recurrent Unit) is an extension of the GRU (Gated Recurrent Unit). Composed of two GRU hidden layers, it connects the network's output at the current moment with both the state at the previous and next moments. The GRU introduces a gating mechanism to control the flow of information, effectively addressing the vanishing gradient problem encountered by traditional RNNs when learning long sequences. The BiGRU further enhances the model's expressive power by processing the input sequence in both the forward (from the start to the end) and reverse (from the end to the start) directions, thereby capturing richer bidirectional information. The BiGRU architecture typically consists of a forward GRU and a reverse GRU, with the output jointly determined by these two GRUs. This design is particularly important when processing sleep data, as changes in sleep stages are often influenced by preceding and following time periods, and traditional unidirectional RNNs are unable to capture these bidirectional dependencies. Therefore, incorporating the BiGRU can significantly improve the model's performance in processing complex time series data. During the training phase, the training set and the test set are divided by leave-one-out cross-validation, that is, one data set is selected as the test set each time, and the other data sets are used as training sets. Through this cross-validation method, the generalization ability of the model can be effectively evaluated to ensure that it adapts to different individual differences. When training the model, the preprocessed data is first input into the model and forward propagation is performed. In addition, the 60-second and 90-second window data are also used as data enhancement to enhance the data set, and the expansion of the data set helps the model better capture the temporal relationship. In order to optimize the model parameters, the Adam optimizer is used. This optimization algorithm has an adaptive learning rate adjustment mechanism, and the initial learning rate is set to 0.0001. In order to balance the sample difference problem in the whole night sleep data, the model uses KL divergence loss instead of the traditional cross entropy loss. The expression of the loss function is:
[0056]
[0057] Where B is the batch size, y t The predicted probability output by the model. The main advantage of label smoothing is that it effectively mitigates model overfitting. When dealing with class imbalance or noisy data, label smoothing prevents the model from making extreme decisions and forces it to distribute probabilities more evenly across classes. This improves the model's generalization ability to test data and reduces its reliance on specific classes in the training set, allowing it to place greater emphasis on the minority class, thereby improving class imbalance.
[0058] After each round of training, the model performs backpropagation to calculate gradients and update parameters. During training, the batch size is set to 32, and the entire training process is set to 30 epochs, meaning the model iterates 30 times through the entire training dataset to ensure model convergence. During training, the model's learning rate is adjusted based on the loss curve as training progresses, ensuring that the model can effectively reduce training error while avoiding overfitting. After each round of training, hyperparameters (such as learning rate and batch size) are fine-tuned based on model performance, and convolutional layers or GRU layers in the model are frozen as needed to further optimize model performance.
[0059] S4, using the automatic sleep staging model to obtain the whole night sleep staging of the subject to be tested;
[0060] In order to verify the generalization ability of the model, this method adopts the leave-one-out validation method. In the leave-one-out validation process, one dataset is selected as the test set each time, and the remaining datasets are used as training sets to ensure the generalization of the model. Finally, the feature sequence processed by BiGRU is input to the fully connected layer for classification. The fully connected layer maps the output of BiGRU to the final classification result and performs multi-classification tasks through the Softmax activation function. The model based on multi-scale convolution-bidirectional gated recurrent neural network (MSC-BiGRU) used in the method is as follows Figure 3 As shown in Figure 2. This combined model not only captures local features in physiological signals, but also handles complex dependencies in time series data, thereby improving the accuracy and robustness of automatic sleep staging. The overall model process is shown in Figure 2. Figure 1 This design effectively extracts useful features from the input physiological data and accurately classifies them into different sleep stages, significantly enhancing the application potential of non-wearable devices in automatic sleep staging.
[0061] After model training is complete, the model is evaluated using the reserved test set. Accuracy, F1 value, and Cohen's Kappa value are used to evaluate the model's performance. Accuracy is used to measure the model's overall prediction accuracy for sleep stages. The formula is:
[0062]
[0063] Average precision is the average accuracy of each test set during leave-one-out validation. NCP refers to the number of correctly classified samples, and TNP refers to the total number of samples. It ranges from 0 to 1, with higher values indicating better classification results.
[0064] The F1 value is used to balance the precision and recall of the model. Its calculation formula is:
[0065]
[0066] Average accuracy is the average F1 score of each test set during leave-one-out validation. Precision (P) is the proportion of correctly predicted positive examples out of all predicted positive examples, while recall (R) is the proportion of correctly predicted positive examples out of all actual positive examples. The F1 score ranges from 0 to 1, with higher values indicating better classification, especially on class-imbalanced datasets.
[0067] The Kappa value is used to measure the consistency of classification results, that is, the consistency between the model prediction results and the actual situation. Its calculation formula is:
[0068]
[0069] The average Kappa value is the average of the Kappa values for each test set during leave-one-out validation. p0 represents the observed consistency, and pe represents the expected consistency. Kappa values range from -1 to 1, with higher values indicating better consistency. A large Kappa value indicates good consistency between the model's predictions and the actual labels, indicating a high degree of reliability in classification tasks. Consistency refers to the degree of agreement between the model's predictions and the actual labels. Higher consistency indicates a more accurate reflection of the actual labels by the model, indicating better model performance.
[0070] This example uses a leave-one-out validation method to test the effectiveness of the proposed automatic sleep staging method. Using a convolutional-bidirectional gated recurrent neural network, each subject is individually validated based on subject specificity. The average accuracy, F1 score, and Kappa value are calculated for each subject to ensure the model's effectiveness and generalizability in real-world applications.
[0071] Based on previous experience and model diversity, this study also conducted comparative experiments on the methods commonly used in PSG equipment research. As shown in Table 1, the current commonly used methods perform poorly in processing non-wearable data. The automatic sleep staging model based on convolutional-bidirectional gated recurrent neural network proposed in this paper outperforms other models in all aspects, which verifies the effectiveness of the method of this invention.
[0072] Table 1 Comparative performance of common sleep staging models and the proposed MSC-BiGRU model
[0073]
[0074] In summary, this embodiment provides a method for automatic sleep staging using a non-wearable device based on a deep learning model. In practical applications, although the accuracy of the method proposed in this article has not yet reached the level of polysomnography (PSG) monitoring, it does not require a cumbersome wearing process and is suitable for sleep monitoring in daily life. Through this method, users can obtain relatively accurate sleep staging, which facilitates self-monitoring of sleep quality. In response to the problems of cumbersome and poor comfort of sleep monitoring using PSG devices, a sleep staging method based on non-wearable devices is proposed, aiming to develop an accurate, efficient and user-friendly sleep staging system that can achieve accuracy comparable to traditional polysomnography while significantly improving the convenience and comfort of monitoring. In this study, a multi-scale convolutional-bidirectional gated recurrent neural network model was established in the pytorch environment. After a series of data enhancement, label smoothing and model operations, the sleep staging of each subject was predicted and compared with the expert staging results. The method adopted in this article achieved good results.
[0075] Second embodiment
[0076] This embodiment provides a sleep staging device based on non-wearable device data. The structure of the sleep staging device based on non-wearable device data is as follows: Figure 2 As shown, it includes the following modules:
[0077] Non-wearable devices are used to collect subjects’ physiological data, including heart rate, respiratory rate, and body movement;
[0078] The data preprocessing module is used to normalize and reconstruct the time window of the collected raw data to generate a data set suitable for input into the neural network;
[0079] A deep neural network module, including multiple convolutional layers and bidirectional GRU layers, is used to extract features from the processed data and perform sleep staging;
[0080] The training module is used to train the deep neural network model based on the existing labeled data set and adjust the network parameters;
[0081] The inference module is used to infer the real-time data of the subjects to be tested and output the whole-night sleep stage results;
[0082] The display and reporting module is used to visualize the staging results and generate reports for doctors or related personnel to conduct further analysis and auxiliary diagnosis.
[0083] The sleep staging apparatus based on non-wearable device data of this embodiment corresponds to the sleep staging method based on non-wearable device data of the first embodiment described above. The functions implemented by the various functional modules in the sleep staging apparatus based on non-wearable device data of this embodiment correspond one-to-one to the various process steps in the sleep staging method based on non-wearable device data of the first embodiment described above. Therefore, they will not be further elaborated here.
[0084] Third embodiment
[0085] This embodiment provides an electronic device, which includes a processor and a memory; wherein the memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the method of the first embodiment.
[0086] The electronic device may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) and one or more memories, wherein the memory stores at least one instruction, which is loaded by the processor to execute the above method.
[0087] Fourth embodiment
[0088] This embodiment provides a computer-readable storage medium, which stores at least one instruction. The instruction is loaded and executed by a processor, and can also be completed by instructing related hardware through a computer program. The computer program is stored in the computer-readable storage medium to implement the method of the above-mentioned first embodiment.
[0089] It should be noted that in the embodiments of the present disclosure, the processor referred to may be a central processing unit, other general-purpose processors, digital signal processors, application-specific integrated circuits, off-the-shelf programmable gate arrays, or other programmable logic devices. A general-purpose processor may be a microprocessor or any conventional processor. The memory may be used to store the computer program and / or modules. The processor implements the various functions of the defect image dataset production device by running or executing the computer program and / or modules stored in the memory and accessing data stored in the memory. The memory may primarily include a program storage area and a data storage area. The program storage area may store an operating system, at least one application required for a function, and the data storage area may store data generated based on the use of the mobile phone. Furthermore, the memory may include high-speed random access memory and non-volatile memory, such as a hard disk, internal memory, a plug-in hard disk, a smart memory card, a secure digital card, a flash memory card, at least one disk storage device, a flash memory device, or other volatile solid-state storage device. The computer program includes computer program code, which may be in source code, object code, an executable file, or some intermediate form. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, floppy disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc.
[0090] It should also be noted that the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected according to actual needs to achieve the objectives of this embodiment.
[0091] Finally, it should be noted that the above is a preferred embodiment of the present invention. It should be noted that although the preferred embodiment of the present invention has been described, it is clear that those skilled in the art, once they understand the basic inventive concept of the present invention, can make a number of improvements and equivalent substitutions without departing from the principles of the present invention. Such improvements and equivalent substitutions should also be considered as the scope of protection of the present invention. Therefore, the appended claims are intended to be interpreted as including the preferred embodiment and all changes and modifications that fall within the scope of the embodiments of the present invention.
Claims
1. A sleep staging model training method based on non-wearable device data, characterized in that: include: 1) Obtain full-night sleep data collected simultaneously by non-wearable devices and polysomnography, and construct the original full-night sleep dataset of non-wearable devices and the control dataset of polysomnography; 2) Constructing a reconstructed sleep dataset required for sleep staging that combines expert opinion and non-wearable device data; 3) Using convolutional neural networks (CNN, including multi-scale convolution) to extract local features and combining them with bidirectional gated recurrent units (BiGRU) to build a temporal model; 4) Training using reconstructed datasets, data augmentation, optimized parameters, label smoothing, and KL divergence loss functions; 5) Use leave-one-out validation (LOO-CV) to evaluate the trained model.
2. The method according to claim 1, characterized in that In step 1), a non-wearable device is used to synchronously collect the subject's full-night sleep data with a polysomnography (PSG); the polysomnography data includes wakefulness (W), non-rapid eye movement (NREM) stage I (N1), stage II (N2), stage III (N3), and rapid eye movement (REM); the data from the smart bed device includes heart rate, respiratory rate, body movement, and the subject's personal information; the smart bed refers to a non-wearable device with integrated sensors that can monitor the user's heart rate, respiratory rate, and body movement physiological characteristics in real time, and synchronously record the subject's height, weight, and gender personal information; the smart bed and the polysomnography (PSG) synchronously collect data as the input data source for constructing the sleep dataset.
3. The method according to claim 1, characterized in that In the aforementioned step 2), the sleep data is reconstructed based on the synchronously collected data from the polysomnography and the smart bed. First, the experts determine the sleep stages of the subjects according to the AASM standards based on the staging results of the polysomnography, including wakefulness W, non-rapid eye movement stage I N1, non-rapid eye movement stage II N2, non-rapid eye movement stage III N3, and rapid eye movement REM. Then, by mapping these judgment results to the heart rate, respiratory rate, and body movement physiological characteristics synchronously collected by the smart bed, as well as the subject's height, weight, and gender personal characteristics, the required reconstructed sleep dataset based on non-wearable device data is constructed.
4. The method according to claim 1, wherein include: In step 3, the data is first z-score normalized to standardize the distribution of each feature and ensure that data of different dimensions are processed at the same scale. Then, the input end uses a feature extraction method based on a convolutional neural network to divide the full-night sleep data of the smart bed into non-overlapping 30-second time windows according to medical standards and timestamps. For each 30-second window, local features in the input time series data are extracted, and multi-scale convolution technology is introduced. Multiple convolution kernels of different sizes are deployed in parallel, and the convolution kernel sizes are set to 1, 3, and 5 to extract features at different time scales. Information captures local temporal changes in sleep data. BiGRU can capture long-term temporal dependencies by simultaneously processing forward and reverse temporal information, thereby effectively improving the accuracy of sleep staging. Finally, after the temporal modeling output of the BiGRU layer, the output of the BiGRU will pass through the fully connected layer, which maps the output of the BiGRU to the final classification result. In order to obtain the predicted probability of each category, the output of the fully connected layer is normalized using the Softmax activation function so that the predicted value of each category is between 0 and 1, and the sum of the predicted values of all categories is 1.
5. The method according to claim 1, wherein In step 4, a BiGRU-based temporal processing model is used as the sleep staging model; the convolutional layer includes three convolution kernels of different sizes (1, 3, and 5), and the number of output channels of each convolutional layer is 16; the convolutional layer is followed by a ReLU activation function to enhance the nonlinear feature expression; The BiGRU layer has a hidden unit size of 128 and contains two layers of bidirectional GRU, which can capture long-term dependencies. The fully connected layer (FC) maps the BiGRU output to the final classification result, with the output dimension equal to the number of categories. The initial training learning rate is set to 0.0001, the training process is set to 30 epochs, and the batch size is 32. During training, data augmentation is performed using data from 60-second and 90-second windows. By combining data from 30-second, 60-second, and 90-second time windows, a comprehensive training dataset is generated, which helps the model fully learn the changing patterns of sleep stages at different time scales and enhances its robustness in variable sleep scenarios. Label smoothing technology is introduced during the training process to reduce the overfitting of the model to the labels, making the probability distribution of the model output smoother and avoiding excessive dependence on a single category. To further improve the stability and effect of the training, the KL divergence loss function is used for optimization. This loss function helps the model optimize the prediction accuracy in the case of multiple labels by minimizing the KL divergence between the predicted distribution of the model output and the smoothed label.
6. The method according to claim 1, characterized in that In step 5), the Leave-One-Out Cross Validation (LOO-CV) method is used. The dataset of one subject is selected as the test set each time, and the datasets of all other subjects are used as the training set for model training. This method ensures that the data of each subject can be validated as an independent test set by cyclically selecting different test sets, thereby effectively evaluating the generalization ability and robustness of the model.
7. A sleep staging method based on non-wearable device data, characterized in that: Applying the sleep staging model based on non-wearable device data obtained according to the method of claim 1, the steps include: 1) Data collection: All-night sleep data were collected synchronously with polysomnography (PSG) using a non-wearable device; 2) Constructing a sleep dataset: Based on data collected by the PSG device, experts determined sleep stages according to the AASM standard. These expert judgments were then mapped to the heart rate, respiratory rate, and body movement physiological characteristics collected by the smart bed to construct a reconstructed sleep dataset based on non-wearable device data. 3) Data preprocessing: Preprocess the collected full-night sleep data, including data normalization, to ensure that the data is at a unified scale for subsequent processing; 4) Feature Extraction and Model Training: Convolutional Neural Networks (CNNs) are used to extract local temporal features of the input data. Multi-scale convolution kernels are combined to extract features at different time scales through convolution operations. Next, BiGRU is used for temporal modeling to capture long-term dependencies. Through multi-scale convolution and temporal modeling, complex sleep data can be accurately segmented. 5) Model Optimization and Training: During model training, data augmentation techniques are used to expand the training set, and label smoothing and KL divergence loss functions are introduced to optimize the model's generalization ability. Optimization algorithms (such as Adam) are used for parameter adjustment, and the network is trained using the backpropagation algorithm. 6) Evaluation and Validation: The trained model was evaluated using the leave-one-out cross-validation (LOO-CV) method. The data of one subject was selected as the test set at a time, and the remaining data was used for training to ensure the generalization ability and stability of the model. 7) Applying a sleep staging model: Apply the trained sleep staging model based on non-wearable device data to the test subject's full-night sleep data to automatically predict sleep stages, outputting staging results including wakefulness, non-rapid eye movement (NREM) stage I N1, stage II N2, stage III N3, and rapid eye movement (REM).
8. A sleep staging device based on non-wearable device data using the method according to claim 7, characterized in that: Non-wearable devices are used to collect subjects’ physiological data, including heart rate, respiratory rate, and body movement; The data preprocessing module is used to normalize and reconstruct the time window of the collected raw data to generate a data set suitable for input into the neural network; A deep neural network module, including multiple convolutional layers and bidirectional GRU layers, is used to extract features from the processed data and perform sleep staging; The training module is used to train the deep neural network model based on the existing labeled data set and adjust the network parameters; The inference module is used to infer the whole-night sleep data of the test subject and output the whole-night sleep stage results; The display and reporting module is used to visualize the staging results and generate reports.
9. An electronic device, characterized in that: include: a memory for storing instructions executable by the processor; A processor configured to execute the sleep staging method based on non-wearable device data according to claim 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which is used to enable the computer to execute the sleep staging method based on non-wearable device data according to claim 7.