A smartwatch-based sleep staging detection method and system

By combining multi-source signal fusion and deep learning technology with bidirectional long short-term memory networks and temporal autocorrelation feature analysis, the problems of insufficient information and insufficient anti-interference ability in smartwatch sleep monitoring are solved, and highly accurate sleep stage identification is achieved.

CN120753596BActive Publication Date: 2026-03-17HUNAN SHENGSHI WEIDE TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-04
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

Existing sleep monitoring methods based on smartwatches suffer from insufficient information dimensions, susceptibility to environmental noise, failure to effectively remove interference factors, and neglect of the temporal dependence of sleep states, resulting in low accuracy in sleep stage identification.

Method used

By fusing heart rate variability signals, triaxial acceleration signals, and body motion intensity index signals, and combining bidirectional long short-term memory network and temporal autocorrelation feature analysis, multi-source signal fusion, noise reduction processing, and temporal modeling are performed to achieve accurate identification and classification of sleep states.

Benefits of technology

It improves the accuracy and anti-interference ability of sleep state recognition, and can maintain a high recognition rate under intense physical movement or noise interference, providing stable and reliable sleep monitoring support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120753596B_ABST
    Figure CN120753596B_ABST
Patent Text Reader

Abstract

This invention discloses a sleep stage detection method and system based on a smartwatch, comprising: S1: acquiring the wearer's heart rate variability, triaxial accelerometer data, and body motion index signal through the smartwatch's sensors, and performing multi-source signal fusion and time synchronization; S2: performing noise reduction processing on the synchronized multi-source signals to construct a feature vector; S3: calculating the temporal autocorrelation feature of the feature vector; S4: performing temporal modeling on the input feature vector and temporal autocorrelation feature based on a bidirectional long short-term memory network structure to obtain a fused bidirectional feature representation; S5: performing multi-classification processing on the fused bidirectional feature representation based on a Softmax classifier to achieve accurate sleep stage classification. This invention can achieve accurate identification and classification of human sleep states by fusing heart rate variability signals and triaxial accelerometer signals, combined with bidirectional long short-term memory network and temporal autocorrelation feature analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of sleep stage detection, and more particularly to a sleep stage detection method and system based on a smartwatch. Background Technology

[0002] As people pay increasing attention to sleep health, sleep monitoring technology is playing an increasingly important role in the medical and health field. Traditional sleep monitoring mainly relies on polysomnography, which needs to be carried out in professional medical institutions. Not only is the testing process complex, but the test subject also needs to wear multiple sensors, which seriously affects sleep comfort. Moreover, the equipment is expensive and cannot meet the needs of daily home monitoring.

[0003] Currently, several sleep monitoring solutions based on portable devices have emerged in the market. For example, patent application number CN202510238137.9 discloses a sleep stage detection method based on polysomnography. This method extracts features of different frequencies through multiple CNN sequences and uses a multi-level model for sleep stage identification. However, this method still requires the collection of polysomnography data, the device is inconvenient to carry, and signal acquisition is easily interfered with by factors such as body movement, reducing the accuracy of identification. In addition, this method mainly relies on CNN networks for feature extraction, failing to fully utilize the temporal correlation of sleep signals, resulting in an insufficiently accurate characterization of the sleep state transition process.

[0004] In recent years, with the popularization of wearable devices such as smartwatches, sleep monitoring methods based on single sensors have gradually emerged. However, existing smartwatch-based sleep monitoring methods mainly suffer from the following problems: First, most methods only utilize a single physiological signal source for sleep state identification, such as relying solely on heart rate variability or acceleration data, resulting in insufficient information dimensions and susceptibility to environmental noise; second, existing methods have relatively simple noise reduction and feature extraction of the original signal, failing to effectively remove the influence of various interference factors; finally, in the design of sleep stage identification models, the temporal dependence of sleep states is often ignored, leading to low accuracy in judging sleep state transitions.

[0005] Therefore, how to achieve accurate and reliable sleep stage identification based on portable devices such as smartwatches has become a pressing technical problem in this field. This invention addresses this problem by proposing a novel sleep stage identification method based on multi-source signal fusion. Summary of the Invention

[0006] In view of this, the present invention provides a sleep stage detection method and system based on a smartwatch, aiming to achieve accurate identification and classification of human sleep states by fusing heart rate variability signals, triaxial acceleration signals and body motion intensity index signals, combined with bidirectional long short-term memory network and temporal autocorrelation feature analysis.

[0007] To achieve the above objectives, the present invention provides a sleep staging detection method based on a smartwatch, comprising the following steps:

[0008] S1: Through the smartwatch's sensors, acquire three raw physiological signals from the wearer: heart rate variability, triaxial accelerometer data, and body intensity index, and perform multi-source signal fusion and time synchronization to obtain synchronized multi-source signals;

[0009] S2: Perform noise reduction on the synchronized multi-source signals, extract time-domain features, and construct feature vectors;

[0010] S3: Calculate the time-series autocorrelation feature of the feature vector; the time-series autocorrelation feature is calculated by calculating the autocorrelation coefficient of each of the four dimensions of the feature vector at each time delay, and then taking the average value of the autocorrelation coefficients of the four dimensions as the autocorrelation feature of that time delay;

[0011] S4: Based on a bidirectional long short-term memory network, temporal modeling is performed on the input feature vector and temporal autocorrelation features to obtain the fused bidirectional feature representation;

[0012] S5: Based on the Softmax classifier, multi-classification processing is performed on the fused bidirectional feature representation to achieve accurate classification of sleep stages.

[0013] Optionally, in step S1, the wearer's heart rate variability, accelerometer data, and body intensity index are acquired through the smartwatch's sensors, and multi-source signal fusion and time synchronization are performed, including:

[0014] S11: Acquire heart rate variability signals and perform sliding window filtering, specifically:

[0015] ;

[0016] in, for Heart rate variability signal at time-sampling points; For summation functions; The sliding window weight function, For the time index within the sliding window, To adjust the sliding window size; for Heart rate variability signal at time-sampling points;

[0017] S12: Acquire triaxial accelerometer data and calculate the composite acceleration. Specifically:

[0018] ;

[0019] in, for The composite acceleration at each sampling point at any given time; , and They are respectively sampling point at time axis, shaft and Acceleration components along the axial direction;

[0020] S13: Calculate the physical intensity index Specifically:

[0021] ;

[0022] in, for The body motion intensity index at the sampling point at any given time; The length of the time window required to calculate the body dynamics intensity index; The time index within the time window required to calculate the body dynamics intensity index; for The composite acceleration at each sampling point at any given time; The attenuation coefficient; It is a natural constant;

[0023] S14: Constructing a multi-source signal fusion matrix Specifically:

[0024] ;

[0025] in, for Multi-source signal fusion matrix at each sampling point; , and They are respectively Heart rate variability signal at time sampling points The composite acceleration at each sampling point at time step The body motion intensity index at each sampling point is normalized to the specified value. interval;

[0026] S15: Perform time synchronization on the multi-source signal fusion matrix to obtain the synchronized multi-source signal. Specifically:

[0027] ;

[0028] in, for Multi-source signals after synchronization of sampling points at each moment; for The first of the multi-source signal fusion matrix at each sampling point in time One signal; For the first The time delay of each signal; For the first The weighting coefficients of each signal; .

[0029] Optionally, in step S2, the acquired raw signal is denoised and temporal features are extracted to construct a feature vector, including:

[0030] S21: Wavelet transform is used to perform multi-scale decomposition on the synchronized multi-source signals, specifically:

[0031] ;

[0032] in, For the first Layer in Wavelet decomposition coefficients at the sampling point at time step; The number of decomposition layers; It is a wavelet transform function;

[0033] S22: Noise reduction is performed using a threshold function, specifically:

[0034] ;

[0035] in, For the first Layer in Wavelet coefficients after noise reduction at each sampling point; It is a symbolic function; For the first The threshold parameter of the layer;

[0036] S23: Reconstruct the signal using the wavelet reconstruction function to obtain the reconstructed signal. Specifically:

[0037] ;

[0038] in, for The reconstructed signal from the sampling points at each time step; This represents the total number of wavelet decomposition layers. For wavelet reconstruction function;

[0039] S24: Extract the temporal features of the reconstructed signal to construct the feature vector. Specifically:

[0040] ;

[0041] in, for Feature vector of sampling point at time step; for Average amplitude at sampling points at time intervals; for Root mean square value of sampling point at time step; for Maximum amplitude at each sampling point at any given time; for Rate of change of waveform at each sampling point at any given time; and They are respectively Time sampling points and The reconstructed signal from the sampling points at each time step; For temporary sampling point count variables; This represents the length of the feature extraction time window.

[0042] Optionally, the calculation of the temporal autocorrelation features of the feature vector in step S3 includes:

[0043] Calculate eigenvectors The time-series autocorrelation characteristics were analyzed to obtain the autocorrelation coefficient sequence. Specifically:

[0044] ;

