CN115062704A - Sleeping posture identification method based on deep migration learning - Google Patents

Sleeping posture identification method based on deep migration learning Download PDF

Info

Publication number
CN115062704A
CN115062704A CN202210688994.5A CN202210688994A CN115062704A CN 115062704 A CN115062704 A CN 115062704A CN 202210688994 A CN202210688994 A CN 202210688994A CN 115062704 A CN115062704 A CN 115062704A
Authority
CN
China
Prior art keywords
data
pressure
model
lying
sleeping posture
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210688994.5A
Other languages
Chinese (zh)
Inventor
许海棋
王述
任佳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Sci Tech University ZSTU
Original Assignee
Zhejiang Sci Tech University ZSTU
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Sci Tech University ZSTU filed Critical Zhejiang Sci Tech University ZSTU
Priority to CN202210688994.5A priority Critical patent/CN115062704A/en
Publication of CN115062704A publication Critical patent/CN115062704A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/103Detecting, measuring or recording devices for testing the shape, pattern, colour, size or movement of the body or parts thereof, for diagnostic purposes
    • A61B5/11Measuring movement of the entire body or parts thereof, e.g. head or hand tremor, mobility of a limb
    • A61B5/1116Determining posture transitions
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/72Signal processing specially adapted for physiological signals or for diagnostic purposes
    • A61B5/7235Details of waveform analysis
    • A61B5/7264Classification of physiological signals or data, e.g. using neural networks, statistical classifiers, expert systems or fuzzy systems
    • A61B5/7267Classification of physiological signals or data, e.g. using neural networks, statistical classifiers, expert systems or fuzzy systems involving training the classification device
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B2562/00Details of sensors; Constructional details of sensor housings or probes; Accessories for sensors
    • A61B2562/02Details of sensors specially adapted for in-vivo measurements
    • A61B2562/0247Pressure sensors

