Intelligent wearable device sleep state monitoring system based on time-frequency analysis
By implementing a sleep state monitoring system based on time-frequency analysis on smart wearable devices, and using LSTM and XGBoost models to perform time-domain and frequency-domain analysis on sleep data, the problem of poor accuracy of existing detection algorithms is solved, and more accurate recognition of sleep breathing events is achieved.
Patent Information
- Application Number
- CN202510097842.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-22
- Publication Date
- 2025-06-03
AI Technical Summary
The existing sleep breathing disorder detection algorithm has poor accuracy in the balance between data diversity, real-time algorithm and computational complexity caused by individual differences.
Design a sleep state monitoring system for intelligent wearable devices based on time-frequency analysis. Through the combination of data acquisition, preprocessing, time-domain analysis, frequency-domain analysis and data classification modules, the LSTM and XGBoost models are used to predict and classify the time-domain and frequency-domain features to achieve accurate identification of sleep state.
By weighted fusion of the prediction results of time and frequency domain characteristics, the accuracy of identification of breathing events during sleep is significantly improved, and the problem of poor accuracy of detection results of existing detection algorithms is solved.
Smart Images

Figure CN120078366A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of health detection, and more particularly, to an intelligent wearable device sleep state monitoring system based on time-frequency analysis. Background Art
[0002] In recent years, with the increasing understanding of the impact of sleep apnea on health, researchers have conducted a large number of studies in this field, especially in the improvement of detection technologies and intelligent applications, and significant progress has been made.
[0003] First of all, although traditional polysomnography is the "gold standard" for diagnosing sleep apnea, its high cost, complexity, and inconvenience to patients have led many researchers to explore the use of wearable devices and convenient biosensors for the detection of sleep apnea. For example, in 2017, Patel et al. published a study in the Journal of Clinical Sleep Medicine evaluating the effectiveness of an SDB screening system based on a home pulse oximeter. The study showed that by analyzing the nocturnal oxygen saturation signal and combining simple machine learning algorithms, it was possible to effectively identify moderate to severe sleep apnea cases. The research results showed that the frequency of hypoxic events in the oxygen saturation signal was closely related to the severity of sleep apnea, providing an important basis for home screening using low-cost, non-invasive devices.
[0004] In addition, researchers have also been constantly trying to apply more advanced signal processing and artificial intelligence technologies to the automatic detection and diagnosis of sleep apnea. In 2020, Zhao et al. published a study in the IEEE Journal of Biomedical and Health Informatics, proposing a deep learning-based multi-channel physiological signal analysis method for the automatic detection of sleep apnea events. This method combines electrocardiogram, oxygen saturation, and airflow signals, and uses convolutional neural networks and long short-term memory networks to extract features and classify the signals. The experimental results showed that the model had high accuracy and robustness in identifying sleep apnea events, especially when dealing with complex multi-modal data, demonstrating the potential of artificial intelligence technology.
[0005] Based on these studies, Li et al. proposed a method for detecting sleep apnea based on transfer learning in *Nature and Science of Sleep*. This method pre-trains the model using a large-scale public sleep database and fine-tunes it for the data of specific patients, thus significantly improving the generalization ability of the model among different populations. The research results show that transfer learning performs well in dealing with the problem of model performance degradation caused by individual differences and insufficient data, providing feasibility for future applications on a larger scale.
[0006] Generally speaking, although existing studies have shown that these emerging technologies have good application prospects in sleep apnea detection, the existing detection algorithms have poor detection result accuracy due to the data diversity caused by individual differences and the balance problem between the real-time performance and computational complexity of the algorithms.
[0007] Therefore, it is necessary to design an intelligent wearable device sleep state monitoring system based on time-frequency analysis to solve the problem of poor detection result accuracy of existing detection algorithms. Summary of the Invention
[0008] In view of this, the present invention proposes an intelligent wearable device sleep state monitoring system based on time-frequency analysis, aiming to solve the problem of poor detection result accuracy of existing detection algorithms.
[0009] On the one hand, the present invention proposes an intelligent wearable device sleep state monitoring system based on time-frequency analysis, including:
[0010] Data acquisition module: used to collect samples of all physiological information of the user from the start to the end of sleep and aggregate them into a data set;
[0011] Data preprocessing module: used to receive the data set collected by the information acquisition module; after receiving the data set, the data processing module detects and removes outliers from the samples in the data set, copies the data set after removing outliers twice to obtain data sets A and B, performs normalization and SMOTE (Synthetic Minority Over-sampling Technique) resampling processing on data set A, and performs Fourier transform, normalization and SMOTE resampling processing on data set B;
[0012] Time domain analysis module: used to receive data set B, construct an LSTM (Long Short-Term Memory) time domain prediction model, extract the time domain features of data set B, and obtain the time domain feature value C of data set B;
[0013] Frequency domain analysis module: It is used to receive the dataset A, construct an XGBoost (eXtreme Gradient Boosting) frequency domain prediction model, extract the frequency domain features of the dataset A, and obtain the frequency domain feature value D of the dataset A;
[0014] Data classification module: It is used to receive the time domain feature value C and the frequency domain feature value D output by the time domain analysis module and the frequency domain analysis module, and classify and identify the dataset.
[0015] Further, a pollution factor z is preset in the data preprocessing module. The data preprocessing module calculates the data anomaly degree of each sample in the dataset through the Isolation Forest algorithm, then arranges the samples in the dataset from small to large according to the anomaly degree, and then eliminates the first z% of the samples;
[0016] The Isolation test formula is:
[0017]
[0018] Among them, E(h(x)) corresponds to the isolation depth of the physiological information data x, Average Path Length is the average path length of the dataset, and Isolation Score is the sample anomaly degree.
[0019] Further, when the data preprocessing module processes the dataset B, it first converts the time domain signal of the dataset B into a frequency domain signal through Fourier transform, and then normalizes the frequency domain signal.
[0020] Further, when the data preprocessing module processes the dataset A and the dataset B, the data preprocessing module identifies all minority class samples from the dataset, based on each minority class sample x i , obtains its k nearest neighbor samples, uses the calculation formula of the new sample x new to generate new synthetic samples, and merges the new synthetic samples with the original dataset;
[0021] The formula of x new is:
[0022] x new = x i + λ · (x neighbor - x i )
[0023] Among them, x i is the current minority class sample; x neighbor is a nearest neighbor sample of x i ; λ is a random number between 0 and 1.
[0024] Further, after receiving the preprocessed dataset B, the time-domain analysis module inputs dataset B into the first LSTM layer with 128 hidden units, and extracts the time-domain features in dataset B based on retaining, updating, and outputting the samples in dataset B. The time-domain analysis module is also configured to input the time-domain features into the second LSTM layer with 64 hidden units to refine the time-domain features.
[0025] The time-domain analysis module is also configured to input the refined time-domain features into a fully connected layer with 32 neurons, and process them using the ReLU (Rectified Linear Unit) activation function. Based on the output layer of the Softmax activation function, the time-domain feature value C of dataset B is obtained.
[0026] Further, the cores of the first LSTM layer and the second LSTM layer in the time-domain analysis module consist of three gating units: a forget gate, an input gate, and an output gate. The first LSTM layer and the second LSTM layer calculate dataset B through the three gating units to obtain the time-domain features.
[0027] Further, a Dropout layer is provided between the first LSTM layer and the second LSTM layer, and the Dropout layer is used to randomly set the outputs of some neurons to zero.
[0028] Further, when constructing the XGBoost frequency-domain prediction model, the XGBoost model is first introduced, expressed as:
[0029]
[0030] In the formula: T and ω are the number of tree leaf nodes and the leaf weight value respectively, γ is the leaf tree penalty coefficient, and λ is the leaf weight penalty coefficient;
[0031] Then, the particle swarm optimization algorithm is introduced to optimize the algorithm parameters of the XGBoost model.
[0032] Further, the algorithm parameters of the XGBoost model are the number of classification trees, the maximum depth of classification trees, the learning rate, the random sampling rate of classification trees, the sample weight of the minimum leaf nodes of classification trees, the feature sampling rate of classification trees, and the L1 and L2 regularization weights; the optimization is specifically as follows:
[0033] Adjust the number of classification trees and the maximum depth of classification trees, and calculate the accuracy of the validation set by taking values from [1000, 5000] and [3, 10] respectively;
[0034] Adjust the learning rate, and the adjustment range is [0.001, 0.5];
[0035] Adjust the random sampling rate of the model and the sample weight of the minimum leaf node of the classification tree.
[0036] Furthermore, the data classification module is configured to perform weighted fusion on the time-domain eigenvalue C and the frequency-domain eigenvalue D to obtain the sample eigenvalue E of each sample in the dataset;
[0037] The data classification module internally presets a standard eigenvalue F, a first difference ΔF 1 and a second difference ΔF 2 , and ΔF 1 <ΔF 2 ;
[0038] The data classification module is also configured to calculate the absolute value of the difference between the sample eigenvalue E and the standard eigenvalue F as ΔE. When ΔE ≤ ΔF 1 , the data classification module determines this sample as no event; when ΔF 1 ≤ΔE≤ΔF 2 , the data classification module determines this sample as a hypopnea event; when ΔE ≥ ΔF 2 , the data classification module determines this sample as an apnea event.
[0039] Compared with the prior art, the beneficial effects of the present invention are as follows: Using LSTM to predict the time-domain features, using XGBoost to predict the frequency-domain features, and then accurately identifying and classifying the breathing time during sleep by weighted fusion of the prediction results of these two parts, greatly improving the accuracy of the detection results. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] By reading the detailed description of the preferred embodiments below, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only for the purpose of showing the preferred embodiments and are not considered to be a limitation of the present invention. Moreover, throughout the drawings, the same reference numerals are used to represent the same components. In the drawings:
[0041] Figure 1 is the architecture diagram of the intelligent wearable device sleep state monitoring system based on time-frequency analysis provided by the embodiment of the present invention;
[0042] Figure 2 is the sample blood oxygen concentration and heart rate change trend diagram;
[0043] Figure 3 is the LSTM model architecture diagram provided by the embodiment of the present invention;
[0044] Figure 4 is the XGBoost model architecture diagram provided by the embodiment of the present invention;
[0045] Figure 5 Schematic diagram showing the influence of various parameters provided by the embodiments of the present invention on the model classification error;
[0046] Figure 6 Flow chart of the particle swarm optimization algorithm iteration provided by the embodiments of the present invention;
[0047] Figure 7 Functional block diagram of the sleep state monitoring system of the intelligent wearable device based on time-frequency analysis provided by the embodiments of the present invention. Detailed implementation manners
[0048] Hereinafter, exemplary embodiments of the present disclosure will be described in more detail with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present disclosure can be more thoroughly understood and the scope of the present disclosure can be completely conveyed to those skilled in the art. It should be noted that, without conflict, the embodiments in the present invention and the features in the embodiments can be combined with each other. Hereinafter, the present invention will be described in detail with reference to the drawings and in conjunction with the embodiments.
[0049] Refer to Figure 1-7 As shown, in some embodiments of the present application, a sleep state monitoring system of an intelligent wearable device based on time-frequency analysis includes:
[0050] Data acquisition module: configured to collect samples of all physiological information of a user from the start to the end of sleep and aggregate them into a data set;
[0051] Data preprocessing module: configured to receive the data set collected by the information acquisition module; after receiving the data set, the data processing module performs outlier detection and removal on the samples in the data set, and then copies the data set after removing outliers twice to obtain data set A and data set B. The data set A is subjected to normalization and SMOTE resampling processing, and the data set B is subjected to Fourier transform, normalization, and SMOTE resampling processing;
[0052] Time domain analysis module: configured to receive the data set B, construct an LSTM time domain prediction model, extract the time domain features of the data set B, and obtain the time domain feature value C of the data set B;
[0053] Frequency domain analysis module: configured to receive the data set A, construct an XGBoost frequency domain prediction model, extract the frequency domain features of the data set A, and obtain the frequency domain feature value D of the data set A;
[0054] Data classification module: configured to receive the time domain feature value C and the frequency domain feature value D output by the time domain analysis module and the frequency domain analysis module, and classify and identify the data set.
[0055] Specifically, the data acquisition module is an intelligent wearable device integrated with a PPG sensor. The data acquisition module detects the heart rate data and blood oxygen saturation data of the user from the start of sleep to the end of sleep through the PPG sensor; the data classification module classifies the samples in the data set into three categories: no event, apnea event, and hypopnea event according to the classification results of the time domain analysis module and the frequency domain analysis module.
[0056] It can be understood that during sleep, the activities of the sympathetic nerve and the parasympathetic nerve will affect the changes in heart rate and blood oxygen saturation. When an apnea or hypopnea event occurs, the sympathetic nerve activity will increase, resulting in an increase in heart rate and a decrease in blood oxygen level. This physiological change can be captured and analyzed through the PPG signal. When the sympathetic nerve is excited, the arterial blood vessels contract, the vascular volume decreases, resulting in heart rate fluctuations and a decrease in blood oxygen saturation; when the parasympathetic nerve dominates, the blood vessels dilate, the vascular volume increases, and the heart rate tends to be stable;
[0057] It can be understood that the autonomic nerve activity of patients with sleep disordered breathing is more active at night than that of normal people, which leads to the frequent occurrence of apnea and hypopnea events. These events will cause periodic decreases in blood oxygen saturation and heart rate fluctuations. The present invention can accurately identify and classify the respiratory events during sleep by continuously detecting and analyzing these physiological signals.
[0058] As Figure 1-7 shown, in some embodiments of the present application, a pollution factor z is preset in the data preprocessing module. The data preprocessing module calculates the data abnormality degree of each sample in the data set through the Isolation Forest algorithm, and then arranges the samples in the data set in ascending order of the abnormality degree, and then eliminates the first z% of the samples;
[0059] The Isolation test formula is:
[0060]
[0061] where E(h(x)) corresponds to the isolation depth of the physiological information data x, Average Path Length is the average path length of the data set, and Isolation Score is the sample abnormality degree.
[0062] Specifically, Isolation Forest is an anomaly detection method based on a tree structure. Its core idea is to isolate abnormal samples by randomly selecting features and generating a tree structure. Outliers are more easily isolated during the construction of the tree, thus distinguishing them from normal data.
[0063] AsFigure 1-7 As shown, in some embodiments of the present application, when the data preprocessing module processes dataset B, it first converts the time-domain signal of dataset B into a frequency-domain signal through Fourier transform, and then normalizes the frequency-domain signal.
[0064] Specifically, the formula for the Fourier transform is: X FFT = FFT(X time ), where X FFT is the frequency-domain feature after Fourier transform, and X time is the data of the sample in the dataset.
[0065] Specifically, the normalization formula is: where X FFT is the frequency-domain feature after Fourier transform, X norm is the normalized feature, X min is the minimum value in the dataset, and X max is the maximum value in the dataset.
[0066] It can be understood that Fourier transform can reveal the frequency components in the signal and provide a basis for subsequent capturing of periodic and frequency-related features; normalization processing can scale the data to a unified range (0 to 1) to eliminate the scale differences between different features.
[0067] As Figure 1-7 shown, in some embodiments of the present application, when the data preprocessing module processes dataset A and dataset B, the data preprocessing module identifies all minority-class samples from the dataset, and based on each minority-class sample x i , obtains its k nearest neighbor samples, generates new synthetic samples using the calculation formula of the new sample x new , and merges the new synthetic samples with the original dataset.
[0068] The calculation formula of the x new is:
[0069] x new = x i + λ · (x neighbor - x i )
[0070] where x i is the current minority-class sample; x neighbor is a nearest neighbor sample of x i ; and λ is a random number between 0 and 1.
[0071] It is understandable that in the original dataset, there is an imbalance problem in the sample distribution of the three types of events (no event, apnea, hypopnea). SMOTE is an instance-based oversampling technique aimed at increasing the number of minority-class samples. Its basic idea is to expand the sample space of the minority class by generating new synthetic samples in the neighborhood of the minority-class samples. These synthetic samples are not simply copies of the existing samples, but new samples generated by interpolating between the minority-class samples and their neighbor samples to achieve the purpose of balancing the class distribution.
[0072] As Figure 1-7 shown, in some embodiments of the present application, after receiving the preprocessed dataset B, the time-domain analysis module inputs the dataset B into the first LSTM layer with 128 hidden units, and extracts the time-domain features in the dataset B by controlling the retention, update, and output of the samples in the dataset B. The time-domain analysis module is also configured to input the time-domain features into the second LSTM layer containing 64 hidden units to refine the time-domain features;
[0073] The time-domain analysis module is also configured to input the refined time-domain features into a fully connected layer with 32 neurons, and process them using the ReLU activation function. Based on the output layer of the Softmax activation function, the time-domain feature value C of the dataset B is obtained.
[0074] Specifically, the formula of the ReLU activation function is: f(x) = max(0, x), where X is the input value.
[0075] The formula of the Softmax function is:
[0076]
[0077] where, w j is the weight vector of class j, x is the input feature vector, and K is the number of classes.
[0078] ReLU introduces non-linear features and can better capture complex feature relationships, while the Softmax function is set in the model output layer to convert the feature information data into a probability distribution.
[0079] It is understandable that LSTM, specifically designed to handle long-term dependence problems, can effectively capture long-term and short-term dependence relationships in complex time series by introducing forget gates, input gates, and output gates. It performs particularly well in processing high-dimensional data and has high accuracy and robustness.
[0080] As Figure 1-7As shown, in some embodiments of the present application, the cores of the first LSTM layer and the second LSTM layer in the time-domain analysis module are composed of three gating units: a forget gate, an input gate, and an output gate. The first LSTM layer and the second LSTM layer calculate the time-domain features from the dataset B through the three gating units.
[0081] Specifically, the forget gate f t controls the retention of samples, and its calculation formula is:
[0082] f t = σ(W f · [h t-1 , x t + b f )
[0083] where W f is the weight matrix, h t-1 is the hidden state at the previous moment, x t is the current input, b f is the bias term, σ is the activation function of this layer, and x t is the data information of each sample in the preprocessed dataset B;
[0084] The input gate i t controls the update of samples, and its calculation formula is:
[0085] i t = σ(W i · [h t-1 , x t + b i )
[0086]
[0087] where W i and W C are weight matrices, b i and b C are bias terms, is the candidate memory unit, and x t is the data information of each sample in the preprocessed dataset B;
[0088] The output gate o t controls the output of samples, and its calculation formula is:
[0089] o t = σ(W o · [h t-1 , x t + b o )
[0090]
[0091] h t = o t × tanh(C t )
[0092] Wherein, h t is the final hidden state, C t is the updated memory cell state, and x t is the data information of each sample in the preprocessed dataset B.
[0093] Specifically, the forget gate determines the retention and discard of feature information in the dataset. After calculation by the dataset refinement forget gate, a value between 0 and 1 will be output, where 1 means complete retention and 0 means complete discard.
[0094] Specifically, through the calculation of these gates, the LSTM can effectively retain important time series information while filtering out irrelevant noise;
[0095] Specifically, through the stacking of multiple LSTM structures in the present invention, the model can fully perceive and model different levels of dependency relationships in the time series.
[0096] As Figure 1-7 shown, in some embodiments of the present application, a Dropout layer is provided between the first LSTM layer and the second LSTM layer in the time domain analysis module, and the Dropout layer is used to randomly set the outputs of some neurons to zero.
[0097] Specifically, the calculation formula of the Dropout layer is:
[0098]
[0099] Wherein, y i is the output of the neuron, h i is the output without Dropout, and p is the Dropout probability
[0100] This formula means that the output of the neuron is set to 0 with probability p, and the neuron output is scaled by with probability 1 - p.
[0101] It can be understood that the mechanism of Dropout is to randomly set the outputs of some neurons to zero, thereby avoiding the over - dependence of the model on specific neurons.
[0102] Specifically, after constructing the LSTM time - domain prediction model, in order to improve the accuracy and robustness of the model, the present invention uses the Adam optimizer to train the LSTM time - domain prediction model. The Adam optimizer combines the methods of momentum and adaptive learning, and its parameter update rule is as follows:
[0103] m t = β 1 m t-1 +(1 - β 1 )g t
[0104]
[0105] where g t is the gradient, β 1 and β 2 are the decay rates of the momentum terms, μ is the learning rate, and ∈ is a small constant used to prevent the denominator from being zero. The Adam optimizer can effectively accelerate the gradient descent process and avoid local optima.
[0106] In terms of the loss function, the present invention uses sparse categorical cross - entropy, which can measure the difference between the predicted probability and the true distribution. The formula is as follows:
[0107]
[0108] where N is the number of samples, y i is the true label, and P(y i |x i ) is the probability distribution predicted by the model.
[0109] By optimizing this loss function, the model can continuously adjust its parameters and improve the classification performance
[0110] As Figure 1-7 shown, in some embodiments of the present application, when the frequency - domain analysis module constructs the XGBoost frequency - domain prediction model, the XGBoost model is first introduced, expressed as:
[0111]
[0112] In the formula: T and ω are the number of tree leaf nodes and the leaf weight values respectively, γ is the leaf tree penalty coefficient, and λ is the leaf weight penalty coefficient;
[0113] Then the particle swarm algorithm is introduced to optimize the algorithm parameters of the XGBoost model.
[0114] Specifically, the specific construction steps of the XGBoost model are as follows:
[0115] For a given data set: D = {(x i , y i ): i = 1, 2, …, m, x i ∈ R P , y i∈R} consists of P features and there are m samples in total. Given k (k = 1, 2, …, K) classification trees, F is the set space of classification trees, expressed as:
[0116]
[0117] It is transformed into the objective function as:
[0118]
[0119] where is the predicted value, y i is the true value, and Ω(f k ) is the regularization term;
[0120] Subsequently, the gradient boosting method is used for iterative calculation. Each time a new classification tree is added to the model, the result of the t-th iterative calculation is:
[0121]
[0122] Substitute the above formula into the objective function again, and the objective function Obj (t) of the t-th iteration is obtained:
[0123]
[0124] Then, perform a second-order Taylor expansion on its objective function and add the regularization term Ω(f k ), to obtain the XGBoost model:
[0125]
[0126] In the formula: T and ω are the number of leaf nodes of the tree and the leaf weight value respectively, γ is the leaf tree penalty coefficient, and λ is the leaf weight penalty coefficient.
[0127] It can be understood that as a powerful gradient boosting model, XGBoost effectively avoids the overfitting problem by integrating multiple weak classifiers and combining regularization means. While processing complex data and capturing high-dimensional features, it maintains high computational efficiency. Especially when dealing with frequency domain features, XGBoost shows strong robustness and can better capture the non-linear feature patterns in the data.
[0128] Such as Figure 1-7As shown, in some embodiments of the present application, the algorithm parameters of the XGBoost model are the number of classification trees (n_estimators), the maximum depth of the classification tree (max_depth), the learning rate, the random sampling rate of the classification tree (subsample), the sample weight of the minimum leaf node of the classification tree (min_child_weight), the feature sampling rate of the classification tree, and the L1 and L2 regularization weights; the optimization is specifically as follows:
[0129] Adjust the number of classification trees and the maximum depth of the classification tree, and calculate the accuracy of the validation set by taking values from [1000, 5000] and [3, 10] respectively;
[0130] Adjust the learning rate, and the adjustment range is [0.001, 0.5];
[0131] Adjust the random sampling rate of the model and the sample weight of the minimum leaf node of the classification tree;
[0132] Adjust the feature sampling rate of the model, and the adjustment ranges are [0, 1] respectively.
[0133] Specifically, as the number of classification trees increases, the model error rate reaches the minimum value when the number of trees reaches 2000, and as the number of classification trees increases, the error rate shows an upward trend. For the maximum depth of the classification tree, the error rate reaches the minimum value when it is equal to 9.
[0134] Specifically, when the model learning rate is 0.01, the model error rate is the smallest.
[0135] Specifically, as Figure 5-6 shown, the relationship between the error rate and the sum of the random sampling rate of the classification tree and the sample weight of the minimum leaf node is relatively complex. Therefore, the particle swarm optimization is used to optimize its parameters. The optimization results of the two parameters of the model by PSO are: subsample = 1; min_child_weight = 1. The iterative process of the model parameter optimization is as Figure 6 shown: when the number of iterations reaches 100 times, the fitness function reaches 0.99.
[0136] Specifically, when colsampe_bytree = 0.1, the error rate is the smallest.
[0137] As Figure 1-7 shown, in some embodiments of the present application, the data classification module is configured to perform weighted fusion on the time-domain feature value C and the frequency-domain feature value D to obtain the sample feature value E of each sample in the dataset;
[0138] The data classification module internally presets a standard feature value F, a first difference ΔF 1 and a second difference ΔF 2 , and ΔF 1<ΔF 2 ;
[0139] The data classification module is further configured to calculate the absolute value of the difference between the sample eigenvalue E and the standard eigenvalue F as ΔE. When ΔE ≤ ΔF 1 , the data classification module determines this sample as a no-event; when ΔF 1 ≤ ΔE ≤ ΔF 2 , the data classification module determines this sample as a hypopnea event; when ΔE ≥ ΔF 2 , the data classification module determines this sample as an apnea event.
[0140] Specifically, the standard eigenvalue F, the first difference ΔF 1 and the second difference ΔF 2 can be set according to medical standards; the weight value of the time-domain eigenvalue C in the weighted fusion is 0.9; the weight value of the frequency-domain eigenvalue D is 0.1.
[0141] Effect test
[0142] 8994 no-event samples are taken as class 0; 8935 apnea event samples are taken as class 1; 8899 hypopnea events are taken as class 2; each sample contains blood oxygen saturation and heart rate data of 180 time steps. Subsequently, all samples of the three classes are input into the sleep state monitoring system of the intelligent wearable device based on time-frequency analysis of the present invention for reclassification, and the classification results are prepared into a confusion matrix table, and the results are as follows:
[0143] Table 1 Confusion matrix
[0144] Actual category 0 Actual category 1 Actual category 2 Classification result is 0 8647 79 268 Classification result is 1 167 8609 159 Classification result is 2 332 160 8407
[0145] It can be obtained from Table 1 that:
[0146] Class 0 (no-event): Among a total of 8994 samples, the present invention correctly classified 8647, only 79 were misclassified as class 1, and 268 were misclassified as class 2. It can be seen that the classification effect of the present invention on no-event samples is very good, and the main problem of misclassification occurs in class 2 (hypopnea event).
[0147] Class 1 (apnea event): For 8935 apnea event samples, the present invention correctly identified 8609, 167 were misclassified as class 0, and 159 were misclassified as class 2. The present invention performs very well in identifying apnea events and has less confusion with other classes.
[0148] Category 2 (hypopnea events): Among the 8,899 hypopnea event samples, 8,407 were correctly classified, 332 were misclassified as Category 0, and 160 were misclassified as Category 1. There was relatively more confusion between the identification of Category 2 and Category 0, probably because the characteristics of hypopnea events are relatively complex and there is a certain similarity with the no-event samples.
[0149] Subsequently, the precision, recall rate, and F1 score were calculated for each of the above classification results to form a classification report, as shown in Table 2 below;
[0150] Table 2: Classification Result Report
[0151]
[0152] According to the classification report, the precision of Category 0 is 0.95, the recall rate is 0.96, and the F1 score is 0.95, indicating that the detection of the present invention on no-event samples is very accurate and the misjudgment rate is relatively low. The precision of Category 1 is 0.97, the recall rate is 0.96, and the F1 score is 0.97, showing that in the detection of apnea events, the present invention has extremely high accuracy and consistency and is the category with the best classification performance. The precision of Category 2 is 0.95, the recall rate is 0.94, and the F1 score is 0.95. Although it is slightly lower than that of Category 1, it still maintains high performance, especially in distinguishing Category 0 and Category 1. The overall evaluation shows that the accuracy rate of the present invention reaches 95.66%, and the Cohen's Kappa index is 0.935, indicating that the present invention performs well in the classification tasks of different categories and has good category consistency.
[0153] Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program codes.
[0154] The present application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowcharts and / or block diagrams can be implemented by computer program instructions, and the combination of the processes and / or blocks in the flowcharts and / or block diagrams can also be implemented by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable data processing devices to generate a machine, so that the instructions executed by the processors of the computer or other programmable data processing devices generate for implementing the processes Figure 1one or more processes and / or blocks Figure 1 means for the functions specified in one or more blocks
[0155] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce a manufacture including an instruction means that implements the functions in the process Figure 1 one or more processes and / or blocks Figure 1 specified in one or more blocks
[0156] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus, such that a series of operational steps are performed on the computer or other programmable apparatus to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable apparatus provide steps for implementing the functions specified in the process Figure 1 one or more processes and / or blocks Figure 1 specified in one or more blocks
[0157] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the above embodiments, those of ordinary skill in the art should understand that: modifications or equivalent replacements can still be made to the specific embodiments of the present invention, and any modifications or equivalent replacements that do not depart from the spirit and scope of the present invention should be covered by the protection scope of the claims of the present invention.
Claims
1. A sleep status monitoring system for smart wearable devices based on time-frequency analysis, characterized in that: include: Data collection module: used to collect samples of all the user's physiological information from the beginning to the end of sleep and compile them into a data set; Data preprocessing module: used to receive the data set collected by the information collection module; After receiving the data set, the data processing module performs outlier detection and removal on the samples in the data set, copies the data set after outliers are removed in two copies to obtain data set A and data set B, performs normalization and SMOTE resampling processing on data set A, and performs Fourier transform, normalization and SMOTE resampling processing on data set B; Time domain analysis module: used to receive the data set B, build an LSTM time domain prediction model, extract the time domain features of the data set B, and obtain the time domain feature value C of the data set B; Frequency domain analysis module: used to receive the data set A, build an XGBoost frequency domain prediction model, extract the frequency domain features of the data set A, and obtain the frequency domain feature value D of the data set A; Data classification module: used to receive the time domain eigenvalues C and frequency domain eigenvalues D output by the time domain analysis module and the frequency domain analysis module, and classify and identify the data set.
2. The sleep state monitoring system for smart wearable devices based on time-frequency analysis according to claim 1, characterized in that: The data preprocessing module is preset with a contamination factor z. The data preprocessing module calculates the data anomaly degree of each sample in the data set by an Isolation Forest algorithm, then arranges the samples in the data set from small to large according to the anomaly degree, and then removes the top z% of samples; The isolation test formula is: Where E(h(x)) corresponds to the isolation depth of the physiological information data x, Average Path Length is the average path length of the data set, and Isolation Score is the degree of sample abnormality.
3. The sleep state monitoring system for smart wearable devices based on time-frequency analysis according to claim 1, characterized in that: When the data preprocessing module processes the data set B, it first converts the time domain signal of the data set B into a frequency domain signal through Fourier transform, and then normalizes the frequency domain signal.
4. The smart wearable device sleep state monitoring system based on time-frequency analysis according to claim 1, characterized in that: When the data preprocessing module processes the data set A and the data set B, the data preprocessing module identifies all minority class samples from the data set, and based on each minority class sample x i , get its k nearest neighbor samples, and use the new sample x new Generate new synthetic samples using the calculation formula, and merge the new synthetic samples with the original data set; The x new The formula is: x new =x i +λ·(x neighbor -x i ) Among them, x i is the current minority class sample; x neighbor is x i is a nearest neighbor sample of ; λ is a random number between 0 and 1.
5. The smart wearable device sleep state monitoring system based on time-frequency analysis according to claim 1, characterized in that: After receiving the preprocessed data set B, the time domain analysis module inputs the data set B into a first LSTM layer having 128 hidden units, extracts the time domain features in the data set B based on controlling the retention, update and output of samples in the data set B, and the time domain analysis module is further configured to input the time domain features into a second LSTM layer having 64 hidden units to refine the time domain features; The time domain analysis module is also configured to input the refined time domain features into a fully connected layer with 32 neurons, and process them using a ReLU activation function, and obtain the time domain feature value C of the data set B through an output layer based on a Softmax activation function.
6. The sleep state monitoring system for smart wearable devices based on time-frequency analysis according to claim 5, characterized in that: The core of the first LSTM layer and the second LSTM layer in the time domain analysis module is composed of three gating units: a forget gate, an input gate and an output gate. The first LSTM layer and the second LSTM layer calculate the data set B through the three gating units to obtain time domain features.
7. The sleep state monitoring system for smart wearable devices based on time-frequency analysis according to claim 5, characterized in that: A Dropout layer is provided between the first LSTM layer and the second LSTM layer in the time domain analysis module, and the Dropout layer is used to randomly set the outputs of some neurons to zero.
8. The smart wearable device sleep state monitoring system based on time-frequency analysis according to claim 1, characterized in that: When the frequency domain analysis module constructs the XGBoost frequency domain prediction model, the XGBoost model is first introduced, which is expressed as: Where: T and ω are the number of tree nodes and leaf weight respectively, γ is the leaf tree penalty coefficient, and λ is the leaf weight penalty coefficient; The particle swarm algorithm is then introduced to tune the algorithm parameters of the XGBoost model.
9. The smart wearable device sleep state monitoring system based on time-frequency analysis according to claim 8, characterized in that: The algorithm parameters of the XGBoost model are the number of classification trees, the maximum depth of the classification tree, the learning rate, the random sampling rate of the classification tree, the minimum leaf node sample weight of the classification tree, the feature sampling rate of the classification tree, and the L1 and L2 regularization weights; the optimization is specifically as follows: Adjust the number of classification trees and the maximum depth of the classification trees, and take values between [1000, 5000] and [3, 10] to calculate the accuracy of the validation set; Adjust the learning rate in the range of [0.001, 0.5]; Adjust the random sampling rate of the model and the minimum leaf node sample weight of the classification tree.
10. The smart wearable device sleep state monitoring system based on time-frequency analysis according to claim 1, characterized in that: The data classification module is configured to perform weighted fusion of the time domain eigenvalue C and the frequency domain eigenvalue D to obtain the eigenvalue E of each sample in the data set; The data classification module is preset with a standard feature value F, a first difference value ΔF1 and a second difference value ΔF2, and ΔF1<ΔF2; The data classification module is also configured to calculate the absolute value of the difference between the sample characteristic value E and the standard characteristic value F as ΔE. When ΔE≤ΔF1, the data classification module determines the sample as no event; when ΔF1≤ΔE≤ΔF2, the data classification module determines the sample as a hypopnea event; when ΔE≥ΔF2, the data classification module determines the sample as an apnea event.
Citation Information
Cited By
Sleep apnea detection method and device, embedded equipment and storage medium
CN121059117A