A Sleep and Wakefulness Detection Method and System Based on a Smart Ring
Patent Information
- Application Number
- CN202611389275.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-08
- Publication Date
- 2026-10-20
AI Technical Summary
[0004]另一方面,在面向睡眠清醒检测的监督学习任务中,低活动清醒数据(如用户躺床玩手机、失眠静卧、赖床等场景)是公认的难例样本:此时活动量几乎为零,仅依靠加速度计无法区分清醒与睡眠;心率与心率变异性虽然整体趋势上清醒高于睡眠,但其数值分布在不同个体之间存在显著重叠
[0046](1)通过双分支非对称路由的卷积神经网络架构,为生理信号(心率、心率变异性)与运动信号(活动量)分别配置差异化的感受野。活动量分支采用小卷积核和短空洞率,使翻身、起身等运动尖峰被精确定位在发生的时刻而不向相邻时间步扩散,避免了睡前洗漱等活动将尖峰前向扩散导致的入睡时间延迟估计、晨起穿衣等活动将尖峰后向扩散导致的清醒时间前移估计、以及夜间大体动导致前后数十分钟睡眠被误判为清醒的问题;PPG分支采用大卷积核和长空洞率,为心率和心率变异性提供足够长的感受野,将熟睡期间心率的正常生理波动、梦境活动伴随的心率短暂上升等局部波动置于整个睡眠周期的宏观趋势中审视,避免产生碎片化的虚假觉醒段。由此,本发明的检测精度显著提升(宏观F1由0.936提升至0.947,Cohen’s Kappa由0.872提升至0.894),入睡时间误差降低22.5%、清醒时间误差降低30.4%,且各变体参数量均约11,000个,精度提升完全来自架构改进而非参数量的增加。
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This invention belongs to the field of wearable devices and artificial intelligence, specifically relating to a sleep and wakefulness detection method and system based on a smart ring. Background Technology
[0002] Sleep wakefulness detection is one of the core functions of wearable health monitoring. By analyzing physiological signals collected by wearable sensors, it identifies the user's wakefulness and sleep state, thereby determining the time of sleep onset and wakefulness, providing a basis for sleep quality assessment and sleep disorder diagnosis. With the popularization of low-power wearable devices such as smart rings, edge sleep wakefulness detection based on deep learning models has gradually become a research hotspot.
[0003] Most existing deep learning sleep-wake detection models based on wearable devices employ a single-branch structure, using the same convolutional kernel size and receptive field configuration for all input channels. However, there are fundamental differences in the temporal characteristics of physiological signals and motion signals: heart rate and heart rate variability during sleep-wake transitions are slow trends spanning several minutes or even tens of minutes, requiring a large receptive field to capture the complete context of change; while changes in activity signals are instantaneous, with movement spikes such as turning over or getting up appearing only at a single time step. If a large convolutional kernel is used uniformly, movement spikes will be blurred and diffused to multiple adjacent time steps, leading to delayed estimates of sleep onset time, forward estimates of wakefulness time, and misclassification of sleep periods tens of minutes before and after major bodily movements at night as wakefulness. Conversely, if a small convolutional kernel is used uniformly to adapt to the instantaneous characteristics of activity, the receptive field is insufficient to cover the entire sleep cycle, and the model will misclassify completely normal physiological fluctuations during deep sleep as wakefulness, generating a large number of fragmented false arousal segments. Therefore, there is an urgent need for a model structure that can configure differentiated receptive fields for different signals.
[0004] On the other hand, in supervised learning tasks for sleep wakefulness detection, low-activity wakefulness data (such as scenarios where users are lying in bed using their phones, insomniacs, or lingering in bed) are recognized as difficult examples: at this time, activity is almost zero, and accelerometers alone cannot distinguish between wakefulness and sleep; although heart rate and heart rate variability generally show a higher trend in wakefulness than sleep, their numerical distributions overlap significantly among different individuals. Existing strategies include two approaches: one is to lengthen the temporal context (such as bidirectional long short-term memory networks with attention mechanisms or Transformer structures) to capture long-term dependencies, but this significantly increases model complexity and parameter count, causing the model to swell from tens of KB to hundreds of KB or even several MB, making it unsuitable for resource-constrained MCUs; the other approach uses cost-sensitive learning or class-weighted loss functions, applying a higher global penalty coefficient to "wakefulness misclassified as sleep" during training. However, because the physiological manifestations of low-activity wakefulness are highly individual-specific, fixed global penalty weights cannot adapt to the dynamic physiological boundaries of each user, easily leading to "overcorrection" for some users and "undercorrection" for others. Therefore, there is an urgent need for a training method that can adapt to individual physiological baselines and improve the ability to recognize low-activity sobriety states without increasing the complexity of model inference. Summary of the Invention
[0005] To overcome the shortcomings of existing technologies, this invention provides a sleep wakefulness detection method and system based on a smart ring.
[0006] The technical solution adopted by this invention to solve its technical problem is:
[0007] In a first aspect, the present invention provides a sleep-wake detection method based on a smart ring, the method being implemented using a convolutional neural network and comprising the following steps:
[0008] The time series of physiological characteristics of the user collected by the smart ring is obtained, and the time series of physiological characteristics includes three feature channels: heart rate, heart rate variability and activity level.
[0009] The physiological characteristic time series is split into a PPG branch and an activity level branch according to signal type. The PPG branch includes two feature channels: heart rate and heart rate variability. The activity level branch includes one feature channel: activity level.
[0010] Multi-layer convolutional local feature extraction is performed on the PPG branch to obtain PPG local features; dual-path convolutional local feature extraction is performed on the activity branch to obtain activity local features.
[0011] Multi-scale temporal context is extracted from the PPG local features using dilated convolution with a long dilation rate to obtain PPG multi-scale context features; multi-scale temporal context is extracted from the activity local features using dilated convolution with a short dilation rate to obtain activity multi-scale context features; wherein, the PPG branch and the activity branch adopt mutually exclusive dilation rate sets to form an asymmetric routing configuration;
[0012] The PPG multi-scale context features and the activity multi-scale context features are concatenated along the channel dimension to obtain multi-scale fused features.
[0013] The multi-scale fusion features are convolutionally projected to obtain the user's sleep and wakefulness binary classification results at each time step.
[0014] Optionally, acquiring the user's physiological characteristic time series includes: acquiring a 30-second photoplethysmography (PPG) signal at a sampling frequency of 25Hz within each acquisition cycle of 5 minutes, and continuously acquiring a triaxial acceleration signal at a sampling frequency of 25Hz; performing digital filtering, peak and trough detection, and beat-by-beat interval extraction on the PPG signal to obtain the heart rate and beat-by-beat interval sequences, and calculating the heart rate variability based on the beat-by-beat interval sequences, using the following formula:
[0015]
[0016] in, The heart rate variability is expressed in milliseconds. For the first The interval between consecutive normal heartbeats, in milliseconds; The total number of valid intervals in the beat-by-beat interval sequence; The index number is used in the interval sequence; the motion state of the triaxial acceleration signal is determined every 2 seconds during the acquisition period. If valid motion is detected, the activity counter is incremented by 1. At the end of the acquisition period, the cumulative value of the activity counter is used as the activity amount.
[0017] Optionally, the physiological feature time series includes a fixed-length time window obtained by segmenting the physiological feature data from the entire night using a sliding window. The length of the time window is 24 time steps, and the step size between adjacent time windows is 12 time steps.
[0018] Optionally, multi-layer convolutional local feature extraction is performed on the PPG branch to obtain PPG local features, including: performing three layers of one-dimensional convolution on the PPG branch in sequence, with each layer having a kernel size of 3, a stride of 1, and the same padding method, and using ReLU non-linear activation after each convolution, with the number of output channels of the three layers being 16, 32, and 32 respectively, to obtain the PPG local features;
[0019] The activity quantity branch is subjected to dual-path parallel convolution local feature extraction to obtain the activity quantity local features, including: performing a first-path one-dimensional convolution and a second-path one-dimensional convolution on the activity quantity branch respectively. The first-path one-dimensional convolution has a kernel size of 5 and outputs 24 channels to capture the rising and falling trend of the activity quantity. The second-path one-dimensional convolution has a kernel size of 1 and outputs 8 channels to retain the absolute activity quantity value at each time step. The stride of both convolutions is 1 and the padding method is the same. The two outputs are concatenated along the channel dimension to obtain the activity quantity local features.
[0020] The convolution operations involved in the method do not use batch normalization, and the method does not include a circular connection structure or an attention mechanism.
[0021] Optionally, the kernel size of the dilated convolution with long void ratio is 3, and the void ratio is 4 and 8, while the kernel size of the dilated convolution with short void ratio is 2, and the void ratio is 1 and 2, with 16 channels output at each scale.
[0022] Optionally, the step of performing convolutional projection on the multi-scale fusion features to obtain the user's sleep and wakefulness binary classification results at each time step includes: performing convolutional projection on the multi-scale fusion features with a kernel size of 1 to obtain wakefulness category scores and sleep category scores; generating gating coefficients based on the activity level, wherein the gating coefficients are:
[0023]
[0024] in, The gating factor; For the sigmoid function; This is the normalized value of the activity level; For slope constant, As a bias constant, , The scores for the awake category and the sleep category are weighted and fused according to the gating coefficient to obtain an adjusted score, which is:
[0025]
[0026] in, The adjusted score; Score the sobriety category; The sleep category is scored; the adjusted score is normalized to obtain the user's sleep and wakefulness binary classification results at each time step.
[0027] Optionally, the method further includes: aggregating the user's sleep and wakefulness binary classification results at each time step according to the starting position of the sliding window, taking the average of the overlapping areas to obtain a binary classification sequence for each time step throughout the night; applying post-processing rules to the binary classification sequence, marking the first sleep time step of the continuous segment as the sleep onset point when at least 6 consecutive time steps are determined to be sleep, and marking the first wakefulness time step of the continuous segment as the wakefulness point when at least 6 consecutive time steps are determined to be wakefulness.
[0028] Optionally, the method further includes a step of training the convolutional neural network, the training step comprising: for each sample in the training set, calculating the mean heart rate of the sample during sleep time steps. and mean heart rate variability The individual sleep physiological baseline of the sample is used as the baseline for sleep; a heart rate threshold is constructed based on the individual sleep physiological baseline. Heart rate variability threshold ,in , , This is the preset heart rate offset. A preset heart rate variability offset is used. Waking timesteps in the training set that simultaneously satisfy the following conditions—activity level below the activity level threshold, heart rate above the heart rate threshold, and heart rate variability below the heart rate variability threshold—are marked as low-activity waking candidate samples. Continuity filtering is applied to these low-activity waking candidate samples, marking consecutive candidate segments with a length not less than a preset minimum running length as low-activity waking samples. During the training phase, a supplementary training window is generated centered at the timestep of each low-activity waking sample. This supplementary training window is added to the training batch for training, and a higher weight coefficient is assigned to the low-activity waking samples than to regular samples in the loss function. The loss function is:
[0029]
[0030] in, Let the loss function be... For category weight coefficients, As an enhancing factor, As a marker, the low-activity conscious samples are marked as 1, and the remaining valid data are marked as 0. For real labels, Predict probabilities for the model.
[0031] Secondly, the present invention provides a sleep-wake detection system based on a smart ring, including a convolutional neural network, and further comprising:
[0032] The acquisition module is used to acquire the user's physiological characteristic time series collected by the smart ring. The physiological characteristic time series includes three feature channels: heart rate, heart rate variability, and activity level.
[0033] The splitting module is used to split the physiological feature time series into a PPG branch and an activity level branch according to the signal type. The PPG branch includes two feature channels: the heart rate and the heart rate variability. The activity level branch includes one feature channel: the activity level.
[0034] The local feature extraction module is used to perform multi-layer convolutional local feature extraction on the PPG branch to obtain PPG local features, and to perform dual-path parallel convolutional local feature extraction on the activity branch to obtain activity local features.
[0035] The multi-scale context extraction module is used to extract multi-scale temporal context from the PPG local features using dilated convolution with a long dilation rate, to obtain PPG multi-scale context features, and to extract multi-scale temporal context from the activity local features using dilated convolution with a short dilation rate, to obtain activity multi-scale context features; wherein, the PPG branch and the activity branch adopt mutually exclusive dilation rate sets to form an asymmetric routing configuration;
[0036] The splicing module is used to splice the PPG multi-scale context features and the activity multi-scale context features along the channel dimension to obtain multi-scale fused features.
[0037] The convolutional projection module is used to perform convolutional projection on the multi-scale fusion features to obtain the user's sleep and wakefulness binary classification results at each time step.
[0038] Optionally, it also includes a training module for training the convolutional neural network, the training module comprising:
[0039] The baseline modeling unit is used to calculate the mean heart rate during sleep time steps for each sample in the training set. and mean heart rate variability This serves as the individual sleep physiology baseline for the sample.
[0040] Threshold construction unit, used to construct heart rate threshold based on the individual's sleep physiological baseline. Heart rate variability threshold ,in , , This is the preset heart rate offset. This is the preset heart rate variability offset.
[0041] The labeling unit is used to label the wakefulness time steps in the training set that simultaneously satisfy the conditions of activity level below the activity level threshold, heart rate above the heart rate threshold, and heart rate variability below the heart rate variability threshold as low-activity wakefulness candidate samples, and to apply continuous filtering to the low-activity wakefulness candidate samples, labeling candidate segments that appear consecutively with a length not less than a preset minimum running length as low-activity wakefulness samples.
[0042] A resampling and weight enhancement unit is used to generate a supplementary training window centered at the time step of each of the low-activity awake samples during the training phase, add the supplementary training window to the training batch for training, and assign a higher weight coefficient to the low-activity awake samples than to the regular samples in the loss function, wherein the loss function is:
[0043]
[0044] in, Let the loss function be... For category weight coefficients, As an enhancing factor, As a marker, the low-activity conscious samples are marked as 1, and the remaining valid data are marked as 0. For real labels, Predict probabilities for the model.
[0045] Compared with the prior art, the present invention has the following beneficial effects:
[0046] (1) Through a convolutional neural network architecture with dual-branch asymmetric routing, differentiated receptive fields are configured for physiological signals (heart rate, heart rate variability) and motion signals (activity level). The activity level branch uses a small convolutional kernel and a short dilatation rate to accurately locate the peaks of movement such as turning over and getting up at the moment of occurrence without spreading to adjacent time steps. This avoids the problem of delayed sleep onset estimation caused by the forward spread of peaks by activities such as washing before bed, the forward spread of wakefulness estimation caused by the backward spread of peaks by activities such as dressing in the morning, and the problem of misjudging tens of minutes of sleep before and after the nighttime physical activity as wakefulness. The PPG branch uses a large convolutional kernel and a long dilatation rate to provide a sufficiently long receptive field for heart rate and heart rate variability. This allows the normal physiological fluctuations of heart rate during deep sleep and the local fluctuations such as the brief increase in heart rate accompanied by dream activities to be examined in the macro trend of the entire sleep cycle, avoiding the generation of fragmented false awakening segments. As a result, the detection accuracy of this invention is significantly improved (macro F1 increased from 0.936 to 0.947, and Cohen's Kappa from 0.872 to 0.894), the error in sleep onset time is reduced by 22.5%, the error in wakefulness time is reduced by 30.4%, and the number of parameters in each variant is approximately 11,000. The improvement in accuracy comes entirely from the architectural improvement rather than the increase in the number of parameters.
[0047] (2) An adaptive threshold for individual heart rate and heart rate variability is constructed by resampling and weight enhancement training of low-activity wakefulness data based on individual physiological baseline modeling. Since the activity level is almost zero during low-activity wakefulness (such as lying in bed playing on a mobile phone, insomnia, lying still, etc.), the accelerometer alone cannot distinguish between wakefulness and sleep. The numerical distribution of heart rate and heart rate variability overlaps significantly among different individuals. The existing cost-sensitive learning global fixed penalty weight cannot adapt to the physiological boundaries of each user's dynamic movement. This invention uses the individual physiological baseline of each sample's own sleep segment to generate an adaptive threshold to automatically filter difficult low-activity wakefulness samples, and performs targeted resampling and weight enhancement on them during the training phase. As a result, without increasing the model's inference complexity and the number of parameters, this invention improves the low-activity wakefulness recognition accuracy from 54.4% to 61.3%, reduces the sleep onset time error to 15.09 minutes and the wakefulness time error to 14.55 minutes, and avoids the overcorrection and undercorrection problems caused by global fixed penalty weight, thus having natural individual adaptability.
[0048] (3) The complete solution of this application achieved five best results in the comparative experiment with the existing best method: overall accuracy of 93.7%, macro F1 score of 0.937, Cohen's Kappa coefficient of 0.875, mean absolute error of sleep onset time of 15.09 minutes, and mean absolute error of wakefulness time of 14.55 minutes. Although the WEAVER model is slightly better than this application in terms of wakefulness time error of 13.91 minutes, its number of parameters of 973,058 (the size of the .pt file is about 3.71MB) is 87 times that of the model of this application (11,170 parameters, the size of the .pt file is about 44KB), which cannot be deployed in smart rings with limited MCU resources; compared with the ETASR machine learning algorithm, the Kappa coefficient of this application (0.875) is significantly higher than its 0.667. This application presents an extremely lightweight architecture with only 11,170 parameters, and the model size is only 0.27% to 15.3% of other deep learning methods, demonstrating significant superiority in the comprehensive trade-off between accuracy and efficiency. Attached Figure Description
[0049] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below.
[0050] Figure 1 This is a diagram illustrating the overall architecture of the technical solution provided in the embodiments of the present invention.
[0051] Figure 2 This is a schematic diagram of the structure of a dual-branch asymmetric routing convolutional neural network provided in an embodiment of the present invention;
[0052] Figure 3 This is a flowchart illustrating the training method provided in an embodiment of the present invention;
[0053] Figure 4 A structural block diagram of the sleep-wake detection system provided in this embodiment of the invention. Detailed Implementation
[0054] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings.
[0055] like Figure 1 As shown, the technical solution of this invention consists of two collaborative layers: the model architecture layer and the training method layer. The model architecture layer employs a dual-branch asymmetric routing convolutional neural network to configure differentiated receptive fields for physiological signals (heart rate, heart rate variability) and motion signals (activity level). The training method layer utilizes low-activity wakefulness resampling and weight enhancement based on individual physiological baseline modeling to improve the recognition rate of difficult examples without increasing inference complexity. The entire technical chain covers the complete process from the original sensor signals of the smart ring to the model output of sleep and wakefulness binary classification detection results.
[0056] First, this invention provides a sleep-wake detection method based on a smart ring, specifically including the following steps:
[0057] S110 Obtains the user's physiological characteristic time series
[0058] The time series of physiological characteristics of the user collected by the smart ring is obtained. The time series of physiological characteristics includes three feature channels: heart rate, heart rate variability and activity level.
[0059] Specifically, the smart ring uses a 5-minute sampling cycle to collect 30 seconds of photoplethysmography (PPG) signals at a sampling frequency of 25Hz within each sampling cycle, and continuously collects triaxial acceleration signals at a sampling frequency of 25Hz.
[0060] The photoplethysmography (PPG) signal is digitally filtered, peaks and troughs are detected, and beat-by-beat intervals are extracted to obtain the heart rate and beat-by-beat interval sequences. Specifically, the heart rate analysis algorithm engine performs digital filtering and peak and trough detection on the raw multi-channel PPG signal, extracts the beat-by-beat intervals (RR intervals) between adjacent normal heartbeats, and outputs the heart rate value (in beats / minute) and a set of RR interval sequences within that acquisition period. Then, the heart rate variability is calculated based on the beat-by-beat interval sequences using the following formula:
[0061]
[0062] in, The heart rate variability is expressed in milliseconds. For the first The interval between consecutive normal heartbeats, in milliseconds; The total number of valid intervals in the beat-by-beat interval sequence; This refers to the index number in the interval sequence.
[0063] The motion state of the triaxial acceleration signal is determined every 2 seconds during the acquisition cycle. If valid motion is detected, the activity counter is incremented by 1. At the end of the acquisition cycle, the cumulative value of the activity counter is used as the activity amount (dimensionless).
[0064] Through the above data collection and feature extraction, physiological feature time series including three feature channels: heart rate, heart rate variability, and activity level were obtained, with each complete night corresponding to a time step sequence of variable length.
[0065] Furthermore, the physiological feature time series includes fixed-length time windows segmented from the entire night's physiological feature data using a sliding window method. Each time window is 24 time steps (corresponding to 2 hours), with adjacent time windows overlapping by 12 time steps (i.e., 50% overlap). The 2-hour window length is chosen because a normal person's complete sleep cycle is approximately 90-120 minutes, and a 2-hour window can cover the physiological rhythm information of about one complete sleep cycle, allowing the model to capture the complete transition patterns of sleep within each window.
[0066] S120 split
[0067] The physiological characteristic time series is split into a PPG branch and an activity level branch according to signal type. The PPG branch includes two feature channels: heart rate and heart rate variability. The activity level branch includes one feature channel: activity level.
[0068] Specifically, the first layer of the network is a channel splitting layer, which splits the three-channel input into two independent sub-streams along the channel dimension: the PPG branch receives the first two channels [heart rate variability, heart rate], and the activity branch receives the third channel [activity]. After local feature extraction in each branch, they each enter the asymmetric routing layer to extract multi-scale context. Finally, the multi-scale features are concatenated and projected into a time-step binary classification probability output.
[0069] like Figure 2 The diagram shown is a schematic representation of the structure of the dual-branch asymmetric routing convolutional neural network in this embodiment.
[0070] S130 Local Feature Extraction
[0071] Multi-layer convolutional local feature extraction is performed on the PPG branch to obtain PPG local features, and dual-path parallel convolutional local feature extraction is performed on the activity branch to obtain activity local features.
[0072] Specifically, the PPG branch is subjected to multi-layer convolutional local feature extraction, including: performing three layers of one-dimensional convolution on the PPG branch in sequence, with each layer having a kernel size of 3, a stride of 1, and the same padding method. ReLU non-linear activation is used after each convolution, and the number of output channels of the three layers are 16, 32, and 32 respectively, to obtain the PPG local features.
[0073] Furthermore, a first-path one-dimensional convolution and a second-path one-dimensional convolution are performed on the activity branch. The first-path one-dimensional convolution has a kernel size of 5 and outputs 24 channels to capture the rising and falling trend of the activity. The second-path one-dimensional convolution has a kernel size of 1 and outputs 8 channels to retain the absolute activity value at each time step. ReLU non-linear activation is applied after both convolutions. The stride of both convolutions is 1 and the padding method is the same. The two outputs are concatenated along the channel dimension to obtain the local features of the activity.
[0074] Specifically, the reason for adopting a dual-path parallel structure for the activity branch is that the activity signal contains two types of information: its rising and falling trend needs to be captured by a large convolution kernel (kernel size 5), while the absolute activity value at each time step needs to be accurately preserved by a convolution with a kernel size of 1. Neither can be neglected.
[0075] Furthermore, the convolutional operations involved in the method do not use batch normalization, and the method does not include recurrent connection structures or attention mechanisms. Specifically, all convolutional layers in the PPG branch and activity branch do not use batch normalization (BatchNorm) layers, and the entire network structure does not contain any recurrent connection structures (such as RNN, LSTM, GRU, etc.) or attention mechanisms, thereby avoiding the accuracy loss introduced by batch normalization layers during model quantization deployment, as well as the real-time bottleneck caused by recurrent structures in serial inference on MCUs.
[0076] S140 Multi-scale Context Extraction
[0077] Multi-scale temporal context is extracted from the PPG local features using dilated convolution with a long dilation rate to obtain PPG multi-scale context features, and multi-scale temporal context is extracted from the activity local features using dilated convolution with a short dilation rate to obtain activity multi-scale context features; wherein, the PPG branch and the activity branch adopt mutually exclusive dilation rate sets to form an asymmetric routing configuration.
[0078] Specifically, after the PPG branch and the activity branch each complete local feature extraction, the two 32-channel feature maps are fed into asymmetric dilated convolutional (Dilated Conv1D) layers to extract multi-scale temporal context. Dilated convolution expands the receptive field exponentially without increasing the number of parameters by inserting holes between the convolutional kernel elements.
[0079] Furthermore, the long-dilution-rate dilated convolutions have kernel sizes of 3 and dilation rates of 4 and 8, while the short-dilution-rate dilated convolutions have kernel sizes of 2 and dilation rates of 1 and 2. Each scale output has 16 channels, and ReLU nonlinear activation is applied after each dilated convolution. The dilation rate configurations of the two branches are completely asymmetrical: the activity branch uses only short dilation rates (dilution rates d=1 and d=2, kernel size 2), while the PPG branch uses only long dilation rates (dilution rates d=4 and d=8, kernel size 3). The dilation rate sets of the two branches do not intersect, forming an exclusive "branch-dilation rate" binding. In this way, activity spikes are precisely located at the moment of occurrence without spreading to distant time steps, while providing a sufficiently long receptive field for physiological signals to fully capture the slow physiological transition trend between sleep and wakefulness. The outputs of the four scales are stitched together along the channel dimension to form a 64-channel multi-scale fusion feature map.
[0080] S150 splicing
[0081] The PPG multi-scale context features and the activity multi-scale context features are concatenated along the channel dimension to obtain multi-scale fused features.
[0082] Specifically, the outputs of the two scales (void ratio 4, 8) of the PPG branch and the two scales (void ratio 1, 2) of the activity branch are spliced along the channel dimension to obtain a multi-scale fused feature map with shape (T, 64).
[0083] S160 Convolution Projection
[0084] The multi-scale fusion features are convolutionally projected to obtain the user's sleep and wakefulness binary classification results at each time step.
[0085] Specifically, the convolutional projection of the multi-scale fusion features includes: performing a convolutional projection of the multi-scale fusion features with a kernel size of 1 to obtain a wakefulness category score and a sleep category score.
[0086] Furthermore, a gating coefficient is generated based on the activity level, and the gating coefficient is...
[0087]
[0088] in, The gating factor; For the sigmoid function; The normalized value of the activity level is activity_norm, which is the z-score normalized result of the activity level channel: activity_norm = (activity − μ) / σ, where μ and σ are the mean and standard deviation of the activity level on the training set, respectively. For slope constant, As a bias constant, , This parameter selection results in extremely low activity levels. That is, when the actual activity level is less than 5 per 5 minutes. Extremely high activity level That is, when the actual activity level is greater than 23 per 5 minutes. The transition midpoint is located at (That is, the actual activity level every 5 minutes is equal to 12).
[0089] Then, the scores for the awake category and the sleep category are weighted and fused according to the gating coefficient to obtain the adjusted score, which is:
[0090]
[0091] in, The adjusted score; Score the sobriety category; Score the sleep category. Gating is applied in the logit space: when activity is extremely high... After adjustment, the score approaches the score of the sobriety category, and the output is forcibly oriented towards sobriety; when the activity level is extremely low... The adjusted score approximates the sleep category score and is entirely determined by the physiological signal characteristics of the PPG branch.
[0092] Finally, the adjusted scores are normalized (Softmax) to obtain the user's sleep and wakefulness binary classification results at each time step. The gating layer is eliminated through computational graph fusion after training and is not included in the final deployment model. The total number of parameters in the model is controlled to approximately 11,000 (approximately 44KB), meeting the storage and computing power constraints of the MCU.
[0093] S170 Post-processor
[0094] The sleep and wakefulness binary classification results of the user at each time step are aggregated according to the starting position of the sliding window, and the average value of the overlapping area is taken to obtain the binary classification sequence for each time step of the whole night.
[0095] Then, post-processing rules are applied to the binary classification sequence. When at least 6 consecutive time steps are determined to be sleep, the first sleep time step of the continuous segment is marked as the sleep onset point. When at least 6 consecutive time steps are determined to be awake, the first awake time step of the continuous segment is marked as the awakening point.
[0096] Through steps S110 to S170 above, the complete detection process of the model inference stage, from the raw sensor signals to the binary classification results of sleep and wakefulness throughout the night, as well as the sleep onset time and wakefulness time, is completed, outputting the user's sleep onset time and wakefulness time. Based on this, the following step S180 describes the implementation of the model training stage.
[0097] S180 Training
[0098] The method also includes the step of training the convolutional neural network. For example... Figure 3 The diagram shown is a schematic flowchart of the training method according to an embodiment of the present invention. The training steps include:
[0099] The training data used in this embodiment was collected by the uAita Ring H1L smart ring, worn on the right index finger, and three physiological signal channels—heart rate variability, heart rate, and activity level—were recorded synchronously at 5-minute (300-second) intervals. The dataset contains 49 nights of sleep records from 7 healthy adult users. Sleep and wakefulness labels were assigned by users nightly based on their daily sleep logs, and after manual verification, were converted into time-step binary labels (0 = awake, 1 = sleep). The overall ratio of wakefulness to sleep timesteps in the dataset is approximately 1:2.15, with low-activity wakefulness (i.e., activity level close to zero but labeled as awake) timesteps accounting for approximately 15% of all wakefulness samples. Training employed leave-one-subject-out cross-validation, with one user per test set, one per validation set, and the remaining five per training set, rotating 7 times.
[0100] For each sample in the training set, the mean heart rate during sleep time steps is calculated. and mean heart rate variability This serves as the individual sleep physiological baseline for the sample. The baseline calculation uses only the sample's own sleep segment data, thus exhibiting individual adaptability; different samples may have drastically different sleep heart rate baselines.
[0101] Heart rate thresholds were constructed based on the individual's sleep physiological baseline. Heart rate variability threshold ,in , , This is the preset heart rate offset. This is the preset heart rate variability offset. The recommended value range is 5-15 bpm. The recommended value range is 5-15ms, and this embodiment uses... bpm, ms; and simultaneously set a fixed activity threshold. .
[0102] Awake time steps in the training set that simultaneously meet the following criteria are identified: activity level below the activity level threshold, heart rate above the heart rate threshold, and heart rate variability below the heart rate variability threshold. These are then labeled as low-activity wakefulness candidate samples. A continuity filter is applied to these low-activity wakefulness candidate samples, marking consecutive candidate segments with a length not less than a preset minimum run length as low-activity wakefulness samples. The preset minimum run length is set to 2 (i.e., 10 minutes). Each sample meeting these criteria is then labeled. All other valid data are assigned .
[0103] During the training phase, a supplementary training window is generated centered at the time step of each of the low-activity awake samples. This supplementary training window is added to the training batch for training, and the low-activity awake samples are assigned a higher weight coefficient than regular samples in the loss function. The loss function is as follows:
[0104]
[0105] in, Let the loss function be... For the category weight coefficients, in this embodiment, both categories take w. y =1.0, As an enhancing factor, As a marker, the low-activity conscious samples are marked as 1, and the remaining valid data are marked as 0. For real labels, Predict probabilities for the model. Enhancement factor. Take 3.0 (verified by ablation experiment): Low activity levels result in lower recognition rates. It reaches its optimal value at this point; further increases to 4.0-6.0 offer no additional improvement.
[0106] The following hyperparameter configuration was used during the training phase: the optimizer was Adam, and the initial learning rate was... , , , ,in , For the first-moment estimate of the exponential decay rate and the second-moment estimate of the exponential decay rate of the Adam optimizer, The numerical stability constant is set to 32; the batch size is set to 32; the maximum number of training epochs is set to 120; the validation set loss is monitored and the model weights with the lowest validation set loss are saved; early stopping is not used; L2 regularization is applied to all convolutional layers, with a regularization coefficient of 120. The aforementioned resampling and weight enhancement occur entirely during the training phase, without altering the network structure or computational cost during model inference.
[0107] Through steps S110 to S180 of the above method embodiments, the present invention fully realizes the entire closed-loop process from raw physiological signal acquisition, dual-branch asymmetric routing feature extraction, sleep and wakefulness binary classification, post-processing to determine the sleep onset point and wakefulness point, to individual physiological baseline modeling and training. Based on the same inventive concept, the system embodiments of the present invention are described below.
[0108] Specifically, such as Figure 4 As shown, this embodiment of the invention also provides a sleep-wake detection system based on a smart ring, including a convolutional neural network, and further comprising:
[0109] The acquisition module is used to acquire the user's physiological characteristic time series collected by the smart ring. The physiological characteristic time series includes three feature channels: heart rate, heart rate variability, and activity level.
[0110] The splitting module is used to split the physiological feature time series into a PPG branch and an activity level branch according to the signal type. The PPG branch includes two feature channels: the heart rate and the heart rate variability. The activity level branch includes one feature channel: the activity level.
[0111] The local feature extraction module is used to perform multi-layer convolutional local feature extraction on the PPG branch to obtain PPG local features, and to perform dual-path parallel convolutional local feature extraction on the activity branch to obtain activity local features.
[0112] The multi-scale context extraction module is used to extract multi-scale temporal context from the PPG local features using dilated convolution with a long dilation rate, to obtain PPG multi-scale context features, and to extract multi-scale temporal context from the activity local features using dilated convolution with a short dilation rate, to obtain activity multi-scale context features; wherein, the PPG branch and the activity branch adopt mutually exclusive dilation rate sets to form an asymmetric routing configuration;
[0113] The splicing module is used to splice the PPG multi-scale context features and the activity multi-scale context features along the channel dimension to obtain multi-scale fused features.
[0114] The convolutional projection module is used to perform convolutional projection on the multi-scale fusion features to obtain the user's sleep and wakefulness binary classification results at each time step.
[0115] Furthermore, the system also includes a training module for training the convolutional neural network, the training module comprising:
[0116] The baseline modeling unit is used to calculate the mean heart rate during sleep time steps for each sample in the training set. and mean heart rate variability This serves as the individual sleep physiology baseline for the sample.
[0117] Threshold construction unit, used to construct heart rate threshold based on the individual's sleep physiological baseline. Heart rate variability threshold ,in , , This is the preset heart rate offset. This is the preset heart rate variability offset.
[0118] The labeling unit is used to label the wakefulness time steps in the training set that simultaneously satisfy the conditions of activity level below the activity level threshold, heart rate above the heart rate threshold, and heart rate variability below the heart rate variability threshold as low-activity wakefulness candidate samples, and to apply continuous filtering to the low-activity wakefulness candidate samples, labeling candidate segments that appear consecutively with a length not less than a preset minimum running length as low-activity wakefulness samples.
[0119] A resampling and weight enhancement unit is used to generate a supplementary training window centered at the time step of each of the low-activity awake samples during the training phase, add the supplementary training window to the training batch for training, and assign a higher weight coefficient to the low-activity awake samples than to the regular samples in the loss function. The loss function is...
[0120]
[0121] in, Let the loss function be... For category weight coefficients, As an enhancing factor, As a marker, the low-activity conscious samples are marked as 1, and the remaining valid data are marked as 0. For real labels, Predict probabilities for the model.
[0122] In addition, the implementation details that are the same as those in the aforementioned method embodiments in the system embodiments can be found in the description of the aforementioned method embodiments, and will not be repeated here.
[0123] Experimental verification
[0124] To further illustrate the effectiveness of the technical solution of this invention, an experiment was conducted using data from 7 users over a total of 49 nights.
[0125] First, the effectiveness of the bi-branch asymmetric routing architecture was verified through ablation experiments. The unimodal model of body movement (activity only) achieved F1 = 0.944 and Kappa = 0.889, but the sleep onset / wake-up errors were as high as 26.55 / 19.24 minutes. The unimodal model of PPG (heart rate + heart rate variability only) reduced F1 to 0.878 and Kappa to 0.756. The bimodal uni-branch model recovered to F1 at 0.936. After replacing with the bi-branch asymmetric routing architecture of this invention, F1 further improved to 0.947 and Kappa to 0.894, and the sleep onset error decreased to 17.55 minutes and the wake-up error decreased to 17.05 minutes, representing reductions of 22.5% and 30.4% respectively compared to the unimodal model. Each variant had approximately 11,000 parameters, and the accuracy improvement came entirely from the architectural improvement.
[0126]
[0127] Secondly, the effectiveness of the training method based on individual physiological baseline modeling was verified through ablation experiments. Using a bimodal bibranch model as the baseline (Kappa=0.894, low-activity wakefulness accuracy 54.4%), the low-activity wakefulness accuracy improved to 61.0% after using specific sample resampling alone; it improved to 54.7% after using weight enhancement alone; when using resampling and weight enhancement together, the low-activity wakefulness accuracy further improved to 61.3%, the sleep onset time error decreased from 17.55 minutes to 15.09 minutes, and the wakefulness time error decreased from 17.05 minutes to 14.55 minutes.
[0128]
[0129] Finally, a comprehensive comparison was conducted with five representative methods from recent years (ETASR, SLAMSS, FASL, WEAVER, etc.) on the same data. Our model achieved best performance in five out of all six metrics: overall accuracy 93.7%, macro F1 score 0.937, Cohen's Kappa coefficient 0.875, mean absolute error of sleep onset time 15.09 minutes, and mean absolute error of wakefulness time 14.55 minutes, with only 11,170 parameters (approximately 44KB for a .pt file). In the wakefulness time error metric, WEAVER achieved the best result of 13.91 minutes, slightly better than our model's 14.55 minutes. However, the WEAVER model has 973,058 parameters (approximately 3.71MB for a .pt file), 87 times more than our model, making it unsuitable for deployment in resource-constrained smart rings with limited MCU resources. The model size of this application is only 0.27% to 15.3% of that of other deep learning methods, demonstrating a significant advantage in the overall trade-off between accuracy and efficiency.
[0130]
Claims
1. A sleep-wake detection method based on a smart ring, characterized in that, The method is based on a convolutional neural network and includes the following steps: The time series of physiological characteristics of the user collected by the smart ring is obtained, and the time series of physiological characteristics includes three feature channels: heart rate, heart rate variability and activity level. The physiological characteristic time series is split into a PPG branch and an activity level branch according to signal type. The PPG branch includes two feature channels: heart rate and heart rate variability. The activity level branch includes one feature channel: activity level. Multi-layer convolutional local feature extraction is performed on the PPG branch to obtain PPG local features; dual-path parallel convolutional local feature extraction is performed on the activity branch to obtain activity local features. Multi-scale temporal context is extracted from the PPG local features using dilated convolution with a long dilation rate to obtain PPG multi-scale context features; multi-scale temporal context is extracted from the activity local features using dilated convolution with a short dilation rate to obtain activity multi-scale context features; wherein, the PPG branch and the activity branch adopt mutually exclusive dilation rate sets to form an asymmetric routing configuration; The PPG multi-scale context features and the activity multi-scale context features are concatenated along the channel dimension to obtain multi-scale fused features. The multi-scale fusion features are convolutionally projected to obtain the user's sleep and wakefulness binary classification results at each time step.
2. The method according to claim 1, characterized in that, The acquisition of the user's physiological characteristic time series includes: The acquisition cycle is 5 minutes. In each acquisition cycle, the photoplethysmography (PPG) signal is acquired for 30 seconds at a sampling frequency of 25 Hz, and the triaxial acceleration signal is continuously acquired at a sampling frequency of 25 Hz. The photoplethysmography (PPG) signal is digitally filtered, peaks and troughs are detected, and beat-by-beat intervals are extracted to obtain the heart rate and beat-by-beat interval sequences. The heart rate variability is then calculated based on the beat-by-beat interval sequences using the following formula: , in, The heart rate variability is expressed in milliseconds. For the first The interval between consecutive normal heartbeats, in milliseconds; The total number of valid intervals in the beat-by-beat interval sequence; The index number in the interval sequence; The motion state of the triaxial acceleration signal is determined every 2 seconds during the acquisition cycle. If valid motion is detected, the activity counter is incremented by 1. At the end of the acquisition cycle, the cumulative value of the activity counter is used as the activity amount.
3. The method according to claim 1, characterized in that, The physiological feature time series includes fixed-length time windows obtained by dividing the physiological feature data from the whole night by sliding windows. The length of the time window is 24 time steps, and the step size between adjacent time windows is 12 time steps.
4. The method according to claim 1, characterized in that, The step of extracting local features from the PPG branch through multi-layer convolution to obtain PPG local features includes: performing three layers of one-dimensional convolution on the PPG branch in sequence, with each layer having a kernel size of 3, a stride of 1, and the same padding method, and using ReLU non-linear activation after each convolution, with the number of output channels of the three layers being 16, 32, and 32 respectively, to obtain the PPG local features. The step of extracting local features of the activity level branch by performing dual-path parallel convolution to obtain local activity level features includes: performing a first-path one-dimensional convolution and a second-path one-dimensional convolution on the activity level branch respectively. The first-path one-dimensional convolution has a kernel size of 5 and outputs 24 channels to capture the rising and falling trend of the activity level. The second-path one-dimensional convolution has a kernel size of 1 and outputs 8 channels to retain the absolute activity level value at each time step. The stride of both convolutions is 1 and the padding method is the same. The two outputs are concatenated along the channel dimension to obtain the local activity level features. The convolution operations involved in the method do not use batch normalization, and the method does not include a circular connection structure or an attention mechanism.
5. The method according to claim 1, characterized in that, The kernel size of the dilated convolution with long porosity is 3, and the porosity is 4 and 8. The kernel size of the dilated convolution with short porosity is 2, and the porosity is 1 and 2. The output at each scale is 16 channels.
6. The method according to claim 1, characterized in that, The process of convolutionally projecting the multi-scale fused features to obtain the user's sleep and wakefulness binary classification results at each time step includes: The multi-scale fusion features are subjected to convolutional projection with a kernel size of 1 to obtain awake category scores and sleep category scores; A gating coefficient is generated based on the activity level, and the gating coefficient is: , in, The gating coefficient; For the sigmoid function; This is the normalized value of the activity level; For slope constant, As a bias constant, , ; The scores for the awake category and the sleep category are weighted and fused according to the gating coefficient to obtain an adjusted score, which is: , in, The adjusted score; Score the sobriety category; Score the sleep category; The adjusted scores are normalized to obtain the user's sleep and wakefulness binary classification results at each time step.
7. The method according to claim 1, characterized in that, The method further includes: The sleep and wakefulness binary classification results of the user at each time step are aggregated according to the starting position of the sliding window, and the average value of the overlapping area is taken to obtain the binary classification sequence of the whole night at each time step. A post-processing rule is applied to the binary classification sequence: when at least 6 consecutive time steps are determined to be sleep, the first sleep time step of the continuous segment is marked as the sleep onset point; when at least 6 consecutive time steps are determined to be awake, the first awake time step of the continuous segment is marked as the awakening point.
8. The method according to claim 1, characterized in that, The method further includes a step of training the convolutional neural network, the training step comprising: For each sample in the training set, the mean heart rate during sleep time steps is calculated. and mean heart rate variability This serves as the individual sleep physiology baseline for the sample. Heart rate thresholds were constructed based on the individual's sleep physiological baseline. Heart rate variability threshold ,in , , This is the preset heart rate offset. This is the preset heart rate variability offset. The wakefulness time steps in the training set that simultaneously satisfy the conditions of activity level below the activity level threshold, heart rate above the heart rate threshold, and heart rate variability below the heart rate variability threshold are marked as low-activity wakefulness candidate samples. Continuity filtering is applied to the low-activity wakefulness candidate samples, and candidate segments that appear consecutively with a length not less than the preset minimum running length are marked as low-activity wakefulness samples. During the training phase, a supplementary training window is generated centered at the time step of each of the low-activity awake samples. This supplementary training window is added to the training batch for training, and the low-activity awake samples are assigned a higher weight coefficient than regular samples in the loss function. The loss function is... , in, Let the loss function be... For category weight coefficients, As an enhancing factor, As a marker, the low-activity conscious samples are marked as 1, and the remaining valid data are marked as 0. For real labels, Predict probabilities for the model.
9. A sleep-wake detection system based on a smart ring, characterized in that, Including convolutional neural networks, and also: The acquisition module is used to acquire the user's physiological characteristic time series collected by the smart ring. The physiological characteristic time series includes three feature channels: heart rate, heart rate variability, and activity level. The splitting module is used to split the physiological feature time series into a PPG branch and an activity level branch according to the signal type. The PPG branch includes two feature channels: the heart rate and the heart rate variability. The activity level branch includes one feature channel: the activity level. The local feature extraction module is used to perform multi-layer convolutional local feature extraction on the PPG branch to obtain PPG local features, and to perform dual-path parallel convolutional local feature extraction on the activity branch to obtain activity local features. The multi-scale context extraction module is used to extract multi-scale temporal context from the PPG local features using dilated convolution with a long dilation rate, to obtain PPG multi-scale context features, and to extract multi-scale temporal context from the activity local features using dilated convolution with a short dilation rate, to obtain activity multi-scale context features; wherein, the PPG branch and the activity branch adopt mutually exclusive dilation rate sets to form an asymmetric routing configuration; The splicing module is used to splice the PPG multi-scale context features and the activity multi-scale context features along the channel dimension to obtain multi-scale fused features. The convolutional projection module is used to perform convolutional projection on the multi-scale fusion features to obtain the user's sleep and wakefulness binary classification results at each time step.
10. The system according to claim 9, characterized in that, It also includes a training module for training the convolutional neural network, the training module comprising: The baseline modeling unit is used to calculate the mean heart rate during sleep time steps for each sample in the training set. and mean heart rate variability This serves as the individual sleep physiology baseline for the sample. Threshold construction unit, used to construct heart rate threshold based on the individual's sleep physiological baseline. Heart rate variability threshold ,in , , This is the preset heart rate offset. This is the preset heart rate variability offset. The labeling unit is used to label the wakefulness time steps in the training set that simultaneously satisfy the conditions of activity level below the activity level threshold, heart rate above the heart rate threshold, and heart rate variability below the heart rate variability threshold as low-activity wakefulness candidate samples, and to apply continuous filtering to the low-activity wakefulness candidate samples, labeling candidate segments that appear consecutively with a length not less than a preset minimum running length as low-activity wakefulness samples. A resampling and weight enhancement unit is used to generate a supplementary training window centered at the time step of each of the low-activity awake samples during the training phase, add the supplementary training window to the training batch for training, and assign a higher weight coefficient to the low-activity awake samples than to the regular samples in the loss function. The loss function is... , in, Let the loss function be... For category weight coefficients, As an enhancing factor, As a marker, the low-activity conscious samples are marked as 1, and the remaining valid data are marked as 0. For real labels, Predict probabilities for the model.