Landscapes

  • Health & Medical Sciences (AREA)
  • Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Public Health (AREA)
  • Pathology (AREA)
  • Evolutionary Computation (AREA)
  • Veterinary Medicine (AREA)
  • Animal Behavior & Ethology (AREA)
  • Surgery (AREA)
  • Mathematical Physics (AREA)
  • Medical Informatics (AREA)
  • Theoretical Computer Science (AREA)
  • Physiology (AREA)
  • Heart & Thoracic Surgery (AREA)
  • Data Mining & Analysis (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Dentistry (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Computational Linguistics (AREA)
  • Fuzzy Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Psychiatry (AREA)
  • Signal Processing (AREA)
  • Measurement Of The Respiration, Hearing Ability, Form, And Blood Characteristics Of Living Organisms (AREA)

Abstract

The invention discloses a sleeping posture identification method based on deep migration learning, which comprises the steps of collecting a pressure data set of a target individual, carrying out preprocessing and normalization processing on the pressure data set, converting the pressure data set into a columnar pressure graph, and training by using a pre-trained sleeping posture identification model to obtain a sleeping posture identification model of the target individual; then, a group of pressure data of the target individual is collected in real time, is subjected to preprocessing and normalization processing and is converted into a columnar pressure graph, and then is input into a sleeping posture identification model of the target individual, so that a real-time identification result of the sleeping posture of the target individual is obtained and output: lying flat or lying on one side. The invention pre-trains the sleep posture identification model based on the basic sample library, then introduces the pre-trained weight parameters into the deep migration learning model, extracts the public characteristics of the sleep posture data in a self-adaptive manner, continuously improves the difference between the characteristics of the individual sample and the basic sample library, and effectively solves the problem of low identification rate caused by the difference between the characteristics of a newly-measured sample and the basic sample library.

Description

Sleeping posture identification method based on deep migration learning
Technical Field
The invention relates to the technical field of transfer learning and neural networks, in particular to a sleeping posture identification method based on deep transfer learning.
Background
Sleeping is one of the factors influencing human health, the sleeping quality is often hooked with the height of the sleeping pillow, and researches show that the optimal sleeping pillow height of a human lying on the side is higher than the optimal sleeping pillow height of the human lying on the flat side. The key point of designing the height self-adaptive pillow is sleeping posture recognition, the currently known sleeping posture recognition method is that a camera is used for acquiring a sleeping posture image, and the sleeping posture can be effectively recognized by utilizing an image processing technology, but the privacy problem is involved; the invention provides a sleeping posture identification scheme based on deep migration learning, aiming at the problem that sleeping postures are difficult to effectively classify through pressure data due to differences (such as weight and shoulder width) among users and lack of effective sample quantity.
In recent years, with the development of deep learning techniques, it is becoming an important research direction to solve practical problems in real life by deep learning, and deep learning can automatically extract more expressive features, and has the advantages of strong learning ability, wide coverage, good adaptability, high portability, and the like, so that images are generally processed by using deep learning techniques. However, deep learning has the problems of large calculation amount, complex model design and the like, a large amount of data is needed for training a perfect model, the data for recognizing the sleeping posture is a small sample, and the model capable of effectively recognizing the sleeping posture is difficult to construct.
The method introduces the transfer learning aiming at the problem of insufficient effective data quantity, wherein the transfer learning is to transfer the knowledge in one field (source field) to the other field (target field) so that the target field can obtain better learning effect. The model does not need to be trained from the beginning for a new task in deep migration learning, so that the time cost is saved; the pre-trained model is usually performed on a large data set, and the training data of the model is invisibly expanded, so that the model is more robust and has better generalization capability.
In conclusion, in order to effectively identify the sleeping posture through the pressure data, the method for identifying the sleeping posture based on the deep migration learning has important academic significance and value.
Disclosure of Invention
The invention aims to provide a sleeping posture identification method based on deep transfer learning, which is used for introducing transfer learning to perform online self-adaptive maintenance on a sleeping posture identification model and identifying the sleeping posture of a user.
In order to solve the technical problem, the invention provides a sleeping posture identification method based on deep transfer learning, which comprises the following processes:
step 1, acquiring a pressure data set of a target individual through a pressure sensing device, preprocessing and normalizing the pressure data set in an upper computer, and then drawing data after normalization to obtain a columnar pressure atlas of the target individual; randomly selecting one group of optimal weight parameters of the sleep posture identification model, introducing the optimal weight parameters into the sleep posture identification model, freezing neuron weight parameters except a residual block and a full connection layer in the sleep posture identification model, inputting a columnar pressure map set of a target individual into the sleep posture identification model for target individual model training, and storing the weight parameter with the highest identification accuracy after running for 5 epochs to obtain the sleep posture identification model of the target individual;
step 2, acquiring a group of pressure data of the target individual in real time through a pressure sensing device, sending the pressure data to an upper computer for preprocessing and normalization processing, drawing by using the data after the normalization processing to obtain a columnar pressure chart of the target individual, inputting the columnar pressure chart of the target individual into a sleep posture identification model of the target individual, and outputting to obtain a sleep posture identification result of the target individual: lying flat or lying on one side.
The improvement of the sleeping posture identification method based on deep transfer learning of the invention is as follows:
the group of pressure data is pressure data of the shoulder and neck of the target individual acquired by the pressure sensing device during one lying or lying on one side, and each group of pressure data comprises 9 characteristics; the pressure data sets are twenty groups of pressure data when lying flat or lying on side;
the preprocessing is to reserve the data with the numerical range of 300-4000 in the pressure data set, and delete the pressure data with data loss and numerical out-of-range (less than 300 or more than 4000);
the normalization processing comprises the following steps:
Figure BDA0003699036770000021
wherein 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 of the current processing;
the sleeping posture identification method based on deep transfer learning is further improved as follows:
the sleep posture identification model is an improved ResNet18 network, convolution attention modules are added to the first layer of the ResNet18 network and the last layer of the convolution layer respectively, a BN layer is added after the average pooling layer, and the improved ResNet18 network sequentially comprises the convolution layer, the convolution attention module, a maximum pooling layer, four residual blocks, the convolution attention module, the average pooling layer and a full-connection layer; the output dimension of the fully connected layer is 2.
The sleeping posture identification method based on deep transfer learning is further improved as follows:
the process of obtaining the optimal weight parameters of the sleep posture identification model comprises the following steps: establishing 20 groups of data sets B, sequentially inputting source domain data sets in the data sets B into the sleeping posture recognition model according to groups, training the sleeping posture recognition model through a training set and a testing set of the source domain data sets by adopting cross entropy as a loss function, and storing model weight parameters with the highest recognition accuracy after operating 20 epochs so as to obtain the optimal weight parameters of the 20 groups of sleeping posture recognition models.
The sleeping posture identification method based on deep transfer learning is further improved as follows:
the establishing process of the data set B is as follows: acquiring 20 individual data sets of pressure data of the shoulder and neck parts lying down and lying on the side through a pressure sensing device, classifying labels according to sleeping posture labels, wherein the label of lying down is marked as '0', and the label of lying on the side is marked as '1'; then, the pressure data in the individual data set is subjected to the preprocessing and the normalization processing, and then the normalized individual data set is subjected to histogram conversion processing in sequence to obtain a columnar pressure map set, wherein the columnar pressure map set is divided into a lying histogram map set or a lying histogram map set according to classification labels; dividing the columnar pressure map set into 20 data according to individuals, wherein the lying histogram map set and the lying histogram map set in each data are respectively calculated according to the following ratio of 8: 2, randomly dividing the data into a training set and a test set, taking one of 20 data sets as a target domain data set in turn, combining the rest 19 data sets as a source domain data set, wherein each target domain data set and each source domain data set respectively comprise the training set and the test set, and obtaining a data set B containing 20 groups of data.
The invention is further improved as a sleeping posture identification method based on deep transfer learning:
the training of the target domain data sets comprises the following steps of sequentially importing the optimal weight parameters into a sleeping posture recognition model, correspondingly taking the target domain data sets in the data set B as the input of the sleeping posture recognition model, and carrying out the following operations on each group of target domain data sets: freezing neuron weight parameters except a residual block and a full connection layer in the sleep gesture recognition model, training a neural network model by using a target domain training set, running 5 epochs, recording the recognition accuracy of each epoch, and taking and storing the model with the highest recognition accuracy; and then inputting the target domain test set into the trained model, thereby obtaining the identification accuracy of the model corresponding to the test set in the current target domain data set.
The sleeping posture identification method based on deep transfer learning is further improved as follows:
the pressure sensing device comprises a pressure sensor, the pressure sensor is in signal connection with an upper computer through a Micro Control Unit (MCU), and the pressure sensor is respectively placed on the left shoulder, the right shoulder and the back neck of a person to be collected.
The invention has the following beneficial effects:
1. the invention converts the collected 9 rows of pressure data into the columnar profile distribution map, compared with the method of directly applying numerical data, the columnar profile map can more effectively extract the pressure distribution characteristics under different sleeping postures, and is beneficial to improving the sleeping posture identification accuracy.
2. The invention introduces transfer learning to carry out online self-adaptive maintenance on a sleeping posture identification model, firstly pre-trains the sleeping posture identification model based on a basic sample library, then introduces pre-trained weight parameters into a deep transfer learning model, continuously improves the difference between the individual sample and the basic sample library characteristic while adaptively extracting the public characteristic of the sleeping posture data by constructing an improved maximum mean difference regular term loss function, and effectively solves the problem of low identification rate caused by the difference between a newly-measured sample book and the basic sample library characteristic. The training method greatly improves the generalization performance of the model and is very suitable for the online maintenance and multi-user expansion of the model.
3. The method improves ResNet18, adds a CBAM attention mechanism, increases the attention of the model to key characteristics, greatly improves the network performance, and has higher convergence speed and better recognition rate and robustness.
Drawings
The following describes embodiments of the present invention in further detail with reference to the accompanying drawings.
FIG. 1 is a schematic flow chart of a sleeping posture identification method based on deep migration learning according to the present invention;
FIG. 2 is a schematic diagram of the present invention including a target domain and source domain data set B;
FIG. 3 is a schematic structural diagram of a sleep posture recognition model according to the present invention;
FIG. 4 is an example graph of a histogram of pressure data of the present invention.
Detailed Description
The invention will be further described with reference to specific examples, but the scope of the invention is not limited thereto:
embodiment 1, a sleeping posture identification method based on deep transfer learning, as shown in fig. 1, preprocessing and normalizing by acquiring pressure data of shoulders of a body in a sleeping state; then, drawing a histogram by using the data after the normalization processing; dividing a data set of the drawn histogram into a source domain data set and a target domain data set according to individuals, and dividing the source domain data set and the target domain data set into a training set and a testing set; then, the improved ResNet neural network trained by the source domain data set is used for obtaining the pre-trained weight parameters, and then the improved ResNet neural network loaded with the pre-trained weight parameters in the training set of the target domain is trained by a deep transfer learning method, so that the sleeping posture type of the sample in the test set of the target domain is predicted, and the method comprises the following steps:
s1, collecting pressure data
Gather shoulder neck pressure data under the different appearance of sleeping (lie flat and lie on one's side) through pressure sensing device, pressure sensing device includes pressure sensor, pressure sensor passes through little the control unit MCU and host computer signal connection, pressure sensor adopts 9 FSR resistance-type film pressure sensor to be used for gathering the pressure value of state shoulder neck of lying down, place respectively in shoulder and back neck about being gathered personnel, pressure sensor's resistance is along with the linear change of pressure, and convert the resistance into voltage signal and send MCU (meaning Semiconductor (ST) company's STM32F103RCT6 through voltage conversion module, MCU acquires behind the voltage signal real-time 9 pressure data transmission to host computer storage and further processing.
The method comprises the steps that 20 persons, namely 20 individual data sets, participate in data acquisition, pressure data of shoulders and back necks of the acquired persons at three positions of lying on the left side, lying on the back side and lying on the right side are acquired through a pressure sensing device and serve as samples, then each sample is classified according to sleeping posture marks, the lying position is marked as '0', the lying position is marked as '1', the lying positions on the left side and the lying positions on the right side belong to the lying positions, and each individual data set comprises 9 characteristics (namely corresponding to the pressure data acquired by 9 pressure sensors).
The collected pressure data (samples) are then pre-processed: retaining data with a value range of 300-4000 in the pressure data, and deleting pressure data with data missing and value exceeding a value range (smaller than 300 or larger than 4000), wherein the preprocessed pressure data set comprises 20 individual data sets, each individual data set comprises 9 characteristic samples (with a range of [300-4000]), and each sample is provided with a corresponding classification label (0 ' or ' 1 '); specific information for the pressure data set is shown in table 1:
TABLE 1 detailed information of pressure data set
Figure BDA0003699036770000051
S2, converting the pressure data into a histogram
S2.1, carrying out normalization processing on each sample in the pressure data set:
Figure BDA0003699036770000052
where max is the maximum value of each column of individual data (i.e., the maximum value of each feature in 20 individual data sets), and min is the minimum value of each column of individual data (i.e., the minimum value of each feature in 20 individual data sets); x is the characteristic value of the current processing; the normalization processing aims to perform dispersion normalization on the individual data, so that pressure values are mapped to be between [0 and 1 ];
the normalized data set includes 20 individual data sets, each containing 9 sets of normalized pressure data and each with a corresponding classification label ("0" or "1")
S2.1, conversion to histogram
Using software MATLAB to sequentially perform histogram conversion processing on the 20 normalized individual data sets, and finally obtaining 5109 histograms:
firstly, loading a normalized personal data set into a working area of MATLAB by using a 'load' function, drawing 9 groups of normalized pressure data into a histogram by using a 'bar' function, and outputting the histogram as a PNG format picture, wherein as shown in FIG. 4, the abscissa of the histogram represents the characteristic bit numbers 1-9, and the ordinate of the histogram represents the pressure value after normalization. In order to enable the histogram to have better observability, stronger identified performance and easy neural network training, and because the pressure data acquired in the step 1 are all in the range of 300-4000, the numerical range of the horizontal axis is limited to be x ∈ [0,8] (representing 9 characteristics) by adopting an "axis" function in the graph output of the histogram, and the numerical range of the vertical axis is y ∈ [0,1] (the data of 300-4000 are normalized to be 0-1). Therefore, the histogram occupies more pixels and has fewer white edges and achromatic elements, and the subsequent neural network training, identification and classification performance is improved;
and then outputting the histogram storage to the lying histogram set or the lying histogram set according to the classification labels (0 is lying down and 1 is lying on side) in the sample. Thereby, a histogram pressure atlas comprising 20 persons is obtained;
s3, dividing the columnar pressure chart set into a data set A with 20 data according to the individual of the person to be collected, wherein the lying histogram chart set and the lying histogram chart set in each data in the data set A are respectively calculated according to the following formula that: 2, randomly dividing the data set into training sets and testing sets, respectively recording a 1-a 20 for each part of data in the data set a, taking one part of a 1-a 20 as a target domain data set in turn, and combining the remaining 19 parts as a source domain data set, thereby obtaining a data set B containing 20 groups of data, wherein each group of data set in the data set B is recorded as B1-B20, B1-B20 contains one target domain data set and one source domain data set, each target domain data set and each source domain data set comprises a training set and a testing set, and the structure of the data set B is shown in fig. 2.
S4, constructing a sleeping posture recognition model
Constructing a sleep posture identification model based on a ResNet18 network, respectively adding a convolution attention module in the first layer of the ResNet18 network and the last layer of a convolution layer of the ResNet18 network, and adding a BN layer after an average pooling layer, wherein the BN layer can accelerate the training of the model and prevent overfitting, and the network structure of the sleep posture identification model is shown in FIG. 3 and sequentially comprises the convolution layer, the convolution attention module (CBAM1), a maximum pooling layer, four residual blocks, a convolution attention module (CBAM2), the average pooling layer and a full-connection layer; the convolution layer is composed of convolution kernels with the size of 7 multiplied by 64, the padding depth is 3, and stride parameters are 2; the size of a pooling window of the maximum pooling layer is 3 multiplied by 3, the padding depth is 1, and stride parameters are 2; the window size of the average pooling layer is 1 × 1; the four residual blocks each contain two basic blocks (basic blocks), and the residual blocks have 4 types:
the first kind of residual block is formed by sequentially connecting 4 convolution kernels with the size of 3 multiplied by 64;
the second kind of residual block is formed by sequentially connecting 4 convolution kernels with the size of 3 multiplied by 128;
the third kind of residual block is formed by sequentially connecting 4 convolution kernels with the size of 3 multiplied by 256;
the fourth kind of residual block is formed by sequentially connecting 4 convolution kernels with the size of 3 multiplied by 512;
and (3) finely adjusting a full connection layer (FC) at the end of the ResNet18 network, and changing the output dimension to be 2, thereby obtaining an initial sleeping posture identification model.
S5 training and testing sleep posture recognition model
S5.1, training by using source domain data set
Training the sleep posture recognition model by using the source domain data set to obtain the optimal weight parameters, which specifically comprises the following steps: sequentially taking source domain data sets of B1-B20 as input of a sleep posture recognition model according to groups, training a neural network model through a training set and a testing set of the source domain data sets by adopting cross entropy, setting a learning rate to be 0.001 by adopting Adam by adopting an optimizer, and storing a model weight parameter with the highest recognition Accuracy (Accuracy) after 20 epochs are operated, wherein one epoch represents that all samples in the training set are used for training once;
and finally obtaining the optimal weight parameters C1-C20 of the 20 groups of sleep posture identification models corresponding to the source domain data sets of B1-B20.
The accuracy is the accurate ratio of the positive and negative predictions:
Figure BDA0003699036770000071
wherein TP represents predicting positive samples as positive samples, FN represents predicting positive samples as negative samples, FP represents predicting negative samples as positive samples, TN represents predicting negative samples as negative samples;
s5.2, training by using target domain data set
The optimal weight parameters C1-C20 are sequentially imported into the sleep posture recognition model, and the target domain data sets of B1-B20 are correspondingly used as the input of the sleep posture recognition model, for example: the target domain data set of B1 is input as a sleep posture recognition model with optimal weight parameters C1, the target domain data set of B2 is input as a sleep posture recognition model with optimal weight parameters C2, and so on. Each set of target domain data sets performs the following operations:
freezing neuron weight parameters except a residual block and a full connection layer in the sleep posture recognition model, training the neural network model by using a target domain training set, running 5 epochs, recording the recognition accuracy of each epoch, and taking and storing the model with the highest recognition accuracy;
and inputting the target domain test sets from B1 to B20 into the trained model, thereby obtaining the identification accuracy of the model corresponding to the test set in the current target domain data set. Finally, the target domain data sets of B1-B20 achieved recognition accuracy for 20 sets of models. The average of the accuracy of the first 5 epochs trained with the target domain training set and the accuracy of the target domain test set is recorded, and the results are shown in table 2, where one Epoch represents one training with all samples in the training set.
TABLE 2 average accuracy of 5 epochs run in the target domain training set and the average accuracy of the test set
Figure BDA0003699036770000081
As can be seen from the table 2, the effect of the method is remarkable after the pressure data set is converted into the columnar pressure map set and the training is carried out by using the deep migration learning method, the time consumption is reduced, and the training accuracy rate can reach 99% by using the first epoch; when the model after 5 cycles of epochs is used for predicting the target domain test set, the recognition accuracy rate can reach more than 99%, and in addition, the freeze layer training after the weight parameters are loaded is convenient for the expansion of the subsequent model to new individuals through transfer learning.
S6, online use:
s6.1, before actual use, a sleeping posture identification model suitable for a target individual needs to be constructed in advance, and the specific process is as follows:
in the step S1-step S5, the sleeping posture data of 20 individuals are acquired, the data of one individual is taken as a target domain data set, the other individuals are combined into a source domain data set, the source domain is trained firstly, the target domain training set is taken for training through a transfer learning method after the optimal weight parameters are acquired, and finally the target domain test set is taken for testing, and the experimental result shows that the method is effective. In actual use, the method is used for recognizing the sleeping posture of a target individual (namely, replacing a target domain used in an experiment by an actual target individual), before actual use, a sleeping posture recognition model suitable for the target individual needs to be constructed in advance, and the specific process is as follows:
the method comprises the steps of collecting shoulder and neck pressure data (20 groups of lying and lying on the side) of a target individual in different sleeping postures through a pressure sensing device, preprocessing and normalizing the data, and converting the normalized data into a histogram to obtain a histogram set of the target individual.
Arbitrarily taking 1 group of the optimal weight parameters C1-C20 of the 20 groups of models in the step S5.1, taking C1 as an example in the embodiment, importing the optimal weight parameters C1 of the models into the sleep posture recognition model, freezing the neuron weight parameters except the residual blocks and the full connection layer in the sleep posture recognition model, taking the columnar pressure map set of the target individual to train the sleep posture recognition model, and storing the weight parameter with the highest recognition accuracy as the weight parameter M of the sleep posture recognition model of the target individual after running 5 epochs, thereby obtaining the sleep posture recognition model of the target individual.
S6.2, during actual use, the pressure sensing device collects the shoulder and neck pressure data of the target individual in real time and sends the data to the upper computer for preprocessing and normalization processing, then the data after normalization processing is used for drawing to obtain a columnar pressure atlas of the target individual, the upper computer converts the received real-time data into a columnar chart and inputs the columnar chart into the sleep posture recognition model of the target individual obtained in the step 6.2, and finally the sleep posture recognition result can be obtained in real time.
Therefore, the training of the model can be effectively accelerated, the model with higher precision can be obtained, and the maintenance of the subsequent model and the expansion of new individuals are facilitated.
Experiment:
1. in order to reflect the effectiveness of converting the pressure data set into a histogram, the pressure data set obtained in the step 1 in the embodiment 1 is used for carrying out a training and testing process on the sleeping posture recognition model;
2. in order to show the effectiveness of the sleep posture recognition model constructed by improving ResNet18, the same training and testing are carried out by using a ResNet18 network according to the step 5 in the embodiment 1;
3. in order to reflect the effectiveness of the transfer learning, the training set and the test set of the target domain are trained and tested under the condition that the weight parameters are not imported.
The experimental results are shown in table 2. Wherein the first act is the present invention; an epoch represents a training once using all the samples in the training set.
TABLE 3 comparison of the results
Figure BDA0003699036770000091
As can be seen from the table 2, the effect is obvious after the pressure data set is converted into the columnar pressure map set, the recognition accuracy rate of 99% can be achieved by the first epoch, and the training precision of the model is improved; the models before and after improvement are compared, and the attention module is added, so that the training of the models can be accelerated, and higher identification accuracy can be achieved; according to the invention, time expenditure is reduced through deep migration learning, the recognition accuracy rate of more than 99% can be achieved when the target domain test set is predicted by taking the model after 5 epochs, the problem of insufficient recognition rate caused by the difference between the newly-measured sample book and the characteristics of the basic sample library is effectively solved, and in addition, through the migration learning, the freeze layer training after loading weight parameters is convenient for the expansion of the subsequent model to new individuals. Therefore, the attention module is added on the basis of ResNet18, the pressure data measured by 9 pressure sensors are drawn into a histogram, and the histogram is divided into a source domain and a target domain according to individuals, and then the method of recognizing and classifying by adopting the deep migration learning technology can better accelerate model training, improve training precision and have higher practical value.
According to the method, a deep learning model is pre-trained on the basis of a basic sample library, and in actual use, firstly, weight parameters obtained on the basis of pre-training in the sample library are introduced into a neural network model through a deep migration learning technology; and then, the online training is carried out by combining the target domain data set, so that the training of the model can be effectively accelerated, a model with higher precision can be obtained, and the maintenance of a subsequent model and the expansion of a new individual are facilitated.
Finally, it is also noted that the above-mentioned lists merely illustrate a few specific embodiments of the invention. It is obvious that the invention is not limited to the above embodiments, but that many variations are possible. All modifications which can be derived or suggested by a person skilled in the art from the disclosure of the present invention are to be considered within the scope of the invention.

Claims (7)

1. A sleeping posture identification method based on deep migration learning is characterized by comprising the following steps:
step 1, acquiring a pressure data set of a target individual through a pressure sensing device, preprocessing and normalizing the pressure data set in an upper computer, and then drawing data after normalization to obtain a columnar pressure atlas of the target individual; randomly selecting one group of optimal weight parameters of the sleep posture identification model, introducing the optimal weight parameters into the sleep posture identification model, freezing neuron weight parameters except a residual block and a full connection layer in the sleep posture identification model, inputting a columnar pressure map set of a target individual into the sleep posture identification model for target individual model training, and storing the weight parameter with the highest identification accuracy after running for 5 epochs to obtain the sleep posture identification model of the target individual;
step 2, acquiring a group of pressure data of the target individual in real time through a pressure sensing device, sending the pressure data to an upper computer for preprocessing and normalization processing, drawing by using the data after the normalization processing to obtain a columnar pressure chart of the target individual, inputting the columnar pressure chart of the target individual into a sleep posture identification model of the target individual, and outputting to obtain a sleep posture identification result of the target individual: lying flat or lying on one side.
2. The sleeping posture identification method based on deep migration learning of claim 1, characterized in that:
the group of pressure data is pressure data of the shoulder and neck of the target individual acquired by the pressure sensing device during one lying or lying on one side, and each group of pressure data comprises 9 characteristics; the pressure data sets are twenty groups of pressure data when lying flat or lying on side;
the preprocessing is to reserve the data with the numerical range of 300-4000 in the pressure data set, and delete the pressure data with data loss and numerical out-of-range (less than 300 or more than 4000);
the normalization processing comprises the following steps:
Figure FDA0003699036760000011
wherein 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 of the current process.
3. The sleeping posture identification method based on deep migration learning of claim 2, characterized in that:
the sleep gesture recognition model is an improved ResNet18 network, convolution attention modules are added to the first layer and the last layer of a convolution layer of the ResNet18 network respectively, a BN layer is added after an average pooling layer, and the improved ResNet18 network sequentially comprises the convolution layer, the convolution attention modules, a maximum pooling layer, four residual blocks, the convolution attention modules, the average pooling layer and a full connection layer; the output dimension of the fully connected layer is 2.
4. The sleeping posture identification method based on deep migration learning of claim 3, characterized in that:
the process for acquiring the optimal weight parameters of the sleep posture identification model comprises the following steps: establishing 20 groups of data sets B, sequentially inputting source domain data sets in the data sets B into the sleeping posture recognition model according to groups, training the sleeping posture recognition model through a training set and a testing set of the source domain data sets by adopting cross entropy as a loss function, and storing model weight parameters with the highest recognition accuracy after operating 20 epochs so as to obtain the optimal weight parameters of the 20 groups of sleeping posture recognition models.
5. The sleeping posture identification method based on deep transfer learning of claim 4, characterized in that:
the establishing process of the data set B is as follows: acquiring 20 individual data sets of pressure data of the shoulder and neck parts lying down and lying on the side through a pressure sensing device, classifying labels according to sleeping posture labels, wherein the label of lying down is marked as '0', and the label of lying on the side is marked as '1'; then, the pressure data in the individual data set is subjected to the preprocessing and the normalization processing, and then the normalized individual data set is subjected to histogram conversion processing in sequence to obtain a columnar pressure map set, wherein the columnar pressure map set is divided into a lying histogram map set or a lying histogram map set according to classification labels; dividing the columnar pressure map set into 20 data according to individuals, wherein the lying histogram map set and the lying histogram map set in each data are respectively calculated according to the following ratio of 8: 2, randomly dividing the data into a training set and a test set, taking one of 20 data sets as a target domain data set in turn, combining the rest 19 data sets as a source domain data set, wherein each target domain data set and each source domain data set respectively comprise the training set and the test set, and obtaining a data set B containing 20 groups of data.
6. The sleeping posture identification method based on deep migration learning of claim 5, characterized in that:
the training of the target domain data sets comprises the following steps of sequentially importing the optimal weight parameters into a sleeping posture recognition model, correspondingly taking the target domain data sets in the data set B as the input of the sleeping posture recognition model, and carrying out the following operations on each group of target domain data sets: freezing neuron weight parameters except a residual block and a full connection layer in the sleep gesture recognition model, training a neural network model by using a target domain training set, running 5 epochs, recording the recognition accuracy of each epoch, and taking and storing the model with the highest recognition accuracy; and then inputting the target domain test set into the trained model, thereby obtaining the identification accuracy of the model corresponding to the test set in the current target domain data set.
7. The sleeping posture identification method based on deep migration learning of claim 6, characterized in that:
the pressure sensing device comprises a pressure sensor, the pressure sensor is in signal connection with an upper computer through a Micro Control Unit (MCU), and the pressure sensor is respectively placed on the left shoulder, the right shoulder and the back neck of a person to be collected.
CN202210688994.5A 2022-06-17 2022-06-17 Sleeping posture identification method based on deep migration learning Pending CN115062704A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210688994.5A CN115062704A (en) 2022-06-17 2022-06-17 Sleeping posture identification method based on deep migration learning

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210688994.5A CN115062704A (en) 2022-06-17 2022-06-17 Sleeping posture identification method based on deep migration learning

Publications (1)

Publication Number Publication Date
CN115062704A true CN115062704A (en) 2022-09-16

Family

ID=83201668

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210688994.5A Pending CN115062704A (en) 2022-06-17 2022-06-17 Sleeping posture identification method based on deep migration learning

Country Status (1)

Country Link
CN (1) CN115062704A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024125566A1 (en) * 2022-12-14 2024-06-20 深圳市三分之一睡眠科技有限公司 Sleeping posture recognition method and system based on deep neural network

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024125566A1 (en) * 2022-12-14 2024-06-20 深圳市三分之一睡眠科技有限公司 Sleeping posture recognition method and system based on deep neural network

Similar Documents

Publication Publication Date Title
CN108764059B (en) Human behavior recognition method and system based on neural network
Singh et al. Transforming sensor data to the image domain for deep learning—An application to footstep detection
CN109543526B (en) True and false facial paralysis recognition system based on depth difference characteristics
CN104063719B (en) Pedestrian detection method and device based on depth convolutional network
CN107451565B (en) Semi-supervised small sample deep learning image mode classification and identification method
CN112784763A (en) Expression recognition method and system based on local and overall feature adaptive fusion
CN102024145A (en) Layered recognition method and system for disguised face
CN103793690A (en) Human body biotic living body detection method based on subcutaneous bloodstream detection and application
CN113435335B (en) Microscopic expression recognition method and device, electronic equipment and storage medium
CN116311483B (en) Micro-expression recognition method based on local facial area reconstruction and memory contrast learning
CN116563887B (en) Sleeping posture monitoring method based on lightweight convolutional neural network
CN109685148A (en) Multi-class human motion recognition method and identifying system
CN113011399A (en) Video abnormal event detection method and system based on generation cooperative judgment network
CN105469117A (en) Image recognition method and device based on robust characteristic extraction
CN112836589A (en) Method for recognizing facial expressions in video based on feature fusion
CN115062704A (en) Sleeping posture identification method based on deep migration learning
CN115188031A (en) Fingerprint identification method, computer program product, storage medium and electronic device
CN114937298A (en) Micro-expression recognition method based on feature decoupling
CN114550299A (en) System and method for evaluating daily life activity ability of old people based on video
CN113128387B (en) Drug addiction attack recognition method for drug addicts based on facial expression feature analysis
CN117010971B (en) Intelligent health risk providing method and system based on portrait identification
CN117338313B (en) Multi-dimensional characteristic electroencephalogram signal identification method based on stacking integration technology
CN112257559A (en) Identity recognition method based on gait information of biological individual
CN108694375A (en) A kind of image conversion white wine recognition methods can be used for polyelectron nose platform
Naidu et al. Stress recognition using facial landmarks and CNN (Alexnet)

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination