Sleeping posture detection and recognition method
Through the three-axis acceleration sensor and distance function recognition algorithm model, the problem of privacy leakage and low recognition accuracy in sleeping posture recognition is solved, and high-accuracy sleeping posture detection and recognition is achieved, providing reliable support for sleep quality monitoring.
Patent Information
- Application Number
- CN202411188632.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2024-12-03
AI Technical Summary
The existing sleeping position recognition technology has problems of privacy leakage and low recognition accuracy, especially the image or video-based methods require camera devices, which leads to privacy leakage. The method based on flexible pressure sensor has a low recognition accuracy, lacking a simple and accurate And a privacy-protecting sleeping position recognition method.
A three-axis acceleration sensor is used to obtain the acceleration signals of different sleep postures of the human body, and identify them by constructing a distance function and sleep posture recognition algorithm model to avoid privacy leakage and achieve high-accurate sleep posture detection and recognition.
It realizes sleeping posture detection and recognition with high privacy protection, high accuracy and low interference, with an identification accuracy of 98.7%, solving the problem of privacy leakage and low recognition accuracy in the existing technology, and providing reliable for the medical and smart home fields. Sleeping position change monitoring support.
Smart Images

Figure CN119055228A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of sleeping posture recognition, and in particular, relates to a sleeping posture detection and recognition method. Background Art
[0002] The "China Sleep Research Report (2024)" shows that in the past 10 years, the Chinese people have fallen asleep more than two hours later, and the average sleep duration has been reduced from 8.5 hours in 2012 to 7.06 hours in 2021. Difficulty falling asleep is the most troubling sleep problem for Chinese respondents, accounting for as high as 54.6%. How to improve sleep comfort, help people fall asleep quickly, and get good sleep quality within a limited time has become an urgent problem for contemporary people to solve. Poor sleep quality will cause serious damage to people's psychological and physical health, affecting people's normal life and work.
[0003] Sleeping posture recognition has a wide range of applications. It is used in medical treatment, such as assisting in the monitoring and treatment of diseases that require sleeping posture, such as heart disease and pressure sores, and providing specific data for further extracting sleep breathing signals and studying human sleep behavior. It is also used in the field of human-computer interaction. For example, in home care, for elderly people who snore or feel unwell during sleep, the sleeping posture monitoring device can provide timely feedback and take corresponding measures, such as controlling the bed to turn over, or even calling an ambulance, notifying the guardian, etc.
[0004] In recent years, computer vision technology has begun to be used for sleeping posture classification, which not only provides a non-contact measurement environment, but also provides higher recognition accuracy and operation speed. RGB, infrared and time-of-flight (ToF) cameras are widely adopted. H.Lyu et al. [1] used RGB cameras and Yolo target detection algorithm to detect the key points of bones, which were then input into the BP neural network to obtain a 95% sleeping posture recognition accuracy.
[0005] Yang Mingjian, Li Jinglin, Guo Ruikun et al. [2] The sleep images collected by the camera are processed using a single-person posture estimation algorithm and a multi-person posture detection algorithm based on OpenPose. The accurate positioning of the face, hands, and joints of the human body is achieved through key point positioning. The sleeping posture recognition algorithm based on the extraction of key points of the human body can determine whether the person is lying on the left side, right side, supine, or prone. This method has an accuracy rate of 92.5%.
[0006] The current sleeping posture recognition system has problems such as privacy leakage, human body restraint and low recognition accuracy, which limits its clinical application. In order to improve practicality, a flexible pressure sensor is used to collect six sleeping posture images without restraint. Liu Jinyue, Zhou Zhiwen and others [3]A sleeping posture recognition method based on support vector machine (SVM) and genetic algorithm (GA) for key parameter optimization is proposed. This method can accurately recognize human sleeping posture with an average recognition accuracy of 93.3%.
[0007] In summary, the recognition method based on images or videos requires a basic camera or camera device, which has the problem of privacy leakage, and the method based on the flexible pressure sensor array has a low accuracy in sleeping position recognition. Compared with the existing sleeping position detection methods, there is a lack of a method that is simple to collect, protects privacy and realizes accurate sleeping position recognition. The present invention proposes a sleeping position detection and recognition method, which obtains the acceleration signal of different sleeping positions of the human body through a three-axis acceleration sensor, and uses the constructed distance function and sleeping position recognition algorithm model to recognize different sleeping position changes, so as to realize sleeping position detection and recognition with privacy protection, high recognition accuracy and little sleep interference, and further, it can deeply understand the user's sleep pattern and identify potential problems that may affect their sleep quality or overall health in the later stage, and provide reliable support for sleeping position changes for researchers in the fields of apnea mitigation in medical treatment, mattress prevention and treatment, and sleep quality improvement in smart homes. Summary of the invention
[0008] In view of the shortcomings of the prior art, the present invention aims to provide an acceleration sensor that obtains acceleration signals of different sleeping postures of the human body and uses a distance function and a sleeping posture recognition algorithm model to identify the sleeping posture, thereby avoiding privacy leakage, ensuring the comfort of the user during sleep, and realizing a sleeping posture detection and recognition method with low cost, high accuracy and little sleep interference, thereby meeting the user's needs for sleep quality and having promising prospects.
[0009] In order to solve the above problems, the present invention provides a sleeping posture detection and recognition method, which can realize accurate sleeping posture recognition by only using a three-axis acceleration sensor to generate acceleration signals of different sleeping postures, wherein:
[0010] Use the ADXL345 three-axis acceleration sensor, which has high sensitivity and can collect acceleration signal changes of less than 1.0° tilt angle;
[0011] The object of the present invention is achieved in that:
[0012] A sleeping posture detection and recognition method comprises the following steps:
[0013] Step a, laying a three-axis acceleration sensor in the mattress in advance, obtaining acceleration signals of different sleeping postures of the human body, and generating original acceleration signal data;
[0014] Step b, preprocessing the original acceleration signal data, and using the preprocessed result as a data set;
[0015] Step c, dividing the data set into a training set, a validation set and a test set, wherein the training set is used to train model parameters, the validation set is used to test prediction accuracy, and the test set is used to predict sleeping posture;
[0016] Step d: construct a sleeping posture recognition algorithm model; the specific implementation steps are as follows:
[0017] Step d1: Center point selection: determine the center point of the algorithm model in the training set;
[0018] When traditional functions calculate local density, they often cannot effectively distinguish between center points and ordinary data points. This deficiency leads to poor accuracy and robustness of the results. In addition, an important challenge faced in practical applications is that the center cannot be determined automatically, and manual intervention is required to determine the center point, which increases the influence of human factors and the complexity of operation. Innovations are made to address these two deficiencies; the specific steps are as follows:
[0019] Step d11: Construct the distance function and calculate the sample point x i The local density of is:
[0020]
[0021] Where: KNN(xi) represents the set of k nearest neighbor points of sample point xi, d(xi,xj) represents the distance between sample points xi and xj, σ=max d(xi,xj),xi,xj∈X;
[0022] Step d12: The local density is changed, so the repulsion value of the sample point also changes accordingly. The repulsion value of the sample point xi and its neighboring points and the points with higher density is calculated. The specific formula is:
[0023]
[0024] Where: d(xi,xj) represents the Euclidean distance between sample points xi and xj; KNN'(xi) = KNN(xi)∪xi; HD(xi) = {xk|ρk>ρi, xk∈X};
[0025] By re-evaluating the relationship between data points by considering the characteristics of neighboring data points, the relative position and density differences of data points can be measured more accurately, thereby more accurately distinguishing the center point from ordinary data points, and improving the accuracy and stability of identifying the center point;
[0026] Step d13: Propose a new center evaluation index and calculate the center evaluation index of sample point xi. The specific formula is:
[0027] γi=ρi 2 ×δi
[0028] Where: i and δ i are the local density and the repulsion value, respectively;
[0029] Step d14: Use the center evaluation index to calculate the candidate center set. The specific formula is:
[0030]
[0031] Where: and are the means of local density and repulsion value, respectively;
[0032] Step d15: Arrange the Centers in ascending order according to the γ value, calculate the difference in the γ value between two adjacent points, and determine the point interval g. The specific formula is:
[0033] gi=γi +1 -γi
[0034] Step d16: Calculate the point interval gi of the sample point xi in Centers and the mean of gi And traverse Centers to find the satisfying The sample point with the smallest γ value among the sample points is marked as x0;
[0035] Step d17: Add all points in Centers that satisfy γi≥γ0 to the set final_centers;
[0036] Step d2: Parameter estimation: using the training samples to adjust the width parameter of the algorithm model and the weight of each center point;
[0037] Step d3: Decision boundary construction: After the new sample is mapped by the algorithm model, the optimal hyperplane is found for classification;
[0038] Step e, calculating the acceleration signal test set of six sleeping postures, namely, supine, prone, right tree trunk, right fetal, left tree trunk, and left fetal, to obtain the final sleeping posture recognition result.
[0039] Preferably, the specific formula of the sleeping posture recognition algorithm model in step d is:
[0040]
[0041] Where LD(xi,xj) 2 for:
[0042]
[0043] The parameter σ is the radial range of the model. The larger the σ, the smaller the range. n is the data dimension.
[0044] Preferably, in the step e, for each sleeping posture, the historical acceleration signal data of the experimenter lying on the three-axis acceleration sensor in the sleeping posture is continuously collected within one minute at a sampling frequency of 50 Hz.
[0045] Preferably, the proposed center evaluation index is used to quantify the difference in characteristics between data points. By calculating the separation value between data points, the center point can be automatically selected, thereby reducing human intervention and improving the automation and applicability of the algorithm. This innovation not only simplifies the operation process, but also enhances the clustering results. The algorithm steps are as follows: Step A1: Calculate the local density ρi and the repulsive group value δi of the sample point; Step A2: Calculate the central evaluation index γi of the sample point; Step A3: Calculate the average local density of sample points and the average repulsion value Step A4: Filter the candidate center set and sort the Centers in ascending order according to γi; Step A5: Calculate the cutoff value gi of the sample points in Centers; Step A6: Traverse Centers to find the satisfying The sample point with the smallest γ value among the sample points is marked as x0; Step A7: Filter out all sample points in Centers that satisfy γi≥γ0 and add them to the set final_centers.
[0046] Compared with the prior art, the present invention has the following beneficial effects:
[0047] The present invention only uses the ADXL345 three-axis acceleration sensor to generate acceleration signals of different sleeping positions, constructs a distance function and a sleeping position recognition algorithm model to realize the recognition of six sleeping positions, greatly reduces the number of signals and the complexity of the system, reduces the resources of system acquisition, transmission, and calculation, realizes privacy protection, and the sleeping position recognition accuracy rate reaches 98.7%; compared with the recognition method of images or videos, it solves the problem of privacy leakage, and compared with the recognition method of flexible sensors, it solves the problem of low accuracy; the present method is simple to install and debug, has a high recognition accuracy rate, and provides good reliability support for subsequent scientific research personnel. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 A flowchart of a sleeping posture detection and recognition method of the present invention;
[0049] Figure 2 This is a step diagram for building a sleeping posture recognition algorithm model;
[0050] Figure 3 To construct the distance function step diagram;
[0051] Figure 4 It is a schematic diagram of the algorithm model structure of the present invention;
[0052] Figure 5 Schematic diagram of mapping the original space to the high-dimensional feature space;
[0053] Figure 6 This is a schematic diagram of sleeping posture recognition rate; DETAILED DESCRIPTION
[0054] In order to make the above-mentioned objects, features and advantages of the present invention more clearly understood, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. Several embodiments of the present invention are shown in the accompanying drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein.
[0055] In a preferred embodiment of the present invention, based on the above problems existing in the prior art, a sleeping posture detection and recognition method is provided, which can realize accurate sleeping posture recognition by only using a three-axis acceleration sensor to generate acceleration signals of different sleeping postures, wherein:
[0056] Use the ADXL345 three-axis acceleration sensor, which has high sensitivity and can collect acceleration signal changes of less than 1.0° tilt angle;
[0057] For the ADXL345 three-axis accelerometer, use the Verilog hardware programming language to configure it as follows:
[0058] Set the sampling rate of the clock: The ADXL345 three-axis accelerometer supports external clock input. The sampling rate of the clock SCl is set to 50Hz through the Verilog hardware programming language to control the data acquisition speed and accuracy of the ADXL345 three-axis accelerometer;
[0059] Set the reference voltage: The reference voltage of the ADXL345 three-axis accelerometer is provided by an external reference circuit. By setting the reference voltage parameters, the signal gain and accuracy of the ADXL345 three-axis accelerometer can be controlled.
[0060] Set filter type and parameters: The ADXL345 three-axis accelerometer integrates a digital filter module that supports multiple filter types and custom filters. By setting the filter type and parameters, the signal filtering effect and frequency band characteristics of the ADXL345 three-axis accelerometer are controlled, and the converted digital signal is filtered to improve the accuracy and stability of the data.
[0061] The above configuration is done through I 2C interface to send the corresponding commands and parameters to the ADXL345 three-axis accelerometer; after the configuration is completed, the ADXL345 three-axis accelerometer is started and the I 2 C interface reads the collected acceleration signal data.
[0062] A sleeping posture detection and recognition method of this embodiment is shown in the flowchart as follows: Figure 1 As shown, the method comprises the following steps:
[0063] Step a, laying a three-axis acceleration sensor in the mattress in advance, obtaining acceleration signals of different sleeping postures of the human body, and generating original acceleration signal data;
[0064] Step b, preprocessing the original acceleration data signal, and using the preprocessed result as a data set;
[0065] Step c, dividing the data set into a training set, a validation set and a test set, wherein the training set is used to train model parameters, the validation set is used to test prediction accuracy, and the test set is used to predict sleeping posture;
[0066] Construct a sleeping posture recognition algorithm model such as Figure 4 As shown in (b), the function of the classification hyperplane can be f(x) = <ω.x> + b, where ω is the normal vector perpendicular to the classification function line (<.> represents the inner product between vectors), x(xj,xk) is a point on the plane, and the points satisfying f(x) = 0 are assumed to be on the hyperplane (there are no sample points on the hyperplane itself). For all points satisfying f(x) < 0 (the five-pointed star in the figure) corresponding to f(x) = -1, and all points satisfying f(x) > 0 (the rectangle in the figure) corresponding to f(x) = 1, they are called model hit points;
[0067] The algorithm model is to map (usually nonlinearly) the original data set (usually linearly inseparable) to a higher-dimensional space (here the dimension refers to the dimension in mathematics) so that the sample set can be linearly separable in the high-dimensional space. In this way, finding the optimal classification hyperplane in this high-dimensional space is to find the optimal classification algorithm. Figure 5 As shown in the figure, mapping the two sample sets (circles and stars) in the original space to the high-dimensional feature space (three-dimensional) realizes the linear separability of the hyperplane, avoiding the need to calculate the nonlinear surface for classification in the original space (two-dimensional);
[0068] Step d: Use the constructed sleeping posture recognition algorithm model; the specific implementation steps are as follows:
[0069] Step d1: Center point selection: determine the center point of the algorithm model in the training set and construct a distance function such as Figure 3 As shown, the specific steps are as follows:
[0070] Step d11: Calculate the sample point x i The local density of is:
[0071]
[0072] Where: KNN(xi) represents the set of k nearest neighbor points of sample point xi, d(xi,xj) represents the distance between sample points xi and xj, σ=max d(xi,xj),xi,xj∈X;
[0073] Step d12: Calculate the repulsion value of the sample point xi and its neighboring points and points with higher density. The specific formula is:
[0074]
[0075] Where: d(xi,xj) represents the Euclidean distance between sample points xi and xj; KNN'(xi) = KNN(xi)∪xi; HD(xi) = {xk|ρk>ρi, xk∈X};
[0076] Step d13: Calculate the central evaluation index of sample point xi. The specific formula is:
[0077] γi=ρi 2 ×δi
[0078] Where: i and δ i are the local density and the repulsion value, respectively;
[0079] Step d14: Use the center evaluation index to calculate the candidate center set. The specific formula is:
[0080]
[0081] Where: and are the means of local density and repulsion value, respectively;
[0082] Step d15: Arrange the Centers in ascending order according to the γ value, calculate the difference in the γ value between two adjacent points, and determine the point interval g. The specific formula is:
[0083] gi=γi +1 -γi
[0084] Step d16: Calculate the point interval gi of the sample point xi in Centers and the mean of gi And traverse Centers to find the satisfying The sample point with the smallest γ value among the sample points is marked as x0;
[0085] Step d17: Add all points in Centers that satisfy γi≥γ0 to the set final_centers;
[0086] Step d2: Parameter estimation: using the training samples to adjust the width parameter (also called Gaussian kernel bandwidth) of the algorithm model and the weight of each center point;
[0087] Step d3: Decision boundary construction: After the new sample is mapped by the algorithm model, the optimal hyperplane is found for classification;
[0088] Step e: Calculate the acceleration signal test set of six sleeping postures: supine, prone, right tree trunk, right fetal, left tree trunk, and left fetal, and obtain the final sleeping posture recognition result. Figure 6 shown.
[0089] The specific formula of the sleeping posture recognition algorithm model in step d is:
[0090]
[0091] Where LD(xi,xj) 2 for:
[0092]
[0093] The parameter σ is the radial range of the model. The larger the σ, the smaller the range. n is the data dimension.
[0094] In the step e, for each sleeping posture, the three-axis acceleration sensor uses a sampling frequency of 50 Hz to continuously collect the historical acceleration signal data of the experimenter lying on the three-axis acceleration sensor in the sleeping posture within one minute.
[0095] From the data in Table 1, we can see that the constructed distance function and sleeping posture recognition algorithm have achieved excellent results in comparison with different algorithms. The accuracy of the constructed distance function and sleeping posture recognition algorithm is 3.7%, 6.2%, and 5.4% higher than that of Yolo target detection algorithm, OpenPose single-person and multi-person posture detection algorithm, support vector machine (SVM) and genetic algorithm (GA), respectively.
[0096] The above are only preferred embodiments of the present invention, and are not intended to limit the implementation methods and protection scope of the present invention. Those skilled in the art should be aware that all solutions obtained by equivalent substitutions and obvious changes made using the description and illustrations of the present invention should be included in the protection scope of the present invention.
Claims
1. A sleeping posture detection and recognition method, characterized in that: The following steps are involved: Step a, laying a three-axis acceleration sensor in the mattress in advance, obtaining acceleration signals of different sleeping postures of the human body, and generating original acceleration signal data; Step b, preprocessing the original acceleration signal data, and using the preprocessed result as a data set; Step c, dividing the data set into a training set, a validation set and a test set, wherein the training set is used to train model parameters, the validation set is used to test prediction accuracy, and the test set is used to predict sleeping posture; Step d: construct a sleeping posture recognition algorithm model; the specific implementation steps are as follows: Step d1: Center point selection: determine the center point of the algorithm model in the training set and construct a distance function; the specific steps are as follows: Step d11: Calculate the sample point x i The local density of is: Where: KNN(x i ) represents the sample point x i The k nearest neighbor point set of d(x i , x j ) represents the sample point x i and x j The distance between them, σ=max d(x i , x j ), x i , x j ∈X; Step d12: Calculate the sample point x i The repulsion value of its neighboring points and higher density points is as follows: Where: d(x i , x j ) represents the sample point x i to x j The Euclidean distance between i )=KNN(x i )∪x i ; HD(x i )={x k |ρ k >ρ i , x k ∈X}; Step d13: Calculate the sample point x i The central evaluation index is: Y i =ρ i 2 ×d i Where: i and δ i are the local density and the repulsion value, respectively; Step d14: Use the center evaluation index to calculate the candidate center set. The specific formula is: Where: and are the means of local density and repulsion value, respectively; Step d15: Arrange the Centers in ascending order according to the γ value, calculate the difference in the γ value between two adjacent points, and determine the point interval g. The specific formula is: gi=γi+1-γi Step d16: Calculate the point interval gi of the sample point xi in Centers and the mean of gi And traverse Centers to find the satisfying The sample point with the smallest γ value among the sample points is marked as x0; Step d17: All the nodes in Centers that satisfy Y i Points ≥Y0 are added to the set final_centers; Step d2: Parameter estimation: using the training samples to adjust the width parameter of the algorithm model and the weight of each center point; Step d3; Decision boundary construction: After the new sample is mapped by the algorithm model, the optimal hyperplane is found for classification; Step e, calculating the acceleration signal test set of six sleeping postures, namely, supine, prone, right tree trunk, right fetal, left tree trunk, and left fetal, to obtain the final sleeping posture recognition result.
2. The sleeping posture detection and recognition method according to claim 1, characterized in that: The specific formula of the sleeping posture recognition algorithm model in step d is: Where LD(x i ,x j ) 2 for: The parameter σ is the radial range of the model. The larger the σ, the smaller the range. n is the data dimension.
3. A sleeping posture detection and recognition method according to claim 1, characterized in that: In the step e, for each sleeping posture, the three-axis acceleration sensor uses a sampling frequency of 50 Hz to continuously collect the historical acceleration signal data of the experimenter lying on the three-axis acceleration sensor in the sleeping posture within one minute.
