Sleep type evaluation method, wearable device, and computer-readable storage medium

CN122604301APending Publication Date: 2026-08-21EARWEISS TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510203662.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-21
Publication Date
2026-08-21

AI Technical Summary

Technical Problem

[0003]但是,现有的睡眠分析算法方法通常按照AASM(American Academy of SleepMedicine,美国睡眠医学学会)的标准进行睡眠分析,得到如Awake(清醒)、REM(Rapid EyeMovement,快速眼动睡眠)、N1(N1 Sleep,阶段1睡眠)、N2(N2 Sleep,阶段2睡眠以)及N3(N3Sleep,阶段3睡眠,深睡眠)等一系列的睡眠状态,但是这些睡眠状态晦涩难懂,普通用户难以从这些睡眠状态中确定自己的睡眠类型以及睡眠问题

Benefits of technology

[0041]上述睡眠类型评估方法、可穿戴设备和计算机可读存储介质,基于用户的睡眠数据以及预设睡眠模型,能够确定该睡眠数据所对应的睡眠类型,用户能够根据预设睡眠模型的输出结果直接确定自己的睡眠类型和睡眠问题,即上述睡眠类型评估方法的直观性较好、准确性较高。且预设睡眠模型基于睡眠数据样本集和深度学习模型训练得到,睡眠数据包括多个时间窗口对应的睡眠状态,深度学习模型直接对睡眠数据处理,无需人工提取特征,减少了信息损失,在大量睡眠数据的基础上,基于睡眠图的数据特性对睡眠数据样本集进行处理,然后经过训练,并在大量睡眠数据上验证,得到预设睡眠模型,预设睡眠模型的准确性高、泛化能力强。该睡眠类型评估方法是将睡眠数据输入至预设睡眠模型中得到的,准确性高、泛化能力强,且直接由睡眠数据得到睡眠类型,端到端自动完成睡眠类型的划分,操作简单。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122604301A_ABST
    Figure CN122604301A_ABST
Patent Text Reader

Abstract

The application relates to a sleep type evaluation method, a wearable device and a computer readable storage medium. The method can determine the sleep type corresponding to the sleep data of a user based on the sleep data of the user and a preset sleep model. The user can directly determine the sleep type and sleep problems of the user according to the output result of the preset sleep model, that is, the sleep type evaluation method has better intuitiveness and higher accuracy. Moreover, the sleep type evaluation method is determined based on a preset sleep model determined by a deep learning model training, and has strong generalization ability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of sleep type assessment technology, and in particular to a sleep type assessment method, wearable device, and computer-readable storage medium. Background Technology

[0002] Sleep is a vital part of human life. It helps us restore our physical strength, promotes the repair of the brain and body, and enhances memory and learning ability. Therefore, modern people are paying more and more attention to sleep, and related sleep analysis algorithms are constantly being developed to help users understand their sleep problems.

[0003] However, existing sleep analysis algorithms typically follow the AASM (American Academy of Sleep Medicine) standards to analyze sleep, resulting in a series of sleep states such as Awake, REM (Rapid Eye Movement sleep), N1 (N1 Sleep, Stage 1 sleep), N2 (N2 Sleep, Stage 2 sleep), and N3 (N3 Sleep, Stage 3 sleep, deep sleep). These sleep states are difficult to understand, making it hard for ordinary users to determine their sleep type and sleep problems. Existing methods for obtaining sleep types require pre-designing multiple sleep metrics (such as variability in bedtime, minutes to fall asleep, hours to sleep, and number of awakenings per hour), and then classifying them into multiple sleep types based on traditional clustering or manual statistical methods. However, classification based on manually designed sleep metrics relies entirely on the rationality and comprehensiveness of the metrics, and these metrics inevitably lead to information loss, resulting in low accuracy and reliability. Furthermore, the lack of large-scale data validation results in low generalization ability. Summary of the Invention

[0004] Therefore, it is necessary to provide a sleep type assessment method, wearable device, and computer-readable storage medium with high accuracy and strong generalization ability to address the above-mentioned technical problems.

[0005] Firstly, this application provides a method for assessing sleep types, the method comprising:

[0006] Acquire the user's sleep data, which includes sleep states corresponding to multiple time windows;

[0007] Sleep data is input into a preset sleep model to obtain the sleep type corresponding to the sleep data; the preset sleep model is a model trained based on a sleep data sample set and a deep learning model.

[0008] In one embodiment, the deep learning model includes a deep clustering model.

[0009] In one embodiment, the steps for determining the preset sleep model include:

[0010] Sleep data from the sleep data sample set is input into the initial deep clustering model, and the initial deep clustering model is trained to obtain the preset sleep model. The sleep data sample set includes sleep data from multiple users.

[0011] In one embodiment, the initial deep clustering model includes a cascaded preset feature extraction module and a comparison module. The steps of inputting sleep data from the sleep data sample set into the initial deep clustering model and training the initial deep clustering model to obtain the preset sleep model include:

[0012] The sleep data in the sleep data sample set is input into the preset feature extraction module, and the first output result of the comparison module is obtained;

[0013] The loss value is obtained based on the first output result, and the preset feature extraction module and comparison module are trained based on the loss value to obtain the preset sleep model.

[0014] In one embodiment, the step of training a preset feature extraction module and a comparison module based on the loss value to obtain a preset sleep model includes:

[0015] Using stochastic gradient descent and backpropagation algorithms, the preset feature extraction module and comparison module are iteratively optimized based on the loss value until the loss value reaches the preset range, thus obtaining the preset sleep model.

[0016] In one embodiment, the step of inputting sleep data from a sleep data sample set into a preset feature extraction module and obtaining a first output result from the comparison module includes:

[0017] The sleep data in the sleep data sample set is randomly segmented to obtain a first sleep segment set and a second sleep segment set;

[0018] The first sleep segment set and the second sleep segment set are respectively input into the first preset feature extraction module and the second preset feature extraction module to obtain the first feature vector and the second feature vector;

[0019] The first feature vector and the second feature vector are sequentially input into the first convolutional neural network and the softmax function to obtain the first predicted class probability vector and the second predicted class probability vector. The first feature vector and the second feature vector are respectively input into the second convolutional neural network to obtain the third feature vector and the fourth feature vector. The first output result includes the first predicted class probability vector, the second predicted class probability vector, the third feature vector and the fourth feature vector.

[0020] In one embodiment, the step of randomly segmenting sleep data in a sleep data sample set to obtain a first sleep fragment set and a second sleep fragment set includes:

[0021] The sleep data in the sleep data sample set is randomly segmented to obtain the first sleep segment and the second sleep segment that correspond one-to-one with the sleep data.

[0022] Based on each first sleep segment, determine the first sleep segment set;