[0045] in, For time delay The autocorrelation coefficient; This represents the total length of the sequence. This is the amount of time delay. , This represents the maximum delay. ; express Sampling points No. Features of dimensions; express Time sampling point No. Features of dimensions; for Feature vector of sampling point at time step.

[0046] Optionally, in step S4, based on a bidirectional long short-term memory network structure, temporal modeling is performed on the input feature vector and temporal autocorrelation features to obtain the fused bidirectional feature representation, including:

[0047] S41: Construct the input sequence for the feedforward network, specifically:

[0048] ;

[0049] in, for The forward network input sequence at each sampling point; The length of the historical time window;

[0050] S42: Construct the feedforward network gating unit, specifically:

[0051] ;

[0052] in, for The state of the input gate at each sampling point; for Output gate state at each sampling point; for Candidate state of sampling points at any given time; , , All are forward weight matrices; , , All are forward loop weight matrices; , , All are bias vectors; for The forward hidden state of the sampling point at time step; It is a sigmoid activation function; It is the hyperbolic tangent function;

[0053] S43: Construct the backward network gating unit, specifically:

[0054] ;

[0055] in, for The state of the backward input gate at each sampling point; for The state of the backward output gate at each sampling point; for Backward candidate state at each sampling point; , , All are backward weight matrices; , , All are backward loop weight matrices; , , All are backward bias vectors; for The backward hidden state of the sampling point at time step;

[0056] S44: Update the bidirectional long short-term memory network state, specifically:

[0057] ;

[0058] in, and They are respectively Time sampling points and Forward memory state of each sampling point; and for Time sampling points and The sampling point represents the backward memory state; ⊙ represents element-wise multiplication;

[0059] S45: Perform temporal modeling on the input feature vector and temporal autocorrelation features to obtain the fused bidirectional feature representation, specifically:

[0060] ;

[0061] in, for Bidirectional feature representation after fusion of sampling points at different times.

[0062] Optionally, in step S5, the fused bidirectional feature representation is subjected to multi-classification processing based on a Softmax classifier to achieve accurate classification of sleep stages, including:

[0063] S51: Construct a labeled dataset based on the fused bidirectional feature representation, where each sample contains the fused bidirectional feature representation. and the corresponding completed sleep stage labels , These represent the waking state, REM sleep, light sleep, and deep sleep, respectively. During the training phase, a Softmax classifier is used to calculate the probability distribution of each sleep stage category, specifically:

[0064] ;

[0065] in, For training samples Bidirectional feature representation after fusion of sampling points at different times; For the training phase The bidirectional feature representation after fusion of sampling points at time step belongs to the first step. The probability of each category; These correspond to the waking period, REM sleep period, light sleep period, and deep sleep period, respectively. For the first The weight vector of the class; For the first Class bias terms; It is an exponential function;

[0066] S52: Train the Softmax classifier to obtain a trained Softmax classifier. Specifically, the training process of the Softmax classifier adopts the mini-batch stochastic gradient descent method. During the training phase, cross-entropy is used as the loss function. At the same time, L2 regularization is introduced to prevent overfitting. The training process continues until the accuracy of the epoch validation set does not improve for 5 consecutive epochs or the maximum number of training epochs of 100 epochs is reached.

[0067] S53: Based on the trained Softmax classifier, calculate the classification result of sleep stage for the sample to be predicted, specifically as follows:

[0068] ;

[0069] in, For the sample to be predicted Bidirectional feature representation after fusion of sampling points at different times; For the prediction stage The bidirectional feature representation after fusion of sampling points at time step belongs to the first step. The probability of each category; and The parameters of the trained model; for Sleep state classification results at each sampling point.

[0070] This invention also discloses a sleep staging detection system based on a smartwatch, comprising:

[0071] Signal acquisition module: Through the smartwatch's sensors, it acquires three raw physiological signals from the wearer: heart rate variability, triaxial accelerometer data, and body intensity index, and performs multi-source signal fusion and time synchronization to obtain synchronized multi-source signals;

[0072] Signal preprocessing module: performs noise reduction on the synchronized multi-source signals, extracts time-domain features, and constructs feature vectors;

[0073] Temporal autocorrelation module: Calculates the temporal autocorrelation features of the feature vectors;

[0074] Bidirectional Feature Module: Based on a bidirectional long short-term memory network, it performs temporal modeling on the input feature vector and temporal autocorrelation features to obtain a fused bidirectional feature representation;

[0075] Classification module: Based on the Softmax classifier, the fused bidirectional feature representation is processed for multi-classification to achieve accurate classification of sleep stages.

[0076] Compared with the prior art, the present invention has at least the following beneficial effects:

