Intelligent room system for optimizing sleep and working method thereof
Through the deep neural network technology of the intelligent room system, the physiological and environmental data of middle-aged and elderly people are analyzed and adjusted, which solves the problem of lack of comprehensive analysis of physiological data in the existing system, realizes personalized sleep monitoring and environmental regulation, and improves middle-aged and elderly people. The quality of sleep and life of a person.
Patent Information
- Application Number
- CN202411330575.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2025-01-10
AI Technical Summary
Most of the existing intelligent sleep systems only focus on the regulation of environmental factors, and lack comprehensive analysis and application of individual physiological data, making it difficult to improve the sleep quality and life quality of middle-aged and elderly people.
An intelligent room system was designed, including data acquisition and monitoring module, machine learning prediction and evaluation module, environment control module, sleep feedback and adjustment module and central control and suggestions module, to use deep neural network technology to provide users' physiological data and environment Parameters are analyzed and adjusted, providing personalized sleep optimization solutions and environmental configuration.
It has achieved comprehensive monitoring and personalized adjustment of sleep, helping middle-aged and elderly people improve sleep quality and life quality, and providing an ideal sleep experience.
Smart Images

Figure CN119296776A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of intelligent control equipment, and in particular relates to an intelligent room system for optimizing sleep and a working method thereof. Background Art
[0002] Sleep is an important part of human health and quality of life, and the sleep quality and sleep problems of middle-aged and elderly people are becoming increasingly prominent. Traditional sleep monitoring and regulation methods usually rely on manual observation or monitoring of a single parameter, which cannot comprehensively evaluate an individual's sleep status and its influencing factors. In addition, most existing intelligent sleep systems only focus on the regulation of environmental factors, and the comprehensive analysis and application of individual physiological data have not yet been fully developed.
[0003] Due to physiological and psychological changes, middle-aged and elderly people have more prominent sleep problems, including difficulty falling asleep, decreased sleep quality, easy awakening, etc. Their needs for sleeping environment are also more personalized, and they need a more intelligent sleep system to help improve their sleep quality.
[0004] Therefore, it is necessary to design a smart room system that can comprehensively monitor and analyze the user's sleep conditions to provide a personalized sleeping environment and related suggestions, thereby improving the sleep quality and quality of life of middle-aged and elderly people. Summary of the invention
[0005] The present invention aims to overcome the problem in the prior art that most of the existing intelligent sleep systems only focus on the regulation of environmental factors, lack comprehensive analysis and application of individual physiological data, resulting in difficulty in improving the sleep quality and quality of life of middle-aged and elderly people. The present invention provides an intelligent room system for optimizing sleep and its working method, which can comprehensively monitor and analyze the user's sleep condition, and provide a personalized sleeping environment and related suggestions, thereby improving the sleep quality and quality of life of middle-aged and elderly people.
[0006] In order to achieve the above-mentioned object of the invention, the present invention adopts the following technical solutions:
[0007] Smart room system for optimized sleep, including:
[0008] The data collection and monitoring module is used to obtain various physiological data of users during activities through wearable smart devices, and to obtain environmental parameters through monitoring equipment in the room;
[0009] The machine learning prediction and evaluation module is used to analyze, predict and evaluate the collected data through deep neural network (DNN) technology to provide users with personalized sleep optimization solutions;
[0010] The environment control module is used to automatically adjust environmental parameters according to the user's current needs and sleep stage through deep neural network (DNN) technology to provide users with a personalized and comfortable sleeping environment;
[0011] The sleep feedback and adjustment module is used to match environmental information with user perception through environmental monitoring technology, further control the output of each terminal device, and provide users with an environment for falling asleep, sleeping, and waking up that meets their personalized needs;
[0012] The central control and suggestion module is used to provide users with sleep environment configuration suggestions by monitoring the user's physical condition, room environment and sleep quality, and supports users to customize sleep environment configuration to create an ideal sleep experience for users;
[0013] The data transmission module is used to transmit and communicate data with the data acquisition and monitoring module, the machine learning prediction and evaluation module, the environmental control module, the sleep feedback and adjustment module, and the central control and suggestion module using wireless communication technology.
[0014] Preferably, in the data acquisition and monitoring module, the physiological data include blood pressure, blood oxygen, pressure, heart rate, caffeine intake and alcohol intake; the environmental parameters include light, temperature, humidity and sound decibels.
[0015] Preferably, the machine learning prediction and evaluation module is as follows:
[0016] Analyze the user's physiological data and environmental parameters, complete the data set construction, and use the data set to build and train the DNN model;
[0017] The trained DNN model is used to classify, judge and predict the user's sleep status, and then the sleep quality is evaluated and improvement suggestions are provided; the sleep status includes 6 stages: daily activities, about to fall asleep, deep sleep, light sleep, rapid eye movement and just waking up.
[0018] Preferably, the environment control module includes several terminal devices, including smart aromatherapy machine, smart air conditioner, projection lamp, electric curtain, smart mattress and smart sound system:
[0019] The smart aromatherapy machine has several different types of perfumes built in, which are used to determine the user's current sleep stage through the DNN model, and then control the degree of mixing and diffusion of different types of perfumes to configure a fragrance that suits the current user's sleep stage.
[0020] The smart air conditioner is used to adjust the room temperature and purify the air according to the user's needs;
[0021] The projection lamp is used to adjust the color temperature and color spectrum of different lights according to user needs;
[0022] The electric curtain is used to adjust the closing of the curtain according to the needs of the user to control the entry of daylight;
[0023] The smart mattress is used to adjust the softness, hardness and temperature of the mattress according to user needs;.
[0024] The intelligent sound system is used to play soothing music or natural sounds according to user needs to offset environmental noise.
[0025] Preferably, the central control and suggestion module monitors the user's physical condition through sensors, including heart rate, breathing rate and body temperature; in the central control and suggestion module, the sleeping environment configuration includes adjusting music selection, light color and curtain opening and closing.
[0026] Preferably, in the data transmission module, the wireless communication technology includes Wi-Fi, Bluetooth and Zigbee.
[0027] The present invention also provides a working method of a smart room system for optimizing sleep, comprising the following steps:
[0028] S1, Data collection
[0029] Collect user's body motion signals, physiological data and environmental parameters;
[0030] S2, Data transmission and communication
[0031] By means of wireless communication technology, the data collected in step S1 is transmitted to the machine learning prediction and evaluation module;
[0032] S3, signal preprocessing and data cleaning
[0033] Preprocessing the original signal and original data collected in step S2, wherein the preprocessing includes denoising, filtering and normalization; for the preprocessed physiological data, further removing outliers and smoothing data processing;
[0034] S4, data partitioning
[0035] The data processed in step S3 is divided, and the division process is as follows:
[0036] Assume that the data set has a total of N samples, divide the first 0.7N samples into the training set, the middle 0.15N samples into the validation set, and the last 0.15N samples into the test set;
[0037] S5, Data labeling
[0038] The data obtained in step S3 is subjected to feature extraction, and a machine learning algorithm or a rule-based system is used to determine the activity type and sleep stage of the human body, as follows:
[0039] Daily activities: high-frequency exercise, frequent changes in body position, increased heart rate and blood pressure;
[0040] About to fall asleep: Movement gradually decreases, changes in body position decrease, and heart rate begins to drop;
[0041] Deep sleep: breathing and heartbeat signals are regular, body position is stable, and blood oxygen saturation remains at normal levels;
[0042] Light sleep: occasional movement, slight adjustments in body position, fluctuations in heart rate and blood pressure;
[0043] Rapid eye movement: limited body movement, rapid eye movement detected, heart rate and blood pressure fluctuations, and decreased blood oxygen saturation;
[0044] Just woke up: Movement gradually increases, body position changes significantly, heart rate and blood pressure rise;
[0045] S6, build DNN model
[0046] Use the training set divided in step S4 to build a DNN model in the machine learning prediction and evaluation module;
[0047] S7, Environmental Control
[0048] The environment control module automatically adjusts the smart air conditioner, projection lamp, electric curtain, smart mattress, smart aromatherapy machine and smart sound system according to the personalized adjustment suggestions for the user by the DNN model constructed in step S6 to optimize the user's sleeping environment;
[0049] S8, central control and suggestions
[0050] Users can customize their sleep environment through the central control and suggestion module, including adjusting music selection, light color and curtain opening and closing, to personalize their sleep environment. The central control and suggestion module is a mobile phone or tablet that monitors the user's physical condition, room environment and sleep quality data, and provides corresponding suggestions.
[0051] S9, Feedback and Regulation
[0052] The sleep feedback and adjustment module uses DNN technology to analyze the user's sleep data and environmental monitoring data, and exchanges and adjusts data with terminal devices; based on the sleep data feedback from the user and the environmental monitoring data feedback from the system, the sleep feedback and adjustment module automatically adjusts the output of each terminal device to ensure that the user has a comfortable sleeping environment.
[0053] Preferably, in step S1, the body motion signal includes the acceleration and angular velocity S of the user in three-dimensional space. i (t); the acceleration in three-dimensional space includes front and back A1(t), left and right A2(t) and up and down A3(t);
[0054] The physiological data includes the user's heart rate h(t), exercise duration e(t), number of steps w(t), calorie consumption h(t), activity hours t, as well as blood pressure b(t), blood oxygen saturation o(t), stress level p(t), caffeine intake c and alcohol intake a during activity.
[0055] The environmental parameters include light l(t), temperature t(t), humidity w(t) and sound decibel d(t).
[0056] Preferably, in step S6, the process of constructing the DNN model is as follows:
[0057] S61, set and select a 4-layer network, and the number of neurons in each layer is l4, l3, l2, and 6 respectively; 6 corresponds to 6 sleep stages;
[0058] S62, select activation function
[0059] Set the hidden layer to use the ReLU function g(z): g(z) = max(0,z), where z represents the value input to the activation function;
[0060] When z>0, the output of the ReLU function is z itself, indicating that the corresponding neuron is activated and transmits a positive signal; when z<0, the output of the ReLU function is 0, indicating that the corresponding neuron is inhibited and does not transmit a signal;
[0061] Set the output layer to use the Softmax function Softmax(z i ): Where k = 6 represents the number of categories, corresponding to the six stages of daily activities, about to fall asleep, deep sleep, light sleep, rapid eye movement and just waking up; z i is the unprocessed output value of the DNN model at the output layer for the i-th category;
[0062] S63, Initialize weights and biases
[0063] Use a random initialization method, including normal distribution or uniform distribution to initialize weights, weight w is initialized to normal distribution N(0,0.01), and bias b is initialized to 0;
[0064] S64, select optimization algorithm
[0065] Using the Adam optimizer, the corresponding update rules are as follows:
[0066] m t =β1m t-1 +(1-β1)g t ;
[0067] Among them, m t is the first momentum estimate at the current moment, which is calculated from the first momentum m at the previous moment. t-1 The calculated value is the first-order moment estimate of the gradient, which is equivalent to the momentum term in the momentum method. As time goes by, m t The exponentially weighted average of the accumulated gradients; β1 represents m t-1 The decay rate, g t is the gradient at the current moment;
[0068]
[0069] Among them, v t represents the second momentum estimate at the current moment, which is calculated from the second momentum v at the previous moment t-1 The calculated value is the second-order moment estimate of the gradient, which is equivalent to the second-order moment term in the RMSProp method; v t It accumulates the exponentially weighted average of the squared gradient; β2 represents v t-1 The decay rate of
[0070]
[0071] in, represents the corrected first momentum estimate, used to correct m t Deviations in the initial stages; is the decay rate of the first momentum at training step t;
[0072]
[0073] in, represents the corrected first momentum estimate, used to correct v t Deviations in the initial stages; is the decay rate of the second momentum at training step t;
[0074]
[0075] Among them, W t is the weight of the optimizer at time t, W t+1 is the updated weight, α is the learning rate, ∈ is a constant used to prevent the denominator from being zero;
[0076] S65, define the forward propagation rules as follows:
[0077] z [1] =W[1] x+b [1] ;
[0078] a [1] =g [1] (z [1] );
[0079] z [2] =W [2] a [1] +b [2] ;
[0080] a [2] =g [2] (z [2] );
[0081] z [l] =W [l] a [l-1] +b [l] ;
[0082] a [l] =g [l] (z [l] );
[0083] Among them, x is the input data or the output of the previous layer (for the first layer, x is usually the original input data), and the linear combination result z of the lth layer is [l] , is to convert the output a of the previous layer [l-1] and the weight matrix W of the current layer [l] Multiply and add the deviation b [l] ; a [l] Represents the activation value, which is z [l] Input to the activation function g [l] (z [l] ) obtained in;
[0084] S66, define the loss function and calculate the loss
[0085] The loss function is set as follows:
[0086]
[0087] A [l] Compare with the true label j to calculate the loss L; L is the value of the loss function, which is used to measure the difference between the prediction result of the DNN model and the true label; N is the number of samples, K is the number of categories, and y ik is the true probability that the i-th sample belongs to the k-th class, is the probability that the DNN model predicts that the i-th sample belongs to the k-th class;
[0088] S67, define the back propagation rules as follows:
[0089] Used to represent the gradient of the loss function with respect to the weight matrix of the lth layer;
[0090] Used to represent the gradient of the loss function with respect to the bias term of the lth layer;
[0091] in, is the gradient of the loss function to the linear combination result of the lth layer, It is the partial derivative of the linear combination result of the lth layer with respect to the weight matrix; It is the partial derivative of the linear combination result of the lth layer with respect to the bias term;
[0092] S68, update weights and biases:
[0093] Adopt the optimization algorithm selected in steps S64 to S67, and update the weights and biases according to the gradient to reduce the loss;
[0094] S69, Model Evaluation
[0095] Set the evaluation indicators of the constructed DNN model as follows:
[0096] Accuracy: Indicates the proportion of true positive samples among the samples predicted to be positive;
[0097] Recall: For category ki, Represents the proportion of samples that are correctly predicted to be positive among all samples that are actually positive;
[0098] F1 value: Metrics for measuring DNN model performance;
[0099] Among them, Precision k Represents precision, Recall k represents the recall rate;
[0100] Confusion Matrix: C ij Indicates the number of samples that are actually class i but predicted to be class j;
[0101] S610, model adjustments and improvements
[0102] Adjust and improve the evaluated DNN model. The specific process is as follows:
[0103] Hyperparameter Tuning:
[0104] Use the SFFS method to automatically try different learning rates, number of layers, number of neurons, and regularization parameters; if the DNN model evaluation indicators cannot be effectively improved after updating the hyperparameters, the hyperparameter update will be automatically stopped;
[0105] Model improvement:
[0106] Try to build several DNN models and evaluate whether the evaluation indicators of the DNN models are improved.
[0107] Compared with the prior art, the present invention has the following beneficial effects: (1) The present invention combines individual physiological data and environmental factors to achieve comprehensive monitoring and personalized adjustment during sleep, thereby creating an ideal sleep experience for users; (2) The present invention uses machine learning technology (DNN) to predict and evaluate the user's falling asleep, sleep quality and waking up conditions, and adjusts factors such as room temperature and humidity, light, sound, mattress hardness and fragrance to optimize the sleeping environment; it is particularly suitable for middle-aged and elderly people to help improve their sleep quality and quality of life. BRIEF DESCRIPTION OF THE DRAWINGS
[0108] Figure 1 A principle block diagram of the smart room system for optimizing sleep in the present invention;
[0109] Figure 2 A flow chart of the working method of the smart room system for optimizing sleep in the present invention. DETAILED DESCRIPTION
[0110] In order to more clearly illustrate the embodiments of the present invention, the specific implementation methods of the present invention will be described below with reference to the accompanying drawings. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those of ordinary skill in the art, other accompanying drawings and other implementation methods can be obtained based on these accompanying drawings without creative work.
[0111] like Figure 1 As shown, the present invention provides a smart room system for optimizing sleep, comprising:
[0112] The data collection and monitoring module is used to obtain various physiological data of users during activities through wearable smart devices, and to obtain environmental parameters through monitoring equipment in the room;
[0113] The machine learning prediction and evaluation module is used to analyze, predict and evaluate the collected data through deep neural network (DNN) technology to provide users with personalized sleep optimization solutions;
[0114] The environment control module is used to automatically adjust environmental parameters according to the user's current needs and sleep stage through deep neural network (DNN) technology to provide users with a personalized and comfortable sleeping environment;
[0115] The sleep feedback and adjustment module is used to match environmental information with user perception through environmental monitoring technology, further control the output of each terminal device, and provide users with an environment for falling asleep, sleeping, and waking up that meets their personalized needs;
[0116] The central control and suggestion module is used to provide users with sleep environment configuration suggestions by monitoring the user's physical condition, room environment and sleep quality, and supports users to customize sleep environment configuration to create an ideal sleep experience for users;
[0117] The data transmission module is used to transmit and communicate data with the data acquisition and monitoring module, the machine learning prediction and evaluation module, the environmental control module, the sleep feedback and adjustment module, and the central control and suggestion module using wireless communication technology.
[0118] The data collection and monitoring module uses wearable devices to obtain the user's physiological data and environmental parameters during activities, including blood pressure, blood oxygen, stress, heart rate, caffeine intake, and alcohol intake. It uses smart bracelets, watches and other devices to monitor the user's physiological state in real time, while using environmental sensors to monitor the room's ambient light, temperature, humidity, and sound decibel parameters.
[0119] The machine learning prediction and evaluation module combines deep neural network technology (DNN) to obtain real-time information on the user's physiological data (such as heart rate, respiratory rate, exercise status, etc.) and environmental parameters (such as temperature, humidity, light, etc.) through the data acquisition and monitoring module. Subsequently, the data analysis module uses deep learning and pattern recognition technology to analyze this data, extract key features and build a data model to gain a deeper understanding of the user's sleep patterns and personal preferences.
[0120] The machine learning prediction and evaluation module uses the DNN algorithm to classify the user's sleep into six stages: daily activities, falling asleep, deep sleep, light sleep, rapid eye movement (dreaming), and just waking up for analysis, prediction and judgment. It evaluates sleep quality through deep sleep, light sleep and rapid eye movement and provides improvement suggestions, adjusts the environmental parameters of the smart room or provides personalized sleep optimization solutions. The DNN algorithm will generate personalized settings based on the user's personal preferences and physiological data, and automatically adjust the environment of the smart room, including temperature, humidity, lighting, etc., to provide the best experience of falling asleep and waking up.
[0121] The environmental control module includes the following terminal devices:
[0122] Smart aromatherapy machine: It can be equipped with multiple different perfumes, and by judging the current stage of the user, it can control the diffusion degree of different perfume liquids through machine learning to comprehensively configure a fragrance that can optimize the current stage of the user. It can be actively controlled and intelligently adjusted by home smart monitoring.
[0123] Smart air conditioner: It can not only adjust the room temperature according to the needs of users and create a comfortable sleeping environment, but also has multiple functions such as air purification, energy saving and environmental protection, and intelligent linkage. Through intelligent temperature control and intelligent linkage, it can automatically adjust the temperature and humidity of the environment through machine learning, and filter the air in the room to provide different air quality to optimize the sleep stage. It can be actively controlled and intelligently adjusted by home intelligent monitoring.
[0124] Projection lamp: The different effects and different lighting of smart projection can be adjusted according to the needs of users, and the color temperature and color spectrum of different lights can be adjusted. Through intelligent lighting control and intelligent linkage, machine learning can automatically adjust the lighting of the environment to give the room a different lighting environment to optimize the current user's sleep stage, which can be actively controlled and intelligently adjusted by home smart monitoring.
[0125] Electric curtains: The curtains can be closed to control the entry of daylight according to user needs. They can be intelligently linked with projection lamps to control the lighting conditions in the room. Through machine learning, the ambient lighting can be automatically adjusted to provide different lighting environments for the room to optimize the lighting during the user's current sleep stage. They can be actively controlled and intelligently adjusted by home smart monitoring.
[0126] Smart mattress: The softness, hardness and temperature of the mattress can be adjusted according to the user's needs. The softness, hardness and temperature of the mattress can be automatically adjusted through machine learning to optimize the current user's sleep stage. It can be actively controlled and intelligently adjusted by home smart monitoring.
[0127] Smart sound system: The smart sound system plays an important role in the smart room system, and its role is multifaceted. First of all, by playing soothing music and natural sounds, you can also play specific audio to reduce environmental noise. The smart sound system can help users relax, relieve stress, and promote sleep. Users can choose different types of music according to their preferences to create a sleeping atmosphere that suits them. The smart sound system also has a voice control function. Users can control music playback, volume adjustment, etc. through voice commands for convenient operation. The smart sound system can also be linked with other smart devices, such as smart lights, smart curtains, etc., to achieve intelligent room environment control and provide users with a more personalized and comfortable sleep experience. It can also be judged through machine learning that different music or playing relative audio automatically reduces environmental noise to optimize the current user's sleep stage, which can be actively controlled and intelligently adjusted by home smart monitoring.
[0128] The central control and suggestion module plays a key role in the smart sleep system. Users can install it with a smart device, such as a tablet or a smart phone, and use its main functions through a smart phone or tablet. Its main functions include monitoring the user's physical condition, room environment and sleep quality, and providing relevant suggestions. It also supports users to customize the sleep environment configuration to create an ideal sleep experience for users.
[0129] The central control and suggestion module can monitor the user's physical condition through sensors, including heart rate, respiratory rate, body temperature and other indicators, so as to understand the user's sleep quality and health status. Based on this data, the system can analyze the user's sleeping habits and sleep quality, and provide users with personalized sleep suggestions, such as adjusting sleep time, improving sleeping posture, etc., to help users improve their sleep quality.
[0130] The central control and suggestion module can also monitor the room environment, including parameters such as temperature, humidity, light, and air quality. The system can provide users with corresponding environmental suggestions based on these data, such as adjusting the temperature and light brightness, to create a comfortable environment suitable for sleep.
[0131] The central control and suggestion module supports users to customize the sleeping environment configuration. Users can set the sleeping environment parameters according to their preferences and needs, such as music selection, light color, curtain opening and closing, etc., to personalize the sleeping environment and create an ideal sleeping experience for users.
[0132] The sleep feedback and adjustment module can also use deep neural network (DNN) technology to improve the intelligence level of the smart sleep system. Through DNN technology, the system can more accurately analyze the user's sleep data and environmental monitoring data, and exchange data with terminal devices for adjustment, so as to more accurately predict the user's sleep needs and feedback adjustment.
[0133] The data transmission module transmits data and communicates with other key modules in the smart room system by using wireless communication technologies such as Wi-Fi, Bluetooth or Zigbee. Figure 1 As shown, the data transmission module cooperates with the data collection and monitoring module to receive and transmit the data collected from the human body and the environment to ensure the accuracy and real-time nature of the data. Subsequently, the data transmission module transmits the data to the machine learning prediction and evaluation module, which realizes the prediction of sleep patterns and the evaluation of personalized optimization solutions by establishing data models and algorithms.
[0134] When receiving instructions from the environment control module, the data transmission module establishes a connection with the smart device through wireless communication technology to monitor and control the room environment and automatically adjust the device output according to user needs and environmental parameters. At the same time, the data transmission module establishes communication with the sleep feedback and adjustment module to transmit environmental monitoring data and user feedback information, realize intelligent feedback control, adjust the terminal device output, and ensure that the user has a comfortable sleeping environment.
[0135] The data transmission module transmits data with the central control and suggestion module, monitors the user's physical condition and room environment, provides relevant suggestions and supports users to customize the sleep environment configuration to help users create an ideal sleep experience. Through these detailed data transmission and inter-module communication processes, the smart room system can provide users with personalized sleep optimization solutions and achieve an intelligent and convenient sleep experience.
[0136] The smart room system for optimizing sleep provided by the present invention comprehensively utilizes smart devices and environmental monitoring technologies to provide users with personalized sleep monitoring and adjustment. The data acquisition and monitoring module obtains the user's physiological data and environmental parameters, such as heart rate, exercise duration, light intensity and temperature, etc. Figure 2 Monitor the user's physiological data. The data transmission module uses wireless communication technology to ensure data accuracy and real-time transmission to the machine learning prediction and evaluation module to achieve sleep pattern prediction and personalized optimization plan evaluation. Figure 2 The wireless communication technology data transmission, wireless communication transmission analysis results and sleep suggestions, and wireless communication terminal device demand transmission parts shown in the figure. The environment control module includes a variety of intelligent devices, which automatically adjust the fragrance, temperature, lighting, curtain opening and closing, mattress softness and hardness, music and other factors to provide users with a comfortable sleeping environment. Figure 2 The sleep feedback and adjustment module accurately controls the output of each device and provides a personalized environment for falling asleep, sleeping, and waking up. Figure 2 The central control and suggestion module monitors the user's physical condition, environmental information and sleep quality to achieve Figure 2 The environment information in the system is intelligently matched with the user's perception, and relevant suggestions are provided to the user, and the user's customized sleep environment configuration is supported to achieve an ideal sleep experience that meets the user's needs. Personalized sleep suggestion feedback, such as Figure 2 The environmental parameter adjustment part is shown according to user needs.
[0137] Using DNN (Deep Neural Network) technology, it is an artificial neural network with multiple hidden layers that can automatically learn complex patterns and features from large amounts of data, and has achieved remarkable results in image recognition, speech processing, natural language processing and other fields. In sleep activity staging, deep neural networks can be used to analyze the user's body motion signals and other physiological and environmental data, and accurately divide the user's activity period into six stages: daily activities, about to fall asleep, deep sleep, light sleep, rapid eye movement (dreaming) and just waking up, providing strong support for personalized sleep monitoring and regulation.
[0138] Specifically, the present invention also provides a working method of a smart room system for optimizing sleep, comprising the following steps:
[0139] S1, Data collection
[0140] Collect user's body motion signals, physiological data and environmental parameters;
[0141] The body motion signal includes the acceleration and angular velocity S of the user in three-dimensional space. i (t) (rotation around three axes); the acceleration in three-dimensional space includes front-back A1(t), left-right A2(t) and up-down A3(t);
[0142] The physiological data includes the user's heart rate h(t), exercise duration e(t), number of steps w(t), calorie consumption h(t), activity hours t, as well as blood pressure b(t), blood oxygen saturation o(t), stress level p(t), caffeine intake c and alcohol intake a during activity.
[0143] The environmental parameters include light l(t), temperature t(t), humidity w(t) and sound decibel d(t).
[0144] S2, Data transmission and communication
[0145] With the help of wireless communication technology, the data collected in step S1 is transmitted to the machine learning prediction and evaluation module; ensuring the accuracy and real-time nature of the data and providing a reliable information source for the smart room system.
[0146] S3, signal preprocessing and data cleaning
[0147] The raw signal and raw data collected in step S2 are preprocessed, and the preprocessing includes denoising, filtering and normalization; the preprocessed physiological data is further processed to remove outliers and smooth the data; this process can improve the signal quality and eliminate the interference caused by environmental noise or sensor errors. The specific processing process of the data is as follows:
[0148] Handling missing values: For a continuous signal such as body motion signal, if at a certain time t i If the value of is missing, linear interpolation can be performed using the values at adjacent moments, namely: If there are missing variables such as activity hours, the daily average value of the user is used for interpolation.
[0149] Outlier processing: By calculating the mean μ and standard deviation σ, values outside the range [μ-3σ,μ+3σ] are considered outliers and corrected, such as replacing them with the mean.
[0150] Noise data processing: Median filtering can be used:
[0151] s′(t i )=median{s(t i-k ),…,s(t i ),…,s(t i+k )}.
[0152] Through Fourier transform, the signal s(t) is converted to the frequency domain S(f):
[0153] Using wavelet transform, the coefficients are
[0154] Physiological feature extraction: heart rate variability indicators, such as the root mean square of the difference between adjacent heartbeat intervals: where RR i is the ith heartbeat interval.
[0155] Exercise duration stability indicators, such as the coefficient of variation of exercise duration over multiple consecutive days: where σ e is the standard deviation of exercise duration, μ e is the mean exercise duration.
[0156] Step count rate of change indicators, such as the percentage of increase or decrease in steps in adjacent time periods:
[0157] Calorie consumption balance indicators, such as the skewness of daily calorie consumption over a period of time: Where n is the number of days, Calorie is the average calorie consumption, and s is the standard deviation.
[0158] Activity hours distribution indicators, such as the kurtosis of activity hours:
[0159]
[0160] Blood pressure fluctuation range indicators, such as the range of systolic and diastolic blood pressure: R = Max (BP) - Min (BP), where BP is the blood pressure value.
[0161] Blood oxygen saturation change indicators, such as the average change rate of blood oxygen saturation:
[0162]
[0163] Indicators of stress level fluctuations, such as the variance of stress values:
[0164] Caffeine intake frequency indicators, such as the percentage of days per week that caffeine is consumed:
[0165] Indicators of alcohol intake concentration, such as the median number of consecutive drinking days: Median (a) = Middle value of consecutive drinking days.
[0166] Environmental feature extraction: including the mean and rate of change of light level l(t), temperature range and fluctuation t(t), humidity change w(t), and decibel change of ambient noise d(t).
[0167] S4, data partitioning
[0168] The data processed in step S3 is divided, and the division process is as follows:
[0169] Assume that the data set has a total of N samples, divide the first 0.7N samples into the training set, the middle 0.15N samples into the validation set, and the last 0.15N samples into the test set;
[0170] S5, Data labeling
[0171] The data obtained in step S3 is subjected to feature extraction, and a machine learning algorithm or a rule-based system is used to determine the activity type and sleep stage of the human body, as follows:
[0172] Daily activities: high-frequency exercise, frequent changes in body position, increased heart rate and blood pressure;
[0173] About to fall asleep: Movement gradually decreases, changes in body position decrease, and heart rate begins to drop;
[0174] Deep sleep: breathing and heartbeat signals are regular, body position is stable, and blood oxygen saturation remains at normal levels;
[0175] Light sleep: occasional movement, slight adjustments in body position, fluctuations in heart rate and blood pressure;
[0176] Rapid eye movement: limited body movement, rapid eye movement detected, heart rate and blood pressure fluctuations, and decreased blood oxygen saturation;
[0177] Just woke up: Movement gradually increases, body position changes significantly, heart rate and blood pressure rise;
[0178] S6, build DNN model
[0179] Using the training set divided in step S4, a DNN model is constructed in the machine learning prediction and evaluation module. The specific process of constructing the DNN model is as follows:
[0180] Choose the right number of layers and neurons per layer; generally, try a simpler structure at first, such as 3-4 layers;
[0181] S61, set and select a 4-layer network, and the number of neurons in each layer is l4, l3, l2, and 6 respectively; 6 corresponds to 6 sleep stages;
[0182] S62, select activation function
[0183] Set the hidden layer to use the ReLU function g(z): g(z) = max(0,z), where z represents the value input to the activation function; in a neural network, it is usually the result of multiplying the output of the previous layer by the weight matrix of the current layer plus the bias term; it can be regarded as the net input value of a neuron;
[0184] When z>0, the output of the ReLU function is z itself, indicating that the corresponding neuron is activated and transmits a positive signal; when z<0, the output of the ReLU function is 0, indicating that the corresponding neuron is inhibited and does not transmit a signal; this feature enables the ReLU function to introduce nonlinearity in the neural network and alleviate the gradient vanishing problem to a certain extent. At the same time, the calculation is simple, which helps to improve the training efficiency;
[0185] Set the output layer to use the Softmax function Softmax(z i ): Where k = 6 represents the number of categories, corresponding to the six stages of daily activities, about to fall asleep, deep sleep, light sleep, rapid eye movement and just waking up; z i is the unprocessed output value of the DNN model for the i-th category at the output layer; the Softmax function converts these values into a probability distribution so that the sum of all output values is 1 and each value is between 0 and 1;
[0186] S63, Initialize weights and biases
[0187] Use a random initialization method, including normal distribution or uniform distribution to initialize weights, weight w is initialized to normal distribution N(0,0.01), and bias b is initialized to 0;
[0188] S64, select optimization algorithm
[0189] The Adam optimizer is used because it usually performs better in most cases. The corresponding update rule is as follows:
[0190] m t =β1m t-1 +(1-β1)g t ;
[0191] Among them, m0 is the momentum estimate at the initial moment, m t is the first momentum estimate at the current moment, which is calculated from the first momentum m at the previous moment. t-1 The calculated value is the first-order moment estimate of the gradient, which is equivalent to the momentum term in the momentum method. As time goes by, m t The exponentially weighted average of the accumulated gradients; β1 represents m t-1 The decay rate, g t is the gradient at the current moment;
[0192]
[0193] Among them, v0 is the second momentum estimate at the initial moment, v t represents the second momentum estimate at the current moment, which is calculated from the second momentum v at the previous moment t-1 The calculated value is the second-order moment estimate of the gradient, which is equivalent to the second-order moment term in the RMSProp method; v t It accumulates the exponentially weighted average of the squared gradient; β2 represents v t-1 The decay rate of
[0194]
[0195] in, represents the corrected first momentum estimate, used to correct m t Deviations in the initial stages; is the decay rate of the first momentum at training step t;
[0196]
[0197] in, represents the corrected first momentum estimate, used to correct v t Deviations in the initial stages; is the decay rate of the second momentum at training step t;
[0198]
[0199] Among them, W t is the weight of the optimizer at time t, W t+1 is the updated weight, α is the learning rate, ∈ is a constant used to prevent the denominator from being zero;
[0200] S65, define the forward propagation rules as follows:
[0201] z [1] =W [1] x+b [1] ;
[0202] a [1] =g [1] (z [1] );
[0203] z [2] =W [2] a [1] +b [2] ;
[0204] a [2] =g [2] (z [2] );
[0205] z [l] =W [l] a [l-1] +b [l] ;
[0206] a [l] =g [l] (z [l] );
[0207] Among them, x is the input data or the output of the previous layer (for the first layer, x is usually the original input data), and the linear combination result z of the lth layer is [l] , is to convert the output a of the previous layer [l-1] and the weight matrix W of the current layer [l] Multiply and add the deviation b [l] ; a [l] Represents the activation value, which is z [l] Input to the activation function g [l] (z [l] ) obtained in;
[0208] S66, define the loss function and calculate the loss
[0209] The loss function is set as follows:
[0210]
[0211] A [l] Compare with the true label j to calculate the loss L; L is the value of the loss function, which is used to measure the difference between the prediction result of the DNN model and the true label; N is the number of samples, K is the number of categories, and y ik is the true probability that the i-th sample belongs to the k-th class, is the probability that the DNN model predicts that the i-th sample belongs to the k-th class;
[0212] S67, define the back propagation rules as follows:
[0213] Used to represent the gradient of the loss function with respect to the weight matrix of the lth layer;
[0214] Used to represent the gradient of the loss function with respect to the bias term of the lth layer;
[0215] in, is the gradient of the loss function to the linear combination result of the lth layer, It is the partial derivative of the linear combination result of the lth layer with respect to the weight matrix; It is the partial derivative of the linear combination result of the lth layer with respect to the bias term;
[0216] S68, update weights and biases:
[0217] Adopt the optimization algorithm selected in steps S64 to S67, and update the weights and biases according to the gradient to reduce the loss;
[0218] S69, Model Evaluation
[0219] Set the evaluation indicators of the constructed DNN model as follows:
[0220] Accuracy: Indicates the proportion of true positive samples among the samples predicted to be positive;
[0221] Recall: For category ki, Represents the proportion of samples that are correctly predicted to be positive among all samples that are actually positive;
[0222] F1 value: Metrics for measuring DNN model performance;
[0223] Among them, Precision k Represents precision, Recall k represents the recall rate;
[0224] Confusion Matrix: C ij Indicates the number of samples that are actually class i but predicted to be class j;
[0225] S610, model adjustments and improvements
[0226] Adjust and improve the evaluated DNN model. The specific process is as follows:
[0227] Hyperparameter Tuning:
[0228] Use the SFFS method to automatically try different learning rates, number of layers, number of neurons, and regularization parameters; if the DNN model evaluation indicators cannot be effectively improved after updating the hyperparameters, the hyperparameter update will be automatically stopped;
[0229] Model improvement:
[0230] Try to build several DNN models and evaluate whether the evaluation indicators of the DNN models are improved
[0231] S7, Environmental Control
[0232] The environment control module automatically adjusts the smart air conditioner, projection lamp, electric curtain, smart mattress, smart aromatherapy machine and smart sound system according to the personalized adjustment suggestions for the user by the DNN model constructed in step S6 to optimize the user's sleeping environment; for example, the smart aromatherapy machine adjusts the fragrance, the smart air conditioner adjusts the temperature and humidity and purifies the air, the projection lamp and electric curtain control the lighting conditions, the smart mattress adjusts the softness and temperature, and the smart sound system plays soothing music or natural sounds and offsets the ambient noise;
[0233] S8, central control and suggestions
[0234] Users can customize their sleep environment through the central control and suggestion module, including adjusting music selection, light color and curtain opening and closing, to personalize their sleep environment. The central control and suggestion module is a mobile phone or tablet that monitors the user's physical condition, room environment and sleep quality data, and provides corresponding suggestions.
[0235] S9, Feedback and Regulation
[0236] The sleep feedback and adjustment module uses DNN technology to analyze the user's sleep data and environmental monitoring data, and exchanges and adjusts data with terminal devices to more accurately predict the user's sleep needs; based on the sleep data feedback from the user and the environmental monitoring data feedback from the system, the sleep feedback and adjustment module automatically adjusts the output of each terminal device to ensure that the user has a comfortable sleeping environment.
[0237] Based on the technical solution of the present invention, the following case scenario is used to illustrate the implementation process of the present invention in practical application. The specific application implementation plan is as follows:
[0238] Data collection and monitoring: Preliminary recording: Use a period of time to record the user's physiological data. The data is collected by wearing smart bracelets, watches and other devices to monitor the user's body movement data in real time during different activities. i (t) and S i(t) and collect physiological data, including heart rate h(t), exercise time e(t), number of steps W(t), calorie consumption c(t), activity hours t, as well as heart and blood pressure b(t), blood oxygen o(t), pressure p(t), caffeine intake c and alcohol intake a, etc. At the same time, if the user is in the room, the sensors in the room monitor environmental parameters such as light l(t), temperature t(t), humidity w(t) and sound d(t) decibels. These data reflect the user's physiological state and environmental conditions, providing a basis for subsequent data analysis.
[0239] Data transmission and communication: Through wireless communication technology (such as Wi-Fi, Bluetooth or Zigbee), the data acquisition and monitoring module transmits the collected data to the machine learning prediction and evaluation module. The data transmission module ensures the accuracy and real-time nature of the data and provides a reliable information source for the smart room system.
[0240] Data analysis and prediction: Using deep learning neural network (DNN) technology, the machine learning prediction and evaluation module analyzes the user's physiological data and environmental parameters, extracts key features, builds data, and trains a personalized model for the user. The prediction module trained with the DNN algorithm classifies and predicts the user's sleep status, including six stages: daily activities, about to fall asleep, deep sleep, light sleep, rapid eye movement, and just waking up, so as to evaluate the sleep quality and provide improvement suggestions.
[0241] Environmental control: The environmental control module automatically adjusts terminal devices such as smart air conditioners, projection lamps, electric curtains, smart mattresses, smart aromatherapy machines, and smart sound systems based on the personalized adjustment suggestions for users by the machine learning prediction and evaluation module to optimize the user's sleeping environment. For example, the smart aromatherapy machine adjusts the mixture of different aromatherapy to release the appropriate fragrance according to the user's current sleep stage; the smart air conditioner adjusts the room temperature and humidity and purifies the air; the projection lamp and electric curtains control the lighting conditions; the smart mattress adjusts the softness and temperature; the smart sound system plays soothing music or natural sounds, and at the same time, it offsets the background noise in the environment and reduces the environmental noise by emitting sound waves that are opposite to the external noise.
[0242] Central control and suggestions: The central control platform can obtain data on the user's physical condition, room environment and sleep quality for mobile phones or tablets, and provide relevant suggestions. Users can customize the sleep environment configuration through the central control platform, such as adjusting music selection, light color and curtain opening and closing, to personalize the sleep environment.
[0243] Feedback and Adjustment: The sleep feedback and adjustment module uses DNN technology to analyze the user's sleep data and environmental monitoring data, and exchanges and adjusts data with the terminal device to more accurately predict the user's sleep needs. Based on user feedback and system monitoring data, the module automatically adjusts to ensure that the user has a comfortable sleeping environment.
[0244] The smart room system designed by the present invention for optimizing sleep obtains the user's heart rate, exercise duration, number of steps, calories, number of activity hours, and physiological data such as heart pressure, blood oxygen, pressure, heart rate, caffeine intake and alcohol intake during activities through wearable devices on the human body, and realizes comprehensive monitoring during sleep by combining the mutual influence of environmental light, temperature, humidity and sound decibel size. Machine learning technology is used to predict and evaluate the user's falling asleep, sleep quality and waking up, and transmit the human body's comfortable environment data to the room central control system. The smart air conditioner adjusts the room temperature and humidity, the projection lamp and electric curtains control the light, the smart sound system adjusts the sound, the smart mattress adjusts the softness and temperature, the smart aromatherapy machine produces different fragrances, and the environmental monitoring module optimizes the matching of the environment and human perception, realizes accurate feedback control of the terminal device output, and finally provides a personalized environment for falling asleep, sleeping and waking up. The central control system monitors the user's physical condition, room environment and sleep quality, provides relevant suggestions and supports customized sleep environment configuration to create an ideal sleep experience for users.
[0245] The above description is only a detailed description of the preferred embodiments and principles of the present invention. For ordinary technicians in this field, according to the ideas provided by the present invention, there will be changes in the specific implementation methods, and these changes should also be regarded as the protection scope of the present invention.
Claims
1. Smart room system for optimizing sleep, characterized by: include: The data collection and monitoring module is used to obtain various physiological data of users during activities through wearable smart devices, and to obtain environmental parameters through monitoring equipment in the room; The machine learning prediction and evaluation module is used to analyze, predict and evaluate the collected data through deep neural network (DNN) technology to provide users with personalized sleep optimization solutions; The environment control module is used to automatically adjust environmental parameters according to the user's current needs and sleep stage through deep neural network (DNN) technology to provide users with a personalized and comfortable sleeping environment; The sleep feedback and adjustment module is used to match environmental information with user perception through environmental monitoring technology, further control the output of each terminal device, and provide users with an environment for falling asleep, sleeping, and waking up that meets their personalized needs; The central control and suggestion module is used to provide users with sleep environment configuration suggestions by monitoring the user's physical condition, room environment and sleep quality, and supports users to customize sleep environment configuration to create an ideal sleep experience for users; The data transmission module is used to transmit and communicate data with the data acquisition and monitoring module, the machine learning prediction and evaluation module, the environmental control module, the sleep feedback and adjustment module, and the central control and suggestion module using wireless communication technology.
2. The smart room system for optimizing sleep according to claim 1, characterized in that: In the data acquisition and monitoring module, the physiological data include blood pressure, blood oxygen, pressure, heart rate, caffeine intake and alcohol intake; the environmental parameters include light, temperature, humidity and sound decibels.
3. The smart room system for optimizing sleep according to claim 1, characterized in that: The machine learning prediction and evaluation module is as follows: Analyze the user's physiological data and environmental parameters, complete the data set construction, and use the data set to build and train the DNN model; The trained DNN model is used to classify, judge and predict the user's sleep status, and then the sleep quality is evaluated and improvement suggestions are provided; the sleep status includes 6 stages: daily activities, about to fall asleep, deep sleep, light sleep, rapid eye movement and just waking up.
4. The smart room system for optimizing sleep according to claim 3, characterized in that: The environment control module includes several terminal devices, including smart aromatherapy machine, smart air conditioner, projection lamp, electric curtain, smart mattress and smart sound system: The smart aromatherapy machine has several different types of perfumes built in, which are used to determine the user's current sleep stage through the DNN model, and then control the degree of mixing and diffusion of different types of perfumes to configure a fragrance that suits the current user's sleep stage. The smart air conditioner is used to adjust the room temperature and purify the air according to the user's needs; The projection lamp is used to adjust the color temperature and color spectrum of different lights according to user needs; The electric curtain is used to adjust the closing of the curtain according to the needs of the user to control the entry of daylight; The smart mattress is used to adjust the softness, hardness and temperature of the mattress according to user needs;. The intelligent sound system is used to play soothing music or natural sounds according to user needs to offset environmental noise.
5. The smart room system for optimizing sleep according to claim 4, characterized in that: The central control and suggestion module monitors the user's physical condition through sensors, including heart rate, breathing rate and body temperature; in the central control and suggestion module, the sleeping environment configuration includes adjusting music selection, light color and curtain opening and closing.
6. The smart room system for optimizing sleep according to claim 4, characterized in that: In the data transmission module, the wireless communication technologies include Wi-Fi, Bluetooth and Zigbee.
7. A working method of a smart room system for optimizing sleep, applied to the smart room system for optimizing sleep according to any one of claims 1 to 6, characterized in that: The working method of the smart room system for optimizing sleep comprises the following steps: S1, Data collection Collect user's body motion signals, physiological data and environmental parameters; S2, Data transmission and communication By means of wireless communication technology, the data collected in step S1 is transmitted to the machine learning prediction and evaluation module; S3, signal preprocessing and data cleaning Preprocessing the original signal and original data collected in step S2, wherein the preprocessing includes denoising, filtering and normalization; For the preprocessed physiological data, further outlier removal and data smoothing processing are performed; S4, data partitioning The data processed in step S3 is divided, and the division process is as follows: Assume that the data set has a total of N samples, divide the first 0.7N samples into the training set, the middle 0.15N samples into the validation set, and the last 0.15N samples into the test set; S5, Data labeling The data obtained in step S3 is subjected to feature extraction, and a machine learning algorithm or a rule-based system is used to determine the activity type and sleep stage of the human body, as follows: Daily activities: high-frequency exercise, frequent changes in body position, increased heart rate and blood pressure; About to fall asleep: Movement gradually decreases, changes in body position decrease, and heart rate begins to drop; Deep sleep: breathing and heartbeat signals are regular, body position is stable, and blood oxygen saturation remains at normal levels; Light sleep: occasional movement, slight adjustments in body position, fluctuations in heart rate and blood pressure; Rapid eye movement: limited body movement, rapid eye movement detected, heart rate and blood pressure fluctuations, and decreased blood oxygen saturation; Just woke up: Movement gradually increases, body position changes significantly, heart rate and blood pressure rise; S6, build DNN model Use the training set divided in step S4 to build a DNN model in the machine learning prediction and evaluation module; S7, Environmental Control The environment control module automatically adjusts the smart air conditioner, projection lamp, electric curtain, smart mattress, smart aromatherapy machine and smart sound system according to the personalized adjustment suggestions for the user by the DNN model constructed in step S6 to optimize the user's sleeping environment; S8, central control and suggestions Users can customize their sleep environment through the central control and suggestion module, including adjusting music selection, light color and curtain opening and closing, to personalize their sleep environment. The central control and suggestion module is a mobile phone or tablet that monitors the user's physical condition, room environment and sleep quality data, and provides corresponding suggestions. S9, Feedback and Regulation The sleep feedback and adjustment module uses DNN technology to analyze the user's sleep data and environmental monitoring data, and exchanges and adjusts data with terminal devices; based on the sleep data feedback from the user and the environmental monitoring data feedback from the system, the sleep feedback and adjustment module automatically adjusts the output of each terminal device to ensure that the user has a comfortable sleeping environment.
8. The working method of the smart room system for optimizing sleep according to claim 7, characterized in that: In step S1, the body motion signal includes the acceleration and angular velocity S of the user in three-dimensional space. i (t); the acceleration in three-dimensional space includes front and back A1(t), left and right A2(t) and up and down A3(t); The physiological data includes the user's heart rate h(t), exercise duration e(t), number of steps w(t), calorie consumption h(t), activity hours t, as well as blood pressure b(t), blood oxygen saturation o(t), stress level p(t), caffeine intake c and alcohol intake a during activity. The environmental parameters include light l(t), temperature t(t), humidity w(t) and sound decibel d(t).
9. The working method of the smart room system for optimizing sleep according to claim 7, characterized in that: In step S6, the process of building the DNN model is as follows: S61, set and select a 4-layer network, and the number of neurons in each layer is l4, l3, l2, and 6 respectively; 6 corresponds to 6 sleep stages; S62, select activation function Set the hidden layer to use the ReLU function g(z): g(z) = max(0, z), where z represents the value input to the activation function; When z>0, the output of the ReLU function is z itself, indicating that the corresponding neuron is activated and transmits a positive signal; when z<0, the output of the ReLU function is 0, indicating that the corresponding neuron is inhibited and does not transmit a signal; Set the output layer to use the Softmax function Softmax(zi): Where k = 6 represents the number of categories, corresponding to the six stages of daily activities, about to fall asleep, deep sleep, light sleep, rapid eye movement and just waking up; z j is the unprocessed output value of the DNN model at the output layer for the i-th category; S63, Initialize weights and biases Use a random initialization method, specifically including normal distribution or uniform distribution to initialize weights, weight w is initialized to normal distribution N(0, 0.01), and bias b is initialized to 0; S64, select optimization algorithm Using the Adam optimizer, the corresponding update rules are as follows: m t =β1m t-1 +(1-β1)g t ; Among them, m t is the first momentum estimate at the current moment, which is calculated from the first momentum m at the previous moment. t -1 is calculated, which is the first-order moment estimate of the gradient, equivalent to the momentum term in the momentum method; as time goes by, m t The exponentially weighted average of the accumulated gradients; β1 represents m t-1 The decay rate, g t is the gradient at the current moment; Among them, v t represents the second momentum estimate at the current moment, which is calculated from the second momentum v at the previous moment t-1 The calculated value is the second-order moment estimate of the gradient, which is equivalent to the second-order moment term in the RMSProp method; v t It accumulates the exponentially weighted average of the squared gradient; β2 represents v t-1 The decay rate of in, represents the corrected first momentum estimate, used to correct m t Deviations in the initial stages; is the decay rate of the first momentum at training step t; in, represents the corrected first momentum estimate, used to correct v t Deviations in the initial stages; is the decay rate of the second momentum at training step t; Among them, W t is the weight of the optimizer at time t, W t+1 is the updated weight, α is the learning rate, ∈ is a constant used to prevent the denominator from being zero; S65, define the forward propagation rules as follows: z [1] =W [1] x+b [1] ; a [1] =g [1] (z [1] ); z [2] =W [2] a [1] +b [2] ; a [2] =g [2] (z [2] ); z [l] =W [l] a [l-1] +b [l] ; a [l] =g [l] (z [l] ); Among them, x is the input data or the output of the previous layer, and the linear combination result z of the lth layer is [l] , is to convert the output a of the previous layer [1 -1] and the weight matrix W of the current layer [l] Multiply and add the deviation b [l] ; a [l] Represents the activation value, which is z [l] Input to the activation function g [l] (z [l] ) obtained in; S66, define the loss function and calculate the loss The loss function is set as follows: A [l] The loss L is calculated by comparing with the true label j; L is the value of the loss function, which is used to measure the difference between the prediction result of the DNN model and the true label; N is the number of samples, K is the number of categories, and yi k is the true probability that the i-th sample belongs to the k-th class, is the probability that the DNN model predicts that the i-th sample belongs to the k-th class; S67, define the back propagation rules as follows: Used to represent the gradient of the loss function with respect to the weight matrix of the lth layer; Used to represent the gradient of the loss function with respect to the bias term of the lth layer; in, is the gradient of the loss function to the linear combination result of the lth layer, It is the partial derivative of the linear combination result of the lth layer with respect to the weight matrix; It is the partial derivative of the linear combination result of the lth layer with respect to the bias term; S68, update weights and biases: Adopt the optimization algorithm selected in steps S64 to S67, and update the weights and biases according to the gradient to reduce the loss; S69, Model Evaluation Set the evaluation indicators of the constructed DNN model as follows: Accuracy: Indicates the proportion of true positive samples among the samples predicted to be positive; Recall: For category ki, Represents the proportion of samples that are correctly predicted to be positive among all samples that are actually positive; F1 value: Metrics for measuring DNN model performance; Among them, Precision k Represents precision, Recall k represents the recall rate; Confusion Matrix: C ij Indicates the number of samples that are actually class i but predicted to be class j; S610, model adjustments and improvements Adjust and improve the evaluated DNN model. The specific process is as follows: Hyperparameter Tuning: Use the SFFS method to automatically try different learning rates, number of layers, number of neurons, and regularization parameters; if the DNN model evaluation indicators cannot be effectively improved after updating the hyperparameters, the hyperparameter update will be automatically stopped; Model improvement: Try to build several DNN models and evaluate whether the evaluation indicators of the DNN models are improved.
Citation Information
Patent Citations
Sleep environment regulation device, system and method
CN109032223A
Sleeping environment adjusting method and system
CN109568760A
Sleep adjusting method and device
CN111358448A
Sleep environment control method and system
CN111594992A
Sleep aiding system based on sleep monitoring and control method thereof
CN117180591A
Cited By
Green data center computing power demand prediction and energy consumption control method, system and device
CN120508401A
Sleep quality analysis method and system for unmanned nursing
CN120899197A
Sleep environment self-adjusting system based on multi-source heterogeneous data
CN121091722A
Environment linkage intelligent awakening method and system of intelligent bed
CN121177636A
An environmental linkage intelligent wake-up method and system for a smart bed
CN121177636B