[0023] The set of second sleep segments is determined based on each second sleep segment.

[0024] In one embodiment, the parameters in the first preset feature extraction module are the same as the parameters in the second preset feature extraction module.

[0025] In one embodiment, the number of convolutional layers in the first convolutional neural network is greater than the number of convolutional layers in the second convolutional neural network.

[0026] In one embodiment, the duration of the random segmentation is longer than one sleep cycle.

[0027] In one embodiment, the step of obtaining the loss value based on the first output result includes:

[0028] Determine the class similarity between the first predicted class probability vector and the second predicted class probability vector, the mean probability of the first predicted class probability vector, and the mean probability of the second predicted class probability vector;

[0029] Determine the category loss value based on category similarity;

[0030] Determine the feature similarity between the third and fourth feature vectors, and determine the feature loss value based on the feature similarity;

[0031] The loss value is determined based on the category loss value, the feature loss value, the probability mean of the first predicted category probability vector, and the probability mean of the second predicted category probability vector.

[0032] In one embodiment, the step of determining the loss value based on the category loss value, the feature loss value, the probability mean of the first predicted category probability vector, and the probability mean of the second predicted category probability vector includes:

[0033] The entropy of the cluster assignment probability is determined based on the probability mean of the first predicted category probability vector and the probability mean of the second predicted category probability vector.

[0034] The loss value is determined based on the category loss value, feature loss value, and entropy of the cluster assignment probability.

[0035] In one embodiment, before the step of inputting the first sleep segment set and the second sleep segment set to the first preset feature extraction module and the second preset feature extraction module, respectively, the method further includes:

[0036] Each sleep segment in the first sleep segment set and the second sleep segment set is sequentially subjected to random Gaussian blurring, resampling, and standardization.

[0037] In one embodiment, after the step of acquiring the user's sleep data and before the step of inputting the sleep data into a preset sleep model, the method further includes:

[0038] Sleep data is resampled and standardized.

[0039] Secondly, this application also provides a wearable device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement any step in the above-described sleep type assessment method.

[0040] Thirdly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any step in the above-described sleep type assessment method.

[0041] The aforementioned sleep type assessment method, wearable device, and computer-readable storage medium, based on user sleep data and a preset sleep model, can determine the sleep type corresponding to the sleep data. Users can directly determine their sleep type and sleep problems based on the output of the preset sleep model, meaning the sleep type assessment method is intuitive and accurate. Furthermore, the preset sleep model is trained on a sleep data sample set and a deep learning model. The sleep data includes sleep states corresponding to multiple time windows. The deep learning model directly processes the sleep data without manual feature extraction, reducing information loss. Based on a large amount of sleep data, the sleep data sample set is processed according to the data characteristics of sleep graphs, then trained and validated on a large amount of sleep data to obtain the preset sleep model. The preset sleep model has high accuracy and strong generalization ability. This sleep type assessment method is obtained by inputting sleep data into the preset sleep model, resulting in high accuracy and strong generalization ability. It directly derives the sleep type from the sleep data, automatically completing the end-to-end sleep type classification, and is simple to operate. Attached Figure Description

[0042] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0043] Figure 1 This is a diagram illustrating the application environment of a sleep type assessment method in one embodiment;

[0044] Figure 2 This is a flowchart illustrating a sleep type assessment method in one embodiment;

[0045] Figure 3 This is a schematic diagram of sleep data in one embodiment;

[0046] Figure 4 This is a flowchart illustrating the steps for determining a preset sleep model in one embodiment;

[0047] Figure 5 This is the result of data clustering in one embodiment;

[0048] Figure 6 For one embodiment Figure 3 One of the sleep data in the dataset after being randomly segmented, randomly Gaussian blurred, and resampled in sequence;

[0049] Figure 7 For one embodiment Figure 3 The second set of sleep data is obtained by randomly segmenting, randomly Gaussian blurring, and resampling the sleep data in sequence.

[0050] Figure 8 For one embodiment Figure 3 The sleep data in the image were sequentially randomly segmented, randomly Gaussian blurred, and resampled into three parts.

[0051] Figure 9 This is one of the sleep type distribution maps in one embodiment;

[0052] Figure 10 This is the second sleep type distribution map in one embodiment;

[0053] Figure 11 This is a structural block diagram of a sleep type assessment device in one embodiment;

[0054] Figure 12 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0055] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0056] The sleep type assessment method provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, the wearable device 102 or electronic device 104 obtains the sleep type corresponding to the user's sleep data based on a preset sleep model stored internally and the user's sleep data. When the above process is implemented on the wearable device 102, after obtaining the sleep type, the wearable device 102 can transmit the sleep type to the electronic device 104 via a communication network for the user to view and determine their corresponding sleep type. Alternatively, the wearable device can announce the sleep type to the user via voice, or the wearable device can have a display screen to present the sleep type to the user in the form of text, charts, or images. The user's sleep data can be data determined after processing data related to the user's sleep state collected by sensors. Correspondingly, the sleep data sample set can also be a data sample set determined after processing data related to the user's sleep state collected by sensors. The preset sleep model obtained based on the sleep data sample set and the deep learning model can be determined in the server 106, and then the trained preset sleep model is sent to the wearable device 102 via a communication network, thereby reducing the memory usage and power consumption of the wearable device. Of course, the process of determining the preset sleep model can also be implemented by the wearable device 102 or the electronic device 104. Correspondingly, the aforementioned sensors can also be built into the wearable device 102 or the electronic device 104. The wearable device 102 can be, but is not limited to, a smartwatch, a smart bracelet, a head-mounted device, or an ear-worn device. The ear-worn device can be, but is not limited to, in-ear headphones, semi-in-ear headphones, open-back headphones, custom headphones, over-ear headphones, ear-hook headphones, clip-on headphones, hearing aids, or other devices worn on the ear. The electronic device 104 can be, but is not limited to, a mobile phone, a computer, or a medical device (such as a PSG (Pulse Shape Generator) device). For example, the wearable device can be integrated into an electronic device; for instance, the wearable device can be integrated into a medical device, and the PSG device can integrate sensors that come into contact with the human body to obtain sensor data, thereby obtaining sleep data. The server 106 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. Data storage systems can be mounted on devices such as headphones, hard drives, hospital equipment (such as PSG (Pulse Shape Generator) devices), and mobile phones.

[0057] In one exemplary embodiment, such as Figure 2 As shown, a sleep type assessment method is provided, including:

[0058] S202, Obtain the user's sleep data, which includes sleep states corresponding to multiple time windows.

[0059] For example, sleep data can be a sleep graph.