[0077] This invention fuses heart rate variability signals with triaxial acceleration signals from multiple sources and introduces a time-decay-based body motion intensity index, achieving optimized signal combination through adaptive weighting coefficients. This multi-source signal fusion strategy not only improves the information richness of sleep state recognition but also effectively offsets the limitations of a single signal source, significantly enhancing the system's anti-interference capability. Especially under conditions of vigorous body movement or strong measurement noise interference, this method maintains a high recognition accuracy, providing more stable and reliable technical support for sleep monitoring.

[0078] This invention achieves refined processing of the original signal by combining wavelet transform multi-scale decomposition and adaptive threshold denoising, and innovatively constructs a time-domain feature vector including average amplitude, root mean square value, maximum amplitude, and waveform rate of change. Based on this, time-series autocorrelation feature analysis is introduced to deeply explore the periodic variation patterns and long-range dependence characteristics of the signal. This multi-level feature extraction method not only comprehensively characterizes the time-domain features of sleep signals but also accurately captures key features of sleep state transitions, providing rich feature representations for sleep stage identification.

[0079] This invention employs a bidirectional long short-term memory network for deep temporal modeling of feature sequences. Through information transmission in both forward and backward directions, combined with fine-tuning of the gating mechanism, it achieves accurate modeling of the temporal dependencies of sleep states. Simultaneously, a Softmax classifier and an adaptive learning rate adjustment strategy are introduced to establish an end-to-end sleep staging identification framework. This method, combining deep learning with traditional feature engineering, not only significantly improves the accuracy of sleep state identification but also possesses strong generalization ability, adapting to individual differences among users and providing reliable technical support for sleep health monitoring. Attached Figure Description

[0080] Figure 1 This is a schematic flowchart of a sleep staging detection method based on a smartwatch, according to an embodiment of the present invention.

[0081] Figure 2 The following is a schematic diagram of multi-source signal fusion according to an embodiment of the present invention: (a) schematic diagram of heart rate variability signal; (b) schematic diagram of accelerometer signal; (c) schematic diagram of body motion intensity signal; (d) schematic diagram of multi-source fusion. Detailed Implementation

[0082] The present invention will be further described below with reference to the accompanying drawings, but this is not intended to limit the present invention in any way. Any modifications or substitutions made based on the teachings of the present invention shall fall within the protection scope of the present invention.

[0083] Example 1: A sleep staging detection method based on a smartwatch, such as... Figure 1 As shown, it includes the following steps:

[0084] S1: Through the smartwatch's sensors, it acquires three raw physiological signals from the wearer: heart rate variability, triaxial velocimeter data, and body intensity index, and performs multi-source signal fusion and time synchronization, such as... Figure 2 As shown, it includes:

[0085] S11: Acquire heart rate variability signals and perform sliding window filtering, such as... Figure 2 As shown in (a), specifically:

[0086] ;

[0087] in, for Heart rate variability signal at time-sampling points; For summation functions; The sliding window weight function, in this embodiment, is the Hanning window function, which satisfies... , For the time index within the sliding window, Pi The value is 1000, which represents 1000 sampling points in this embodiment; for Heart rate variability signal at time-sampling points;

[0088] S12: Acquire triaxial accelerometer data, such as Figure 2 As shown in (b), calculate the resultant acceleration. Specifically:

[0089] ;

[0090] in, for The composite acceleration at each sampling point at any given time; , and They are respectively sampling point at time axis, shaft and Acceleration components along the axial direction;

[0091] S13: Calculate the physical intensity index ,like Figure 2 As shown in (c), specifically:

[0092] ;

[0093] in, for The body motion intensity index at the sampling point at any given time; In this embodiment, the time window length required to calculate the body dynamics intensity index is 6000, representing 6000 sampling points; The time index within the time window required to calculate the body dynamics intensity index; for The composite acceleration at each sampling point at any given time; The attenuation coefficient is 0.1 in this embodiment; It is a natural constant;

[0094] S14: Constructing a multi-source signal fusion matrix Specifically:

[0095] ;

[0096] in, for Multi-source signal fusion matrix at each sampling point; , and They are respectively Heart rate variability signal at time sampling points The composite acceleration at each sampling point at time step The body motion intensity index at each sampling point is normalized to the specified value. interval;

[0097] S15: Perform time synchronization on the multi-source signal fusion matrix to obtain the synchronized multi-source signal. ,like Figure 2 As shown in (d), specifically:

[0098] ;

[0099] in, for Multi-source signals after synchronization of sampling points at each moment; for The first of the multi-source signal fusion matrix at each sampling point in time One signal; For the first The time delay of each signal, in this embodiment , and The sampling points were 0, 5, and 10, respectively. For the first The weighting coefficients of each signal, in this embodiment , and They are 0.4, 0.3, and 0.3 respectively; .

[0100] It should be noted that this step first implements sliding window filtering of the heart rate variability signal, effectively eliminating high-frequency noise and abrupt interference in the original signal, and improving the stability and reliability of the signal; secondly, by calculating the composite acceleration of triaxial acceleration, it comprehensively reflects the human motion state and avoids the loss of motion characteristics that may be caused by acceleration data in a single direction; thirdly, it introduces the calculation of the body motion intensity index, adopting an exponentially decaying weighted method, which not only retains the importance of recent body motion information, but also takes into account the reference value of historical body motion information, so that the body motion intensity index can more accurately reflect the continuous change process of human activity state.

[0101] S2: Denoise the synchronized multi-source signals and extract time-domain features to construct a feature vector, including:

[0102] S21: Wavelet transform is used to process the synchronized multi-source signals. Multi-scale decomposition is performed, specifically as follows:

[0103] ;

[0104] in, For the first Layer in Wavelet decomposition coefficients at the sampling point at time step; To decompose the number of layers, in this embodiment... ; The wavelet transform function is used; in this embodiment, it is the db4 wavelet basis function.

[0105] S22: Noise reduction is performed using a threshold function, specifically:

[0106] ;

[0107] in, For the first Layer in Wavelet coefficients after noise reduction at each sampling point; It is a symbolic function; For the first The threshold parameter of the layer, in this embodiment , and The values ​​are 0.5, 0.3, and 0.2 respectively.

[0108] S23: Reconstruct the signal using the wavelet reconstruction function to obtain the reconstructed signal. Specifically:

[0109] ;

[0110] in, for The reconstructed signal from the sampling points at each time step; This represents the total number of wavelet decomposition layers, which is 3 in this embodiment; For wavelet reconstruction function;

[0111] S24: Extract the temporal features of the reconstructed signal to construct the feature vector. Specifically:

[0112] ;

[0113] in, for Feature vector of sampling point at time step; for Average amplitude at sampling points at time intervals; for Root mean square value of sampling point at time step; for Maximum amplitude at each sampling point at any given time; for Rate of change of waveform at each sampling point at any given time; and They are respectively Time sampling points and The reconstructed signal from the sampling points at each time step; For temporary sampling point count variables; The feature extraction time window length is 1000 in this embodiment, representing 1000 sampling points.

[0114] It should be noted that this step first uses the db4 wavelet basis function for three-level multi-scale decomposition, which makes full use of the localization characteristics of wavelet transform in the time and frequency domain, and can effectively capture the detailed features of the signal in different frequency bands. Secondly, an adaptive threshold function is introduced for noise reduction. By setting different threshold parameters for different decomposition levels, hierarchical suppression of noise is achieved, which not only preserves the important features of the signal, but also effectively removes noise interference at different scales. Finally, the denoised signal is recovered through wavelet reconstruction, ensuring the integrity and continuity of the signal.

[0115] S3: Calculate the time-series autocorrelation feature of the feature vector, wherein the time-series autocorrelation feature is obtained by calculating the autocorrelation coefficient of each of the four dimensions of the feature vector at each time delay, and then taking the average of the autocorrelation coefficients of the four dimensions as the autocorrelation feature of that time delay; including:

[0116] Calculate eigenvectors The time-series autocorrelation characteristics were analyzed to obtain the autocorrelation coefficient sequence. Specifically:

[0117] ;

[0118] in, For time delay The autocorrelation coefficient; The total length of the sequence is 6000 in this embodiment, representing 6000 sampling points; This is the amount of time delay. , The maximum delay is 1000 in this embodiment, representing 1000 sampling points; ; express Time sampling point No. Features of dimensions; express Time sampling point No. Features of dimensions; for Feature vector of sampling point at time step.

[0119] This step calculates the autocorrelation coefficients of the four-dimensional feature vectors, comprehensively reflecting the correlation variation patterns of different feature components over time, which helps to discover the periodic patterns and long-range dependence characteristics of the signal.

[0120] S4: Based on a bidirectional long short-term memory network, temporal modeling is performed on the input feature vector and temporal autocorrelation features to obtain a fused bidirectional feature representation, including:

[0121] S41: Construct the input sequence for the feedforward network, specifically:

[0122] ;

[0123] in, for The forward network input sequence at each sampling point; This is the length of the historical time window, which is 100 in this embodiment, representing 100 sampling points;

[0124] S42: Construct the feedforward network gating unit, specifically:

[0125] ;

[0126] in, for The state of the input gate at each sampling point; for Output gate state at each sampling point; for Candidate state of sampling points at any given time; , , All are forward weight matrices; , , All are forward loop weight matrices; , , All are bias vectors; for The forward hidden state of the sampling point at time step; It is a sigmoid activation function; It is the hyperbolic tangent function;

[0127] S43: Construct the backward network gating unit, specifically:

[0128] ;

[0129] in, for The state of the backward input gate at each sampling point; for The state of the backward output gate at each sampling point; for Backward candidate state at each sampling point; , , All are backward weight matrices; , , All are backward loop weight matrices; , , All are backward bias vectors; for The backward hidden state of the sampling point at time step;

[0130] S44: Update the bidirectional long short-term memory network state, specifically:

[0131] ;

[0132] in, and They are respectively Time sampling points and Forward memory state of each sampling point; and for Time sampling points and The sampling point represents the backward memory state; ⊙ represents element-wise multiplication;

[0133] S45: Perform temporal modeling on the input feature vector and temporal autocorrelation features to obtain the fused bidirectional feature representation, specifically:

[0134] ;

[0135] in, for The bidirectional feature representation after the fusion of sampling points at each time step; in this embodiment, the hidden layer dimension of the network is set to 128.

[0136] It should be noted that this step uses a bidirectional long short-term memory network that considers the influence of both historical and future information. Through information transmission in both forward and backward directions, it can comprehensively capture the temporal dependencies of sleep signals. Secondly, the gating mechanism of the long short-term memory network can adaptively control the transmission and forgetting of information. The input gate is responsible for selectively receiving new information, the forget gate can clear irrelevant historical information, and the output gate controls the output intensity of information. This fine information regulation mechanism is particularly suitable for handling the gradual process of sleep state transition.

[0137] S5: Based on the Softmax classifier, multi-classification processing is performed on the fused bidirectional feature representation to achieve accurate classification of sleep stages, including:

[0138] S51: Construct a labeled dataset based on the data processed in steps S1-S4, where each sample contains a fused bidirectional feature representation. and the corresponding completed sleep stage labels , These represent the waking state, REM sleep, light sleep, and deep sleep, respectively. During the training phase, a Softmax classifier is used to calculate the probability distribution for each category, specifically:

[0139] ;

[0140] in, For training samples Bidirectional feature representation after fusion of sampling points at different times; For the training phase The bidirectional feature representation after fusion of sampling points at time step belongs to the first step. The probability of each category; These correspond to the waking period, REM sleep period, light sleep period, and deep sleep period, respectively. For the first The weight vector of the class; For the first Class bias terms; It is an exponential function;

[0141] S52: Train the Softmax classifier to obtain a trained Softmax classifier. Specifically, the training process of the Softmax classifier adopts the mini-batch stochastic gradient descent method. During the training phase, cross-entropy is used as the loss function. In this embodiment, the batch size is set to 32, the initial learning rate is set to 0.001, and an adaptive learning rate adjustment strategy is adopted. When the accuracy of the validation set does not improve for 3 consecutive epochs, the learning rate is reduced to 0.1 times the original value. At the same time, an L2 regularization term is introduced to prevent overfitting. In this embodiment, the regularization coefficient is set to 0.0001. The training process continues until the accuracy of the validation set does not improve for 5 consecutive epochs or the maximum number of training epochs of 100 epochs is reached.

[0142] S53: Based on the trained Softmax classifier, the classification decision is calculated during the prediction phase, specifically as follows:

[0143] ;

[0144] in, For the sample to be predicted Bidirectional feature representation after fusion of sampling points at different times; For the prediction stage The bidirectional feature representation after fusion of sampling points at time step belongs to the first step. The probability of each category; and The parameters of the trained model; for Sleep state classification results at each sampling point.

[0145] To further explain, this step constructs a standardized labeled dataset, clearly dividing sleep states into four categories: wakefulness, REM sleep, light sleep, and deep sleep, providing a reliable training foundation for the classification task. Secondly, the use of a Softmax classifier for multi-class processing can transform the bidirectional feature representation into the probability distribution of each sleep state, not only outputting the final classification result but also providing classification confidence information.

[0146] Example 2: This invention also discloses a sleep staging detection system based on a smartwatch, comprising the following five modules:

[0147] Signal acquisition module: Through the smartwatch's sensors, it acquires three raw physiological signals from the wearer: heart rate variability, triaxial accelerometer data, and body intensity index, and performs multi-source signal fusion and time synchronization to obtain synchronized multi-source signals;

[0148] Signal preprocessing module: performs noise reduction on the synchronized multi-source signals, extracts time-domain features, and constructs feature vectors;

[0149] Temporal autocorrelation module: Calculates the temporal autocorrelation features of the feature vectors;

[0150] Bidirectional Feature Module: Based on a bidirectional long short-term memory network, it performs temporal modeling on the input feature vector and temporal autocorrelation features to obtain a fused bidirectional feature representation;

[0151] Classification module: Based on the Softmax classifier, the fused bidirectional feature representation is processed for multi-classification to achieve accurate classification of sleep stages.

[0152] It should be noted that the sequence numbers of the above embodiments of the present invention are merely for descriptive purposes and do not represent the superiority or inferiority of the embodiments. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, apparatus, article, or method. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.

[0153] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0154] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1.A smart watch-based sleep staging detection method, characterized in that, The method comprises the following steps: S1: acquiring, through a sensor of a smart watch, three kinds of original physiological signals of a wearer, i.e., heart rate variability, three-axis accelerometer data and body motion intensity index, and performing multi-source signal fusion and time synchronization to obtain synchronized multi-source signals; calculating the body motion intensity index , in particular: ; wherein, is the body motion intensity index at the sampling point of time instant; is the length of the time window required for calculating the body motion intensity index; is the time index within the time window required for calculating the body motion intensity index; is the resultant acceleration at the sampling point of time instant; is the decay coefficient; is the natural constant; S2: performing noise reduction processing on the synchronized multi-source signals, and extracting time domain features to construct a feature vector; S3: calculating time sequence autocorrelation features of the feature vector; the time sequence autocorrelation features are autocorrelation coefficients of four dimensions of the feature vector at each time delay, and then an average value of the four dimension autocorrelation coefficients is taken as an autocorrelation feature of the time delay; S4: based on a bidirectional long short-term memory network, performing time sequence modeling on the input feature vector and the time sequence autocorrelation features to obtain a fused bidirectional feature representation; The S4 comprises: S41: constructing a forward network input sequence, specifically: ; wherein, is a sequence of forward network inputs for the time sample point; is a history time window length; S42: constructing a forward network gating unit, specifically: ; wherein, is the input gate state at time step t; is the output gate state at time step t; is the candidate state at time step t; , , are all forward weight matrices; , , are all forward recurrent weight matrices; , , are all bias vectors; is the forward hidden state at time step t; is a sigmoid activation function; is a hyperbolic tangent function; S43: constructing a backward network gating unit, specifically: ; wherein, is the backward input gate state at time step t; is the backward output gate state at time step t; is the backward candidate state at time step t; , , are all backward weight matrices; , , are all backward recurrent weight matrices; , , are all backward bias vectors; is the backward hidden state at time step t; S44: updating a bidirectional long short-term memory network state, specifically: ; wherein, and are the forward memory state at the time step and the forward memory state at the time step and are the backward memory state at the time step and the backward memory state at the time step S45: performing time sequence modeling on the input feature vector and the time sequence autocorrelation features to obtain a fused bidirectional feature representation, specifically: ; wherein, is a fused bidirectional feature representation at the time sample point; S5: based on a Softmax classifier, performing multi-classification processing on the fused bidirectional feature representation to realize accurate classification of sleep staging. 2.The smart watch based sleep staging detection method of claim 1, wherein, The S1 comprises: S11: collecting a heart rate variability signal and performing sliding window filtering processing, specifically: ; wherein, is the heart rate variability signal at time instant sample point; is a summation function; is a sliding window weight function, is a time index within the sliding window, is a sliding window size; is the heart rate variability signal at time instant sample point; S12: Acquire triaxial accelerometer data, calculate synthetic acceleration Specifically: ; wherein is the resultant acceleration of the sampling point at the instant , and are the acceleration components of the sampling point at the instant in the direction of the x-axis, in the direction of the y-axis, and in the direction of the z-axis. S13: Calculate the body motion intensity index ; S14: Constructing a multi-source signal fusion matrix Specifically, ; wherein, is a multi-source signal fusion matrix of the sampling point at the time instant; , and are respectively a heart rate variability signal of the sampling point at the time instant, a composite acceleration of the sampling point at the time instant, and a body movement intensity index of the sampling point at the time instant and are all normalized to an interval. S15: Time synchronization is performed on the multi-source signal fusion matrix to obtain a synchronized multi-source signal Specifically, ; wherein, is the multi-source signal at the sampling point of time t; is the th signal in the multi-source signal fusion matrix at the sampling point of time t; is the time delay of the th signal; is the weight coefficient of the th signal; is . 3.The smart watch based sleep staging detection method of claim 2, wherein, The S2 comprises: S21: performing multi-scale decomposition on the synchronized multi-source signals by using wavelet transform, specifically: ; wherein, is the first layer in wavelet decomposition coefficients of the sampling point at the time instant; is the number of decomposition layers; is a wavelet transform function; S22: performing noise reduction processing by using a threshold function, specifically: ; wherein, is the first layer in the time instant; is the sign function; is the first layer threshold parameter; S23: signal reconstruction is performed through a wavelet reconstruction function to obtain a reconstructed signal Specifically, ; wherein, is the reconstructed signal at the sampling point; is the total number of wavelet decomposition levels; is a wavelet reconstruction function; S24: extract the time domain feature of the reconstructed signal to form a feature vector Specifically, ; wherein, is the feature vector of the sampling point at time t; is the average amplitude of the sampling point at time t; is the root mean square value of the sampling point at time t; is the maximum amplitude of the sampling point at time t; is the waveform change rate of the sampling point at time t; and are the reconstructed signal of the sampling point at time t and the reconstructed signal of the sampling point at time t; is a temporary time sampling point count variable; is a feature extraction time window length. 4.The smart watch based sleep staging detection method of claim 3, wherein, The S3 comprises: Computing eigenvectors of the time series autocorrelation feature, obtaining an autocorrelation coefficient sequence , specifically: ; wherein is the autocorrelation coefficient of the time delay ; is the total length of the sequence; is the amount of time delay, , is the maximum amount of delay; ; denotes the sampling point at time the dimensional feature; denotes the sampling point at time the dimensional feature; is the sampling point feature vector at time 5.The smart watch based sleep staging detection method of claim 1, wherein, The S5 comprises: S51: based on the fused bidirectional feature representation, a labeled data set is constructed, wherein each sample contains the fused bidirectional feature representation and the corresponding completed labeled sleep staging labels , respectively represent the wake period, the rapid eye movement period, the light sleep period and the deep sleep period; in the training stage, the probability distribution of each sleep staging category is calculated using a Softmax classifier, specifically: ; wherein, is the training sample, is the fused bidirectional feature representation of the sampling point at time t; is the training phase, is the probability that the fused bidirectional feature representation of the sampling point at time t belongs to the th class; respectively correspond to the wake stage, the rapid eye movement stage, the light sleep stage and the deep sleep stage; is the weight vector of the th class; is the bias term of the th class; is the exponential function; S52: training the Softmax classifier to obtain a trained Softmax classifier, specifically: a small batch stochastic gradient descent method is used in the training process of the Softmax classifier; in the training stage, cross entropy is used as a loss function; an L2 regularization term is introduced to prevent overfitting; the training process continues until the epoch validation set accuracy rate does not appear to improve for five consecutive rounds or reaches the maximum training rounds of 100 rounds; S53: based on the trained Softmax classifier, calculating a sleep staging classification result for a to-be-predicted sample, specifically: ; wherein, is the fused bi-directional feature representation of the sampling point at time is the fused bi-directional feature representation of the sampling point at time is the probability that the fused bi-directional feature representation of the sampling point at time is the probability that the fused bi-directional feature representation of the sampling point at time belongs to the k-th class; and are the parameters of the trained Softmax classifier; is the classification result of the sleep stage of the sampling point at time is the classification result of the sleep stage of the sampling point at time 6.A smart watch-based sleep staging detection system, characterized in that, It comprises: A signal acquisition module: acquiring, through a sensor of a smart watch, three kinds of original physiological signals of a wearer, i.e., heart rate variability, three-axis accelerometer data and body motion intensity index, and performing multi-source signal fusion and time synchronization to obtain synchronized multi-source signals; A signal preprocessing module: performing noise reduction processing on the synchronized multi-source signals, and extracting time domain features to construct a feature vector; A time sequence autocorrelation module: calculating time sequence autocorrelation features of the feature vector; A bidirectional feature module: based on a bidirectional long short-term memory network, performing time sequence modeling on the input feature vector and the time sequence autocorrelation features to obtain a fused bidirectional feature representation; A classification module: based on a Softmax classifier, performing multi-classification processing on the fused bidirectional feature representation to realize accurate classification of sleep staging; To realize a sleep staging detection method based on a smart watch as claimed in any one of claims 1-5.

Citation Information

Patent Citations

  • Sleep staging detection method and sleep staging detection device

    CN119719921A

  • Sleep-aiding massage eyeshade based on brainwave resonance

    CN117338515A

  • Sleep state monitoring method based on GM-GP algorithm

    CN119377900A