{'fraction_non_alphanumeric': 0.021848432215010514, 'fraction_numerical': 0.009804369686443002, 'mean_word_length': 4.596955743156817, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Estimation of posture and prediction of the elderly getting out of bed using a body pressure sensor

Received Feb 19, 2020 Revised Aug 21, 2020 Accepted Oct 28, 2020 We propose an IoT support system for estimating the posture of the care recipient on the bed from the body pressure of the care recipient measured by a sheet-type body pressure sensor, and detecting the posture related to leaving the bed in real time. In addition, we propose a method that predicts getting out of the bed before the care recipient takes a posture related to getting out of the bed by considering the state transition. Intervention experiment showed that using body pressure features as an explanatory variable and applying machine learning, 16 types of postures on the bed of care recipients with an F value of 0.7 or more could be identified. From the experiment without intervention, by applying the hidden Markov model, we calculated the transition probability to each hidden state when the care recipient getting out of the bed and the transition probability to each hidden state when the care recipient not getting out of the bed. As a result, there was a difference of about 0.1 in the transition probability of the state related to raising upper body.


INTRODUCTION
Recently, rapid aging in Japan brings larger population of elderly care recipients, who need nursing care to live. It increased to 3 times during the latest 15 years. On the other hand, hospitals and nursing facilities is facing a shortage of staffs compared to the number of care recipients.
Many of care recipients spend almost all day in the bed. The beds are the place not only to sleep but also to live for the care recipients. However, there have been occurring accidents, injuries and illnesses caused by living mainly on beds. Falling at bedsides, and bedsores especially have been occurring frequently. In order to prevent the care recipients from falling at the bedside and from beds, measures such as installing a fence on the beds are taken. However, they often fall due to dizziness and getting out of the beds in unstable postures. In addition, the elderly can suffer from fractures and sprains after they fall. As a result, it decreases the opportunity to move the body, which weakens muscle and bone strengths. It increases the risk for the elderly to run into a state requiring nursing care [1].
In addition, bedsore is caused by skin necrosis in the care recipients who have lain at a fixed posture for a long term. The disuse syndrome such as hypanakinesia and depression also develop in such the care recipients. Though body pressure dispersing equipment has been introduced against them, it is difficult to permanently install the equipment on the bed because of its expensiveness. For this reason, in many 1209 hospitals and nursing facilities, caregivers regularly change the posture of care recipients. However, due to the shortage of staff, it is difficult for caregivers to perform enough patrols and monitoring of care recipients, which is a great burden for caregivers. Therefore, in order to reduce the burden on caregivers, it is necessary an IoT support system to monitor care recipients instead of humans, to detect accidents and illnesses in the care recipients, and to inform the caregivers. Such an IoT support system is also required to cause no physical burden and no mental stress on care recipients by installing it. As a situation requiring such a system, this paper mainly deals with the following situation: a care recipient wakes up during the sleeping time, gets out of the bed on their own, and then falls. Sensor environments are important for monitoring elderly inpatients. Systems in [2][3][4] monitor them with smartphones and wireless sensor networks. Since elder patients at bedtime do not use smartphones, which cannot be used to detect their leaving beds. Wearable sensors on the inpatient's hands and feet are not recommended because they would interfere with medical procedures such as infusion. Like the driver monitoring [5], ambient sensor systems, which incorporate sensors into patient's environments [6,7], are useful. In order to analyze a lot of data collected by sensors, there are works [8,9] applying data science to medical treatment. Sensors for the patient must be physically non-invasive [10]. Therefore, various computer vision technologies [11][12][13][14][15] are used. However, sensors to detect the behavior from patients should provide less mental load. The use of cameras should be avoided because inpatients are extremely reluctant to be monitored.
We should predict the intention of the elder patients to leave their beds at night from their behavior before they really leave the beds. The intention cannot be estimated only by the movement of the patient at a specific time point. It is necessary to extract the intention from the time series that expresses the behavior. Many works address detection of behavior from time series data [16][17][18]. The detection of intension from the behavior is studies in the field of intelligent tutoring systems [19,20] and information retrieval [21]. Recognition of features in time series is discussed in several works [22,23] proposed methods to improve the identification of time series data using shapelets, which are discriminative sub-sequences in time series data, while methods proposed in [24,25] find motifs that are frequent patterns in time series.
The above survey derives that a bed equipped with sensors [26] is excellent as a non-invasive ambient system. They also suggest that it is a good solution to predict intentions of elderly patients from their behavior, using the ambient system. There are many studies on measuring an elderly person's posture, movement, and biological information at the bedside to support nursing care. In addition, there are many studies on observing the behavior and actions in daily life and monitoring where and what the elderly is doing.
As a support systems that is introduced in hospitals and nursing facilities, there is a bed that detects getting out of the bed of the care recipients [27][28][29]. Those systems determine whether the care recipient is sleeping on the bed or getting out of the bed through a load sensor such as a weighting scale installed under the bed. The introduction of those systems has been shown to have the effect of reducing accidents such as falls. However, only detecting whether the care recipient is sleeping or getting out of bed cannot grasp the detailed turnover and posture of the care recipient. Notification to the caregiver do not occur until the care recipient has completely got out of the bed.
In addition to posture and movement, there are studies on measuring biological information such as the respiratory rate, pulse wave, and body temperature of the care recipient in bed [30][31][32]. Sleep disorder and arrhythmia can be detected by measuring the biological information of the care recipient through a conductive sheet or thermistor. Unfortunately, the measurement of biological information requires long-term monitoring and the wearing of complex sensors. In addition, in the measurement of biological information, it is not possible to confirm postural change or getting out of bed of the care recipient.
There are studies on detecting extraordinary behavior of the elderly [33][34][35]. In these studies, the system learns the pattern of the elderly's daily activities through cameras and location information. They examine state transitions to determine whether the elderly's behavior is ordinary or extraordinary. However, monitoring with a camera and wearing sensors forces a mental and physical burden on the elderly. In addition, since care recipients are living mainly on beds, it is difficult for these systems to detect extraordinary behaviors of care recipients from bedside location information.
In this paper, we propose a method for estimating the posture of a care recipient on a bed from the body pressure of the care recipient measured by a sheet-type body pressure sensor and for detecting the posture related to leaving the bed in real time. In addition, we propose a method that predicts getting out of the bed before the care recipient takes a posture related to getting out of the bed by considering the state transition. The characteristics of body pressure during the sleeping time appear on the back, hips, and legs. Therefore, the body pressure of the care recipient measured by the body pressure sensor is divided into three parts to o acquire the features of body pressure. As the result of experiments using the proposed method, it was found that it is possible to estimate the posture of the care recipient on the bed and to predict getting out of the bed by using the features of body pressure. This paper is organized as follows. Section 2 introduces a preliminary survey forwarding to research motivation, followed by the basic idea of our method. Section 3 describes the method proposed in this research. Section 4 presents experiments and evaluations. It also gives a discussion of the experimental results. Section 5 presents a summary of this research.

PREDICTION OF GETTING OUT OF THE BED FROM POSTURE TRANSITION
In this research, we propose a system that classifies the care recipient's posture on the bed in detail and predicts the care recipient's getting out of the bed. The prediction is performed by determining whether a current posture in raising up of the upper body will lead to getting out or to supine position based on posture transitions obtained from the observed data of body pressure distribution on the bed.

Preliminary survey
For a preliminary survey, we interviewed a care worker working in a nursing facility about falls and bedsores. As the result of the interview, it was found that accidents such as falls of care recipients frequently occurred from 20:00 to 6:00 a.m. It was also found that bedsores could be prevented by performing regular postural changes at every two hours. The causes of frequent accidents of care recipients at night are that there were few nurses and care workers working at night in the nursing facilities, that a care recipient could not call a care worker because of consideration for other patients in the room, and that the visibility was poor. A care recipient got out of the bed on their own, worrying about bothering the busy caregivers. Such concern of care recipients causes an accident.
It is necessary to predict getting out of the bed before the care recipient getting out of the bed and to delay the care recipient getting out of the bed. In addition, it became clear that regular postural change against bedsores burdens caregivers such as time management. The Interview with the care worker suggests that falls are more urgent than bedsores. Additionally, it was found that preventing the care recipient from getting out of the bed on his own would significantly reduce the risk of falling.
We focus on accidents such as falls from the viewpoint of larger urgency in this paper. We consider to predict that a care recipient will get out of the bed before he actually gets out. Once it is predicted that a care recipient will get out of the bed at night, notification to caregivers is required. Because false notification makes caregivers tired, such the prediction should be with high accuracy. In addition to notification, stopping the care recipient getting out is also required on the prediction. For example, it may be possible by installing a smart speaker talking to the care recipient on the bed, which can prevent bedside accidents.

Prediction using sheet-type body pressure sensor
Hidden markov models (HMM) [36], which is an unsupervised learning, are suitable to predict human behavior because the models can address state transitions of postures of the care recipient. However, some ingenuity is needed here. It is difficult for humans to understand the correspondence of each state in the state transitions to postures because HMMs automate the correspondence. In addition, the body pressure distribution of the whole body of the care recipient on the bed is measured by a body pressure sensor. The body pressure distribution is measured from the pressure distribution among plural sample points evenly spaced on the bed. Since the number of sample points is enormous, it is not reasonable to make a black box model to deal with state transitions for all of the sample points. Humans can easily identify postures on a bed, such as supine, lateral, and long sitting positions. Instead of the automated correspondence, we consider identifying each state in the state transitions of the posture of the care recipient from the body pressure distribution. Supervised learning models using labels by human can provide clear explanation of posture transition unlike unsupervised learning. Therefore, based on the examples of natural language processing [37] and the existing research [38], a posture estimation model is constructed by supervised learning. The position transition is identified by an HMM, which is an unsupervised learning.
The characteristics of body pressure on the bed is significant with respect to the posture in the three parts: the back, the hip, and the legs. In this research, we deal with the body pressure distribution individually for each of these three parts. The classifier for estimating the posture is trained by using the features of body pressure for each of the parts acquired by the body pressure sensor and the labels of the posture identified by the human as training data. Furthermore, the posture on the bed is estimated from the features of the body pressure of each of the part extracted from the training data. bed with respect to the learned HMM parameters, we predict in advance that the care recipient getting out of the bed. Figure 1 shows an overview of the prediction system for getting out of the bed in this method. In this research, the body pressure distribution of the whole body on the bed of the care recipient is measured by a sheet-type body pressure sensor. The body pressure by the back, hip, and legs vary significantly on posture change and getting out of the bed. We calculate the body pressure feature for these parts separately from the body pressure distribution in three-division regions of the whole sheet. We define the three-division regions so that the body pressure on each of the regions is dominated by only one of the back, hip, and legs. By applying HMM, it is possible to calculate the transition probability to each posture through the body pressure features. It is also possible to predict whether the care recipient will get out of the bed successively after sitting up or not. When this prediction system predicts the getting out of bed of the care recipient, it is possible to prevent accidents such as falls at the bedside by notifying the caregiver and stopping the care recipient using smart speakers [39,40].

PREDICTION OF GETTING OUT OF THE BED FROM POSTURE TRANSITION 3.1. Outline of body pressure sensor and acquisition of body pressure features
In this research, the position and movement of each body part are calculated from the body pressure distribution on the bed of the care recipient measured by the body pressure sensor, the posture of the care recipient is estimated, and the getting out of the bed is predicted. From section 2, monitoring with a camera and wearing a wearable sensor put a great deal of physical and mental burden on the care recipient. Therefore, we measure the distribution of body pressure on the bed of the care recipient using a sheet-type body pressure sensor. The sheet-type body pressure sensor is thin and has excellent elasticity, and we can visualize and measure the whole-body pressure distribution with little load on the care recipient. The sheettype body pressure sensor consists of 1600 sensors evenly placed on the sheet with 2.8cm interval. The number of sensors along with the short side direction is 25 while that along with the long side one is 64. The measuring range of each sensor is from 15 mmHg to 110 mmHg. The posture in the sitting position could be estimated by installing a body pressure sensor on the back or seat of the chair and measuring the body pressure distribution on the back and the hip [38]. Examination of the distribution of body pressure collected from the sheet-type body pressure sensor showed that the back, hip and legs were the sites where body pressure was particularly likely to concentrate when sleeping. Therefore, we focus on the position and movement of the legs in addition to the back and waist for estimating the posture of the care recipient on the bed and predicting getting out of the bed.
In order to calculate the position and movement for each part of the back, hip and legs, the body pressure distribution of the whole body acquired by the body pressure sensor is divided into three parts. We express the position of the 1600 sensors placed on the body pressure sensor by the coordinate system as Figure 2. Let the short side direction of the body pressure sensor be the Y axis and the long side direction be the X axis. The position of the sensor at top-left corner is defined as the origin (0, 0). The sensor of the bottom-left corner has the coordinate (0, 24) while that of the top-right corner does (63, 0). We divide the region The first region is used to obtain the body pressure of the legs. The second and third are used to obtain that of the hips and back, respectively. The number of the sensors along with X-axis in the first region is 21. Those in the second and third regions are 22 and 21, respectively. As an example, Figure 2 shows the body pressure distribution in the supine position and the dividing method. In order to acquire the position and movement of each part, the center of gravity of each part, and the velocity and acceleration of the center of gravity are calculated from the body pressure distribution in each of the three-division regions. The body pressure is measured every 200 ms by body pressure sensor. The position of the center of gravity of a part is denoted by ( , ) in below. Its calculation method is expressed by the following formula. is the pressure value (unit: mmHg) measured by the sensor located at the coordinates ( , ). We assign n=1 and k=20 for the legs, n=21 and k=42 for the hips, and n=43 and k=63 for the back, respectively. Let ∆ be the moving distance of the center of gravity position for ∆ seconds, v be the velocity, and a be the acceleration. ∆ , v and a are given as follows.
Since the spread of body pressure in each part differs for each posture, the variance-covariance matrix S at the center of gravity position ( , ) for a certain time is calculated for each part. For example, in the supine position, the spread of the hips pressure is wide and circular, whereas in the lateral position, the spread of the hips pressure is long and elliptical. Let ( ) be the variance of x and ( , ) be the covariance between x y. The variance-covariance matrix S is shown in below.

Estimating the posture of the care recipient on the bed by machine learning
In order to grasp the movement and posture of the care recipient on the bed in real time, we generate a classifier that estimates the posture of the care recipient on the bed from the body pressure features of each part by machine learning. The body pressure features are the center of gravity, the velocity v and acceleration a of the center of gravity, and the variance-covariance matrix S of the center of gravity for a certain time calculated in section 3.1. They are individually calculated for the back, hips, and legs. To calculate the variance-covariance matrix S of the center of gravity, several items of data are required. Therefore, a set of variance-covariance matrices S is calculated from the five items of data of the center of gravity acquired for every 200ms. In addition, the average of the center of gravity position, velocity v and acceleration a at the center of gravity is calculated from the five. The explanatory variables used for machine learning are 21 (=3 parts times 7 types of body pressure features) types of center of gravity position of the three parts, velocity v of the center of gravity position, average of acceleration a for 1000ms, and variance-covariance matrix S of the center of gravity position for 1000 ms. Table 1 shows the explanatory variables.  The objective variables are 16 postures in total, including 6 stable states and 10 transient states on the bed of the care recipient, as shown in section 2.2. The machine learning algorithm used to train the classifier uses random forest (RF) [41], a kind of ensemble learning. RF is an algorithm that constructs a plurality of decision trees trained to classify a specific class with high accuracy. It takes a majority decision of the decision trees to classify newly input data to a prepared class. RF has a learning phase and a classification phase. In the learning phase of this study, we manually give a posture label for each tuple of body pressure features acquired by the body pressure sensor in advance, and use them as an item of the training data to construct a set of decision trees that classify the posture from body pressure features. After that, in the classification phase, each decision tree classifies the position of the care recipient by using newly acquired body pressure features as explanatory variables. The RF outputs the most frequent identification result from the decision trees. In this method, by predicting the care recipient's posture related to getting out of the bed in real time, it can prevent bedside accidents by detecting a situation such as that a care recipient needs to go to the bathroom on their own.

Prediction of getting out of bed using a hidden markov model
By machine learning, the posture of the care recipient on the bed can be estimated in real time. However, only estimating posture by machine learning cannot enable to detect leaving that the care recipient gets out of the bed with antecedent posture changes such as from the supine to the long sitting, from the long to the edge sitting, and so on. In addition, to prevent the care recipient from falling off from the bed in trying to get out of bed on his own, it is necessary for the caregiver to have time to go to support. Therefore, it is too late even if the system detects just before the care recipient gets out of the bed. It is necessary to detect getting out of the bed as early as possible. In this research, in order to predict the getting out of the bed of a care recipient earlier, we use HMM. HMM is a statistical model that assumes that multiple hidden states that cannot be observed cause fluctuations in the observed data of time-series data.
Let the observed time series data at time t be O = 1 , 2 , ⋯ , , the hidden state be S = 1 , 2 , ⋯ , , and the HMM be λ. The following three parameters define λ = ( , , ).
-Start probability π = 1 , 2 , ⋯ , : is the probability that the hidden state is at time t =1. -Transition probability matrix A: The square matrix of the probability of transition from hidden state (1≤ j ≤ N) to hidden state (1≤ l ≤ i).
-Emission probability B: The set of the probability ( ) that hidden state outputs observed value (1 ≤ k ≤ T). The Baum-Welch algorithm is applied to HMM for learning unknown parameters from observations and the Viterbi algorithm is done for predicting hidden state sequences from observations [42][43][44]. In this study, the observable time-series data O are the 21 types of body pressure features shown in Table 1 in section 3.2, and the hidden state S corresponds to the posture of the care recipient. However, the mean and variance-covariance matrix of each hidden state are calculated by the Baum-Welch algorithm. Therefore, the hidden state and the 16 postures shown in section 2.2 are not in a one-to-one relationship. Multiple postures may be included in one hidden state. It is difficult for the caregiver to interpret the meaning of the hidden state.
However, by comparing the sequence of hidden states predicted by the Viterbi algorithm with the posture labels assigned by random forest in section 3.2, it is possible to confirm the postures included in each hidden state. In addition, the transition probability to each hidden state can be calculated by the body pressure feature by using Baum-Welch algorithm. In this method, when the care recipient raises his upper body, by comparing the transition probability to each hidden state when transitioning to the supine position again and the transition probability to getting out of the bed. It is possible to predict getting out of the bed before moving from the long sitting position to the end sitting position.

EXPERIMENT AND EVALUATION
It was verified by an intervention experiment whether the posture of the care recipient can be classified from the body pressure features measured by the body pressure sensor through the proposed system. The details and results of this experiment are shown in sections 4.1 and 4.2, respectively. Secondly, we conducted an experiment without intervention. The transition probability for each hidden state was calculated from the body pressure features. It was verified whether the situations of getting out of the bed and otherwise can be identified by the transition probabilities or not. Its detail and result are described in sections 4.3 and 4.4, respectively.

Purpose and outline of the intervention experiment
In the intervention experiment, we performed an intervention in which the subjects' postures on the bed was specified in advance. At that time, the body pressure of the subjects was measured by a body pressure sensor. We verified whether the body pressure features shown in section 3.1 are effective or not for classifying the postures of the 16 types of care recipients on the bed shown in section 2.2. The subjects were university students and graduate students between the ages of 22 and 23. They were 3 males and 2 females (5 subjects in total). In order to acquire the subjects body pressure, we installed SR soft vision (it is a sheettype pressure distribution measuring device manufactured by Sumitomo Riko Co., Ltd.) on the bed, and acquired the subjects' body pressure at every 200 ms. The pressure-sensitive range of SR soft vision is 1800×700 mm. The body pressure is measured in the range from 15 to 110 mmHg by 25×64 sensors arranged at 2.8 cm intervals. We divided the pressure-sensitive range into three ranges, called as Ranges 1, 2, and 3. Ranges 1-3 are assumed to be the range of the position of the back, hips, and legs, respectively. For every 1000 ms and Range i, we calculated the average center of gravity, average velocity of the center of gravity, average acceleration of the center of gravity, the variance-covariance matrix of the position of the center of gravity. Figure 3 shows the experimental environment and the body pressure acquired during the supine position. We can acquire the body pressure of all 16 postures shown in section 2.2 by the subjects' turning over with patterns 1 and 2. Before the experiment, the subjects practiced turning over with patterns 1 and 2. In addition, during the subjects' turning over, we instructed the subjects the next posture after 10 seconds at each stable state for enabling natural movement.

Classification results of the posture of care recipients by machine learning
In the intervention experiment, a classifier was constructed using random forest, which is one of supervised learning. For comparison of the classification results, a classifier using support vector machine (SVM) was also constructed. As the SVM parameters, those with optimal results were selected within the range of (0 ≦ C ≦ 300, 0.00001 ≦ gamma ≦ 1) [45]. General classification results were calculated by 5-fold cross validation. In this research, we do not consider the posture of the subjects before going to bed because our purpose is to predict the getting out of the bed of the care recipient. According to doctors' opinions, most care recipients sleep in the supine position in bed. Therefore, the data section used for classifying a subject's posture was from a few seconds after the subject started the supine position on the bed until the subject completely got out of the bed. The explanatory variables were the 21 types of body pressure features shown in section 3.1, and the objective variables were the 16 types of postures shown in section 2.2. Table 2 shows the RF confusion matrix. Table 3 shows the results of RF and SVM classification. The macro average in Table 3 is the average of the precision, recall, and F-value among all classes. The weighted average is the weighted average of precision, recall, and F-values among all classes with the weights according to the ratio of the number of data for each class. The accuracy is an index indicating the rate of true classification. Therefore, recall and precision are not considered.
From the confusion matrix, it was possible to classify all stable states with high accuracy by estimating the posture of the care recipient using 21 types of body pressure features as explanatory variables. There were many misclassifications in the transient state, especially in the prone position. In addition, it was possible to classify the body position from the supine position to the long sitting position in the patters, related to leaving the bed, with high accuracy.
Estimation of the posture of the subjects using body pressure features was better accuracy than that using with RF than with SVM. From the RF results, The F-value was about 0.72 in the macro average and

Purpose and outline of the experiment without intervention
In the experiment without intervention, the subjects freely changed their positions for a certain period, and the body pressure of the subjects at that time was measured by the body pressure sensor. In this experiment, we verified that the body pressure features shown in section 2.2 can predict whether the subjects will get out of the bed or not. The subjects were university students and graduate students between the ages of 20 and 23, with a total of 5 males and 4 females. The used body pressure sensor, the experimental environment, and the method of calculating body pressure features are the same as described in section 4.1. Each of the subjects followed the instructions of patterns 3 and 4 shown in below. As a result, we measured the body pressure when the subject got out of the bed and the body pressure when the subject did not do. The subject performed pattern 4 successively after pattern 3.  Pattern 3: The Subject freely changes his/her posture for 5 minutes from the start of the experiment. After this 5 minutes, he/she raises the upper body once on the bed and changes to supine, left lateral, right lateral, or prone position.  Pattern 4: The subject freely changes his/her posture for 5 minutes. After this 5 minutes, he/she raises the upper body on bed and get out of the bed.
In ppattern 3, we assumed a situation in which the care recipient gets up to drink water or blow his nose on the bed and return to sleeping. In advance, the subject was instructed to imagine such a scene and raise his/her upper body when performing pattern 3. In pattern 4, we assumed a situation in which the care recipient raises his upper body for the purpose of leaving the bed. As a result, it is possible to acquire the body pressure when the subject gets out of the bed and when the subject changes his/her posture to supine, left lateral, right lateral, or prone position. For later analysis, the human body was labeled manually to determine the posture of the subject.

Calculation and comparison transition probabilities for each hidden state
In the experiment without intervention, the transition probability to each hidden state was calculated from the body pressure features when the subject gets out of the bed and when the subject does not get out of the bed using the HMM. The data section used to calculate the transition probability to each hidden state was from the subject's supine position to the end of his upper body (long sitting position). In this research, the long sitting position is the state in which the subject raises the upper body near the center of the bed.
When applying to HMM, the time series data that can be observed are the 21 types of body pressure features shown in section 3.1. Each variable of the body pressure features has a different unit and size. Therefore, the average value of the body pressure features was normalized. The normalized body pressure features were applied to the Baum-Welch algorithm of HMM. The Baum-Welch algorithm was used to calculate the HMM parameters shown in section 3.3 for the number of hidden states from 3 to 7. Figures 4 and 5 shows the state transition diagrams and the transition probabilities for pattern 3 and pattern 4. In addition, we used the parameters of the HMM calculated by the Baum-Welch algorithm for applying the Viterbi algorithm to confirm the positions included in each of the hidden state.
According to the state transition diagrams, when the number of hidden states is 4, the probability of staying in the hidden state 3 in patterns 3 is higher than that in the hidden state 3 in patterns 4 more than 0.1 (see the probability with red color in (a) and (b) of Figure 4. The postures that were included in the hidden state 3 were from supine to long sitting (StoLong), long sitting (LongSitting), and from supine to right lateral position (StoR). Similarly, when the number of hidden states was 5, there was a difference more than 0.1 between the probabilities of stayingin the hidden state 2 in patterns 3 and that in patterns 4 (see the probability with red color in (a) and (b) of Figure 5). The postures that were included in hidden state 2 were from supine to long sitting (StoLong), long sitting (LongSitting), and supine (Supine). Comparison of the transition probabilities showed that the transition probabilities from a hidden state differ between when the subject gets out of the bed and when he/she does not. The including positions of the hidden state was confirmed based on the label given by humans. It was found that when the number of states were 4 and 5, the state with a large difference in the probabilities corresponded to the state in which the subject was trying to raise his upper body. From the new observations obtained from the posture change of the care recipient on the bed, it is possible to predict whether to get out of the bed or return to the supine position by using the state transition diagram and the Viterbi algorithm. The Viterbi algorithm extracts an optimal state transition path reaching to the state corresponding to StoLong and its probability for the new observations. The state transition diagrams calculated from each of patterns 3 and 4 have a difference in transition probabilities. Thus, the probabilities on the optimal paths are different between patterns 3 and 4. In case of the probability on the optimal path for pattern 3 is larger than that for pattern 4, we can predict that the care recipient will stay on the bed. Otherwise, we can predict that he/she will get out of the bed.

Position estimation in experiment without intervention
In the experiment without intervention, in order to confirm whether the posture could be estimated by machine learning, we used the 21 types of body pressure features obtained by patterns 3 and 4 as explanatory variables to classify the posture of the subjects. In the experiment without intervention, we do not observe the change of posture from the right lateral position to the prone position (RtoP). Therefore, the From the confusion matrix given in Table 2, it was possible to identify the posture related to getting out of the bed and the stable state with high accuracy. However, as shown in Table 4, there were many misidentifications in the transient state. According to the results of RF classification, the precision, recall, and F-value were about 0.62 by Macro average and about 0.91 by weighted average. The accuracy rate was about 0.92. In experiments without intervention, the 21 types of body pressure features were found to be useful for classifying the subject's posture.

Evaluation of postural estimation results
The experiment in section 4.1 was performed to estimate the posture on the bed from the subjects' body pressure measured by the body pressure sensor. From the results in Tables 2 and 3, we showed that the F-value was more than 0.7 in classifying the subjects' postures by RF using the 21 types of body pressure features shown in section 3.1 as explanatory variables. It was suggested that by measuring the body pressure of the care recipient on the bed with a body pressure sensor, getting out of the bed of the care recipient can be estimated in real time. Figure 6 shows the variable importance obtained by RF identification in the data obtained by the intervention experiment in section 4.1.
The six most important variables are the position of the center of gravity of each part, and the X coordinate is particularly important. This means that the position of the center of gravity of the body pressure sensor in the short side direction is important for estimating the posture of the subject. The reason why the X coordinate of the position of the center of gravity is important is that the speed and acceleration of each part are very small when the subject is in a stable state. It is considered that the center of gravity is biased in the direction of the body by the arms and legs. The seventh or below most important variables are mainly the velocity of the center of gravity of the hips and the acceleration of the back. It is considered that the reason why the hips and back movement is important is that when a subject turns over from the supine position, the subject moves quickly without applying any physical force. On turning over from the prone position, the subject moves slowly with force. On the other hand, when the subject is getting out of the bed, the subject moves with applying force and moves quickly. The results in Table 4 indicate that there were many misclassifications of the transient state related to the prone position, and that there was no feature variable in the body pressure features that clearly distinguished the prone position from the supine position. Therefore, we consider that, in order to classify the transient state related to the prone position in more detail, it is necessary to consider not only the X and Y coordinates of the position of the center of gravity but also the depth and spread of the body pressure in the Z axis direction. By measuring the three-dimensional body pressure features, it may be possible to grasp the movement and position of the body parts such as the arms and thighs of the subject in more detail, and the classification accuracy is improved. Figure 6. Valuable importance by RF for intervention experiment

Evaluation of transition probability calculated by HMM
The experiment in section 4.3 is to predict the getting out of the bed of the subjects based on the transition probabilities calculated by applying HMM using the body pressure features as the observed values. We confirmed that, for 6 or more hidden states, there was no significant difference in the transition probabilities to hidden states between patterns 3 and 4. From the results of Figure 4 and Figure 5 shown in section 4.4, for 4 and 5 hidden states, the difference in the transition probabilities of hidden states between pattern 3 and pattern 4 appeared.
The states that showed a large difference in the probabilities were from long sitting to supine, long sitting, and supine. In addition, it was found that the probability of self-transition of such the state is larger in pattern 3 than in pattern 4. It is considered that the subjects slowly raised their upper bodies in pattern 3 because they seemed to be in unhurried situations such as those where they would drink water. On the other hand, it is considered that the subjects moved quickly in pattern 4. It seems that they got out of bed without hesitation because they had already decided to get out of bed. In order to clarify the difference in transition probability to each hidden state, it is necessary to acquire long-term observed data of the body pressure features to be fed to HMM, such as for one week from the same user. It enables us to calculate the parameters of HMM in consideration of the individual differences. It is also expected that there occurs a clear difference in the transition sequences and transition probabilities between getting out of the bed and not getting out of the bed.

CONCLUSION
In this paper, we proposed a system for estimating the body posture from the body pressure of the care recipient. The system collects body pressure using sensors built into the bed to eliminate invasiveness. We also provide the method to predict getting out of the bed through the body pressure sensor to prevent the care recipient from falling at the bedside. Although existing works have been able to monitor the movements of a person on the bed with sensors, they have not quantitatively predicted the next action from the transition of the movement. The proposed system estimating the care recipient's intention from the transitions of movements so as to eliminate the possibility of accidents where they fall from the bed. This system divides the body pressure data of the care recipient into three parts. It calculates the centers of gravity of the legs, hips and back. Based on the division, it figures out the velocities, the accelerations of the centers of gravity, and the variance-covariance of the centers of gravity, as the body pressure features. This system estimating the positions of 16 types of the care recipients on the bed, applying machine learning with the body pressure feature as the explanatory variables. In addition, this system analyzes the body pressure features using an HMM. It examines the transition probability among each hidden state. We have succeeded in prediction of the care recipient getting out of the bed, before moving from the long sitting position to the end sitting position.
We carried out the intervention experiment to classify the subjects' postures on the bed into 16 types defined in advance through the proposed system. The experimental result showed that the F-value was 0.7 or more. We also carried out the experiment without intervention to verify whether the proposed system can predict getting out of the bed or not. We compared the transition probability in the two cases, which turns out there was a difference of the transition probabilities of the state related to raising the upper body in the cases. From these results, it is concluded not only the body posture can be estimated through the body pressure features, but also the intention of the care recipients getting out of bed can be predicted.
As the future work, we will measure body pressure features in three dimensions to improve the accuracy of posture classification. We will also acquire more detailed movements and positions of body parts such as the arms and thighs of the subject. In addition, in order to clarify the difference between the transition probabilities among the hidden states, we will observe the long-term body pressure feature from the same subject, in order to apply them to the HMM. We will also conduct experiments on actual care recipients who move slowly, because the subjects in the experiment were students who move fater.