[0060] like Figure 3 As shown, sleep data can be sleep maps determined based on physiological data such as heart rate, electroencephalogram (EEG), or skin conductance response; sleep maps determined based on environmental data such as noise or light levels in the user's sleep environment; or sleep maps determined based on behavioral data such as the frequency of activity during the user's sleep.

[0061] Furthermore, the aforementioned physiological, environmental, and behavioral data can all be processed by data processing algorithms such as filtering and denoising to generate corresponding sleep maps.

[0062] For example, during sleep, the resting heart rate is lower than that during wakefulness, the electroencephalogram (EEG) differs from that during wakefulness, and the skin is more relaxed compared to when awake. Therefore, these physiological data can be used to determine whether a user is asleep. This physiological data can be obtained using devices or sensors such as PPG (Photoplethysmography) sensors, ECG (Electrocardiogram) sensors, EEG (Electroencephalogram) sensors, temperature sensors, sound sensors (such as microphones), pressure sensors, and polysomnography (PSG) devices.

[0063] For example, since ambient light intensity and noise levels are low during sleep, it is possible to determine whether a user is asleep by analyzing the ambient light intensity and noise levels. This environmental data can be acquired using sound sensors (such as microphones), optical sensors, etc.

[0064] For example, since human activity decreases during sleep, motion sensors can be used to analyze a user's movement patterns. These motion sensors can be accelerometers, gyroscopes, etc. They can be integrated into watches or ear-worn devices worn by the user. Alternatively, pressure sensors installed under mattresses or pillows can monitor changes in body pressure to determine whether the user is asleep.

[0065] S202 can be executed on wearable devices, mobile phones, computers, tablets, and other terminal devices, as well as on hospital equipment (such as PSG equipment) and servers.

[0066] For example, wearable devices include ear-worn devices, watches, wristbands, glasses, VR or AR devices, etc. Ear-worn devices may include in-ear headphones, semi-in-ear headphones, open-back headphones, custom headphones, over-ear headphones, ear-hook headphones, clip-on headphones, hearing aids, or other devices worn on the ear, etc., without specific limitations. For example, the above-mentioned wearable devices are equipped with sensors that can collect at least one of the above-mentioned physiological data, environmental data, and motion data, thereby enabling the wearable device or terminal to determine the user's sleep state based on these data, thereby obtaining sleep data, which may be a sleep graph.

[0067] The sleep data mentioned above can be sleep data during a short nap, sleep data during a whole night's sleep, sleep data over a 24-hour period, or sleep data over a week. Of course, it can also be any other sleep data that requires a long-term sleep type assessment, such as 2 days, 3 days, a week, or a month.

[0068] The time window can be determined based on the sleep stage segmentation method. For example, a time window of 30 seconds means that the user's sleep state is determined every 30 seconds.

[0069] S204, input the sleep data into the preset sleep model to obtain the sleep type corresponding to the sleep data; wherein, the preset sleep model is a model trained based on the sleep data sample set and the deep learning model.

[0070] For example, sleep data can be sleep graphs, and the sleep data sample set can be a sleep graph sample set.

[0071] During a sleep cycle, a user's sleep state changes. By inputting sleep data representing multiple time windows into a preset sleep model, the predicted sleep type corresponding to the sleep data from these multiple time windows can be determined. Sleep states are selected from at least one of the following groups, or from at least one of the following groups after adding uncertainties: wakefulness and sleep; wakefulness, REM sleep, sleep stage N1, sleep stage N2, and sleep stage N3; wakefulness, REM sleep, light sleep, and deep sleep; or wakefulness, REM sleep, and non-REM sleep; wakefulness and sleep.

[0072] More specifically, sleep data can be sleep graphs, and a sleep data sample set can be a sample set of sleep graphs.

[0073] Therefore, the aforementioned sleep type assessment method, based on user sleep data and a preset sleep model, can determine the sleep type corresponding to the sleep data. Users can directly determine their sleep type and sleep problems based on the output of the preset sleep model, meaning that the aforementioned sleep type assessment method has good intuitiveness and high accuracy. Furthermore, the preset sleep model is trained based on a sleep data sample set and a deep learning model. The sleep data includes sleep states corresponding to multiple time windows. The deep learning model directly processes the sleep data without manual feature extraction, reducing information loss. Based on a large amount of sleep data, the sleep data sample set is processed according to the data characteristics of the sleep graph, then trained, and validated on a large amount of sleep data to obtain the preset sleep model. The preset sleep model has high accuracy and strong generalization ability. This sleep type assessment method is obtained by inputting sleep data into a preset sleep model, resulting in high accuracy and strong generalization ability. It directly derives the sleep type from the sleep data, automatically completing the end-to-end sleep type classification, and is simple to operate.

[0074] In one exemplary embodiment, the deep learning model includes a deep clustering model.

[0075] Deep clustering models combine deep learning methods with clustering concepts to better discover latent structures in sleep data. The basic idea is to use deep neural networks to automatically extract features from high-dimensional data (such as physiological images, noise, etc.) in sleep data, and then apply these features for classification. The automatic feature extraction and classification processes are jointly optimized to obtain the sleep type.

[0076] Compared to traditional clustering methods, deep clustering models can better handle large-scale sleep data, thereby improving the generalization ability of sleep type assessment methods.

[0077] Deep clustering models can automatically extract deep features from sleep data, eliminating the need for manual feature extraction and manual labeling of sleep types. They can cluster sleep data and automatically identify and obtain sleep types. When the sleep data is a sleep graph, deep clustering models are well-suited and exhibit high accuracy. Sleep type assessment methods using deep clustering models also possess strong generalization capabilities.

[0078] In one exemplary embodiment, the step of determining the preset sleep model includes:

[0079] Sleep data from the sleep data sample set is input into the initial deep clustering model, and the initial deep clustering model is trained to obtain the preset sleep model. The sleep data sample set includes sleep data from multiple users.

[0080] Sleep data is divided into a sleep data sample set and a sleep data validation set. Sleep data from the sample set is input into an initial deep clustering model for training to obtain a preset sleep model. The preset sleep model is then validated using the validation set. If the evaluation metrics obtained during validation are within a reasonable range, the preset sleep model is considered to have high reliability. If the evaluation metrics exceed a reasonable range, the parameters of each dimension in the initial deep clustering model are automatically optimized, and a new preset sleep model is determined again based on the sleep data from the sample set, until the obtained evaluation metrics are within a reasonable range.

[0081] The aforementioned evaluation metrics being within a reasonable range can be understood as the accuracy of the preset sleep model obtained based on sleep data from the sleep data sample set meeting the accuracy requirements for practical application. For example, the evaluation metric could be the loss value. Of course, other data can also be used as evaluation metrics, which will not be elaborated upon here.

