A sleeping posture recognition method based on deep transfer learning
Through deep transfer learning and improved ResNet18 network model, combined with histogram representation and attention mechanism, the problem of sleeping posture recognition is solved, and high accuracy and robust sleeping posture recognition is achieved, which is suitable for multi-user expansion and online maintenance.
Patent Information
- Application Number
- CN202210688994.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-17
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2042-06-17
AI Technical Summary
The prior art is difficult to effectively identify sleeping postures through stress data, especially when the number of data samples is insufficient.
The sleeping position recognition method based on deep transfer learning is adopted, and data is collected through the pressure sensing device, pre-processed and normalized, converted into a bar chart, and the improved ResNet18 network model is used for identification, combining transfer learning and attention mechanism, and online adaptive maintenance is performed.
It improves the accuracy and robustness of sleeping posture recognition, is suitable for multi-user expansion and online maintenance of models, reduces training time and improves recognition rate.
Smart Images

Figure CN115062704B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of transfer learning and neural network technology, and specifically to a sleeping posture recognition method based on deep transfer learning. Background Art
[0002] Sleep is one of the factors that affect human health. Sleep quality is often linked to the height of the pillow. Studies have shown that the optimal pillow height for people lying on their side should be greater than the optimal pillow height for people lying flat. The key to designing a highly adaptive pillow is sleeping posture recognition. Currently known sleeping posture recognition methods include obtaining sleeping posture images through a camera, which can effectively identify sleeping postures using image processing technology, but involve privacy issues; another solution is to obtain pressure data from a thin film pressure sensor placed on the mattress to identify sleeping postures. Due to differences between individual users (such as weight, shoulder width) and a lack of effective sample quantity, it is difficult to effectively classify sleeping postures through pressure data. To address this problem, the present invention proposes a sleeping posture recognition solution based on deep transfer learning.
[0003] In recent years, with the development of deep learning technology, solving practical problems in real life through deep learning has become an important research direction. Deep learning can automatically extract more expressive features and has the advantages of strong learning ability, wide coverage, good adaptability, and high portability. Therefore, deep learning technology is usually used to process images. However, deep learning has problems such as large amount of calculation and complex model design. Training a perfect model requires a large amount of data. The data used for sleeping position recognition is a small sample, making it difficult to build a model that can effectively recognize sleeping positions.
[0004] In order to solve the problem of insufficient effective data, we introduced the method of transfer learning. Transfer learning is to transfer knowledge from one field (source field) to another field (target field) so that the target field can achieve better learning results. Deep transfer learning does not require training models from scratch for new tasks, saving time costs; pre-trained models are usually trained on large data sets, which invisibly expands our training data, making the model more robust and more generalizable.
[0005] In summary, in order to effectively identify sleeping posture through pressure data, designing a sleeping posture recognition method based on deep transfer learning has important academic significance and value. Summary of the invention
[0006] The technical problem to be solved by the present invention is to provide a sleeping posture recognition method based on deep transfer learning, which is used to introduce transfer learning to perform online adaptive maintenance on the sleeping posture recognition model and recognize the user's sleeping posture.
[0007] In order to solve the above technical problems, the present invention provides a sleeping posture recognition method based on deep transfer learning, including the following process:
[0008] Step 1: Collect the pressure data set of the target individual through the pressure sensing device and perform preprocessing and normalization in the host computer, and then use the normalized data to draw a columnar pressure atlas of the target individual; randomly select a group of optimal weight parameters of the sleeping posture recognition model and import them into the sleeping posture recognition model, freeze the neuron weight parameters except the residual block and the fully connected layer in the sleeping posture recognition model, and then input the columnar pressure atlas of the target individual into the sleeping posture recognition model to train the target individual model. After running 5 epochs, save the weight parameter with the highest recognition accuracy to obtain the sleeping posture recognition model of the target individual;
[0009] Step 2: A set of pressure data of the target individual is collected in real time through the pressure sensing device and sent to the host computer for preprocessing and normalization. The normalized data is used to draw a columnar pressure graph of the target individual, and then the columnar pressure graph of the target individual is input into the sleeping posture recognition model of the target individual to output the sleeping posture recognition result of the target individual: lying flat or lying on the side.
[0010] As an improvement of the sleeping posture recognition method based on deep transfer learning of the present invention:
[0011] The set of pressure data is pressure data of the shoulder and neck of the target individual collected by the pressure sensing device once when the target individual lies flat or lies on the side, and each set of pressure data includes 9 features; the pressure data set includes 20 sets of pressure data when the target individual lies flat or lies on the side;
[0012] The preprocessing is to retain the data with a value range of 300 to 4000 in the pressure data set, and delete the pressure data with missing data and values out of range (less than 300 or greater than 4000);
[0013] The normalization process is:
[0014]
[0015] Where max is the maximum value of each feature in the pressure data, min is the minimum value of each feature in the pressure data, and x is the feature value currently being processed;
[0016] As a further improvement of the sleeping posture recognition method based on deep transfer learning of the present invention:
[0017] The sleeping posture recognition model is an improved ResNet18 network. A convolutional attention module is added to the first layer and the last layer of the convolutional layer of the ResNet18 network, and a BN layer is added after the average pooling layer. The improved ResNet18 network includes a convolutional layer, a convolutional attention module, a maximum pooling layer, four residual blocks, a convolutional attention module, an average pooling layer and a fully connected layer in sequence; the output dimension of the fully connected layer is 2.
[0018] As a further improvement of the sleeping posture recognition method based on deep transfer learning of the present invention:
[0019] The process of obtaining the optimal weight parameters of the sleeping posture recognition model is as follows: 20 groups of data sets B are established, and the source domain data sets in the data set B are input into the sleeping posture recognition model in groups in sequence. The loss function adopts cross entropy, and the sleeping posture recognition model is trained through the training set and test set of the source domain data set. After running 20 epochs, the model weight parameters with the highest recognition accuracy are saved, thereby obtaining 20 groups of optimal weight parameters of the sleeping posture recognition model.
[0020] As a further improvement of the sleeping posture recognition method based on deep transfer learning of the present invention:
[0021] The establishment process of the data set B is as follows: a total of 20 individual data sets of pressure data of the shoulders and necks in lying flat and lying on the side are collected through a pressure sensing device, and the lying flat is marked as "0" and the lying side is marked as "1" according to the sleeping posture mark classification label; then the pressure data in the individual data sets are preprocessed and normalized, and then the normalized individual data sets are successively subjected to histogram conversion processing to obtain a columnar pressure atlas, and the columnar pressure atlas is divided into a lying flat histogram atlas or a lying side histogram atlas according to the classification label; the columnar pressure atlas is divided into 20 data sets according to individuals, and the lying flat histogram atlas and the lying side histogram atlas in each data set are randomly divided into a training set and a test set in a ratio of 8:2, and one of the 20 data sets is taken in turn as the target domain data set, and the remaining 19 are combined as a source domain data set, and each target domain data set and source domain data set includes a training set and a test set, so as to obtain the data set B containing 20 groups of data.
[0022] As a further improvement of the sleeping posture recognition method based on deep transfer learning of the present invention:
[0023] The training of the target domain data set includes sequentially importing the optimal weight parameters into the sleeping posture recognition model, and the target domain data set in the data set B is correspondingly used as the input of the sleeping posture recognition model. Each group of target domain data sets performs the following operations: freezing the neuron weight parameters except the residual block and the fully connected layer in the sleeping posture recognition model, training the neural network model using the target domain training set, running 5 epochs, recording the recognition accuracy of each epoch, taking the model with the highest recognition accuracy and saving it; and then inputting the target domain test set into the trained model to obtain the recognition accuracy of the model corresponding to the test set in the current target domain data set.
[0024] As a further improvement of the sleeping posture recognition method based on deep transfer learning of the present invention:
[0025] The pressure sensing device includes a pressure sensor, which is connected to a host computer signal through a microcontroller unit MCU. The pressure sensors are respectively placed on the left and right shoulders and the back of the neck of the person being collected.
[0026] The beneficial effects of the present invention are mainly reflected in:
[0027] 1. The present invention converts the collected 9 columns of pressure data into a columnar profile distribution diagram. Compared with directly applying numerical data, the columnar profile diagram can more effectively extract the pressure distribution characteristics under different sleeping positions, which helps to improve the accuracy of sleeping position recognition.
[0028] 2. The present invention introduces transfer learning to perform online adaptive maintenance of the sleeping posture recognition model. First, the sleeping posture recognition model is pre-trained based on the basic sample library, and then the pre-trained weight parameters are imported into the deep transfer learning model. By constructing an improved maximum mean difference regularization term loss function, while adaptively extracting the common features of the sleeping posture data, the difference between the individual samples and the basic sample library features is continuously improved, effectively solving the problem of low recognition rate caused by the difference between the new test samples and the basic sample library features. This training method greatly improves the generalization performance of the model and is very suitable for online maintenance and multi-user expansion of the model.
[0029] 3. The present invention improves ResNet18 by adding the CBAM attention mechanism to increase the model's attention to key features. The performance of the network is greatly improved, the convergence speed is faster, and the recognition rate and robustness are better. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The specific implementation modes of the present invention are further described in detail below with reference to the accompanying drawings.
[0031] Figure 1 It is a flowchart of a sleeping posture recognition method based on deep transfer learning of the present invention;
[0032] Figure 2 is a schematic diagram of a target domain and a source domain dataset B of the present invention;
[0033] Figure 3 It is a structural schematic diagram of the sleeping posture recognition model of the present invention;
[0034] Figure 4 It is an example diagram of a bar graph of pressure data of the present invention. DETAILED DESCRIPTION
[0035] The present invention is further described below in conjunction with specific embodiments, but the protection scope of the present invention is not limited thereto:
[0036] Embodiment 1: A sleeping posture recognition method based on deep transfer learning, such as Figure 1As shown, the pressure data of the shoulders of the body in the sleeping state is obtained for preprocessing and normalization; then the normalized data is used to draw a bar graph; the data set of the drawn bar graph is divided into a source domain data set and a target domain data set according to individuals, and the source domain data set and the target domain data set are divided into a training set and a test set; then the source domain data set is used to train the improved ResNet neural network to obtain the pre-trained weight parameters, and then the target domain training set is combined with the improved ResNet neural network loaded with the pre-trained weight parameters through the deep transfer learning method to train the sleeping posture type of the samples in the target domain test set, including the following steps:
[0037] S1. Collect pressure data
[0038] The pressure data of the shoulder and neck in different sleeping positions (lying flat and lying on the side) are collected through a pressure sensing device. The pressure sensing device includes a pressure sensor. The pressure sensor is connected to the host computer signal through a microcontroller unit MCU. The pressure sensor uses 9 FSR resistive film pressure sensors to collect the pressure values of the shoulder and neck in the lying state. They are placed on the left and right shoulders and back of the neck of the person being collected. The resistance of the pressure sensor changes linearly with the pressure, and the resistance is converted into a voltage signal through a voltage conversion module and sent to the MCU (STM32F103RCT6 of STMicroelectronics (ST)). After obtaining the voltage signal, the MCU sends the 9 pressure data to the host computer in real time for storage and further processing.
[0039] A total of 20 people participated in the data collection, that is, a total of 20 individual data sets. The pressure sensing device collected the pressure data of the shoulders and back of the neck of the subjects in three positions: lying on the left side, lying flat, and lying on the right side as samples. Then each sample was classified and labeled according to the sleeping position. Lying flat was marked as "0" and lying on the side was marked as "1". Both lying on the left side and lying on the right side belong to lying on the side. Each individual data set contains 9 features (i.e. corresponding to the pressure data collected by 9 pressure sensors).
[0040] Then, the collected pressure data (samples) are preprocessed: the data with a value range of 300 to 4000 in the pressure data are retained, and the pressure data with missing data and values out of range (less than 300 or greater than 4000) are deleted. The preprocessed pressure data set includes 20 individual data sets, each of which contains samples of 9 features (ranging from [300-4000]) and each sample has a corresponding classification label ("0" or "1"); the specific information of the pressure data set is shown in Table 1:
[0041] Table 1 Detailed information of the pressure dataset
[0042]
[0043] S2. Convert pressure data into a bar graph
[0044] S2.1. Normalize each sample in the pressure data set:
[0045]
[0046] Where max is the maximum value of each column of individual data (i.e., the maximum value of each feature in the 20 individual data sets), min is the minimum value of each column of individual data (i.e., the minimum value of each feature in the 20 individual data sets); x is the feature value currently being processed; the purpose of normalization processing is to standardize the deviation of individual data so that the pressure value is mapped to between [0-1];
[0047] The normalized data set includes 20 individual data sets, each of which contains 9 groups of normalized pressure data and each has a corresponding classification label ("0" or "1").
[0048] S2.1. Convert to a bar graph
[0049] The 20 normalized individual data sets were transformed into histograms in turn using MATLAB software, and a total of 5109 histograms were obtained:
[0050] First, a normalized personal data set is loaded into the MATLAB workspace using the "load" function, and the 9 sets of normalized pressure data are plotted into a bar graph using the "bar" function, and output as a PNG format image, such as Figure 4 As shown, the horizontal axis of the bar graph represents the feature bit number 1 to 9, and the vertical axis of the bar graph represents the normalized pressure value. Among them, the bar graph represents a 9*1 vector, and the bar graph is a binary image with a resolution of 224×224. In order to make the bar graph have better observability, stronger recognition performance and easy neural network training, and because the pressure data collected in step 1 are all within the range of 300 to 4000, the "axis" function is used in the graphic output of the bar graph to limit the numerical range of the horizontal axis to x∈[0,8] (representing 9 features) and the numerical range of the vertical axis to y∈[0,1] (normalizing the data of 300 to 4000 to 0 to 1). In this way, the bar graph occupies more pixels, has fewer white edges and non-color elements, and improves the recognition and classification performance of subsequent neural network training;
[0051] Then, according to the classification label in the sample ("0" means lying flat, "1" means lying sideways), the bar graph is stored and output to the lying flat bar graph atlas or the lying side bar graph atlas. Thus, a bar graph pressure atlas of 20 people is obtained;
[0052] S3. Divide the columnar pressure atlas into 20 sets of data according to the individuals of the subjects, and the flat-lying columnar atlas and the side-lying columnar atlas in each set of data in the data set A are randomly divided into training sets and test sets in a ratio of 8:2. Each set of data in the data set A is recorded as a1 to a20, and one set of a1 to a20 is taken as the target domain data set in turn, and the remaining 19 sets are combined as the source domain data set, so as to obtain a data set B containing 20 sets of data. Each set of data in the data set B is recorded as B1 to B20, and B1 to B20 each contains a target domain data set and a source domain data set. Each target domain data set and source domain data set includes a training set and a test set. The structure of the data set B is as follows Figure 2 shown.
[0053] S4. Build a sleeping posture recognition model
[0054] The sleeping posture recognition model is constructed based on the ResNet18 network. The convolutional attention module is added to the first layer of the ResNet18 network and the last layer of the convolutional layer of the ResNet18 network. The BN layer is added after the average pooling layer. The BN layer can speed up the training of the model and prevent overfitting. The network structure of the sleeping posture recognition model is as follows: Figure 3 As shown in the figure, it includes a convolutional layer, a convolutional attention module (CBAM1), a maximum pooling layer, four residual blocks, a convolutional attention module (CBAM2), an average pooling layer and a fully connected layer in sequence; the convolutional layer is composed of a convolutional kernel of size 7×7×64, with a padding depth of 3 and a stride parameter of 2; the pooling window size of the maximum pooling layer is 3×3, the padding depth is 1, and the stride parameter is 2; the window size of the average pooling layer is 1×1; the four residual blocks all contain two basic blocks, and there are 4 types of residual blocks:
[0055] The first type of residual block is composed of four convolution kernels of size 3×3×64 connected in sequence;
[0056] The second type of residual block is composed of four convolution kernels of size 3×3×128 connected in sequence;
[0057] The third type of residual block is composed of four convolution kernels of size 3×3×256 connected in sequence;
[0058] The fourth type of residual block is composed of four convolution kernels of size 3×3×512 connected in sequence;
[0059] Fine-tune the fully connected layer (FC) at the end of the ResNet18 network and change the output dimension to 2 to obtain the initial sleeping posture recognition model.
[0060] S5. Training and testing of sleeping posture recognition model
[0061] S5.1. Training with source domain dataset
[0062] The sleeping posture recognition model is trained using the source domain dataset to obtain the optimal weight parameters. Specifically, the source domain datasets B1 to B20 are grouped as the input of the sleeping posture recognition model, the loss function uses cross entropy, the optimizer uses Adam, and the learning rate is set to 0.001. The neural network model is trained using the training set and test set of the source domain dataset. After running 20 epochs, the model weight parameters with the highest recognition accuracy are saved, where one epoch means using all samples in the training set for training once.
[0063] Finally, the optimal weight parameters C1-C20 of 20 groups of sleeping posture recognition models corresponding to the source domain data sets B1 to B20 are obtained.
[0064] Accuracy is the ratio of positive and negative predictions to accuracy:
[0065]
[0066] Among them, TP means predicting a positive sample as a positive sample, FN means predicting a positive sample as a negative sample, FP means predicting a negative sample as a positive sample, and TN means predicting a negative sample as a negative sample;
[0067] S5.2. Training using the target domain dataset
[0068] Import the optimal weight parameters C1-C20 into the sleeping position recognition model in sequence, and use the target domain data sets B1 to B20 as the input of the sleeping position recognition model accordingly. For example, the target domain data set B1 is used as the input of the sleeping position recognition model with the optimal weight parameter C1, the target domain data set B2 is used as the input of the sleeping position recognition model with the optimal weight parameter C2, and so on. Perform the following operations on each set of target domain data sets:
[0069] Freeze the neuron weight parameters except the residual block and the fully connected layer in the sleeping posture recognition model, use the target domain training set to train the neural network model, run 5 epochs, record the recognition accuracy of each epoch, and take the model with the highest recognition accuracy and save it;
[0070] Then, the target domain test set of B1 to B20 is input into the trained model to obtain the recognition accuracy of the model corresponding to the test set in the current target domain data set. Finally, the recognition accuracy of 20 groups of models is obtained for the target domain data set of B1 to B20. The average accuracy of the first 5 epochs of the target domain training set and the accuracy of the target domain test set are recorded. The results are shown in Table 2, where one epoch means that all samples in the training set are used for training once.
[0071] Table 2 Average accuracy of the target domain training set after running 5 epochs and the average accuracy of the test set
[0072]
[0073] It can be seen from Table 2 that the present invention converts the pressure data set into a columnar pressure atlas and uses the deep transfer learning method for training, which has a significant effect and reduces the time cost. The first epoch can achieve a training accuracy of 99%; the model after 5 epochs can achieve a recognition accuracy of more than 99% when predicting the target domain test set. In addition, through transfer learning, frozen layer training after loading weight parameters also facilitates the expansion of subsequent models to new individuals.
[0074] S6. Online use:
[0075] S6.1. Before actual use, a sleeping posture recognition model suitable for the target individual needs to be built in advance. The specific process is as follows:
[0076] In step S1-step S5, the sleeping posture data of 20 individuals are obtained, and the data of one of the individuals is taken as the target domain data set, and the remaining individuals are combined as the source domain data set. First, the source domain is trained, and after obtaining the optimal weight parameters, the target domain training set is trained through the transfer learning method, and finally the target domain test set is tested. The experimental results show that the method is effective. In actual use, this method is used for sleeping posture recognition of the target individual (that is, the actual target individual replaces the target domain used in the experiment). Before actual use, a sleeping posture recognition model suitable for the target individual needs to be pre-built. The specific process is:
[0077] The shoulder and neck pressure data of the target individual in different sleeping positions (20 groups each for lying flat and lying on the side) were collected through a pressure sensing device, and preprocessed and normalized. The normalized data were then converted into a bar graph to obtain a bar graph pressure atlas of the target individual.
[0078] Take any one of the 20 groups of optimal weight parameters C1-C20 of the model in step S5.1. In this embodiment, take C1 as an example, import the optimal weight parameter C1 of the model into the sleeping posture recognition model, freeze the neuron weight parameters except the residual block and the fully connected layer in the sleeping posture recognition model, take the columnar pressure atlas of the target individual to train the sleeping posture recognition model, and after running 5 epochs, save the weight parameter M of the sleeping posture recognition model with the highest recognition accuracy as the target individual, so as to obtain the sleeping posture recognition model of the target individual.
[0079] S6.2. In actual use, the shoulder and neck pressure data of the target individual is collected in real time through the pressure sensing device and sent to the host computer for preprocessing and normalization. The normalized data is then used to draw a bar chart of the target individual. The host computer converts the received real-time data into a bar chart and inputs it into the sleeping position recognition model of the target individual obtained in step 6.2. Finally, the sleeping position recognition result can be obtained in real time.
[0080] This can effectively speed up model training and obtain a more accurate model. It also facilitates subsequent model maintenance and expansion of new individuals.
[0081] experiment:
[0082] 1. To demonstrate the effectiveness of converting the pressure data set into a histogram, the pressure data set obtained in step 1 of Example 1 is used to train and test the sleeping posture recognition model;
[0083] 2. To demonstrate the effectiveness of the sleeping posture recognition model constructed by improving ResNet18, the same training and testing are performed according to step 5 in Example 1 using the ResNet18 network;
[0084] 3. To demonstrate the effectiveness of transfer learning, the target domain training set and test set are trained and tested without importing weight parameters.
[0085] The experimental results are shown in Table 2. The first row is the present invention; one epoch means using all samples in the training set for training once.
[0086] Table 3 Comparison of experimental results
[0087]
[0088] It can be seen from Table 2 that the present invention has a significant effect after converting the pressure data set into a columnar pressure atlas. The first epoch can achieve a recognition accuracy of 99%, improving the training accuracy of the model; the model before and after the improvement is compared, and the addition of the attention module can speed up the training of the model and achieve a higher recognition accuracy; the present invention reduces the time cost through deep transfer learning, and the model after 5 rounds of epochs can achieve a recognition accuracy of more than 99% when predicting the target domain test set, effectively solving the problem of insufficient recognition rate caused by the difference between the characteristics of the new test sample and the basic sample library. In addition, through transfer learning, the frozen layer training after loading the weight parameters is also convenient for the subsequent model to expand new individuals. Therefore, the present invention adds an attention module on the basis of ResNet18, draws a bar chart of the pressure data measured by 9 pressure sensors, and divides the individuals into source domain and target domain, and then uses deep transfer learning technology for recognition and classification. The method can better speed up model training, improve training accuracy, and has high practical value.
[0089] The present invention pre-trains the deep learning model based on the basic sample library. In actual use, the weight parameters obtained based on the pre-training in the sample library are first imported into the neural network model through the deep transfer learning technology; then online training is performed in combination with the target domain dataset, which can effectively speed up the training of the model and obtain a higher-precision model. It is also convenient for the subsequent maintenance of the model and the expansion of new individuals.
[0090] Finally, it should be noted that the above examples are only some specific embodiments of the present invention. Obviously, the present invention is not limited to the above embodiments, and there are many variations. All variations that can be directly derived or associated with the content disclosed by a person skilled in the art should be considered as the protection scope of the present invention.
Claims
1. A sleeping posture recognition method based on deep transfer learning, characterized in that The process is as follows: Step 1: Collect the pressure data set of the target individual through the pressure sensing device and perform preprocessing and normalization in the host computer, and then use the normalized data to draw a columnar pressure atlas of the target individual; randomly select a group of optimal weight parameters of the sleeping posture recognition model and import them into the sleeping posture recognition model, freeze the neuron weight parameters except the residual block and the fully connected layer in the sleeping posture recognition model, and then input the columnar pressure atlas of the target individual into the sleeping posture recognition model to train the target individual model. After running 5 epochs, save the weight parameter with the highest recognition accuracy to obtain the sleeping posture recognition model of the target individual; The sleeping posture recognition model is an improved ResNet18 network. A convolutional attention module is added to the first layer and the last layer of the convolutional layer of the ResNet18 network, and a BN layer is added after the average pooling layer. The improved ResNet18 network includes a convolutional layer, a convolutional attention module, a maximum pooling layer, four residual blocks, a convolutional attention module, an average pooling layer and a fully connected layer in sequence; the output dimension of the fully connected layer is 2; Step 2: A set of pressure data of the target individual is collected in real time through the pressure sensing device and sent to the host computer for preprocessing and normalization. The normalized data is used to draw a columnar pressure graph of the target individual, and then the columnar pressure graph of the target individual is input into the sleeping posture recognition model of the target individual to output the sleeping posture recognition result of the target individual: lying flat or lying on the side.
2. The sleeping posture recognition method based on deep transfer learning according to claim 1, characterized in that: The set of pressure data is pressure data of the shoulder and neck of the target individual collected by the pressure sensing device once when the target individual lies flat or lies on the side, and each set of pressure data includes 9 features; the pressure data set includes 20 sets of pressure data when the target individual lies flat or lies on the side; The preprocessing is to retain the data in the pressure data set with a value range of 300 to 4000, and delete the pressure data with missing data and values out of range; the missing data and values out of range are less than 300 or greater than 4000; The normalization process is: Where max is the maximum value of each feature in the pressure data, min is the minimum value of each feature in the pressure data, and x is the feature value currently being processed.
3. The sleeping posture recognition method based on deep transfer learning according to claim 2, characterized in that: The process of obtaining the optimal weight parameters of the sleeping posture recognition model is as follows: 20 groups of data sets B are established, and the source domain data sets in the data set B are input into the sleeping posture recognition model in groups in sequence. The loss function adopts cross entropy, and the sleeping posture recognition model is trained through the training set and test set of the source domain data set. After running 20 epochs, the model weight parameters with the highest recognition accuracy are saved, thereby obtaining 20 groups of optimal weight parameters of the sleeping posture recognition model.
4. The sleeping posture recognition method based on deep transfer learning according to claim 3, characterized in that: The establishment process of the data set B is as follows: a total of 20 individual data sets of pressure data of the shoulders and necks in lying flat and lying on the side are collected through a pressure sensing device, and the lying flat is marked as "0" and the lying side is marked as "1" according to the sleeping posture mark classification label; then the pressure data in the individual data sets are preprocessed and normalized, and then the normalized individual data sets are successively subjected to histogram conversion processing to obtain a columnar pressure atlas, and the columnar pressure atlas is divided into a lying flat histogram atlas or a lying side histogram atlas according to the classification label; the columnar pressure atlas is divided into 20 data sets according to individuals, and the lying flat histogram atlas and the lying side histogram atlas in each data set are randomly divided into a training set and a test set in a ratio of 8:2, and one of the 20 data sets is taken in turn as the target domain data set, and the remaining 19 are combined as a source domain data set, and each target domain data set and source domain data set includes a training set and a test set, so as to obtain the data set B containing 20 groups of data.
5. The sleeping posture recognition method based on deep transfer learning according to claim 4, characterized in that: The training of the target domain data set includes sequentially importing the optimal weight parameters into the sleeping posture recognition model, and the target domain data set in the data set B is correspondingly used as the input of the sleeping posture recognition model. Each group of target domain data sets performs the following operations: freezing the neuron weight parameters except the residual block and the fully connected layer in the sleeping posture recognition model, training the neural network model using the target domain training set, running 5 epochs, recording the recognition accuracy of each epoch, taking the model with the highest recognition accuracy and saving it; and then inputting the target domain test set into the trained model to obtain the recognition accuracy of the model corresponding to the test set in the current target domain data set.
6. The sleeping posture recognition method based on deep transfer learning according to claim 5, characterized in that: The pressure sensing device includes a pressure sensor, which is connected to a host computer signal through a microcontroller unit MCU. The pressure sensors are respectively placed on the left and right shoulders and the back of the neck of the person being collected.
Citation Information
Patent Citations
Sleeping posture pressure image identification method based on HOG characteristic and machine learning
CN107330352A
Ward intelligent nursing identification method and system based on vision and pressure sensing
CN112287783A