Sleep stage recognition algorithm based on weighing sensor
The BP neural network model uses the BP neural network model to process the weight sensor data and identify the sleep state, solving the problems of high cost and rough analysis of the existing sleep monitoring technology, and achieving accurate identification and high-quality monitoring of the sleep stage.
Patent Information
- Application Number
- CN202411225637.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2024-12-13
AI Technical Summary
The existing sleep monitoring technology is costly and rough in analysis, so it cannot effectively identify sleep quality, affecting health and efficiency.
The sleep stage recognition algorithm based on the weighing sensor is used to process body movement data and sleep posture change data through the BP neural network model, identify the sleep state, and optimize the recognition effect through filtering and feature extraction.
It realizes accurate identification of each stage of sleep, reduces monitoring costs, and provides high-quality sleep analysis results, which are suitable for individual sleep disorder monitoring.
Smart Images

Figure CN119112103A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of sleep monitoring, and more particularly to a sleep stage recognition algorithm based on a weighing sensor. Background Art
[0002] The patent with application publication number CN111387936A discloses a sleep stage recognition method, device and equipment, which relates to the field of communication technology, including: according to the user attribute information of the target user, the frequency domain spectrum of the feedback signal is input into the target recognition model corresponding to the user attribute information; the output result of the target recognition model is used as the current sleep stage of the target user; wherein the feedback signal is the signal reflected back by the target user by the radio frequency signal, and the target recognition model is a deep neural network model; the application scenarios are expanded and the recognition accuracy is improved.
[0003] In daily life, poor sleep may lead to mood swings, increase the risk of anxiety, depression and emotional instability, and easily affect memory, attention, decision-making and problem-solving abilities, leading to reduced work and study efficiency. In the existing technology, the field of sleep monitoring mostly uses smart wearable devices or non-contact technology, but the analysis of sleep quality is relatively rough, the cost of use is too high and the process is relatively cumbersome.
[0004] In view of this, the present invention proposes a sleep stage recognition algorithm based on a weighing sensor to solve the above problem. Summary of the invention
[0005] In order to overcome the above-mentioned defects of the prior art and to achieve the above-mentioned purpose, the present invention provides the following technical solutions: a sleep stage recognition algorithm based on a weighing sensor, comprising: collecting sleep data;
[0006] The sleep data includes body movement data and sleep posture change data;
[0007] Constructing a BP neural network model, and using the BP neural network model to process body movement data and sleep posture change data, respectively obtaining improved body movement data and improved sleep posture change data;
[0008] The sleeping state is identified based on the improved body movement data and the improved sleeping posture change data.
[0009] Furthermore, the method of obtaining the body movement data and the sleep posture change data includes:
[0010] Weighing sensors are set on the four legs of the bed, and the waveform of the sum of the physical values of the weighing sensors changing with time is recorded as W1, which is the body movement data;
[0011] If the difference between the peak and trough values of waveform W1 within a continuous fixed time is less than or equal to 1, it is determined that the user is in bed, otherwise it is determined that the user is not in bed;
[0012] If it is determined that the user is in bed, the sum of the physical values of the weighing sensor at this time is recorded as y; the waveform W2 of the discrete values of the physical values of the weighing sensor changing with time is simultaneously recorded;
[0013] If there is a peak in the waveform W2 whose value is greater than the preset sleep posture change threshold V0, and the peak is the first peak of the waveform W2, then the start time t0 of the waveform cycle where the peak is located is recorded;
[0014] If it is determined that the user is not in bed, the time tx is recorded;
[0015] A first sleep posture change threshold V0 and a second sleep posture change threshold V1 are preset; if the period of waveform W1 is greater than or equal to V0 and the discrete values of various physical values of the weighing sensor are greater than or equal to V1, the sleep posture change data is defined as waveform W2.
[0016] Furthermore, the methods of constructing the BP neural network model include:
[0017] S1. Collect historical data, process the historical data, obtain training labels and feature vectors, and form a training set;
[0018] S2. Define the neural network structure of the BP neural network model, including input layer, hidden layer and output layer; the number of neurons in the input layer is N input , the number of neurons in the hidden layer is N hidden , the number of neurons in the output layer is N output ;
[0019] S3. Initialize the parameters of the BP neural network model, including the weight matrix W and the bias vector b;
[0020] S4. Calculate the output O of the hidden layer hidden =f(W input-to-hidden X+b hidden ) and the output of the output layer O output =f(W input-to-hidden O hidden +b output ), where f is the activation function, W input-to-hidden refers to the weight matrix from the input layer to the hidden layer, b hidden is the bias vector of the hidden layer, b output is the bias vector of the output layer;
[0021] S5. Use the filtered body motion data and filtered sleep posture change data as training labels and define the loss function
[0022] Among them, Y is the training label; in the formula, Y i Corresponding to O output , Corresponding to Y;
[0023] S6. Encode the parameters of the BP neural network model as chromosome C; and define the fitness function F(C)=-L; perform selection, crossover and mutation operations to generate a new population;
[0024] S7. Repeat steps S4-S6 until the value of the loss function no longer decreases; at this time, the parameters are fixed to obtain a completed BP neural network model;
[0025] Based on the constructed BP neural network model, the filtered data is trained to obtain the waveform of the perfect body movement data as Wa, and the waveform of the perfect sleep state data as Wb.
[0026] Furthermore, the historical data is historical body movement data and historical sleep posture change data; the body movement data S(t) and sleep posture change data P(t) within a fixed historical time are collected and recorded as historical body movement data and historical sleep posture change data; t is a time point index;
[0027] Ways to process historical data include:
[0028] The collected historical body movement data and historical sleep posture change data are filtered, and the filtering formula is:
[0029] S filtered (t) = Filter(S(t));
[0030] P filtered (t) = Filter(S(t));
[0031] Among them, S filtered (t) refers to the historical body motion data after filtering, recorded as filtered body motion data; P filtered (t) refers to the historical sleep posture change data after filtering; recorded as filtered sleep posture change data; Filter refers to filtering processing; filtered body movement data and filtered sleep posture change data are training labels;
[0032] Extracting features from the filtered body motion data and the filtered posture change data, the features including peak frequency, maximum amplitude, rate of change and stability;
[0033] Combine the extracted features into a feature vector X = [Fs, Fp, μs, σs];
[0034] Among them, μs represents the combined vector of the mean of historical body motion data based on all time points and the mean of historical sleep posture change data based on all time points, σs represents the standard deviation; Fs is the combined vector of peak frequency and maximum amplitude; Fp is the combined vector of change rate and stability.
[0035] Furthermore, the sleep state identification method includes:
[0036] From t0 to tx, the waveform value y1 of the waveform Wa and the waveform value y2 of the waveform Wb are gradually extracted based on the order of time points, and the body movement index M=|y1-y|×n1+y2×n2 is calculated, where n1 and n2 are corresponding weights; the value of the body movement index from t0 to tx forms a waveform Wc;
[0037] The sleep state is determined based on the waveform Wc and the waveform Wd is constructed; based on the waveform Wd, the sleep cycle and the sleep stage are determined.
[0038] Furthermore, the method of determining the sleep state based on the waveform Wc and constructing the waveform Wd includes:
[0039] Define sleep states as deep sleep, light sleep, or moderate sleep;
[0040] According to the waveform Wc, the time period from t0 to tx is divided into n small time periods; the length of each small time period is j minutes; if the body movement index M is less than the preset low body movement threshold D in two consecutive small time periods, the sleep state is determined to be deep sleep; if the average value of the body movement index M is greater than the preset light sleep threshold A in two consecutive small time periods, the sleep state is determined to be light sleep; the rest of the time, the sleep state is determined to be moderate sleep;
[0041] The values of t0 and tx are 5, and the values of light sleep, moderate sleep, and deep sleep are defined as 3, 2, and 1, respectively, in the n time periods from the beginning to the end; thus, a waveform Wd is constructed;
[0042] Further, the methods for determining sleep cycles and sleep stages include:
[0043] Defining a decision constraint, wherein the decision constraint includes a first constraint and a second constraint;
[0044] The first constraint is that starting from t0, the interval between two deep sleep stages is less than or equal to 10 hours;
[0045] The second constraint is that there is a light sleep state before the first deep sleep state, and there is a medium sleep state between the light sleep and deep sleep time intervals;
[0046] If the first constraint and the second constraint are satisfied at the same time, and the next sleep state ends in deep sleep, it is determined as a sleep cycle; otherwise, it ends when the first sleep state is deep sleep, or when the tx time is reached, it is determined as a sleep cycle; the next sleep cycle is determined in the same way until tx;
[0047] Sleep stages include NREM3-4 sleep stages, REM sleep stages, NREM1 sleep stages, and NREM2 sleep stages;
[0048] According to waveform Wd, for each sleep cycle, there are at most two deep sleeps, and waveform We is generated; among them, the first deep sleep is determined as the NREM3-4 sleep stage, and the waveform value is 1; the second deep sleep is determined as the REM sleep stage, and the waveform value is 4; the light sleep is the NREM1 sleep stage, and the waveform value is 3; the moderate sleep is the NREM2 sleep stage, and the waveform value is 2;
[0049] Sleep stage recognition system based on weighing sensor, including:
[0050] A data collection module, used for collecting sleep data, wherein the sleep data includes body movement data and sleep posture change data;
[0051] A feature extraction module is used to construct a BP neural network model, and use the BP neural network model to process the body movement data and the sleep posture change data to obtain the improved body movement data and the improved sleep posture change data respectively;
[0052] The algorithm recognition module recognizes the sleep state based on the improved body movement data and the improved sleep posture change data. The various modules are connected by wired and / or wireless means.
[0053] The technical effects and advantages of the sleep stage recognition algorithm based on the weighing sensor of the present invention are as follows:
[0054] By collecting sleep data, a machine learning model was established to process the data, and the image and the obtained data were organically combined to achieve accurate identification of each stage of sleep; compared with existing experience, by establishing an improved BP neural network model, the obtained sleep data was processed to make the data more accurate, effectively preventing the situation of easily falling into the local minimum, and making the algorithm recognition effect more excellent; each cycle in the sleep process and each sleep stage in each cycle can be separated, and the sleep data of each stage can be accumulated to obtain intuitive analysis results of the quantity and quality of sleep; moreover, based on long-term sleep data, the thresholds of each stage of individual sleep can also be optimized to meet the monitoring needs of some individuals with sleep disorders. Compared with existing sleep monitoring equipment, it not only greatly reduces the monitoring cost, but also maintains high-quality monitoring results. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 It is a schematic diagram of a sleep stage recognition algorithm based on a weighing sensor of the present invention;
[0056] Figure 2 Schematic diagram of the sleep stage recognition system based on weighing sensor of the present invention. DETAILED DESCRIPTION
[0057] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0058] Example 1
[0059] See also Figure 1 As shown, the sleep stage recognition algorithm based on the weighing sensor described in this embodiment includes: collecting sleep data; the sleep data includes body movement data and sleep posture change data;
[0060] A BP neural network model is constructed, and the body movement data and the sleep posture change data are processed using the BP neural network model to obtain perfect body movement data and perfect sleep posture change data respectively.
[0061] Identify sleep status based on improved body movement data and improved sleep posture change data;
[0062] The methods for obtaining body movement data and sleep posture change data include:
[0063] Weighing sensors are set on the four legs of the bed, and the waveform of the sum of various physical values of the weighing sensors changing with time is recorded as W1, which is the body movement data.
[0064] If the difference between the peak and trough values of waveform W1 within a continuous fixed time is less than or equal to 1, it is determined that the user is in bed, otherwise it is determined that the user is not in bed;
[0065] If it is determined that the user is in bed, the sum of the physical values of the weighing sensor at this time is recorded as y; the waveform W2 of the discrete values of the physical values of the weighing sensor changing with time is simultaneously recorded;
[0066] If there is a peak in the waveform W2 whose value is greater than the preset sleep posture change threshold V0, and the peak is the first peak of the waveform W2, then the start time t0 of the waveform cycle where the peak is located is recorded;
[0067] If it is determined that the user is not in bed, the time tx is recorded.
[0068] A first sleep posture change threshold V0 and a second sleep posture change threshold V1 are preset; if the period of waveform W1 is greater than or equal to V0 and the discrete values of various physical values of the weighing sensor are greater than or equal to V1, the sleep posture change data is defined as waveform W2.
[0069] It should be noted that the physical values measured by the weighing sensor include weight (the weight borne by each leg of the bed, the sum of these weight data can be used to determine whether the human body is in bed), pressure (the distribution of force exerted by the human body on the bed surface), displacement (small displacement changes of the bed caused by the weight of the human body), and vibration frequency (the frequency of the human body turning over or leaving the bed); the discrete value is calculated using the mean square error method, that is, the arithmetic square root of the mean of the sum of the squares of the differences between each physical value and its mean; the setting of the sleep posture change thresholds V0 and V1 is related to different stages of sleep. In different sleep stages, the characteristics of body movement are significantly different; when the human body is in a deep sleep state, body movement decreases and the frequency of sleep posture changes decreases.
[0070] Ways to construct a BP neural network model include:
[0071] S1. Collect historical data, process the historical data, obtain training labels and feature vectors, and form a training set;
[0072] S2. Define the neural network structure of the BP neural network model, including input layer, hidden layer and output layer; the number of neurons in the input layer is N input , the number of neurons in the hidden layer is N hidden , the number of neurons in the output layer is N output .
[0073] S3. Initialize the parameters of the BP neural network model, including the weight matrix W and the bias vector b;
[0074] S4. Calculate the output O of the hidden layer hidden =f(W input-to-hidden X+b hidden ) and the output of the output layer O output =f(W input-to-hidden O hidden +b output ), where f is the activation function, W input-to-hidden refers to the weight matrix from the input layer to the hidden layer, b hidden is the bias vector of the hidden layer, b output is the bias vector of the output layer.
[0075] S5. Use the filtered body motion data and filtered sleep posture change data as training labels and define the loss function
[0076] Among them, Y is the training label; in the formula, Y i Corresponding to O output , Corresponding to Y;
[0077] It should be noted that MSE stands for mean square error, which is used to evaluate the prediction accuracy of the model. It is a common indicator to measure the difference between the model prediction value and the actual observation value. In order to make the model performance better, MSE is weighted and the calculation formula is:
[0078] Where n is the number of samples, Y i is the ith observation, is the i-th predicted value, k i is the weight corresponding to the i-th observation value; the smaller the KMSE value, the smaller the difference between the model's predicted value and the actual observed value, and the better the model performance.
[0079] S6. Encode the parameters of the BP neural network model into chromosome C; define the fitness function F(C)=-L; perform selection, crossover and mutation operations to generate a new population.
[0080] S7. Repeat steps S4-S6 until the value of the loss function no longer decreases; at this time, the parameters are fixed to obtain the constructed BP neural network model.
[0081] Based on the constructed BP neural network model, the filtered data is trained to obtain the waveform of the perfect body movement data as Wa and the waveform of the perfect sleep state data as Wb;
[0082] The historical data includes historical body movement data and historical sleep posture change data; the body movement data S(t) and sleep posture change data P(t) within a fixed historical time are collected and recorded as historical body movement data and historical sleep posture change data; t is a time point index.
[0083] Ways to process historical data include:
[0084] The collected historical body movement data and historical sleep posture change data are filtered, and the filtering formula is:
[0085] S filtered (t) = Filter(S(t));
[0086] P filtered (t) = Filter(P(t));
[0087] Among them, S filtered (t) refers to the historical body motion data after filtering, recorded as filtered body motion data; P filtered(t) refers to the historical sleep posture change data after filtering; recorded as the sleep posture change data after filtering; Filter refers to filtering processing;
[0088] It should be noted that the filtering calculation formula is
[0089] Wherein, x is the value of body movement data S(t) or sleep posture change data P(t), and σ is the preset standard deviation;
[0090] Features are extracted from the filtered body motion data and the filtered posture change data, including peak frequency, maximum amplitude, rate of change, and stability.
[0091] Combine the extracted features into a feature vector X = [Fs, Fp, μs, σs];
[0092] Among them, μs represents the combined vector of the mean of historical body motion data based on all time points and the mean of historical sleep posture change data based on all time points, σs represents the standard deviation; Fs is the combined vector of peak frequency and maximum amplitude; Fp is the combined vector of change rate and stability.
[0093] Sleep status can be identified by:
[0094] From t0 to tx, the waveform value y1 of the waveform Wa and the waveform value y2 of the waveform Wb are gradually extracted based on the order of time points, and the body movement index M=|y1-y|×n1+y2×n2 is calculated, where n1 and n2 are corresponding weights; the value of the body movement index from t0 to tx forms a waveform Wc;
[0095] The sleep state is determined based on the waveform Wc and the waveform Wd is constructed; based on the waveform Wd, the sleep cycle and the sleep stage are determined.
[0096] The method of determining the sleep state based on the waveform Wc and constructing the waveform Wd includes:
[0097] Define sleep states as deep sleep, light sleep, or moderate sleep;
[0098] According to the waveform Wc, the time period formed by t0 to tx is divided into n small time periods; the length of the small time period is j minutes; if the body movement index M is less than the preset low body movement threshold D in two consecutive small time periods, the sleep state is judged to be deep sleep; if the average value of the body movement index M is greater than the preset light sleep threshold A in two consecutive small time periods, the sleep state is judged to be light sleep; the rest of the time, the sleep state is judged to be moderate sleep.
[0099] The values of t0 and tx are 5, and the values of light sleep, moderate sleep, and deep sleep are defined as 3, 2, and 1, respectively, in the n time periods from the beginning to the end; thus, a waveform Wd is constructed;
[0100] Ways to determine sleep cycles and sleep stages include:
[0101] Defining a decision constraint, wherein the decision constraint includes a first constraint and a second constraint;
[0102] The first constraint is that starting from t0, the interval between two sleeps in the deep sleep stage is less than or equal to 10 hours.
[0103] The second constraint is that there is a light sleep state before the first deep sleep state, and there is a medium sleep state between the light sleep and deep sleep time intervals;
[0104] If the first constraint and the second constraint are satisfied at the same time, and the next sleep state ends in deep sleep, it is determined as a sleep cycle; otherwise, it ends when the first sleep state is deep sleep, or when the tx time is reached, it is determined as a sleep cycle; the next sleep cycle is determined in the same way until tx;
[0105] Sleep stages include NREM3-4 sleep stages, REM sleep stages, NREM1 sleep stages, and NREM2 sleep stages;
[0106] According to waveform Wd, for each sleep cycle, there are at most two deep sleeps, and waveform We is generated; among them, the first deep sleep is determined as the NREM3-4 sleep stage, and the waveform value is 1; the second deep sleep is determined as the REM sleep stage, and the waveform value is 4; the light sleep is the NREM1 sleep stage, and the waveform value is 3; the moderate sleep is the NREM2 sleep stage, and the waveform value is 2;
[0107] It should be noted that the human body's sleep follows the structure of alternating non-rapid eye movement (NREM) sleep and rapid eye movement (REM) sleep. NREM sleep can be divided into four stages, NREM stage 1, NREM stage 2, NREM stage 3, and NREM stage 4, from shallow to deep. During REM sleep, rapid eye movements, dreams, and muscle activity inhibition occur. It is generally believed that NREM stage 3 and NREM stage 4 belong to deep sleep.
[0108] This embodiment collects sleep data, establishes a machine learning model to process the data, organically combines images with the obtained data, and realizes accurate identification of each stage of sleep; compared with existing experience, by establishing an improved BP neural network model, the obtained sleep data is processed to make the data more accurate, effectively prevent the situation of easily falling into the local minimum, and make the algorithm recognition effect more excellent; each cycle in the sleep process and each sleep stage in each cycle can be separated, and the sleep data of each stage can be accumulated to obtain intuitive analysis results of sleep quantity and quality; moreover, based on long-term sleep data, the thresholds of each stage of individual sleep can also be optimized to meet the monitoring needs of individuals with some sleep disorders; compared with existing sleep monitoring equipment, not only the monitoring cost is greatly reduced, but also high-quality monitoring results are maintained.
[0109] Example 2
[0110] See also Figure 2 As shown, the part not described in detail in this embodiment is described in Example 1, and a sleep stage recognition algorithm system based on a weighing sensor is provided, including:
[0111] A data collection module, used for collecting sleep data during sleep, wherein the sleep data includes body movement data and sleep posture change data;
[0112] A feature extraction module is used to construct a BP neural network model, and use the BP neural network model to process the body movement data and the sleep posture change data to obtain the improved body movement data and the improved sleep posture change data respectively;
[0113] The algorithm recognition module identifies different stages of sleep through the recognition algorithm based on the improved body movement data and the improved sleep posture change data; it accumulates the sleep data of each stage, so as to better analyze the sleep status and sleep quality;
[0114] The modules are connected to each other via wired and / or wireless means to achieve data transmission between the modules.
[0115] Example 3
[0116] This embodiment discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the operation mode of the sleep stage recognition algorithm based on the weighing sensor provided above is implemented.
[0117] Since the electronic device introduced in this embodiment is an electronic device used to implement the sleep stage recognition algorithm based on the weighing sensor in the embodiment of the present application, based on the sleep stage recognition algorithm based on the weighing sensor introduced in the embodiment of the present application, the technical personnel of the field can understand the specific implementation of the electronic device of the present embodiment and its various variations, so how the electronic device implements the method in the embodiment of the present application is not introduced in detail here. As long as the technical personnel of the field implement the electronic device used in the sleep stage recognition algorithm based on the weighing sensor in the embodiment of the present application, it belongs to the scope of protection of the present application.
[0118] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters and thresholds in the formula are set by technicians in this field according to actual conditions.
[0119] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technical users in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. The sleep stage recognition algorithm based on weighing sensor is characterized by: include: Collecting sleep data; the sleep data includes body movement data and sleep posture change data; Constructing a BP neural network model, and using the BP neural network model to process body movement data and sleep posture change data, respectively obtaining improved body movement data and improved sleep posture change data; The sleeping state is identified based on the improved body movement data and the improved sleeping posture change data.
2. The sleep stage recognition algorithm based on weighing sensor according to claim 1 is characterized in that: The method for acquiring the body movement data and the sleep posture change data includes: Weighing sensors are set on the four legs of the bed, and the waveform of the sum of the physical values of the weighing sensors changing with time is recorded as W1, which is the body movement data; If the difference between the peak and trough values of waveform W1 within a continuous fixed time is less than or equal to 1, it is determined that the user is in bed, otherwise it is determined that the user is not in bed; If it is determined that the user is in bed, the sum of the physical values of the weighing sensor at this time is recorded as y; the waveform W2 of the discrete values of the physical values of the weighing sensor changing with time is simultaneously recorded; If there is a peak in the waveform W2 whose value is greater than the preset sleep posture change threshold V0, and the peak is the first peak of the waveform W2, then the start time t0 of the waveform cycle where the peak is located is recorded; If it is determined that the user is not in bed, the time tx is recorded; A first sleep posture change threshold V0 and a second sleep posture change threshold V1 are preset; if the period of waveform W1 is greater than or equal to V0 and the discrete values of various physical values of the weighing sensor are greater than or equal to V1, the sleep posture change data is defined as waveform W2.
3. The sleep stage recognition algorithm based on weighing sensor according to claim 2 is characterized in that: The method of constructing the BP neural network model includes: S1. Collect historical data, process the historical data, obtain training labels and feature vectors, and form a training set; S2. Define the neural network structure of the BP neural network model, including input layer, hidden layer and output layer; the number of neurons in the input layer is N input , the number of neurons in the hidden layer is N hidden , the number of neurons in the output layer is N output ; S3. Initialize the parameters of the BP neural network model, including the weight matrix W and the bias vector b; S4. Calculate the output O of the hidden layer hidden =f(W input-to-hidden X+b hidden ) and the output of the output layer O output =f(W input-to-hidden O hidden +b output ), where f is the activation function, W input-to-hidden refers to the weight matrix from the input layer to the hidden layer, b hidden is the bias vector of the hidden layer, b output is the bias vector of the output layer; S5. Use the filtered body motion data and filtered sleep posture change data as training labels and define the loss function Among them, Y is the training label; in the formula, Y i Corresponding to O output , Corresponding to Y; S6. Encode the parameters of the BP neural network model as chromosome C; and define the fitness function F(C)=-L; perform selection, crossover and mutation operations to generate a new population; S7. Repeat steps S4-S6 until the value of the loss function no longer decreases; at this time, the parameters are fixed to obtain a completed BP neural network model; Based on the constructed BP neural network model, the filtered data is trained to obtain the waveform of the perfect body movement data as Wa, and the waveform of the perfect sleep state data as Wb.
4. The sleep stage recognition algorithm based on weighing sensor according to claim 3 is characterized in that: The historical data is historical body movement data and historical sleep posture change data; the body movement data S(t) and sleep posture change data P(t) within a fixed historical time are collected and recorded as historical body movement data and historical sleep posture change data; t is the time point index; The method of processing the historical data includes: The collected historical body movement data and historical sleep posture change data are filtered, and the filtering formula is: S filtered (t)=Filter(S(t)); P filtered (t)=Filter(P(t)); Among them, S filtered (t) refers to the historical body motion data after filtering, recorded as filtered body motion data; P filtered (t) refers to the historical sleep posture change data after filtering; recorded as filtered sleep posture change data; Filter refers to filtering processing; filtered body movement data and filtered sleep posture change data are training labels; Extracting features from the filtered body motion data and the filtered posture change data, the features including peak frequency, maximum amplitude, rate of change and stability; Combine the extracted features into a feature vector X = [Fs, Fp, μs, σs]; Among them, μs represents the combined vector of the mean of historical body motion data based on all time points and the mean of historical sleep posture change data based on all time points, σs represents the standard deviation; Fs is the combined vector of peak frequency and maximum amplitude; Fp is the combined vector of change rate and stability.
5. The sleep stage recognition algorithm based on weighing sensor according to claim 4 is characterized in that: The sleep state recognition method includes: From t0 to tx, the waveform value y1 of the waveform Wa and the waveform value y2 of the waveform Wb are gradually extracted based on the order of time points, and the body movement index M=|y1-y|×n1+y2×n2 is calculated, where n1 and n2 are corresponding weights; the value of the body movement index from t0 to tx forms a waveform Wc; The sleep state is determined based on the waveform Wc and the waveform Wd is constructed; based on the waveform Wd, the sleep cycle and the sleep stage are determined.
6. The sleep stage recognition algorithm based on weighing sensor according to claim 5 is characterized in that: The method of determining the sleep state based on the waveform Wc and constructing the waveform Wd includes: Define sleep states as deep sleep, light sleep, or moderate sleep; According to the waveform Wc, the time period from t0 to tx is divided into n small time periods; the length of each small time period is j minutes; if the body movement index M is less than the preset low body movement threshold D in two consecutive small time periods, the sleep state is determined to be deep sleep; if the average value of the body movement index M is greater than the preset light sleep threshold A in two consecutive small time periods, the sleep state is determined to be light sleep; the rest of the time, the sleep state is determined to be moderate sleep; The values at t0 and tx are set to 5, and the values of light sleep, moderate sleep, and deep sleep are defined as 3, 2, and 1, respectively, in n small time periods from the earliest to the latest; thus, a waveform Wd is constructed.
7. The sleep stage recognition algorithm based on weighing sensor according to claim 6 is characterized in that: The method of determining the sleep cycle and the sleep stage includes: Defining a decision constraint, wherein the decision constraint includes a first constraint and a second constraint; The first constraint is that starting from t0, the interval between two deep sleep stages is less than or equal to 10 hours; The second constraint is that there is a light sleep state before the first deep sleep state, and there is a medium sleep state between the light sleep and deep sleep time intervals; If the first constraint and the second constraint are satisfied at the same time, and the next sleep state ends in deep sleep, it is determined as a sleep cycle; otherwise, it ends when the first sleep state is deep sleep, or when the tx time is reached, it is determined as a sleep cycle; the next sleep cycle is determined in the same way until tx; Sleep stages include NREM3-4 sleep stages, REM sleep stages, NREM1 sleep stages, and NREM2 sleep stages; According to waveform Wd, for each sleep cycle, there are at most two deep sleeps, and waveform We is generated; among them, the first deep sleep is determined as the NREM3-4 sleep stage, and the waveform value is 1; the second deep sleep is determined as the REM sleep stage, and the waveform value is 4; light sleep is the NREM1 sleep stage, and the waveform value is 3; moderate sleep is the NREM2 sleep stage, and the waveform value is 2.
8. A sleep stage recognition system based on a weighing sensor, which is used to implement the sleep stage recognition algorithm based on a weighing sensor as described in any one of claims 1 to 7, characterized in that: include: A data collection module, used for collecting sleep data, wherein the sleep data includes body movement data and sleep posture change data; A feature extraction module is used to construct a BP neural network model, and use the BP neural network model to process the body movement data and the sleep posture change data to obtain the improved body movement data and the improved sleep posture change data respectively; The algorithm recognition module recognizes the sleep state based on the improved body movement data and the improved sleep posture change data. The various modules are connected by wired and / or wireless means.
Citation Information
Patent Citations
Sleep stage identification method, device and equipment
CN111387936A