[0082] A sleep data sample set can be a collection of all or part of the sleep data of one or more users. Preferably, the sleep data sample set is a collection of partial sleep maps from multiple different users. This determined sleep data sample set can cover more sleep types, thereby improving the generalization ability of the sleep type assessment method. For example, a user's partial sleep map can refer to measuring the user's sleep state over multiple nights to obtain multiple sleep maps. Selecting one or more sleep maps from these multiple sleep maps constitutes the user's partial sleep map.

[0083] In addition, the sleep data sample set used for each training session can be the same or different.

[0084] In an exemplary embodiment, the initial deep clustering model includes a cascaded preset feature extraction module and a comparison module. The steps of inputting sleep data from the sleep data sample set into the initial deep clustering model and training the initial deep clustering model to obtain a preset sleep model include:

[0085] The sleep data in the sleep data sample set is input into the preset feature extraction module, and the first output result of the comparison module is obtained.

[0086] The loss value is obtained based on the first output result, and the preset feature extraction module and comparison module are trained based on the loss value to obtain the preset sleep model.

[0087] The loss value quantifies the difference between the sleep type of the preset sleep model and the target sleep type. A lower loss value indicates that the preset sleep model fits the sleep data well, while a higher loss value indicates that the preset sleep model's prediction is inaccurate. Therefore, based on the loss value, the adjustment direction and magnitude of each parameter in the preset feature extraction module and the comparison module can be determined. This allows for retraining based on the updated preset feature extraction module and comparison module, resulting in a reliable preset sleep model.

[0088] In an exemplary embodiment, the step of training a preset feature extraction module and a comparison module based on the loss value to obtain a preset sleep model includes:

[0089] Using stochastic gradient descent and backpropagation algorithms, the preset feature extraction module and comparison module are iteratively optimized based on the loss value until the loss value reaches the preset range, thus obtaining the preset sleep model.

[0090] Stochastic gradient descent is an optimization algorithm used to minimize a loss function to obtain the minimum loss value. Specifically, stochastic gradient descent uses only a randomly selected small subset (one or a few) of sleep data samples to calculate the gradient in each iteration. This method can accelerate the convergence of a pre-defined sleep model and effectively prevent the pre-defined sleep model from getting trapped in local optima.

[0091] Backpropagation is a gradient calculation method in deep learning used to train multi-layer neural networks. Based on the chain rule, it calculates the contribution of each layer's parameters to the loss function by backpropagating the loss value of a pre-defined sleep model from the output layer to the input layer.

[0092] Therefore, iteratively optimizing the preset feature extraction module and comparison module using stochastic gradient descent and backpropagation algorithms can improve the training efficiency and accuracy of the preset sleep model while optimizing the loss value.

[0093] In an exemplary embodiment, the step of inputting sleep data from a sleep data sample set into a preset feature extraction module and obtaining a first output result from the comparison module includes:

[0094] The sleep data in the sleep data sample set is randomly segmented to obtain a first sleep segment set and a second sleep segment set. The first sleep segment set includes multiple first sleep segments, each determined based on multiple sleep data. Correspondingly, the second sleep segment set includes multiple second sleep segments, each determined based on multiple sleep data.

[0095] The sleep data is randomly segmented at least once. That is, the first and second sleep segments corresponding to a given set of sleep data can be obtained after one random segmentation or after two separate random segments. For example, the sleep data is randomly segmented once to obtain one or more sleep segments. When multiple sleep segments are obtained, two segments are selected from these to obtain the first and second sleep segments. Alternatively, the sleep data is randomly segmented twice: the first segment is obtained after the first random segmentation, and the second segment is obtained after the second random segmentation. These are merely examples and do not constitute a limitation on the scope of protection; other implementation methods are also possible.

[0096] The first and second sleep segments were obtained by randomly segmenting the same sleep data. They are derived from the same sleep data and belong to the same data category. The two sleep segments randomly segmented from the same sleep data have high similarity, which fits the deep clustering model and can yield a reliable sleep type.

[0097] The sleep data sample set can be a collection of all or part of the sleep data of one or more users. Preferably, the sleep data sample set is a collection of partial sleep maps from multiple different users. This determined sleep data sample set can cover more sleep types, thereby improving the generalization ability of the sleep type assessment method.

[0098] For example, the sleep data sample set used in one training session is N represents the amount of data in one training iteration, x 1 Represents the first sleep graph, x 2 Representing the second sleep pattern..., x N This represents the Nth sleep map, which can come from 1 to N people. Preferably, these sleep maps come from different people, for example, N people. Then, through random data partitioning, the data is processed to form two parts, namely the first sleep segment set. With the second sleep fragment set Among them, the same sleep data This will create two data fragments. , For example, the first sleep graph x 1 The sleep was randomly split twice to form two sleep segments. , , Represents the first sleep graph x 1 The corresponding first sleep segment, Represents the first sleep graph x 1 The corresponding second sleep segment, the second sleep graph x 2 The sleep was randomly split twice to form two sleep segments. , , This represents the second sleep graph x. 2 The corresponding first sleep segment, This represents the second sleep graph x. 2 The corresponding second sleep segment, ..., the Nth sleep image x N The sleep was randomly split twice to form two sleep segments. , , This represents the first sleep segment corresponding to the Nth sleep map. This represents the second sleep segment corresponding to the Nth sleep map.

[0099] The first sleep segment set and the second sleep segment set are respectively input into the first preset feature extraction module and the second preset feature extraction module to obtain the first feature vector and the second feature vector.

[0100] The first and second preset feature extraction modules can automatically extract highly abstract data features, thereby determining the first and second feature vectors after layer-by-layer data processing. For example, the first and second preset feature extraction modules can be CNN (Convolutional Neural Network) feature extraction modules. The core structure of a CNN feature extraction module includes stacked convolutional layers, pooling layers, activation layers, etc. Parameters of each layer, such as the number and size of convolutional kernels, and the stride and pooling type of pooling layers, can be adjusted according to the confidence and accuracy of the prediction results of the preset sleep model to improve the prediction accuracy of the preset sleep model. This CNN feature extraction module can be designed independently or can utilize classic network structures, such as AlexNet and ResNet.

[0101] like Figure 4 As shown, the first sleep fragment set After processing by the first preset feature extraction module, the first feature vector is output. Second Sleep Fragment Collection After processing by the second preset feature extraction module, the second feature vector is output. .

[0102] The first feature vector and the second feature vector are sequentially input into the first convolutional neural network and the softmax function to obtain the first predicted class probability vector and the second predicted class probability vector. The first feature vector and the second feature vector are respectively input into the second convolutional neural network to obtain the third feature vector and the fourth feature vector. The first output result includes the first predicted class probability vector, the second predicted class probability vector, the third feature vector and the fourth feature vector.

