Sleep management optimization system and method based on image recognition and environment perception
Through the sleep management system of image recognition and environment perception, a personalized sleep management strategy is generated using an optimized bionic neural network and a spatial-temporal environment sleep quality correlation model, which solves the problem of difficult to evaluate the equipment complexity and environmental factors of the traditional sleep management system, and achieves more accurate sleep state monitoring and management.
Patent Information
- Application Number
- CN202510523154.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-24
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2045-04-24
AI Technical Summary
The existing sleep management system cannot accurately judge the specific impact of environmental factors on sleep quality, and it is difficult to formulate personalized and accurate sleep management strategies. The traditional monitoring methods and equipment are complex, which are inconvenient for long-term real-time monitoring of the family, and cannot fully reflect the sleep state.
A sleep management system based on image recognition and environment perception is adopted, and the first sleep state data is obtained through the optimization of bionic neural network to analyze image data, and the environmental data is analyzed in combination with the spatial and temporal environment sleep quality correlation model, and a personalized sleep management strategy is generated using improved reinforcement learning strategies.
Multi-dimensional monitoring of sleep state and environmental factors is realized, personalized sleep management suggestions are provided, and the accuracy of sleep quality assessment and the targeted sleep management are improved.
Smart Images

Figure CN120388672A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of sleep management, and particularly to an optimized sleep management system and method based on image recognition and environmental perception. Background Art
[0002] In modern life, sleep quality is crucial to people's physical and mental health, work efficiency, and quality of life. However, there are many limitations in current sleep management technologies. From the perspective of sleep state monitoring, traditional sleep monitoring methods, such as polysomnography (PSG), although highly accurate, are complex devices that need to be carried out in a hospital environment, causing great inconvenience to the daily life of sleepers and making it difficult to achieve long-term and real-time home monitoring. While some wearable devices can monitor sleep data to a certain extent, they mainly focus on aspects such as movement and heart rate, and have limited access to key information such as the facial expressions and body postures of sleepers, and cannot comprehensively reflect the sleep state.
[0003] In existing sleep management systems, it is impossible to accurately judge the specific impact of environmental factors on sleep quality, and it is difficult to formulate personalized and precise sleep management strategies. When a sleeper experiences sleep interruption, it is impossible to quickly determine whether it is caused by environmental noise, temperature change, or other factors, and thus it is impossible to take targeted measures in a timely manner to improve sleep. Therefore, an optimized sleep management system and method based on image recognition and environmental perception are proposed here to solve the above problems. Summary of the Invention
[0004] In order to overcome the above-mentioned defects of the prior art and to achieve the above object, the present invention proposes the following technical solutions:
[0005] An optimized sleep management system and method based on image recognition and environmental perception, comprising:
[0006] An image recognition module: collecting image data and obtaining first sleep state data from the image data through an optimized bionic neural network;
[0007] An environmental perception module: collecting sleep environment data, obtaining time dimension features and space dimension features from the sleep environment data through a spatio-temporal environmental sleep quality association model, and obtaining second sleep state data through a small neural network to adaptively adjust weights;
[0008] A sleep management module: generating a continuously optimized sleep management strategy based on the first sleep state data and the second sleep state data through an improved reinforcement learning strategy;
[0009] The hidden layer of the optimized bionic neural network includes a feature extraction sub-layer and a feature fusion sub-layer. The feature extraction sub-layer randomly initializes the convolutional kernels of the original convolutional neural network according to biological neurons, and adjusts the convolutional kernel weights based on reinforcement learning. The feature fusion sub-layer fuses features through an attention mechanism;
[0010] The improved reinforcement learning strategy includes an optimized policy network, and the optimized policy network initializes the policy network parameters by introducing the adjustment mode of biological neuron connection weights.
[0011] The image data includes facial expression image data and body posture image data;
[0012] The image data is converted into matrix form through grayscale processing and normalization operations and then input into the input layer of the optimized bionic neural network.
[0013] The process of obtaining the first sleep state data through the optimized bionic neural network is as follows:
[0014] The optimized bionic neural network includes an input layer, a hidden layer, and an output layer;
[0015] The input layer of the optimized bionic neural network receives the image data converted into matrix form through grayscale processing and normalization operations;
[0016] The hidden layer outputs a feature map through the feature extraction sub-layer and obtains a fused feature map through the feature fusion sub-layer;
[0017] The output layer converts the fused feature map into vector form through a fully connected layer, and then uses the Softmax function to calculate the probability distribution of the fused feature map in different sleep states to obtain the first sleep state data.
[0018] The specific implementation process of the hidden layer is as follows:
[0019] Take the convolution operation of the convolutional neural network as the basic operation of the feature extraction sub-layer, and randomly initialize the convolutional kernels of the convolutional neural network according to biological neurons;
[0020] After random initialization, the convolutional kernels are trained;
[0021] During the training process of the convolutional kernels, adjust the convolutional kernel weights based on reinforcement learning. Take the convolutional kernels as the agents of reinforcement learning. The agents interact with the sleep environment, learn the optimal policy according to the feedback reward signal, and after the adjustment, perform the convolution operation on the input image data to output the feature map;
[0022] The feature fusion sub-layer obtains the importance dimension of each feature map through the attention mechanism, obtains the attention weight of each feature map in sleep state recognition through the importance dimension, and realizes the fusion of feature maps by weighted summation based on the attention weight to obtain the fused feature map.
[0023] The importance dimension is obtained by constructing an association model between facial expression features and light sleep state;
[0024] The association model between facial expression features and light sleep state uses logistic regression in machine learning algorithms, takes the facial expression feature vector as the input, takes the light sleep state as the output label, and uses the labeled facial image data to train the model, and outputs the importance dimension corresponding to different feature maps.
[0025] The sleep environment data includes temperature data, light data, noise data, and air quality data.
[0026] The spatio-temporal environment sleep quality association model includes a part that captures the change trend of sleep environment data over time and a part that captures the spatial association between sensor nodes of sleep environment data;
[0027] The part that captures the change trend of sleep environment data over time uses a long short-term memory network to capture the change trend of sleep environment data over time, and generates a hidden state reflecting the time characteristics of environmental parameters at the current time point to obtain the time feature dimension;
[0028] The part that captures the spatial association between sensor nodes of sleep environment data uses a graph convolutional network to model the sensor network, regards different sensor nodes as vertices of the graph, regards the physical connection or correlation between nodes as edges, and adds a self-loop to the adjacency matrix to obtain the degree matrix before graph convolutional operation, and obtains the spatial feature dimension through graph convolutional operation.
[0029] The number of neurons in the input layer, hidden layer, and output layer of the small neural network is obtained based on the time feature dimension and the spatial feature dimension;
[0030] The small neural network adaptively adjusts the importance weights of the time feature dimension and the spatial feature dimension and then outputs the second sleep state data through the spatio-temporal environment sleep quality association model.
[0031] The construction process of the improved reinforcement learning strategy is as follows:
[0032] The improved reinforcement learning strategy includes an optimized policy network, a value network, and a reward function;
[0033] The optimized policy network applies the biological neuron connection weight adjustment mode to the initialization of the optimized policy network parameters. After initialization, it outputs the probability distribution of taking different sleep intervention actions;
[0034] The value network obtains the sleep state based on the first sleep state data and the second sleep state data, and evaluates the expected value of improving sleep quality after taking all possible actions in the current sleep state based on the sleep state;
[0035] The components of the reward function include the increase in sleep efficiency, the decrease in the number of awakenings, the increase in deep sleep duration, and the user's satisfaction with the intervention strategy.
[0036] The process of obtaining the continuously optimized sleep management strategy is as follows:
[0037] Based on the improved reinforcement learning strategy, collect the sleep state and intervention actions at multiple time steps and train the update process of the strategy through the reward function. During the training process, use the importance sampling technique to reduce the sampling error and obtain the objective function for strategy update;
[0038] Iteratively optimize the policy network parameters through the objective function to generate the optimal sleep management strategy.
[0039] A sleep management optimization method based on image recognition and environmental perception, the method steps include:
[0040] S1: Collect image data, and obtain the first sleep state data from the image data through an optimized bionic neural network;
[0041] S2: Collect sleep environment data, obtain the time dimension features and space dimension features from the sleep environment data through a spatio-temporal environment sleep quality correlation model, and obtain the second sleep state data by adaptively adjusting the weights of a small neural network;
[0042] S3: Generate a continuously optimized sleep management strategy based on the first sleep state data and the second sleep state data through an improved reinforcement learning strategy.
[0043] The present invention has the following beneficial effects:
[0044] In the present invention, first, the collected image data is processed through an optimized bionic neural network to obtain the first sleep state data, including information such as the facial expression, body posture, and turning frequency of the sleeper. Compared with traditional monitoring means, the monitoring indicators are more comprehensive and can deeply reflect the physiological and psychological states of the sleeper. At the same time, the environmental perception module uses the spatio-temporal environment sleep quality correlation model to collect and analyze environmental data such as temperature, light, noise, and air quality, and obtain the second sleep state data, accurately capturing the impact of the environment on sleep quality from the time and space dimensions. This multi-dimensional sleep state monitoring method provides a more comprehensive and accurate data basis for subsequent sleep management;
[0045] Secondly, by optimizing the bionic neural network to dynamically adjust the weights of convolutional kernels based on reinforcement learning, making it more suitable for the sleep state recognition task. Meanwhile, the small neural network in the spatio-temporal environment sleep quality correlation model can dynamically adjust the weights of time and space dimension features according to historical data and real-time feedback, improving the accuracy of sleep quality assessment.
[0046] Finally, fuse the first sleep state data and the second sleep state data, and generate a continuously optimized sleep intervention strategy through an improved reinforcement learning strategy. The optimization strategy network in the improved reinforcement learning strategy assigns initial values to corresponding parameters according to the biological neuron connection weight adjustment mode, enabling the network to be sensitive to sleep environment features at the initial stage, fully considering the individual differences of sleepers and the dynamic changes of the sleep environment, and providing personalized suggestions for sleepers according to different sleep states and environmental conditions to meet the diverse needs of different users. Brief Description of the Drawings
[0047] Figure 1 It is a system block diagram of the sleep management optimization system and method based on image recognition and environment perception proposed by the present invention.
[0048] Figure 2 It is a method step diagram of the sleep management optimization system and method based on image recognition and environment perception proposed by the present invention. Detailed Embodiments
[0049] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0050] Embodiment 1
[0051] As Figure 1 shown, the sleep management optimization system based on image recognition and environment perception proposed by the present invention includes:
[0052] An image recognition module: collect image data and obtain the first sleep state data from the image data through an optimized bionic neural network.
[0053] Deploy a camera with infrared night vision function in the sleep environment, install it at a position vertically downward above the head of the bed, collect images at a frequency of 2-3 frames per second, capture the facial expression (relaxed, tense, sad) image data and body posture (supine, side lying, prone) image data of the sleeper, and convert the color image into a gray image. The conversion formula is expressed as:
[0054] G = 0.299g1 + 0.587g2 + 0.114g3
[0055] where g1, g2, and g3 are the red, green, and blue components of the color image respectively;
[0056] The pixel value range of the grayscale image is uniformly adjusted to [0, 1], and then the image data in matrix form is constructed;
[0057] Specifically, although the color image contains rich color information, in the sleep state recognition task, some color information is not helpful for judging the sleep state, but instead increases the data dimension and processing complexity. After the image data is grayscaled and normalized, each pixel point of the image corresponds to an element in the matrix;
[0058] The image data in matrix form is input into the optimized bionic neural network;
[0059] The construction process of the optimized bionic neural network is as follows:
[0060] The optimized bionic neural network includes an input layer, a hidden layer, and an output layer;
[0061] Among them, the hidden layer is composed of a feature extraction sub-layer and a feature fusion sub-layer;
[0062] The input layer receives the preprocessed image data matrix. Through preliminary integration of the data, the input image data matrix is arranged and organized and enters the subsequent hidden layer in an orderly manner;
[0063] The construction process of the feature extraction sub-layer is as follows:
[0064] The convolution operation of the convolutional neural network (CNN) is used as the basic operation of the feature extraction sub-layer, and the convolutional kernels of the convolutional neural network are randomly initialized according to biological neurons;
[0065] After random initialization, the convolutional kernels are trained. During the training process of the convolutional kernels, the weights of the convolutional kernels are adjusted according to reinforcement learning;
[0066] In reinforcement learning, the agent interacts with the sleep environment and learns the optimal strategy according to the feedback reward signal. In the feature extraction sub-layer, the convolutional kernel is the agent, and the role of the extracted features in sleep state recognition is the environmental feedback. When the features extracted by the convolutional kernel can accurately indicate the sleep state (such as the rapid eye movement feature of the eyes during rapid eye movement sleep), a positive reward is given and the weight is enhanced; otherwise, a negative reward is given and the weight is weakened;
[0067] The process of adjusting the weights of the convolutional kernels according to reinforcement learning is as follows:
[0068] Define the reward function \(R\). When the features extracted by the convolutional kernel accurately identify the sleep state (such as identifying light sleep and the actual state is light sleep), \(R\) takes a relatively large positive value. When the identification is incorrect, \(R\) takes a negative value;
[0069] Suppose the formula for updating the convolutional kernel weights with a weight adjustment step size of \(\alpha\) is:
[0070] \(k\) +1 \(= k+\alpha R\)
[0071] For example, in a certain calculation, the eye features extracted by the convolutional kernel accurately indicate rapid eye movement sleep. The reward function \(R = 0.5\), the step size \(\alpha=0.1\), and the original weight \(k = 0.3\). Then the updated weight \(k\) +1 \(=0.3 + 0.1\times0.5=0.35\). The increase in the updated weight makes it easier for this convolutional kernel to extract such key features subsequently;
[0072] After adjusting the convolutional kernel weights, assume that the convolutional kernel performs a convolution operation on the input image data and outputs a feature map \(Y\). The formula is expressed as:
[0073]
[0074] where \(q\), \(p\) are the convolutional kernel sizes, \(X\) is the output feature map coordinate, and \(k\) is the convolutional kernel;
[0075] Specifically, the optimized bionic neural network is based on the convolution operation of the convolutional neural network, combined with the characteristics of biological neurons, making the convolutional kernel fit the working mode of the biological nervous system to improve the pertinence of feature extraction. At the same time, reinforcement learning is introduced to dynamically adjust the convolutional kernel weights, changing the traditional way of adjusting weights in a fixed or simple rule in CNN. Through a reward mechanism closely combined with the sleep state recognition task, the convolutional kernel continuously self-optimizes during the training process;
[0076] The construction process of the feature fusion sublayer is as follows:
[0077] The feature maps obtained by different feature extraction sublayers contain different aspects of image information, such as facial expression features and body posture features. The feature fusion sublayer will optimally fuse these feature maps to obtain a more comprehensive image representation;
[0078] Through an attention mechanism, corresponding attention weights are obtained based on the importance dimension of each feature map in sleep state recognition. The importance dimension is obtained by analyzing a large number of labeled sleep image data and constructing an association model between facial expression features and light sleep states. Suppose the facial expression feature vector is \(F=(f_1,f_2,\cdots,f\) n )), where \(f\) nRepresents the nth facial feature parameter, such as the degree of eye muscle relaxation, the frequency of facial micro-expression changes, and at the same time, the association model between facial expression features and light sleep state is constructed, which is expressed as:
[0079] S light-sleep =w1f1+w2f2+..+w n f n
[0080] Among them, S light-sleep is the output of the association model between facial expression features and light sleep state (i.e., importance dimension), w n is the weight coefficient obtained by training the nth machine learning algorithm. Through the logistic regression in the machine learning algorithm, the facial expression feature vector is used as input, the light sleep state (yes or no) is used as the output label, and a large amount of labeled facial image data (divided into training set and validation set) is used to train the model. After the training is completed, the model will output the importance dimension S corresponding to different feature maps. light-sleep ;
[0081] Assume that the number of feature maps obtained by the feature extraction sublayer is N. For two features Y i (i∈N) and feature map Y j (j∈N), the attention weight formula is expressed as:
[0082]
[0083] Among them, a represents the attention weight, s i ∈S light-sleep is the feature map Y i The importance dimension, s j ∈S light-sleep is the feature map Y j The importance dimension;
[0084] After determining the attention weight a of each feature map, the weighted summation formula is used to achieve feature map fusion:
[0085]
[0086] Among them, Q is the fused feature map, that is, the output of the feature fusion sublayer;
[0087] Specifically, an attention mechanism is introduced for the output feature maps of the feature extraction sublayer. This mechanism determines the importance of feature maps through in-depth analysis of a large amount of sleep image data and constructs a correlation model between facial expression features and sleep states to determine the dimension of feature map importance. This model, combined with the characteristics of sleep images and unlike general feature fusion methods, is specifically designed for the sleep domain and can better explore the potential value of different feature maps in sleep state recognition, providing a more effective feature representation for sleep state judgment.
[0088] The fused feature map output by the feature fusion sublayer is used as the output of the output layer. After feature extraction and fusion in the hidden layer, a fully connected layer is set in the output layer to convert the fused feature map into a vector form, and then the Softmax function is used to calculate the probability distribution of the fused feature map in different sleep states (light sleep, deep sleep, rapid eye movement sleep). The formula is expressed as:
[0089]
[0090] where Q i is the input value (fused feature map) of the nth output layer, M is the number of neurons in the output layer, and P is the probability representation of different sleep states;
[0091] Specifically, starting from the image data in matrix form, after being processed by each layer of the network, the probability information of the sleeper in different sleep states and the facial expression and body posture feature information of the sleeper corresponding to different sleep states are finally obtained. These information constitute the first sleep state data [J].
[0092] Environmental perception module: Collect sleep environment data, obtain time - dimension features and space - dimension features from the sleep environment data through a spatio - temporal environment sleep quality association model, and obtain the second sleep state data through self - adaptively adjusting the weights of a small neural network;
[0093] Collect sleep environment data during sleep. Collect temperature data, light data, noise data, and air quality data through different types of sensors. Through these data, initially understand the impact of the sleep environment on sleep quality, and then perform data normalization pre - processing as the input of a spatio - temporal environment sleep quality association model. Let the input sleep environment data be E;
[0094] The construction process of the spatio - temporal environment sleep quality association model is as follows:
[0095] Capture the changing trend of sleep environment data over time;
[0096] Use a long short - term memory network to capture the changing trend of sleep environment data over time, generate a hidden state H reflecting the time features of environmental parameters at the current time point, and continuously update this hidden state through an input gate, a forget gate, and an output gate. The core formula is expressed as:
[0097] H t =o t tanh(c t )
[0098] where, H tThe hidden state of the data input at time t, which synthesizes the current input environmental data E and the previously memorized information, is a feature representation output by the LSTM network at time t, o t is the activation value of the output gate, which controls the output ratio of the memory cell information, c t is the memory cell, which stores long-term dependence information, and tanh is the hyperbolic tangent function;
[0099] Specifically, for the hidden state H t the values of each dimension will change with time and environmental parameters. For example, if the temperature of the sleep environment continuously decreases, the values of the dimensions related to temperature will change accordingly. By observing the hidden state H t the change situations at different times are obtained, reflecting the downward trend of the sleep environment data over time. The hidden state H t is the time dimension feature;
[0100] Capture the spatial correlation between the sensor nodes that collect sleep environment data;
[0101] There is a spatial correlation among the sensor data at different positions in the sleep environment. The graph convolutional network (GCN) is used to model the sensor network. Different sensor nodes are regarded as the vertices of the graph, and the physical connections or correlations between nodes are regarded as the edges. Let the adjacency matrix of the graph be A and the node feature matrix be X (E) (the node feature matrix at the initial stage obtained based on the fused environmental data E);
[0102] Before performing the graph convolution operation, a self-loop is added to the adjacency matrix where I is the identity matrix. The purpose of adding the self-loop is to enable each node to consider its own feature information and enhance the model's ability to capture the characteristics of the node itself; The degree matrix D is obtained,
[0103] where represents the connection degree of all nodes in the sleep environment data; The node feature matrix Z after the graph convolution operation based on the degree matrix D is expressed as:
[0104]
[0105]
[0106] where is the weight matrix in the graph convolution operation, represents the normalization process of the adjacency matrix to balance the connection weights between nodes, so that the output node feature matrix Z can more reasonably consider the correlation strength between different nodes, and σ is the activation function;
[0107] Capture the spatial correlation between sensor nodes through graph convolution operations, comprehensively consider the characteristics of each node itself and the connection relationship with adjacent nodes in the sleep environment data, and transform the node feature matrix X (E) to extract the node feature matrix Z reflecting spatial correlation, which is used to obtain the spatial distribution patterns of parameters such as temperature and humidity in the sleep environment, and judge the correlation between environmental conditions in different regions. This node feature matrix Z is the spatial dimension feature;
[0108] Further, adaptively assign fusion weights to the time dimension feature H and the spatial dimension feature Z respectively. Let the importance weight of the time dimension feature be W (H) , and the importance weight of the spatial dimension feature be W (Z) . Learn the historical environmental data and sleep quality data through a small neural network to dynamically adjust W (H) and W (Z) ;
[0109] Specifically, the small neural network includes an input layer, a hidden layer and an output layer. The number of neurons in the input layer is u1, the length of the time dimension feature H and the spatial dimension feature Z. The hidden layer uses the ReLU function, and the number of neurons is where u1 is the number of neurons in the input layer, u2 is the number of neurons in the output layer, γ is a regulation constant, and the number of neurons in the output layer u2 is two, corresponding to the importance weights W (H) and W (Z) ;
[0110] When the small neural network finds that the recent sleep quality fluctuations are mainly more correlated with the temporal changes of environmental parameters (such as continuous changes in night temperature), it will increase the importance weight W (H) of the time dimension feature, and correspondingly reduce the importance weight W (Z) of the spatial dimension feature. If the environmental differences in space (such as noise differences at different positions in the room) have a greater impact on sleep quality, then increase the importance weight W (Z) ;
[0111] Then the final spatio-temporal environmental sleep quality correlation model is expressed as:
[0112] [E]=W (H) H + W (Z) Z
[0113] where W (Z) and W (H) represent the importance weights adjusted in real time through the small neural network, and [E] represents the second sleep state data output by the spatio-temporal environmental sleep quality correlation model through the sleep environment data;
[0114] The spatio-temporal environment-sleep quality association model is trained using sleep environment data. During the training process, the mean squared error loss function is used, and the importance weights in the model are continuously adjusted in real-time through an optimization algorithm (here it is a small neural network), enabling the model to evaluate sleep quality based on spatio-temporal (time dimension and space dimension) associated environment data in real-time, and obtaining the second sleep state data;
[0115] Specifically, by correlating the environmental features in the time dimension and the space dimension, deeply exploring the characteristics of the time and space features respectively, using long short-term memory networks and graph convolutional networks to extract the optimized features in the time dimension and the space dimension respectively, then organically integrating them, and introducing a small neural network to dynamically adjust the importance weights of the time and space dimension features. Different from the traditional methods of fixed weights or simple heuristic weight adjustment, the final association model can automatically optimize the weights in real-time according to the actual sleep environment data and sleep quality feedback, adapting to different sleep scenarios and individual differences, providing a more accurate basis for sleep quality assessment and intervention.
[0116] Sleep management module: Based on the first sleep state data and the second sleep state data, generate a continuously optimized sleep management strategy through an improved reinforcement learning strategy;
[0117] Fuse the first sleep state data and the second sleep state data to obtain the comprehensive sleep state data U = {[E], [J]};
[0118] The construction process of the improved reinforcement learning strategy is as follows:
[0119] The improved reinforcement learning strategy includes an optimized policy network, a value network, and a reward function;
[0120] The construction process of the optimized policy network and the value network is as follows:
[0121] Use the different sleep characteristics in the fused comprehensive sleep state data U as the sleep states of the improved reinforcement learning strategy
[0122] Define the optimized policy network as where θ is the parameter of the optimized policy network, and a is the intervention action for different sleep states;
[0123] Apply the biological neuron connection weight adjustment mode to the initialization of the optimized policy network parameter θ, and the optimized policy network Finally, output the probability distribution of taking different sleep intervention actions a;
[0124] Specifically, in a traditional policy network, the parameter θ is usually randomly initialized. This method does not take into account specific sleep-related information, resulting in a relatively low learning efficiency in the initial stage of the network. In the optimized policy network, a biological neuron connection weight adjustment mode is introduced to initialize the parameter θ. The implementation process of the connection weight adjustment mode is as follows:
[0125] There is a specific connection weight distribution law among biological neurons. Taking the impact of environmental temperature changes on sleep as an example, when an individual feels a decrease in the external temperature during sleep, the temperature receptor neurons in the skin will be activated. These neurons are synaptically connected to other neurons that transmit temperature information, and the connection weights will be adjusted according to the intensity and frequency of the stimuli. Let the adjustment process of the biological neuron connection weight between two neurons, neuron 1 and neuron 2, be expressed as:
[0126]
[0127] Among them, represents the change in the connection weight between neuron β1 and neuron β2. η is a learning rate parameter that controls the amplitude of the weight change. f(s temp ) is a function that reflects the influence of the intensity and characteristics of the temperature change coefficient s temp on the weight adjustment. β1 and β2 are the activation values of neuron 1 and neuron 2 respectively, representing the activity level of the neurons when receiving stimuli;
[0128] According to the above biological neuron connection weight adjustment mode, initial values are assigned to the corresponding parameters, enabling the network to be sensitive to the temperature (or other light data, noise data, air quality data) feature of the sleep environment in the initial stage. For other relevant sleep environment features, the parameters are also initialized based on the neuron connection weight change mode during temperature adjustment;
[0129] Define the value network as are the parameters of the value network. The value network estimates the value of the current sleep state , that is, evaluates the expected value of improving sleep quality after taking all possible actions in the current sleep state;
[0130] Define the reward function The components of include the increase in sleep efficiency the decrease in the number of awakenings deep the increase in the deep sleep duration ΔT Taking these components into comprehensive consideration, measuring the rewards obtained after taking a certain sleep intervention action, and guiding the optimization of the policy network according to the rewards to learn a better policy, which is expressed by the formula:
[0131]
[0132] where is the execution cost of the intervention policy, w1 is the weight of the increase in sleep efficiency w2 is the weight of the decrease in the number of awakenings w3 is the weight of the increase in deep sleep duration ΔT deep w4 is the weight of the user's satisfaction ΔS with the intervention policy, and w5 is the weight of the execution cost of the intervention policy;
[0133] Collect the sleep states U and intervention actions a at multiple time steps, and train the update process of the policy through the reward function During the training process, use the importance sampling technique to reduce the sampling error, and set an objective function for policy update:
[0134]
[0135] where represents the expectation operator, min(·) is the minimum value function, clip is the clipping function, r (θ) represents the ratio between the new and old policies, is the advantage estimate value, and θ is the parameter of the optimized policy network;
[0136] Specifically, the expectation operator represents taking the expectation at the time step. By taking the expectation, the situations of different time steps can be comprehensively considered, avoiding being overly influenced by the data of individual abnormal time steps, and obtaining a more representative result for policy update. The purpose of the minimum value function min(·) is to prevent the step size from being too large during policy update. The clipping function clip is used to limit the change range of the action probabilities between the current policy and the old policy, and the ratio r (θ) between the new and old policies is restricted within (1 - ∈, 1 + ∈) to prevent the policy update from being too radical and causing the model to be unstable. ∈ is the clipping parameter that restricts the change range of r (θ) The advantage estimate value is used to obtain the advantage degree of the current intervention action a relative to the average action, and evaluate the additional rewards brought by taking the action in the current state compared with other actions;
[0137] Iteratively optimize the policy network parameters (i.e., continuously adjust θ) through the objective function L of policy update, so as to maximize the long-term cumulative rewards of the optimized policy network parameters, and thus generate the optimal sleep management policy;
[0138] Make relevant sleep management decisions based on the optimal policy generated by the improved reinforcement learning strategy;
[0139] For example:
[0140] Based on the first sleep state data (image data) and the sleep state, it is found that the sleeper has symptoms such as whole-body muscle tension and rigid posture before going to bed. The optimal policy recommends performing progressive muscle relaxation exercises 20 minutes before going to bed;
[0141] Based on the second sleep state data (sleep environment data), the optimal policy recommends that the best sleep environment is a temperature of 24°C, a humidity of 50%, a light intensity of 5 lux, and a noise control below 30 dB.
[0142] Embodiment 2
[0143] As Figure 2 shown, the sleep management optimization method based on image recognition and environmental perception proposed by the present invention includes the following method steps:
[0144] S1: Collect image data and obtain the first sleep state data from the image data through an optimized bionic neural network;
[0145] S2: Collect sleep environment data, obtain the time dimension features and space dimension features from the sleep environment data through a spatio-temporal environment sleep quality correlation model, and obtain the second sleep state data through a small neural network to adaptively adjust the weights;
[0146] S3: Generate a continuously optimized sleep management policy based on the first sleep state data and the second sleep state data through an improved reinforcement learning strategy.
[0147] In the application, several formulas involved are calculated by taking their numerical values after dimensionless. The establishment of the formula is obtained by collecting a large amount of data for software simulation to get a formula closest to the real situation. Some coefficients or weights in the formula are set by those skilled in the art according to the actual situation, so no more details will be given here.
[0148] The above embodiments can be implemented in whole or in part by software, hardware, firmware, or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution.
[0149] Although embodiments of the present invention have been shown and described, it will be understood by those of ordinary skill in the art that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of the present invention, and the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A sleep management optimization system based on image recognition and environmental perception, characterized in that, Including: Image recognition module: Collect image data and obtain first sleep state data from the image data through an optimized bionic neural network; Environmental perception module: Collect sleep environment data, obtain time - dimension features and space - dimension features from the sleep environment data through a spatio - temporal environment sleep quality correlation model, and obtain second sleep state data through a small neural network to adaptively adjust weights; Sleep management module: Generate a continuously optimized sleep management strategy based on the first sleep state data and the second sleep state data through an improved reinforcement learning strategy; The hidden layer of the optimized bionic neural network includes a feature extraction sub - layer and a feature fusion sub - layer. The feature extraction sub - layer randomly initializes the convolution kernels of the original convolutional neural network according to biological neurons and adjusts the convolution kernel weights according to reinforcement learning. The feature fusion sub - layer fuses features through an attention mechanism; The improved reinforcement learning strategy includes an optimized policy network, and the optimized policy network initializes the policy network parameters by introducing a biological neuron connection weight adjustment mode.
2. The sleep management optimization system based on image recognition and environmental perception according to claim 1, wherein The process of obtaining the first sleep state data through the optimized bionic neural network is as follows: The image data includes facial expression image data and body posture image data; The optimized bionic neural network includes an input layer, a hidden layer, and an output layer; The image data is converted into matrix form through grayscale processing and normalization operations and then input into the input layer of the optimized bionic neural network; The hidden layer outputs a feature map through the feature extraction sub - layer and obtains a fused feature map through the feature fusion sub - layer; The output layer converts the fused feature map into vector form through a fully - connected layer, and then uses the Softmax function to calculate the probability distribution of the fused feature map in different sleep states corresponding to the sleep state to obtain the first sleep state data.
3. The sleep management optimization system based on image recognition and environmental perception according to claim 2, characterized in that The specific implementation process of the hidden layer is as follows: Take the convolution operation of the convolutional neural network as the basic operation of the feature extraction sub - layer, and randomly initialize the convolution kernels of the convolutional neural network according to biological neurons; After random initialization, convolution kernel training is carried out; During the convolution kernel training process, adjust the convolution kernel weights according to reinforcement learning. Take the convolution kernel as the agent of reinforcement learning. The agent interacts with the sleep environment, learns the optimal policy according to the feedback reward signal, and after adjustment, perform convolution operation on the input image data to output a feature map; The feature fusion sub - layer obtains the importance dimension of each feature map through the attention mechanism, obtains the attention weight of each feature map in sleep state recognition through the importance dimension, and realizes feature map fusion by weighted summation based on the attention weight to obtain the fused feature map.
4. The sleep management optimization system based on image recognition and environmental perception according to claim 3, characterized in that, The importance dimension is obtained by constructing a correlation model between facial expression features and light sleep state; The correlation model between facial expression features and light sleep state uses logistic regression in machine learning algorithms. Taking the facial expression feature vector as the input and the light sleep state as the output label, train the model with the labeled facial image data, and output the importance dimension corresponding to different feature maps.
5. The sleep management optimization system based on image recognition and environmental perception according to claim 1, wherein The sleep environment data includes temperature data, light data, noise data, and air quality data.
6. The sleep management optimization system based on image recognition and environmental perception according to claim 1, wherein The spatio-temporal environment sleep quality association model includes a part for capturing the changing trend of sleep environment data over time and a part for capturing the spatial association between sensor nodes of sleep environment data; The part for capturing the changing trend of sleep environment data over time uses a long short-term memory network to capture the changing trend of sleep environment data over time, generates a hidden state reflecting the time characteristics of environmental parameters at the current time point, and obtains the time feature dimension; The part for capturing the spatial association between sensor nodes of sleep environment data uses a graph convolutional network to model the sensor network, treats different sensor nodes as vertices of the graph, regards the physical connection or correlation between nodes as edges, and adds a self-loop to the adjacency matrix before graph convolutional operations to obtain the degree matrix, and obtains the spatial feature dimension through graph convolutional operations.
7. The sleep management optimization system based on image recognition and environmental perception according to claim 1, wherein The number of neurons in the input layer, hidden layer, and output layer of the small neural network is obtained based on the time feature dimension and the spatial feature dimension; The small neural network adaptively adjusts the importance weights of the time feature dimension and the spatial feature dimension and then outputs the second sleep state data through the spatio-temporal environment sleep quality association model.
8. The sleep management optimization system based on image recognition and environmental perception according to claim 1, characterized in that, The process of constructing the improved reinforcement learning policy is as follows: The improved reinforcement learning policy includes an optimized policy network, a value network, and a reward function; The optimized policy network applies the biological neuron connection weight adjustment mode to the initialization of the optimized policy network parameters. After initialization, it outputs the probability distribution of taking different sleep intervention actions; The value network obtains the sleep state based on the first sleep state data and the second sleep state data, and evaluates the expected value of improving sleep quality after taking all possible actions in the current sleep state based on the sleep state; The composition components of the reward function include the increase in sleep efficiency, the decrease in the number of awakenings, the increase in deep sleep duration, and the user's satisfaction with the intervention strategy.
9. The sleep management optimization system based on image recognition and environmental perception according to claim 8, characterized in that The process of obtaining the continuously optimized sleep management strategy is as follows: Based on the improved reinforcement learning policy, the sleep state and intervention actions at multiple time steps are collected, and the update process of the policy is trained through the reward function. During the training process, the importance sampling technique is used to reduce the sampling error to obtain the objective function for policy update; The optimal sleep management policy is generated by iteratively optimizing the policy network parameters through the objective function.
10. A sleep management optimization method based on image recognition and environmental perception, according to the system described in any one of claims 1-9, characterized in that, The method steps include: S1: Collect image data, and obtain the first sleep state data from the image data through an optimized bionic neural network; S2: Collect sleep environment data, obtain the time dimension features and spatial dimension features from the sleep environment data through a spatio-temporal environment sleep quality association model, and adaptively adjust the weights through a small neural network to obtain the second sleep state data; S3: Generate a continuously optimized sleep management policy based on the first sleep state data and the second sleep state data through an improved reinforcement learning policy.
Citation Information
Patent Citations
Sleep stage staging method, device and equipment and storage medium
CN117617911A
Sleep staging method and system based on reinforcement learning
CN117668512A
Multi-modal fusion learning method and system for sleep management
CN117789931A
Automatic sleep staging method and system
CN119312143A
Method and system for adjusting humidification device using neural network based on user's sleep state
KR102653940B1
Cited By
Non-contact sleep thermal comfort identification method based on multi-source data fusion
CN121810697A
A non-contact sleep thermal comfort identification method based on multi-source data fusion
CN121810697B