Pressure classification method and device, computer device and storage medium
By acquiring and analyzing physiological signals during a user's sleep process, and using a twin neural network for stress detection and classification, this technology solves the problem of not being able to accurately distinguish multiple sleep stressors in existing technologies, thereby improving the accuracy of stress detection and sleep quality.
Patent Information
- Application Number
- CN202511407916.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-29
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2045-09-29
AI Technical Summary
Existing stress classification methods cannot accurately distinguish between various sleep stressors, resulting in the inability to provide targeted interventions and affecting sleep quality.
By acquiring physiological signals during the user's sleep process, feature extraction and screening are performed, and stress detection and classification are carried out using a Siamese neural network. Combined with a preset stress template, accurate stress type identification is achieved.
It enables accurate classification of various sleep pressures, improving the accuracy of pressure detection and sleep quality.
Smart Images

Figure CN120873878B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of sleep management, and in particular to a stress classification method and device, computer equipment and a storage medium. BACKGROUND
[0002] During sleep, people are often disturbed by various stressors, such as nightmares, post-traumatic stress disorder (PTSD), temperature discomfort, environmental noise, and sleep apnea, etc. These stressors can affect physiological activity during sleep, resulting in decreased sleep quality.
[0003] Currently, existing methods mainly focus on the collection and analysis of heart rate or respiration rate to determine when the user is experiencing stress abnormalities. When the user is disturbed by multiple different stressors, the system can only provide a general abnormality prompt and cannot accurately distinguish whether the stress response is caused by sleep apnea, nightmares, or environmental factors, etc. Therefore, it is difficult to provide targeted intervention measures.
[0004] Therefore, how to comprehensively analyze multiple physiological signals during sleep and then detect stress states and classify stressors has become a technical problem that needs to be solved to improve sleep monitoring and management. SUMMARY
[0005] Therefore, it is necessary to provide a stress classification method, device, computer equipment and storage medium to solve the problem of low recognition accuracy of traditional stress classification methods.
[0006] A stress classification method, the method comprising:
[0007] Obtaining at least one physiological signal of a user during sleep;
[0008] Performing feature extraction processing based on the physiological signals to obtain features corresponding to each physiological signal;
[0009] Based on the correlation between each feature and a stress detection task, a target feature is selected from all the features;
[0010] Performing stress detection processing based on the target feature to determine whether the user is in a stress state;
[0011] When the user is in a stress state, performing stress classification processing based on all the features and a preset stress template to obtain a stress classification result of the user.
[0012] Optionally, the physiological signals include ballistocardiogram signals, and the feature extraction processing based on the physiological signals to obtain features corresponding to each physiological signal comprises:
[0013] performing denoising processing based on the ballistocardiogram signal to obtain a denoised ballistocardiogram signal;
[0014] extracting, through a preset sliding window, a signal peak amplitude, a signal variance, a signal energy mean value, and a high-frequency energy proportion in the denoised ballistocardiogram signal;
[0015] determining a body movement feature of the user in the sleep process based on the signal peak amplitude, the signal variance, the signal energy mean value, and the high-frequency energy proportion;
[0016] extracting a heart rate parameter and a heart rate variability parameter of the user in the sleep process based on the denoised ballistocardiogram signal;
[0017] determining a feature corresponding to the ballistocardiogram signal based on the body movement feature, the heart rate parameter, and the heart rate variability parameter.
[0018] Optionally, the physiological signals include a respiration envelope, and the feature extraction processing based on the physiological signals to obtain a feature corresponding to each physiological signal includes:
[0019] performing band-pass filtering processing based on the respiration envelope to obtain a filtered respiration envelope;
[0020] eliminating abnormal peaks in the filtered respiration envelope to obtain a valid respiration envelope;
[0021] extracting an average interval between respiration peaks in the valid respiration envelope, and calculating a respiration rate of the user in the sleep process based on the average interval;
[0022] determining a trough position in the valid respiration envelope, and performing integral calculation on each respiration wave in the valid respiration envelope to obtain a respiration intensity, with the trough position as a demarcation point;
[0023] determining a respiratory pause feature of the user in the sleep process based on the respiration intensity and a preset intensity threshold;
[0024] determining a feature corresponding to the respiration envelope based on the respiratory pause feature and the respiration rate.
[0025] Optionally, the correlation between each feature and a stress detection task is used to screen a target feature from all the features, including:
[0026] constructing a feature matrix based on all the features;
[0027] perform eigenvalue decomposition on the covariance matrix to obtain eigenvalues of each feature, the eigenvalues being used to represent the correlation between the corresponding feature and the stress detection task;
[0028] sort the features based on the sizes of the eigenvalues to obtain a feature sorting table;
[0029] extract features satisfying a preset condition from the feature sorting table as the target features.
[0030] Optionally, the stress detection processing based on the target features to determine whether the user is in a stress state comprises:
[0031] providing the target features to a trained stress detection model to enable the trained stress detection model to output a stress detection result, and determining whether the user is in a stress state based on the stress detection result;
[0032] Before the target features are provided to the trained stress detection model, the method further comprises:
[0033] obtaining a stress detection model to be trained and a training set, the training set comprising sample features and corresponding stress state labels;
[0034] inputting the sample features into the stress detection model to be trained to enable the stress detection model to be trained to output a stress detection result corresponding to the sample features;
[0035] calculating a loss value between the stress detection result and the stress state label based on a preset loss function;
[0036] combining a preset regularization function to iteratively train the stress detection model to be trained with the optimization goal of minimizing the loss value, and stopping the iteration when the loss value is less than a preset value or the number of iterations exceeds a preset number of times to obtain the trained stress detection model.
[0037] Optionally, after the stress classification processing based on all the features and a preset stress template to obtain a stress classification result of the user, the method further comprises:
[0038] when the stress classification result is empty, recording the features;
[0039] after a preset time, providing an unidentified stress source prompt to the user to enable the user to feed back a stress classification corresponding to the features;
[0040] constructing an association between the stress classification and the corresponding features, and storing the association in the preset stress template.
[0041] Optionally, the preset pressure template includes a pressure type and a response strategy corresponding to the pressure type, and after the pressure classification processing based on all the features and the preset pressure template is performed to obtain the pressure classification result of the user, the method further includes:
[0042] determining the response strategy corresponding to the pressure classification result in the preset pressure template;
[0043] performing pressure management on the user based on the response strategy.
[0044] A pressure classification device, the device comprising:
[0045] a first acquisition module configured to acquire at least one physiological signal of a user during sleep;
[0046] a first extraction module configured to perform feature extraction processing based on the physiological signal to obtain features corresponding to each of the physiological signals;
[0047] a first screening module configured to screen target features from all the features based on the correlation between each of the features and a pressure detection task;
[0048] a first judgment module configured to perform pressure detection processing based on the target features to determine whether the user is in a pressure state;
[0049] a first classification module configured to perform pressure classification processing based on all the features and a preset pressure template to obtain a pressure classification result of the user when the user is in a pressure state.
[0050] A computer device comprising a memory, a processor, and computer readable instructions stored in the memory and executable on the processor, wherein the processor executes the computer readable instructions to implement the pressure classification method.
[0051] A readable storage medium having computer readable instructions stored thereon, wherein the computer readable instructions are executable by a processor to implement the pressure classification method.
[0052] The aforementioned stress classification method, apparatus, computer equipment, and storage medium acquire at least one physiological signal from a user during sleep; perform feature extraction processing based on the physiological signal to obtain features corresponding to each physiological signal; based on the correlation between each feature and the stress detection task, select target features from all the features; perform stress detection processing based on the target features to determine whether the user is in a stress state; when the user is in a stress state, perform stress classification processing based on all the features and a preset stress template to obtain the user's stress classification result. Through extraction and correlation filtering, the accuracy of stress detection can be improved while reducing interference from redundant features; when a user is detected to be in a stress state, stress classification is performed in conjunction with the preset stress template to accurately distinguish stress types, thereby effectively improving the user's sleep quality based on stress classification. Attached Figure Description
[0053] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0054] Figure 1 This is a flowchart illustrating a pressure classification method in one embodiment of the present invention;
[0055] Figure 2 This is a schematic diagram of a pressure classification model in one embodiment of the present invention;
[0056] Figure 3 This is a schematic diagram of a pressure classification system in one embodiment of the present invention;
[0057] Figure 4 This is a schematic diagram of the pressure classification device in one embodiment of the present invention;
[0058] Figure 5 This is a schematic diagram of a computer device according to an embodiment of the present invention. Detailed Implementation
[0059] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0060] In one embodiment, such as Figure 1As shown, a pressure classification method is provided, comprising the following steps:
[0061] 101. Obtain at least one physiological signal of a user during sleep.
[0062] In embodiments of the present application, the above-mentioned pressure classification method can be applied to smart beds, smart mattresses and other health home devices, and can be applied to the processors of the above-mentioned devices. The above-mentioned devices can be built-in with heart impact signal sensors, pressure sensors, microphones or array sensors, etc.
[0063] At least one physiological signal can be collected through the above-mentioned heart impact signal sensor, pressure sensor, microphone or array sensor, etc. The above-mentioned heart impact signal sensor can be a piezoelectric film sensor for collecting corresponding heart impact signals (Ballistocardiogram, BCG), pressure signals, array pressure distribution signals or audio signals, respectively. The above-mentioned physiological signal can be any of the above-mentioned signals or a combination thereof.
[0064] By collecting the above-mentioned physiological signal at the device end, continuous monitoring of the sleep process can be achieved without affecting the normal sleep of the user.
[0065] It should be noted that the above-mentioned sleep process is not limited to daytime or nighttime, nor is it limited to whether the user is in a deep sleep state. When the user uses the above-mentioned smart bed or smart mattress and other home devices, it can be judged as a sleep state.
[0066] 102. Perform feature extraction processing based on the physiological signal to obtain features corresponding to each physiological signal.
[0067] In embodiments of the present application, the above-mentioned physiological signal can include heart impact signals, pressure signals, array pressure distribution signals and audio signals. Different processing methods can be used to extract the features of different types of physiological signals, for example: heart rate, heart rate variability and body movement features are extracted from heart impact signals; respiratory rate, apnea features are extracted from pressure signals; sleep posture changes and body position distribution features are extracted from array pressure distribution signals; snoring intensity and ambient noise level are extracted from audio signals. Through the above processing, each physiological signal can be converted into corresponding features to provide input data for subsequent correlation screening and pressure detection.
[0068] Specifically, different types of physiological signals can be extracted using corresponding signal processing methods, for example:
[0069] For heart impact signals, heart rate, heart rate variability and body movement features can be extracted by filtering and peak detection methods;
[0070] For the pressure signal, the respiration rate, respiration intensity and apnea features can be extracted through time domain analysis and threshold determination method;
[0071] For the array pressure distribution signal, the user's sleep posture and body position change features can be extracted based on matrix distribution calculation and pattern recognition method;
[0072] For the audio signal, the snoring sound features and ambient noise level can be extracted through spectrum analysis or energy detection method.
[0073] Through the above processing, each physiological signal can be converted into corresponding features to provide input data for subsequent correlation screening and stress detection.
[0074] 103、Based on the correlation between each feature and the stress detection task, the target feature is screened out from all features.
[0075] In the embodiments of the present application, the above correlation can be understood as the contribution degree of the feature to the stress detection result, for example, the tightness between a certain feature and the stress state is measured by indicators such as variance contribution, information gain or correlation coefficient. The higher the correlation is, the more effectively the feature can reflect whether the user is in a stress state.
[0076] The above target feature can be understood as a feature subset highly related to the stress detection task selected from all features. This subset can reduce redundant information and computational complexity while retaining the most representative information for stress state determination, thereby improving the accuracy and efficiency of the subsequent stress detection model.
[0077] Specifically, all features can be sorted according to the size of the above correlation, and features meeting the preset conditions are selected from the sorting results as the final target feature set.
[0078] 104、Based on the target feature, the stress detection processing is performed to determine whether the user is in a stress state.
[0079] In the embodiments of the present application, the above stress detection processing can be realized by inputting the target feature into the trained stress detection model. The above stress detection model can be a model constructed based on gradient boosting tree or other supervised learning model. In the training stage, the sample features with stress state labels are used for iterative optimization to minimize the difference between the predicted results and the true labels, and the regularization constraint is combined to avoid overfitting.
[0080] In the actual use stage, the target features of the user are input into the trained stress detection model, and the stress detection result corresponding to the model output is output. When the above detection result meets the preset determination condition, it is determined that the user is in a stress state, otherwise it is determined that the user is in a non-stress state. The above-mentioned preset determination condition can be that the stress probability value output by the detection model is greater than or equal to the threshold value, for example, when the output probability value is greater than 0.5, it is determined to be a stress state; or the score result output by the detection model exceeds the preset score threshold.
[0081] 105、In the user is in a stress state, based on all features and a preset stress template, a stress classification process is performed to obtain a stress classification result of the user.
[0082] In the embodiment of the application, the above-mentioned stress classification process can be realized by comparing all the features of the user with the preset stress template. The stress template stores feature mode information (i.e. template features) corresponding to different stress sources, such as apnea, pain, environmental interference or nightmare, etc. When the similarity between the detected features and a certain stress template meets the preset condition (for example, greater than a preset similarity threshold), the stress source corresponding to the template can be determined as the stress classification result of the user; if no template is matched, an unidentified state can be output, and the user is prompted to supplement a new stress template.
[0083] Specifically, the above-mentioned comparison process can be realized by using a classification model. In an optional embodiment, the classification model is a twin neural network, which is composed of two parameter-shared sub-networks for respectively extracting feature vectors from the features and the template features in the stress template, and classifying based on the similarity between the two. In the model training process, the Euclidean distance can be used as the similarity calculation method, and the model parameters are optimized in combination with the contrast loss function, so as to realize the convergence of the distance between the same stress source samples and the separation of the distance between the different stress source samples. Finally, the model outputs the similarity probability between the sample and each stress category, and the category corresponding to the maximum probability is taken as the stress classification result.
[0084] For example, the structure of a stress classification model can be further illustrated as shown in FIG. 1. Figure 2 The above-mentioned stress classification process can be realized by using a classification model. The classification model can use a twin neural network, which is composed of two identical sub-networks. The main body of the sub-network is composed of three fully connected (FCN) layers and one Flatten layer, and a BatchNorm batch normalization layer is added to accelerate convergence and improve generalization. A LeakyReLU is added to alleviate the gradient disappearance problem in the training process.
[0085] The to-be-classified data (i.e., features) and the stress template data (i.e., template features in the stress template) are output as feature vectors (feature vectors extracted from the above-mentioned feature groups) through a subnetwork, and the model parameters are optimized by calculating the Euclidean distance thereof and combining a contrast loss function until the model converges. The Euclidean distance is defined as:
[0086]
[0087] wherein, and denote the input sample, and denote the feature vectors extracted by the subnetwork (i.e., the vectors of the above-mentioned template features and the vectors of the above-mentioned features, respectively).
[0088] The contrast loss function can be defined as:
[0089]
[0090] wherein y is the sample label, d is the above-mentioned Euclidean distance, and m is a preset boundary value. The training target of the Siamese neural network is to narrow the Euclidean distance of the same stress source and widen the Euclidean distance of different stress sources.
[0091] The neural network model outputs the similarity probability of the sample and the category, and the stress source category is determined by the maximum output probability.
[0092] In the embodiment of the present application, at least one physiological signal of a user during sleep is obtained; feature extraction processing is performed based on the physiological signal to obtain features corresponding to each physiological signal; target features are selected from all the features based on the correlation between each feature and a stress detection task; stress detection processing is performed based on the target features to determine whether the user is in a stress state; when the user is in a stress state, stress classification processing is performed based on all the features and a preset stress template to obtain a stress classification result of the user. By extraction and correlation screening, the accuracy of stress detection can be improved while reducing the interference of redundant features; when the user is detected to be in a stress state, stress classification is performed in combination with the preset stress template to accurately distinguish the stress type, so that the sleep quality of the user can be effectively improved according to the stress classification.
[0093] It can be understood that in the specific embodiments of the present application, data related to physiological signals and the like are involved, and when the embodiments in the present application are applied to specific products or technologies, the user's permission or consent needs to be obtained, and the collection, use and processing of related data and the construction and use of the stress detection model need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0094] Optionally, the physiological signal includes a ballistocardiogram, and in the step of performing feature extraction based on the physiological signal to obtain the features corresponding to each physiological signal, a denoising process can also be performed based on the ballistocardiogram to obtain a denoised ballistocardiogram; the signal peak amplitude, signal variance, mean value of signal energy, and proportion of high-frequency energy in the denoised ballistocardiogram are extracted through a preset sliding window; the body movement features of the user during sleep are determined based on the signal peak amplitude, signal variance, mean value of signal energy, and proportion of high-frequency energy; the heart rate parameter and heart rate variability parameter of the user during sleep are extracted based on the denoised ballistocardiogram; and the features corresponding to the ballistocardiogram are determined based on the body movement features, heart rate parameter, and heart rate variability parameter.
[0095] In the embodiment of the present application, a denoising process is performed based on the ballistocardiogram to obtain a denoised ballistocardiogram (i.e., BCG signal), and the above denoising process can use a band-pass filter of 1-20 Hz and combine a 50 Hz notch filter to remove power frequency interference; in another embodiment, a wavelet denoising method can also be used, for example, a soft threshold denoising using Daubechies wavelet (db4 / db5 / db6, decomposition layer number is 6-9) to further reduce noise interference.
[0096] The above body movement detection can extract the following features through a preset sliding window: (1) signal peak amplitude in the window; (2) signal variance in the window; (3) mean value of signal energy in the window; (4) proportion of high-frequency energy in the window; and the above features are fused and weighted, and when the fusion result is greater than a set threshold, it is determined that the user has body movement in the time period.
[0097] Based on the above denoised ballistocardiogram, the heart rate and heart rate variability (Heart Rate Variability, HRV) are calculated, and the above calculation process includes: performing peak value detection on the ballistocardiogram to identify J-wave peak values; calculating JJ interval based on adjacent J-wave peak values, and further obtaining heart rate and HRV time domain metrics (i.e., heart rate variability parameters), for example:
[0098] The calculation method of heart rate (Heart Rate, HR) is:
[0099]
[0100] wherein HR represents the heart rate, and the unit is beats / minute, represents the average JJ interval, and the unit is seconds.
[0101] wherein JJ interval refers to the time interval between two adjacent J-wave peak values.
[0102] The aforementioned heart rate variability can include time-domain and frequency-domain measures. For the calculation methods of SDNN, RMSSD, and pNN50 in the HRV time-domain measure, please refer to:
[0103]
[0104]
[0105]
[0106] Wherein, SDNN represents the standard deviation of the J-interval. This indicates the total number of JJ intervals; Let represent the i-th JJ interval, and RMSSD represent the root mean square of the difference between adjacent JJ intervals; This represents the difference between the (i+1)th and the ith interval. pNN50 represents the proportion of adjacent intervals with a difference greater than 50ms. This indicates the number of intervals that satisfy the condition.
[0107] The JJ interval sequence is processed to obtain the frequency domain HRV metric. The specific calculation method is as follows:
[0108] The power spectral density (PSD) of the JJ interval sequence was estimated using the autoregressive (AR) method, and the power spectrum was divided into frequency bands, with the ranges of each band as follows:
[0109]
[0110]
[0111]
[0112] in The power spectral density is calculated for the JJ interval sequence, where VLF represents ultra-low frequency, LF represents low frequency, and HF represents high frequency.
[0113] After obtaining the above-mentioned body movement characteristics (i.e. whether there is body movement), heart rate parameters and heart rate variability parameters (i.e. the corresponding frequency domain measurement and time domain measurement), the above-mentioned body movement characteristics, heart rate parameters and heart rate variability parameters are combined to form the characteristics of the above-mentioned cardiac impact signal.
[0114] Optionally, the physiological signal includes a respiration envelope, in the step of performing feature extraction based on the physiological signal to obtain a feature corresponding to each physiological signal, a band-pass filtering process can also be performed on the respiration envelope to obtain a filtered respiration envelope; in the filtered respiration envelope, abnormal peaks are removed to obtain an effective respiration envelope; an average interval between respiration peaks in the effective respiration envelope is extracted, and a respiration rate of the user in the sleep process is calculated based on the average interval; a trough position is determined in the effective respiration envelope, and each respiration wave in the effective respiration envelope is integrated based on the trough position as a demarcation point to obtain a respiration intensity; based on the respiration intensity and a preset intensity threshold, a respiration pause feature of the user in the sleep process is determined; and based on the respiration pause feature and the respiration rate, a feature corresponding to the respiration envelope is determined.
[0115] In the embodiment of the present application, the respiration envelope can be a respiration signal extracted based on a body surface micro-vibration signal collected by a piezoelectric film sensor, can be a signal formed based on a respiration pressure fluctuation collected by a pressure sensor, or can be a respiration energy change curve obtained by filtering and envelope detection based on an audio signal collected by a microphone. The respiration envelope reflects respiration strength and rhythm information of the user in the sleep process changing with time, and can be used as a basic signal for subsequent calculation of a respiration rate, a respiration intensity, and a respiration pause feature.
[0116] Specifically, the frequency band range of the filtering process can be 0.1-10 Hz, which is used to remove burr signals and body motion interference, so as to retain the main respiration component. Peak detection is performed on the filtered respiration envelope, and abnormal peaks are removed to obtain an effective respiration envelope. The abnormal peaks can be abnormal high-amplitude signals caused by noise, body motion, or transient signal interference.
[0117] In the effective respiration envelope, an average interval between respiration peaks is extracted , and a respiration rate is calculated based on the following formula:
[0118]
[0119] wherein, RR represents the respiration rate (times / minute);
[0120] represents an average time interval (second) between adjacent respiration wave peaks.
[0121] In the effective respiration envelope, a trough position is determined by using a minimum value method, and each respiration wave is integrated based on the trough as a demarcation point to obtain an area of a curve surrounded by the baseline, which is the respiration intensity A. The average respiration intensity is obtained by averaging the first ten respiration intensities of the user.
[0122] When the breathing intensity is lower than the threshold value for 10 consecutive seconds , it is determined that the user has sleep apnea (i.e., the apnea feature). The threshold value can be set to 0.3 times the average breathing intensity, i.e.,
[0123]
[0124] After obtaining the apnea feature and the breathing rate, the apnea feature and the breathing rate are combined to obtain the feature corresponding to the breathing envelope.
[0125] Optionally, in the step of screening the target features from all features based on the correlation between each feature and the pressure detection task, a feature matrix can be constructed based on all features, a covariance matrix of the feature matrix is calculated, and eigenvalues of the covariance matrix are obtained by eigenvalue decomposition, the eigenvalues being used to represent the correlation between the corresponding features and the pressure detection task; the features are sorted based on the sizes of the eigenvalues to obtain a feature sorting table; and the features meeting the preset conditions are extracted from the feature sorting table as the target features.
[0126] In the embodiments of the present application, the importance of each feature can be evaluated by a correlation analysis method, and the feature most relevant to the pressure detection task is determined based on the evaluation result. The correlation analysis method can include but is not limited to variance contribution degree analysis, information gain evaluation, correlation coefficient analysis or principal component analysis, etc.
[0127] For example, the principal component analysis (PCA) method can be used to realize feature screening, and the specific steps include:
[0128] A feature matrix X is constructed based on all features;
[0129] A covariance matrix of the feature matrix X is calculated , and eigenvalues of the covariance matrix are obtained by eigenvalue decomposition, the eigenvalues being used to represent the correlation between the corresponding features and the pressure detection task; the larger the eigenvalue, the higher the variance contribution degree of the feature in the overall feature set;
[0130] The features are sorted based on the sizes of the eigenvalues to obtain a feature sorting table;
[0131] The first k features in the feature sorting table or the features meeting the preset correlation threshold are selected as the target feature set, so as to reduce the redundant features while retaining the features most representative of the pressure detection task.
[0132] Optionally, in the step of detecting stress based on the target feature to determine whether the user is in a stress state, the target feature can also be provided to the trained stress detection model to make the trained stress detection model output a stress detection result, and determine whether the user is in a stress state based on the stress detection result. Before the target feature is provided to the trained stress detection model, the method can also obtain a to-be-trained stress detection model and a training set, the training set including sample features and corresponding stress state labels. The sample features are input into the to-be-trained stress detection model to make the to-be-trained stress detection model output a stress detection result corresponding to the sample features. A loss value between the stress detection result and the stress state label is calculated based on a preset loss function. The to-be-trained stress detection model is iterated with a preset regularization function as an optimization objective until the loss value is less than a preset value or the number of iterations exceeds a preset number of times, and the iteration is stopped to obtain the trained stress detection model.
[0133] In the embodiments of the present application, the stress detection model described above can adopt a gradient boosting tree model, such as an XGBoost model. By generating a new decision tree based on residual error and gradient information in each iteration, and using an exact greedy algorithm to traverse all candidate split points, the node with the maximum information gain is selected as the split node, thereby gradually optimizing the prediction ability of the overall model.
[0134] The objective function of the XGBoost model described above can be expressed as:
[0135]
[0136] wherein, represents a loss function, which can measure the distance between the model prediction value and the true value , represents a regularization function, which is used to prevent model overfitting, and its expression can be:
[0137]
[0138] wherein, T is the number of leaf nodes, and is a regularization coefficient, is the weight of the jth leaf node.
[0139] The ensemble model of multiple decision trees is trained by the above-mentioned manner, and finally outputs the stress detection result described above.
[0140] Optionally, after the step of classifying the stress based on all the features and the preset stress template to obtain the stress classification result of the user, when the stress classification result is empty, the features can be recorded; after a preset time, an unidentified stress source prompt is provided to the user to make the user feedback the stress classification corresponding to the features; the stress classification and the corresponding features are associated and stored in the preset stress template.
[0141] In the embodiment of the present application, when the stress classification result is empty, the corresponding features can be recorded; after a preset time (for example, after the user wakes up or the next day), an unidentified stress source prompt is provided to the user to make the user feedback the features and record the stress classification information corresponding to the features; finally, based on the user feedback result, the stress classification and the corresponding features are associated and stored in the preset stress template to form a new stress source template for subsequent stress classification processing.
[0142] The above process can be realized through an application program (APP) of a smart terminal, for example, when it is monitored that the user is affected by stress at night but no existing stress template is matched, the APP prompts the user to record a new stress source type the next day, and automatically saves the physiological features of the user in the stressed state as a new template, while allowing the user to set a feedback operation strategy (or response strategy) corresponding to the template.
[0143] Optionally, the preset stress template includes a stress type and a response strategy corresponding to the stress type, and after the step of classifying the stress based on all the features and the preset stress template to obtain the stress classification result of the user, the method can further determine the response strategy corresponding to the stress classification result in the preset stress template; based on the response strategy, the user is managed.
[0144] In the embodiment of the present application, the above response strategy can be customized by the user in advance, for example, when a stress reaction caused by apnea is detected, the smart bedside is lifted to improve ventilation; when a stress reaction caused by pain is detected, the massage function of the smart bed is turned on to relieve muscle discomfort; when a stress reaction caused by environmental discomfort (such as temperature or noise) is detected, the air conditioner temperature is adjusted or the smart curtain is closed; when a stress reaction caused by nightmare is detected, the smart sound box is turned on to play soothing music or the soft light is switched.
[0145] The above response strategy can not only act on the smart bed body, but also can be linked with other smart home devices through a wireless communication interface, thereby providing personalized stress intervention and management effect for the user.
[0146] It should be understood that the size of the serial number of each step in the above embodiment does not mean the order of execution, and the execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.
[0147] In an embodiment, a stress classification system is provided, as shown in Figure 3 including a feature parameter calculation module, a psychological stress detection model, a psychological stress classification model, and a custom feedback module.
[0148] Specifically, the system can receive physiological or environmental signal inputs from various sensors, such as piezoelectric film (i.e. ballistocardiogram sensor), microphone, pressure sensor, etc. The above signals are processed by the feature parameter calculation module to obtain a set of feature parameters reflecting the user's sleep state. The psychological stress detection model is used to determine whether the user is in a psychological stress state based on the feature parameters; when no psychological stress is detected, the system can maintain a regular monitoring mode, and when psychological stress is detected, the feature parameters are input into the psychological stress classification model. The psychological stress classification model is used to further identify the type of stress source and determine whether there is a stress template matching the current features.
[0149] If there is a matching stress template, the system determines the corresponding response strategy according to the stress template and executes it through the custom feedback module, such as controlling smart beds, air conditioners, smart table lamps, or sound boxes, etc. Intelligent devices to complete automated intervention and stress management; if there is no matching stress template, the system prompts the user to enter a new stress template through the APP end and allows the user to customize the corresponding feedback operation. The newly added template and feedback strategy will be stored for subsequent classification and management.
[0150] In an embodiment, a stress classification device is provided, which corresponds one-to-one to the stress classification method in the above embodiment. As shown in Figure 4 The stress classification device includes a first acquisition module 401, a first extraction module 402, a first screening module 403, a first judgment module 404, and a first classification module 405. The functions of each module are described in detail as follows:
[0151] The first acquisition module 401 is configured to acquire at least one physiological signal of a user during sleep;
[0152] The first extraction module 402 is configured to perform feature extraction processing based on the physiological signal to obtain a feature corresponding to each physiological signal;
[0153] The first screening module 403 is configured to screen a target feature from all the features based on the correlation between each feature and a stress detection task;
[0154] The first determining module 404 is configured to determine whether the user is in a stress state based on the target feature and a stress detection process.
[0155] The first classification module 405 is configured to perform a stress classification process based on all the features and a preset stress template to obtain a stress classification result of the user when the user is in a stress state.
[0156] Optionally, the physiological signal includes ballistocardiogram signals, and the first extraction module 402 is further configured to:
[0157] perform a denoising process based on the ballistocardiogram signals to obtain denoised ballistocardiogram signals;
[0158] extract a signal peak amplitude, a signal variance, a mean value of signal energy, and a proportion of high-frequency energy in the denoised ballistocardiogram signals through a preset sliding window;
[0159] determine body movement features of the user in the sleep process based on the signal peak amplitude, the signal variance, the mean value of signal energy, and the proportion of high-frequency energy;
[0160] extract heart rate parameters and heart rate variability parameters of the user in the sleep process based on the denoised ballistocardiogram signals;
[0161] determine features corresponding to the ballistocardiogram signals based on the body movement features, the heart rate parameters, and the heart rate variability parameters.
[0162] Optionally, the physiological signal includes a breathing envelope, and the first extraction module 402 is further configured to:
[0163] perform a band-pass filtering process based on the breathing envelope to obtain a filtered breathing envelope;
[0164] remove abnormal peaks in the filtered breathing envelope to obtain an effective breathing envelope;
[0165] extract an average interval between breathing peaks in the effective breathing envelope, and calculate a breathing rate of the user in the sleep process based on the average interval;
[0166] determine trough positions in the effective breathing envelope, and perform integral calculation on each breathing wave in the effective breathing envelope with the trough positions as the dividing points to obtain a breathing intensity;
[0167] determine an apnea feature of the user in the sleep process based on the breathing intensity and a preset intensity threshold;
[0168] determine a feature corresponding to the respiration envelope based on the apnea feature and the respiration rate.
[0169] Optionally, the first screening module 403 is further configured to:
[0170] construct a feature matrix based on all the features;
[0171] calculate a covariance matrix of the feature matrix, and perform eigenvalue decomposition on the covariance matrix to obtain eigenvalues of each feature, the eigenvalues being used to represent the correlation between the corresponding feature and the stress detection task;
[0172] sort the features based on the sizes of the eigenvalues to obtain a feature sorting table;
[0173] extract features satisfying a preset condition from the feature sorting table as the target features.
[0174] Optionally, the first judging module 404 is further configured to:
[0175] provide the target features to the trained stress detection model, so that the trained stress detection model outputs a stress detection result, and judge whether the user is in a stress state based on the stress detection result;
[0176] The device further comprises:
[0177] a second obtaining module configured to obtain a stress detection model to be trained and a training set, the training set including sample features and corresponding stress state labels;
[0178] a second input module configured to input the sample features to the stress detection model to be trained, so that the stress detection model to be trained outputs a stress detection result corresponding to the sample features;
[0179] a second calculating module configured to calculate a loss value between the stress detection result and the stress state label based on a preset loss function;
[0180] a second training module configured to combine a preset regularization function to iteratively train the stress detection model to be trained with a minimization of the loss value as an optimization objective, and stop the iteration when the loss value is less than a preset value or the number of iterations exceeds a preset number of times, to obtain the trained stress detection model.
[0181] Optionally, the device further comprises:
[0182] a third recording module configured to record the features when the stress classification result is empty.
[0183] The third providing module is configured to provide an unidentified stress source prompt to the user after a preset time, so as to make the user feed back a stress classification corresponding to the feature;
[0184] The third storage module is configured to construct an association between the stress classification and the corresponding feature, and store the association in the preset stress template.
[0185] Optionally, the preset stress template includes a stress type and a response strategy corresponding to the stress type, and the device further includes:
[0186] The fourth determination module is configured to determine the response strategy corresponding to the stress classification result in the preset stress template.
[0187] The fourth management module is configured to perform stress management on the user based on the response strategy.
[0188] The specific limitations of the stress classification device can be referred to the limitations of the stress classification method described above, and will not be repeated here. Each module in the stress classification device described above can be realized by software, hardware and their combination in whole or in part. Each module described above can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory in the computer device in software form, so as to call and execute the operations corresponding to each module by the processor.
[0189] In one embodiment, a computer device is provided, which can be a terminal device, and its internal structure diagram can be as shown in Figure 5 The computer device includes a processor, a memory and a network interface connected through a system bus. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a readable storage medium. The readable storage medium stores computer readable instructions. The network interface of the computer device is configured to communicate with an external terminal through a network connection. The computer readable instructions are executed by the processor to implement a stress classification method. The readable storage medium provided in the embodiment includes a non-volatile readable storage medium and a volatile readable storage medium.
[0190] In the embodiments of the present application, a computer device is provided, which includes a memory, a processor and computer readable instructions stored in the memory and executable on the processor. When the processor executes the computer readable instructions, the steps of the stress classification method described above are implemented.
[0191] In the embodiments of the present application, a readable storage medium is provided, which stores computer readable instructions. When the computer readable instructions are executed by the processor, the steps of the stress classification method described above are implemented.
[0192] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing relevant hardware through computer readable instructions, and the computer readable instructions can be stored in a non-volatile readable storage medium or a volatile readable storage medium. When the computer readable instructions are executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, storage, database or other medium used in the embodiments provided in the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0193] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above-mentioned division of functional units and modules is exemplified, and in actual application, the above-mentioned functions can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above.
[0194] The above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A pressure classification method, characterized by, The method comprises: acquiring at least one physiological signal of a user during sleep; performing feature extraction processing based on the physiological signal to obtain a feature corresponding to each physiological signal; screening a target feature from all the features based on the correlation between each feature and a stress detection task; performing stress detection processing based on the target feature to determine whether the user is in a stress state; when the user is in a stress state, performing stress classification processing based on all the features and a preset stress template to obtain a stress classification result of the user; after the stress classification processing based on all the features and the preset stress template to obtain the stress classification result of the user, the method further comprises: when the stress classification result is empty, recording the feature; after a preset time, providing an unidentified stress source prompt to the user to make the user feedback the stress classification corresponding to the feature; constructing an association relationship between the stress classification and the corresponding feature, and storing it in the preset stress template; the stress classification processing based on all the features and the preset stress template to obtain the stress classification result of the user is realized by a classification model, the classification model is a twin neural network, the twin neural network is composed of two parameter-shared sub-networks, which are used to extract feature vectors of features and template features in a stress template respectively, and perform classification based on the similarity between them, in the model training process, the Euclidean distance is used as the similarity calculation method, and the contrast loss function is used to optimize the model parameters, to realize the convergence of the distance between samples of the same stress source and the separation of the distance between samples of different stress sources, finally, the model outputs the similarity probability between the sample and each stress category, and the category corresponding to the maximum probability is taken as the stress classification result.
2. The pressure classification method of claim 1, wherein, The physiological signal comprises a ballistocardiogram, and the feature extraction processing based on the physiological signal to obtain a feature corresponding to each physiological signal comprises: performing denoising processing based on the ballistocardiogram to obtain a denoised ballistocardiogram; extracting signal peak amplitude, signal variance, mean value of signal energy, and proportion of high-frequency energy in the denoised ballistocardiogram through a preset sliding window; determining body movement features of the user during the sleep process based on the signal peak amplitude, signal variance, mean value of signal energy, and proportion of high-frequency energy; extracting heart rate parameters and heart rate variability parameters of the user during the sleep process based on the denoised ballistocardiogram; determining the feature corresponding to the ballistocardiogram based on the body movement features, the heart rate parameters, and the heart rate variability parameters.
3. The pressure classification method of claim 1, wherein, The physiological signal comprises a respiratory envelope, and the feature extraction processing based on the physiological signal to obtain a feature corresponding to each physiological signal comprises: performing band-pass filtering processing based on the respiratory envelope to obtain a filtered respiratory envelope; eliminating abnormal peaks in the filtered respiratory envelope to obtain an effective respiratory envelope; extracting an average interval between breath peaks in the effective breath envelope, and calculating a breathing rate of the user during the sleep process based on the average interval; determining a trough position in the effective breath envelope, and integrating each breath wave in the effective breath envelope with the trough position as a demarcation point to obtain a breath intensity; determining a breathing pause feature of the user during the sleep process based on the breath intensity and a preset intensity threshold; determining a feature corresponding to the breath envelope based on the breathing pause feature and the breath rate.
4. The pressure classification method of claim 1, wherein, screening a target feature from all the features based on a correlation between each feature and a stress detection task, including: constructing a feature matrix based on all the features; calculating a covariance matrix of the feature matrix, and performing eigenvalue decomposition on the covariance matrix to obtain eigenvalues of each feature, the eigenvalues being used to represent a correlation between the corresponding feature and the stress detection task; sorting the features based on sizes of the eigenvalues to obtain a feature sorting table; extracting a feature satisfying a preset condition from the feature sorting table as the target feature.
5. The pressure classification method of claim 1, wherein, performing stress detection processing based on the target feature to determine whether the user is in a stress state, including: providing the target feature to a trained stress detection model to enable the trained stress detection model to output a stress detection result, and determining whether the user is in a stress state based on the stress detection result; before the target feature is provided to the trained stress detection model, the method further includes: obtaining a to-be-trained stress detection model and a training set, the training set including sample features and corresponding stress state labels; inputting the sample features into the to-be-trained stress detection model to enable the to-be-trained stress detection model to output a stress detection result corresponding to the sample features; calculating a loss value between the stress detection result and the stress state label based on a preset loss function; iterating the to-be-trained stress detection model in combination with a preset regularization function to minimize the loss value until the loss value is less than a preset value or the number of iterations exceeds a preset number of times, and stopping iteration to obtain the trained stress detection model.
6. The pressure classification method according to any one of claims 1 to 5, characterized in that, the preset stress template includes a stress type and a response strategy corresponding to the stress type, and after the stress classification result is obtained based on all the features and the preset stress template, the method further includes: determining the response strategy corresponding to the stress classification result in the preset stress template; managing stress of the user based on the response strategy.
7. A pressure classification device, characterized by the device includes: a first obtaining module configured to obtain at least one physiological signal of a user during a sleep process; a first extracting module configured to perform feature extraction processing based on the physiological signal to obtain a feature corresponding to each physiological signal; The first screening module is configured to screen target features from all the features based on the correlation between each of the features and the stress detection task. The first determining module is configured to determine whether the user is in a stress state based on the stress detection processing of the target features. The first classification module is configured to perform stress classification processing based on all the features and a preset stress template to obtain a stress classification result of the user when the user is in a stress state. The device further comprises: The third recording module is configured to record the features when the stress classification result is empty. The third providing module is configured to provide an unidentified stress source prompt to the user after a preset time to enable the user to feed back stress classification corresponding to the features. The third storage module is configured to construct an association between the stress classification and the corresponding features and store the association in the preset stress template. The stress classification processing based on all the features and the preset stress template to obtain the stress classification result of the user is implemented by using a classification model. The classification model is a twin neural network composed of two parameter-shared sub-networks for extracting feature vectors of features and template features in a stress template, respectively, and performing classification based on the similarity measurement between them. In the model training process, the Euclidean distance is used as the similarity calculation method, and the model parameters are optimized in combination with the contrast loss function to realize the convergence of distances between samples of the same stress source and the separation of distances between samples of different stress sources. Finally, the model outputs the similarity probability between the sample and each stress category, and the category corresponding to the maximum probability is taken as the stress classification result. 8.A computer device, comprising a memory, a processor, and computer readable instructions stored on the memory and running on the processor, wherein, The processor executes the computer readable instructions to implement the stress classification method of any one of claims 1-6.
9. A readable storage medium, having stored thereon computer readable instructions, characterized in that, The computer readable instructions are executed by the processor to implement the stress classification method of any one of claims 1-6.
Citation Information
Patent Citations
Sleep apnea preliminary screening method and system based on BCG signal
CN114668407A
Sleep monitoring-based pressure analysis relieving method and device and computer equipment
CN117017295A
Sleep breathing monitoring method and non-contact sleep breathing monitoring device
CN119745364A