[0103] like Figure 4 As shown, the first feature vector After inputting into the first convolutional neural network, the output is... Then, the data is input into the softmax function, which converts it into a probability distribution to obtain the classification result, thus yielding the first predicted class probability vector. Correspondingly, the second feature vector After inputting into the first convolutional neural network, the output is... Then, the data is input into the softmax function, which converts it into a probability distribution to obtain the classification result, thus yielding the second predicted class probability vector. .

[0104] More specifically, It can be represented in matrix form: Where N represents the number of sleep segments in a sleep segment cluster, and M represents the number of sleep types. That is: , , ..., .in, Represented as the first sleep fragment set x a Sleep segments The probability of it being the first type of sleep; Represented as the first sleep fragment set x a Sleep segments The probability of it being the second type of sleep; Represented as the first sleep fragment set x a Sleep segments The probability of it being the third type of sleep; ... Represented as the first sleep fragment set x a Sleep segments The probability that it is the Mth sleep type; Represented as the first sleep fragment set x a Sleep segments The probability of it being the first type of sleep; Represented as the first sleep fragment set x a Sleep segments The probability of it being the first type of sleep; Represented as the first sleep fragment set x a Sleep segments This represents the probability of the Mth sleep type. It should be noted that the specific meanings of the matrix elements not exhaustively listed above can be found in the examples above; they will not be repeated here. For example... The content and meaning refer to .

[0105] like Figure 4 As shown, the first feature vector After inputting into the second convolutional neural network, the third feature vector is output. Correspondingly, the second feature vector After inputting into the second convolutional neural network, the output is the fourth feature vector. .

[0106] Furthermore, if each sleep data point in the sleep data sample set contains corresponding personal information, such as age, gender, and region, this personal information can be digitally encoded and its features normalized, and then concatenated with the z in the output results mentioned above. a , z b , , By combining these methods, the accuracy of predictions can be improved.

[0107] In an exemplary embodiment, the step of randomly segmenting sleep data in a sleep data sample set to obtain a first sleep fragment set and a second sleep fragment set includes:

[0108] The sleep data in the sleep data sample set is randomly segmented to obtain the first sleep segment and the second sleep segment that correspond one-to-one with the sleep data.

[0109] The first sleep segment set is determined based on each first sleep segment.

[0110] The set of second sleep segments is determined based on each second sleep segment.

[0111] Let's take sleep data as an example to illustrate: If the sleep data sample set used in one training session is... Where N represents the amount of data in one training iteration, and x 1 Represents the first sleep graph, x 2 Representing the second sleep pattern..., x N This represents the Nth sleep map, which can be from 1 to N people. Preferably, these sleep maps are from different people, for example, N people. The sleep maps in this sleep data sample set are randomly partitioned, i.e., based on the first sleep map x... 1 Obtain the first sleep segment Second sleep segment According to the second sleep chart x 2 Obtain the first sleep segment Second sleep segment ...; based on the Nth sleep graph x N Obtain the first sleep segment Second sleep segment Then, based on each sleep... Figure 1 A corresponding first sleep segment is used to determine the first sleep segment set, i.e., the first sleep segment set is... Correspondingly, according to each sleep... Figure 1 A corresponding second sleep segment is used to determine the set of second sleep segments, i.e., the set of second sleep segments is... .

[0112] The first sleep segment and the second sleep segment are obtained by randomly dividing the same sleep data. The first sleep segment set and the second sleep segment set are obtained by corresponding one-to-one with each sleep data. Based on the random segmentation method, data from different time periods of sleep data are cropped as sample data of the same type, which enhances the generalization ability of the algorithm.

[0113] In one exemplary embodiment, the parameters in the first preset feature extraction module are the same as those in the second preset feature extraction module.

[0114] The same parameters can be understood as weight sharing between the first preset feature extraction module and the second preset feature extraction module.

[0115] Using the same parameters can significantly reduce the total number of parameters in a deep clustering model, thereby alleviating the complexity of the deep clustering model and reducing the resource requirements for training and storage.

[0116] In one exemplary embodiment, the number of convolutional layers in the first convolutional neural network is greater than the number of convolutional layers in the second convolutional neural network.

[0117] The first convolutional neural network is related to the final sleep type. Therefore, setting a deeper number of convolutional layers can ensure that the preset sleep model can output a reliable sleep type.

[0118] The second convolutional neural network is related to the optimization of the preset sleep model. Setting a shallower number of convolutional layers can improve the optimization efficiency of the preset sleep model.

[0119] In one exemplary embodiment, the duration of the random segmentation is longer than one sleep cycle.

[0120] During sleep, a person's sleep state switches periodically among different states, resulting in periodic sleep data. Generally, 1.5h is considered a sleep cycle, and the sleep data can be a hypnogram. Usually, the randomly segmented time length is greater than one sleep cycle (e.g., 1.5h), and the number of sleep states in a sleep segment obtained by randomly segmenting the hypnogram once is l, where l < L min <l < L, where L min is the number of sleep states corresponding to one sleep cycle, and L is the number of sleep states corresponding to the total time length of a hypnogram. There is no special limitation on the number l of sleep states in a sleep segment obtained by randomly segmenting the hypnogram once in this application, as long as l is greater than zero, for example, l ≤ L min or l = L.

[0121] Furthermore, the starting point of the random segmentation can be any value less than L min of any value.

[0122] Exemplarily, there is a hypnogram with a total sleep duration of 8 hours. If the sleep state corresponding to every 30s can be determined, then the data length L of the hypnogram is 960, that is, there are 960 sleep states. Assuming the randomly segmented time length is greater than 1.5h, then the length of the randomly segmented data is any value greater than 180 and less than 960. During random segmentation, if l is selected as 200 and the starting point of the randomly segmented data length is 10, then it can be determined that the first sleep segment is the segment data within the range of 10 - 210 of the hypnogram. Similarly, the hypnogram can be randomly segmented again to obtain a second sleep segment. The second sleep segment is the segment data within the range of 200 - 900 of the hypnogram, or the segment data within any other range. The second sleep segment can also be the entire hypnogram.

[0123] In an exemplary embodiment, the step of obtaining the loss value according to the first output result includes:

[0124] Determining the class similarity between the first predicted class probability vector and the second predicted class probability vector, the probability mean of the first predicted class probability vector, and the probability mean of the second predicted class probability vector.

[0125] The class similarity between the first predicted class probability vector and the second predicted class probability vector can be determined according to the following formula:

[0126] , where i ≠ j.

[0127] , where i ≠ j.

[0128] , where i ≠ j.

[0129] , where i≠j.

[0130] Where i = 1, 2, 3, ..., M; j = 1, 2, 3, ..., M; T is the mathematical transpose.

[0131] Category similarity includes , , , .

[0132] The category loss value is determined based on the category similarity.

[0133] Category loss value as well as It can be determined using the following formula:

[0134] , where i≠j.

[0135] , where i≠j.

[0136] Where i = 1, 2, 3, ..., M; j = 1, 2, 3, ..., M, M represents the number of clusters; The category loss is the temperature coefficient; specifically, It can be set to 1 by default, or it can be adjusted based on experience and the performance requirements of the preset sleep model.

[0137] Determine the feature similarity between the third and fourth feature vectors, and determine the feature loss value based on the feature similarity.

[0138] Feature similarity between the third and fourth feature vectors It can be determined using the following formula:

[0139] , where i≠j.

[0140] , where i≠j.

[0141] , where i≠j.

[0142] , where i≠j.

[0143] Where i = 1, 2, 3, ..., N; j = 1, 2, 3, ..., N; T is the mathematical transpose.

[0144] Feature loss value as well as It can be determined using the following formula:

[0145] , where i≠j.

[0146] , where i≠j.

[0147] Where i = 1, 2, 3, ..., N; j = 1, 2, 3, ..., N; The feature loss is the temperature coefficient, specifically... It can be set to 1 by default, or it can be adjusted based on experience and the performance requirements of the preset sleep model.

[0148] The loss value is determined based on the category loss value, the feature loss value, the probability mean of the first predicted category probability vector, and the probability mean of the second predicted category probability vector.

[0149] The reliability of the preset sleep model obtained during training is determined based on the loss value. If the loss value does not meet the preset conditions, the parameters in the deep clustering model are modified through a parameter optimization algorithm. Then, based on the adjusted deep clustering model, the preset sleep model is re-determined until the loss value meets the preset conditions.

[0150] The preset condition is that the loss value reaches its minimum. For example, determining whether the loss value has reached its minimum can be done by comparing the loss value obtained after parameter tuning with the loss value obtained before parameter tuning. If the upward or downward trend of the loss value is greater than the reasonable trend level, and the deviation level is greater than the reasonable deviation level, then the loss value is considered not yet at its minimum. If the upward or downward trend of the loss value is less than or equal to the reasonable trend level, and the deviation level is less than or equal to the reasonable deviation level, then the loss value is considered to have reached its minimum. Here, the trend level refers to the change trend of the loss value obtained this time compared to the loss values ​​obtained previously; the reasonable trend level can be determined based on historical experience or the performance requirements of the preset sleep model. The deviation level is the difference between the loss value obtained this time and the loss value obtained the previous time or the time before that; the deviation level can also be the difference between the loss value obtained this time and the best loss value obtained previously; the reasonable deviation level can be determined based on historical experience or the performance requirements of the preset sleep model. Determining whether the loss value has reached its minimum can also be done when the obtained loss value shows a convergence trend and the loss value is within a reasonable range. Here, the reasonable range can be determined based on historical experience or the performance requirements of the preset sleep model.

[0151] Based on the aforementioned loss values, the preset sleep model can be optimized. After the sleep model optimization is complete, the data clustering results can be obtained. The number of clusters is set according to the data and experience, such as... Figure 5Based on the clustering results of the sleep type assessment method, five sleep types were obtained, namely, Type A sleep, Type B sleep, Type C sleep, Type D sleep, and Type E sleep. For example, Type A sleep, Type B sleep, Type C sleep, Type D sleep, and Type E sleep represent normal sleep, light sleep, difficulty falling asleep, insomnia, and sleep disorder, respectively; each color represents a category, and each dot represents a data point, i.e., a person's sleep map.

[0152] In an exemplary embodiment, the step of determining the loss value based on the category loss value, the feature loss value, the probability mean of the first predicted category probability vector, and the probability mean of the second predicted category probability vector includes:

[0153] The entropy of the cluster assignment probability is determined based on the mean probability of the first predicted category probability vector and the mean probability of the second predicted category probability vector.

[0154] The loss value is determined based on the category loss value, feature loss value, and entropy of the cluster assignment probability.

[0155] The entropy H(Y) of the cluster assignment probability can be determined according to the following formula:

[0156] , where i≠j.

[0157] in, , This represents the mean probability of each class in the classification prediction. Specifically, Let be the mean probability of the i-th predicted category among the sleep segments in the first sleep segment set. Let M be the mean probability of the predicted category of the sleep segment in the second sleep segment set, and let M represent the number of clusters, i = 1, 2, 3, ..., M. M is an integer greater than or equal to 1, and generally, M is an integer greater than or equal to 2. Specifically, when M is 5, it represents 5 sleep types; when M is 3, it represents 3 sleep types; and when M is 2, it represents 2 sleep types.

[0158] Specifically, It can be determined using the following formula:

[0159]

[0160] It can be determined using the following formula:

[0161]

[0162] The loss value L can be determined using the following formula:

[0163] , where i≠j.

[0164] in, and The feature loss value, and Let H(Y) be the category loss value, and H(Y) be the entropy of the cluster assignment probability. The entropy of the cluster assignment probability can control the clusters from becoming overly concentrated in one class.

[0165] In an exemplary embodiment, before the step of inputting the first sleep segment set and the second sleep segment set to the first preset feature extraction module and the second preset feature extraction module, respectively, the method further includes:

[0166] Each sleep segment in the first sleep segment set and the second sleep segment set is sequentially subjected to random Gaussian blurring, resampling, and standardization.

[0167] The window range length k of the random Gaussian blur is set according to the actual prediction performance, and the weight G of each sleep state of each first sleep segment and second sleep segment within the window range is set.

[0168] Specifically, the weight G can be determined according to the following formula:

[0169]

[0170] Where, d i For example, the distance from the center of the window for the d-th data point within a random Gaussian blurred window; For the parameters of G.

[0171] in, =(0.3*((k-1)*0.5-1)+0.8)*p, where p is a random value for random Gaussian blur, 0≤p≤1. Furthermore, Gaussian blur can be set to occur when p is greater than a certain value, such as when p>0.2.

[0172] The more blurred the first and second sleep fragment sets are after random Gaussian blurring, the greater the deviation between them and the original data, and the more difficult it is to identify the data. This enhances the generalization ability and robustness of the preset feature extraction module.

[0173] Resample each sleep segment in the first and second sleep segment sets after random Gaussian blurring, so that all sleep segments in the first and second sleep segment sets are resampled. , The lengths are consistent, that is The lengths are consistent.

[0174] Resampling can be achieved through linear interpolation or other interpolation methods to ensure that all sleep segments in the first sleep segment set and the second sleep segment set are resampled. , The lengths of all data are consistent, thus ensuring the consistency of data length before entering the preset feature extraction module.

[0175] For example, for Figure 3 After sequentially performing random segmentation of different lengths, random Gaussian blurring, and resampling on the sleep data, we can obtain... Figure 6 , Figure 7 as well as Figure 8 The sleep data shown is from the data sample. Although it has been resampled, Figure 6 , Figure 7 as well as Figure 8 The sleep data have the same data length, but based on the sparsity of the sleep data, it can be seen that... Figure 7 The corresponding random segment length is greater than Figure 6 The corresponding random segment length, and less than Figure 8 The corresponding random segment length.

[0176] Standardization refers to shifting sleep data to a uniform scale to improve the convergence speed and performance of preset sleep models.

[0177] Specifically, all data can be labeled using a standardization formula, as follows:

[0178]

[0179] Where x represents a segment of sleep data ( , ), This represents the mean of all sleep data in the sleep data sample set. This represents the variance of each sleep data point in the sleep data sample set. The sleep data can be a sleep graph. For example, u and... It can be calculated from a statistical sample set of overall sleep data.

[0180] Based on the characteristics of sleep data and the working mode of contrastive learning in deep clustering models, this solution designs sleep data processing schemes such as random segmentation, random Gaussian blurring, resampling, and standardization to fit sleep data with the model, enabling the model to converge quickly.

[0181] In one embodiment, after the step of acquiring the user's sleep data and before the step of inputting the sleep data into a preset sleep model, the method further includes:

[0182] Sleep data is resampled and standardized.

[0183] The processing method is consistent with that used for sleep data during the training phase, which helps to output reasonable sleep type assessment results.

[0184] After resampling and standardizing the sleep data, the processed sleep data is input into a preset sleep model to obtain the sleep type corresponding to the sleep data.

[0185] In one embodiment, the above sleep type assessment method further includes:

[0186] The distribution of sleep types is determined based on the identified sleep types.

[0187] Users can obtain multiple sleep types by using wearable devices equipped with this sleep type assessment method during multiple sleep cycles. By statistically analyzing these multiple sleep types, the distribution of sleep types corresponding to the user can be determined, allowing the user to clearly know which sleep type they prefer.

[0188] A defined distribution of sleep types can be represented numerically, such as as a percentage, or graphically, such as in a bar chart or pie chart. Of course, sleep type distribution can be represented in other ways as well; the examples above are not intended to limit it.

[0189] For example, such as Figure 9 and Figure 10 As shown, Figure 9 and Figure 10 To represent the distribution of sleep types in a sleep type distribution map, if type A sleep type represents normal sleep, type B sleep type represents light sleep, type C sleep type represents difficulty falling asleep, type D sleep type represents insomnia, and type E sleep type represents sleep disorder, then... Figure 9 The sleep type distribution map indicates that this user prefers the lighter sleep type represented by type B sleep. Figure 10 The sleep type distribution map indicates that the user is more inclined to the shallow sleep type represented by type B sleep type and the insomnia type represented by type D sleep type.

[0190] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0191] Based on the same inventive concept, this application also provides a sleep type assessment device for implementing the sleep type assessment method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more sleep type assessment device embodiments provided below can be found in the limitations of the sleep type assessment method described above, and will not be repeated here.

[0192] In one exemplary embodiment, such as Figure 11 As shown, a sleep type assessment device 900 is provided, including: an acquisition module 902 and a prediction module 904, wherein:

[0193] The acquisition module 902 is used to acquire the user's sleep data, which includes sleep states corresponding to multiple time windows.

[0194] The prediction module 904 is used to input the sleep data into a preset sleep model to obtain the sleep type corresponding to the sleep data; wherein, the preset sleep model is a model trained based on a sleep data sample set and a deep learning model.

[0195] In one exemplary embodiment, the deep learning model in the sleep type assessment device 900 described above includes a deep clustering model.

[0196] In an exemplary embodiment, the sleep type assessment device 900 further includes a training module.

[0197] The training module is used to input sleep data from the sleep data sample set into the initial deep clustering model and train the initial deep clustering model to obtain the preset sleep model. The sleep data sample set includes sleep data from multiple users.

[0198] In an exemplary embodiment, the initial deep clustering model includes a cascaded preset feature extraction module and a comparison module, and the training module includes a first output result determination module and an optimization module.

[0199] The first output result determination module is used to input sleep data from the sleep data sample set into the preset feature extraction module and obtain the first output result output by the comparison module.

[0200] The optimization module is used to obtain the loss value based on the first output result, and to train the preset feature extraction module and the comparison module based on the loss value to obtain the preset sleep model.

[0201] In one exemplary embodiment, the optimization module includes an iterative optimization module.

[0202] The iterative optimization module uses stochastic gradient descent and backpropagation algorithms to iteratively optimize the preset feature extraction module and comparison module based on the loss value until the loss value reaches the preset range, thus obtaining the preset sleep model.

[0203] In an exemplary embodiment, the first output result determination module includes: a sleep fragment set determination module, a first data determination module, and a second data determination module.

[0204] The sleep fragment set determination module is used to randomly segment the sleep data in the sleep data sample set to obtain a first sleep fragment set and a second sleep fragment set.

[0205] The first data determination module is used to input the first sleep segment set and the second sleep segment set into the first preset feature extraction module and the second preset feature extraction module, respectively, to obtain the first feature vector and the second feature vector.

[0206] The second data determination module is used to input the first feature vector and the second feature vector into the first convolutional neural network and the softmax function in sequence to obtain the first predicted class probability vector and the second predicted class probability vector. The first feature vector and the second feature vector are respectively input into the second convolutional neural network to obtain the third feature vector and the fourth feature vector. The first output result includes the first predicted class probability vector, the second predicted class probability vector, the third feature vector and the fourth feature vector.

[0207] In an exemplary embodiment, the sleep fragment set determination module includes: a random segmentation module, a first sleep fragment set determination module, and a second sleep fragment set determination module.

[0208] The random segmentation module is used to randomly segment each sleep data in the sleep data sample set to obtain a first sleep segment and a second sleep segment that correspond one-to-one with the sleep data.

[0209] The first sleep segment set determination module is used to determine the first sleep segment set based on each first sleep segment.

[0210] The second sleep segment set determination module is used to determine the second sleep segment set based on each second sleep segment.

[0211] In one exemplary embodiment, the parameters in the first preset feature extraction module are the same as those in the second preset feature extraction module.

[0212] In one exemplary embodiment, the number of convolutional layers in the first convolutional neural network is greater than the number of convolutional layers in the second convolutional neural network.

[0213] In one exemplary embodiment, the duration of the random segmentation is longer than one sleep cycle.

[0214] In an exemplary embodiment, the optimization module includes: a third data determination module, a category loss value determination module, a feature loss value determination module, and a loss value determination module.

[0215] The third data determination module is used to determine the class similarity between the first predicted class probability vector and the second predicted class probability vector, the mean probability of the first predicted class probability vector, and the mean probability of the second predicted class probability vector.

[0216] The category loss value determination module is used to determine the category loss value based on category similarity.

[0217] The feature loss value determination module is used to determine the feature similarity between the third and fourth feature vectors, and to determine the feature loss value based on the feature similarity.

[0218] The loss value determination module is used to determine the loss value based on the category loss value, feature loss value, the probability mean of the first predicted category probability vector, and the probability mean of the second predicted category probability vector.

[0219] In one exemplary embodiment, the loss value determination module includes an entropy determination module and a loss value determination submodule.

[0220] The entropy determination module is used to determine the entropy of the cluster assignment probability based on the probability mean of the first predicted category probability vector and the probability mean of the second predicted category probability vector.

[0221] The loss value determination submodule is used to determine the loss value based on the category loss value, feature loss value, and entropy of the cluster assignment probability.

[0222] In an exemplary embodiment, the sleep type assessment device 900 further includes a first data processing module.

[0223] The first data processing module is used to perform random Gaussian blurring, resampling, and standardization on each sleep segment in the first sleep segment set and the second sleep segment set in sequence.

[0224] In an exemplary embodiment, the sleep type assessment device 900 further includes a second data processing module.

[0225] The second data processing module is used to resample and standardize the sleep data.

[0226] Each module in the aforementioned sleep type assessment device 900 can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.

[0227] In one exemplary embodiment, a wearable device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement any of the steps in the sleep type assessment method described above.

[0228] Wearable devices equipped with the aforementioned sleep type assessment method can monitor in real time whether a user has entered a sleep state and perform targeted sleep type monitoring for that user, thereby achieving personalized sleep type assessment.

[0229] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the methods described above for sleep type assessment.

[0230] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of any of the methods described above for sleep type assessment.

[0231] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0232] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0233] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0234] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for assessing sleep types, characterized in that, The method includes: Acquire the user's sleep data, which includes sleep states corresponding to multiple time windows; The sleep data is input into a preset sleep model to obtain the sleep type corresponding to the sleep data; wherein, the preset sleep model is a model trained based on a sleep data sample set and a deep learning model.

2. The method according to claim 1, characterized in that, The deep learning model includes a deep clustering model.

3. The method according to claim 2, characterized in that, The steps for determining the preset sleep model include: Sleep data from the sleep data sample set is input into an initial deep clustering model, and the initial deep clustering model is trained to obtain the preset sleep model. The sleep data sample set includes sleep data from multiple users.

4. The method according to claim 3, characterized in that, The initial deep clustering model includes a cascaded preset feature extraction module and a comparison module. The process of inputting sleep data from the sleep data sample set into the initial deep clustering model and training the initial deep clustering model to obtain the preset sleep model includes: The sleep data in the sleep data sample set is input into the preset feature extraction module to obtain the first output result output by the comparison module; The loss value is obtained based on the first output result, and the preset feature extraction module and the comparison module are trained based on the loss value to obtain the preset sleep model.

5. The method according to claim 4, characterized in that, The step of training the preset feature extraction module and the comparison module based on the loss value to obtain the preset sleep model includes: Using stochastic gradient descent and backpropagation algorithms, the preset feature extraction module and the comparison module are iteratively optimized based on the loss value until the loss value reaches a preset range, thus obtaining the preset sleep model.

6. The method according to claim 4, characterized in that, The step of inputting sleep data from the sleep data sample set into the preset feature extraction module to obtain the first output result from the comparison module includes: The sleep data in the sleep data sample set is randomly segmented to obtain a first sleep segment set and a second sleep segment set; The first sleep segment set and the second sleep segment set are respectively input into the first preset feature extraction module and the second preset feature extraction module to obtain the first feature vector and the second feature vector; The first feature vector and the second feature vector are sequentially input into the first convolutional neural network and the softmax function to obtain the first predicted class probability vector and the second predicted class probability vector. The first feature vector and the second feature vector are respectively input into the second convolutional neural network to obtain the third feature vector and the fourth feature vector. The first output result includes the first predicted class probability vector, the second predicted class probability vector, the third feature vector and the fourth feature vector.

7. The method according to claim 6, characterized in that, The step of randomly segmenting the sleep data in the sleep data sample set to obtain a first sleep fragment set and a second sleep fragment set includes: The sleep data in the sleep data sample set is randomly segmented to obtain a first sleep segment and a second sleep segment that correspond one-to-one with the sleep data. Based on each of the first sleep segments, determine the first sleep segment set; The second sleep segment set is determined based on each of the second sleep segments.

8. The method according to claim 6, characterized in that, The parameters in the first preset feature extraction module are the same as those in the second preset feature extraction module.

9. The method according to claim 6, characterized in that, The number of convolutional layers in the first convolutional neural network is greater than the number of convolutional layers in the second convolutional neural network.

10. The method according to claim 6, characterized in that, The duration of the random segmentation is longer than one sleep cycle.

11. The method according to claim 6, characterized in that, The step of obtaining the loss value based on the first output result includes: Determine the class similarity between the first predicted class probability vector and the second predicted class probability vector, the mean probability of the first predicted class probability vector, and the mean probability of the second predicted class probability vector; Based on the category similarity, determine the category loss value; Determine the feature similarity between the third feature vector and the fourth feature vector, and determine the feature loss value based on the feature similarity; The loss value is determined based on the category loss value, the feature loss value, the probability mean of the first predicted category probability vector, and the probability mean of the second predicted category probability vector.

12. The method according to claim 11, characterized in that, Determining the loss value based on the category loss value, the feature loss value, the probability mean of the first predicted category probability vector, and the probability mean of the second predicted category probability vector includes: The entropy of the clustering assignment probability is determined based on the probability mean of the first predicted category probability vector and the probability mean of the second predicted category probability vector. The loss value is determined based on the category loss value, the feature loss value, and the entropy of the cluster assignment probability.

13. The method according to claim 6, characterized in that, Before the step of inputting the first sleep segment set and the second sleep segment set into the first preset feature extraction module and the second preset feature extraction module respectively, the method further includes: Each sleep segment in the first sleep segment set and the second sleep segment set is sequentially subjected to random Gaussian blurring, resampling, and standardization.

14. The method according to any one of claims 1-13, characterized in that, After the step of acquiring the user's sleep data, and before the step of inputting the sleep data into a preset sleep model, the method further includes: The sleep data is resampled and standardized.

15. A wearable device comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 14.

16. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 14.