Bed Position Classification by a Neural Network and Bayesian Network Using Noninvasive Sensors for Fall Prevention

Falls from a bed often occur when an elderly patient attempts to get out of bed or comes close to the edge of a bed. These mishaps have a high possibility of serious injuries, such as bruises, soreness, and bone fractures. Moreover, a lack of repositioning the body of a bedridden elderly person may cause bedsores. To avoid such a risk, a continuous activity monitoring system is needed for taking care of the elderly. In this study, we propose a bed position classification method based on the sensor signals collected from only four sensors that are embedded in a panel (composed of two piezoelectric sensors and two pressure sensors). It is installed under the mattress on the bed. The bed positions considered are classified into five different classes, i.e., off-bed, sitting, lying center, lying left, and lying right. To collect the training dataset, three elderly patients were asked for consent to participate in the experiment. In our approach, a neural network combined with a Bayesian network is adopted to classify the bed positions and put a constraint on the possible sequences of the bed positions. The results from both the neural network and Bayesian network are combined by the weighted arithmetic mean. The experimental results have a maximum accuracy of position classification of 97.06% when the proportion of coefficients for the neural network and the Bayesian network is 0.3 and 0.7, respectively.


Introduction
Due to the significant growth of the elderly population in today's demography, the needs of geriatric care have increased. A survey of the National Statistical Office of Thailand has shown that the single elderly increased to 8.7% in 2014, and 18.76% of the elderly population live with their spouse only [1]. This is one of the results from gradual changes in the Thai social structure. Most young people have to spend their time earning money. Increasingly, elderly people are abandoned to stay alone at home or are left in a nursing home during working hours.
Without being carefully watched over, elderly patients can fall which is a major cause of trouble in nursing care [2]. The accident can cause severe injuries, such as bruises, soreness, and bone fractures. The National Statistical Office of Thailand reported that 11.6% of elderly people have experienced a fall, and 46.3% of them were treated and 7.8% of them were hospitalized as an inpatient [1]. Moreover, falls are the leading cause of death and disability in elderly people, as high as 40.4% [3]. An injury at a higher age has a higher possibility of death because of health weaknesses [1]. The Department of Disease Control, Ministry of Public Health of Thailand, reported that 1,049 elderly people died from falls in 2015 [4]. In 2014, Tsai et al. conducted a study of the factors of fall injuries in the elderly patients at a medical center in Taiwan [5]. They found that 8.7% of elderly patients who participated in the study had repeatedly fallen in the previous year. Some of them (28.6%) fell at the bedside, in which most of the cases are an unassisted bed exit [5]. However, there is also a risk of rolling out of bed when an elderly patient lies too close to the edge of the bed. In addition, the bedridden elderly patients are often unable to reposition themselves, which is a cause of bedsores. Desirable bodily movement can alleviate the prolonged pressure over the body. The most widely accepted way of preventing bedsores is to turn the elderly body every two hours. Therefore, continuous monitoring is inevitable for the elderly to prevent falls and bedsores. This requires a large number of caregivers with respect to the growth of the elderly population. Geriatric care can be highly costly and faces a shortage in the number of caregivers, which is only 11.1% of the elderly population as reported in [1]. This is leading to an inefficiency of nursing care services in the near future. The monitoring system for bed fall and bedsore prevention can be a complementary utility to support caregivers and to diminish their workloads. The system must be able to detect the position of an elderly patient on the bed and movement which comes close to falling in an allowable time period for a caregiver to assist the elderly patient.
A wearable device is widely used for an elderly activity monitoring system [6,7]. However, in most cases, the elderly can feel uncomfortable with their daily living activities, which leads to discontinuous monitoring [8,9]. Also, a video camera is unacceptable for the elderly because of privacy concerns. As a result, a noncontact sensing device is a proper approach for continuously monitoring elderly activity [10][11][12][13][14][15][16][17][18][19][20][21][22][23][24][25][26][27][28][29]. There are some reports of using an ultrasonic sensor, air pressure sensor, and vibration sensor [10][11][12]. Though the aforementioned studies can determine whether the patient is in the bed or not, this is not enough to prevent a fall. To prevent falls, the system needs to detect the position of lying with respect to the edge of the bed. To prevent bedsores, the duration of the same position of lying can be observed by monitoring movement. Some previous studies used commercial pressure mat systems to detect the bed position [13][14][15][16][17][18][19][20][21]. However, their proposed pressure mat systems need a large number of sensors which are not practical and are costly in actual practice. Some studies proposed approaches to reduce the number of sensing array sensors. The minimum number of sensors in the aforementioned studies is 16 sensors, as reported by Hsia et al. [21]. Although the studies have shown promising results in bed position classification, their approaches still require quite a large number of sensors. For this concern, we reduced the number of sensors to only four in our study while maintaining high accuracy in bed position classification.
In this paper, we propose a bed position classification based on a neural network combined with a Bayesian network, with signals from only four sensors. The results of our study can be applied to prevent elderly bedsores and bed falls. We classify the bed positions into five classes, namely, off-bed, sitting, lying center, lying left, and lying right. The off-bed and sitting positions are highly important for detecting the bed exit activity because they normally are the positions just before or after the bed exit according to our statistical analysis. With the bed position, the system will alert the caregiver to assist an elderly patient to prevent falls when the elderly patient moves towards the edge of the bed. The system will also alert the caregiver to turn the elderly patient's body when staying in the same position for almost the allowed time period (normally two hours) to prevent bedsores.

Materials
2.1. Sensor Panel. The sensor panel is a ready-made set of sensors provided by AIVS Co., Ltd. The size of the panel is 60 × 18 cm. The panel is equipped with two types of sensors, i.e., two piezoelectric sensors and two pressure sensors. Each pair of sensors is embedded symmetrically on each side of the panel as shown in Figure 1. The sensors are sandwiched between two ABS boards, which has an advantage in stiffness and being firm and difficult to bend. The sandwich structure keeps the sensors firm avoiding the signal distortion as shown in Figure 2.
To detect the weight applied on the bed, we use two lowcost force-resistive sensors (FRS) from Interlink 402. Each is installed on the left and the right side of the panel. The FSR consists of two membranes separated by a thin air gap. Resistance decreases when force is applied, and resistance is infinite when force is zero. The force sensitivity range is~0.2 to 20 N. The temperature operating range is -30 to 70°C. The sensor is low-cost and can be used to detect physical pressure, squeezing, and weight, though it is rarely accurate. However, its sensitivity is sufficient for detecting a weighted object on the bed.
The piezoelectric sensor, Murata Piezoelectric Diaphragms 7BB-15-6L0, can change the energy between the kinetic energy and electric energy. When a vibration force is applied, the voltage is changed. The resonance frequency    Journal of Sensors is 2.8 kHz. In the sensor panel, it is installed to detect the vibration transmitted from the patient activities.
The combination of both pairs of different types of sensors is used to detect the position from each side of the body on the bed. The panel is simply set under the mattress in the thoracic area, as shown in Figure 3. The panel is fixed to the bed board to keep the constant relative position to the patient body. It is designed to work 24 hours in common use, avoiding the wet circumstance since there is not much temperature change in the hospital ward or at home. In our case, the sensor is not designed to be used in a severe condition.
Placing the panel in such a position can distinguish between sitting and lying positions on the bed. Figure 4 shows the correlation between signals of four sensors and positions. For example, Figure 4(a) is the signal of four sensors of the off-bed position. The activation of both sensor signals is low compared to the signal of the sitting position which has low activation of pressure signals while the signals from the piezoelectric sensors are still being detected. Normally, the signals from the piezoelectric sensors in any positions on the bed show high activation, whereas they are very low in the off-bed position. The pair of pressure sensors can be used to distinguish between the positions of lying. For example, in the lying center position, the weight of the body is on both sides of the sensors while in the lying left or lying right positions, only one side of the sensors is activated, as shown in Figures 4(c)-4(e). In lying positions, the activation of pressure sensors is quite high in contrast to sitting positions in which the activation of the pressure sensors is low.

Data
Structure. The control device outputs a package of data in a sample rate of 30 samples in one second. The data package contains 45 bytes. It is divided into 3 parts: 8 bytes for the header, 34 bytes for the data from four sensors, and 3 bytes for the ender. In the 34 bytes for the data from four sensors, the first two bytes contain the sensor ID, and the next 32 bytes contain four 8-byte blocks (one block for each sensor), i.e., the left piezoelectric signal, left pressure signal, right piezoelectric signal, and right pressure signal. The magnitude of the sensors is 256. The range of the value of the piezoelectric signal is -127 to 128, and the pressure signal is from 0 to 256. The sampling rate of each sensor is 30 Hz. Table 1 shows the details of the structure of the signal data package.

Data Collection.
The collected data include the sensor signal data and the corresponding videos. Three elderly patients, whose ages are between 60 and 85, participated in the experiment. To evaluate the effects of the environment, the data from two different rooms are collected with different sets of sensors. The data of two patients are collected from two different rooms. The total collected data are 459 hours long. The position labels are annotated by observing the corresponding video. The position labels are defined in five classes, i.e., off-bed (O), sitting (S), lying center (C), lying left (L), and lying right (R). The definition of each position is described as follows:

Position Classification by the Neural Network.
To classify a position on the bed, the signal data from the control device output, i.e., the left piezoelectric signal (P l ), right piezoelectric signal (P r ), left pressure signal (W l ), and right pressure signal (W r ), are used as the input for the neural network. These four inputs are passed through the neural network as defined in (1) and depicted in Figure 6.
Since the initial weight and the scale of the signal from the piezoelectric sensor and pressure sensor are different, instead of using the raw values from the sensors, we apply the unity-based normalization (or feature scaling) method to eliminate the biases of the weight from different bodies where Y i is the normalized value, x i is the sensor data in the i th time position of the sequence, min is the minimum value, and max is the maximum value of the collection.
To accumulate the signal data in one second from the property of the sensors where the sampling rate is 30 Hz, one set of data is composed of 30 samples of 4 types of sensors, which makes 120 data signals as defined in   Journal of Sensors more likely that a subject will sit on the bed before lying down to a sleeping position, while it is rarely found that a subject will jump to lying down on the opposite side of the bed. To estimate the next possible transition positions, the Bayesian network [31] is applied. This method can depress the noise of the signal that is caused by other activities in an uncontrolled environment. The probability of a consecutive position can be estimated by the former n positions and the current signal, as shown in (4) and (5) for the trigram model estimation.
where P i , P i−1 , and P i−2 P i−2 are, respectively, the positions in the ði − 2Þ th , ði − 1Þ th , and i th time positions of the sequence. S is the current set of signals consisting of four sensor signals (P l , W l , P r , and W r

Combination of the Neural Network and Bayesian
Network. We apply the weighted arithmetic mean for the combination of the results from the neural network and Bayesian network, as shown in Figure 7 and (5).
where N is the neural network probability, B is the Bayesian probability, C is classes, and α and β are coefficients where the sum of α and β is 1.    Journal of Sensors Table 2. The datasets are selected from four different time intervals for each subject and randomly divided into 70% for training and 30% for testing. In the combination of two rooms, the dataset consists of 12 time intervals, as shown in the "Total" row in Table 2. Table 3 shows the result of the feature evaluation test with the small clean dataset. The overall performance on the 120 inputs with normalized signals can reach 100% accuracy. In total, the model based on the normalized signal data and the model based on the accumulated signal data of 120 inputs can provide a better result when compared to the 4-input model.

Experiment and Result
In the off-bed and sitting positions, the signals are quite similar. For example, in the sitting position, the activation of the pressure sensors is low, similar to that in the off-bed position, but not for the signals from the piezoelectric sensors. Therefore, at some points, the signals of both positions look the same, as shown in Figures 8 and 9. In the case of 4 inputs, the accuracy of the off-bed position is 99.2 and that of the sitting position is 93.2, showing an error of 0.8 in   7 Journal of Sensors classifying off-bed as sitting and an error of 6.8 in classifying sitting as off-bed, as shown in Figure 10.
The accumulation of the signal data in a one-second time slot (120-input set) can solve the confusion between the sitting position and the off-bed position, as shown in Figure 11. This is because by using the 120 inputs, the neural network can capture more context features, to distinguish the off-bed position from the sitting position.
Expanding the size of the dataset on the single subject A from 2,000 to 394,113 samples, we evaluated the features of input in four categories. The selected dataset includes many signal errors and unexpected noise. The dataset is also divided randomly into 70% for training and 30% for testing. Table 4 shows the number of time intervals, sampled from the position data. The total size of the unclean data- The result of the feature evaluation test on subject A is shown in Table 5. The best result is 96.64% for the accuracy of the 120 inputs with normalized signals. The accuracy of the larger dataset decreases because of the signal ambiguity. The accuracy of the large and unclean dataset (Table 5) decreases, compared to that of the small and clean dataset as shown in Table 3. The best result of Table 5 is 96.64% while the best result for subject A in Table 3 is 99.9%. This is because the larger dataset includes much-unexpected noise.

Position Classification by the Combination of the Neural
Network and Bayesian Network. The very large and unclean dataset includes many signal errors and much-unexpected noise. Figures 12 and 13 show some examples of errors. For the signals shown in Figure 12, the signals of the sitting posi-tion are similar to the signals of the lying right position. This is because the subject gets on/off on the right side of the bed. Before getting out of bed, the subject usually moves to sit on the right side of the bed, applying force on the right pressure sensor. Therefore, sitting before getting out of bed can cause the signal to look similar to lying right. Similarly, the signals in Figure 14 show the similarity of signal patterns between the lying center position and the lying right position because the subject tends to stay on the right side of the bed.
To solve the problems of signal ambiguity, we introduce the Bayesian network to estimate the likelihood of the consecutive position, to eliminate the unexpected result of the output position from the neural network model. We create the Bayesian network from the large unclean dataset of subject A, as shown in Table 4. All possible connecting positions are calculated from the transition network, as shown in Figure 14. We estimate the Bayesian network by using the position trigram model, according to (5).
The results from both the neural network and the Bayesian network estimations are combined by the weighted arithmetic mean. To evaluate the coefficient (α, β) of the weighted arithmetic mean in (5), the values of α and β are varied for the dataset of subject A, as shown in Table 6. α is the coefficient of neural network probability, and β is the coefficient of Bayesian network probability. The accuracy can reach 97.06% when the proportion of the coefficient for the neural network is 0.3 and that for the Bayesian network is 0.7, as shown in Table 6. As a result of this combination model, the Bayesian network effectively shows the improved performance in position estimation in the case of signal confusing errors.
Looking into the details of improvement, Figure 15 shows a significant change in recognizing the sitting position better by reducing the fault detection of the lying right position, while still maintaining other position classification in similar accuracy. The sitting position detection is improved from 86.10% to 89.07% by reducing the confusion errors of the detection with lying right and out of bed positions from 8.06% to 6.24% and 4.68% to 3.91%, respectively. The improvement of sitting position detection is crucial for care givers in making decision of supporting help.

Comparative Evaluation with Other
Approaches. It is quite difficult to evaluate the performance against other approaches because of the differences in datasets, number of bed positions, and number of sensors. The best we can do is to compare the results on the estimation of the common target position. Table 7 is tabulated by accumulating the results of the sleeping position estimation only. Our approach can reach 97.8% accuracy in classifying the three   9 Journal of Sensors sleep positions, i.e., lying center, lying left, and lying right. Our approach, using only four sensors, outperforms the approaches proposed by [13] using 2,048 sensors, [15] using 360 sensors, [18] using 2,048 sensors, [19] using 56 sensors, and [20] using 60 sensors in overall evaluation.
In terms of a position-by-position comparison, there is only one report from Hsia et al. [21], which has the same three bed positions as defined by our model. The positionby-position comparison result is shown in Table 8.
The result of our approach is not the best though it shows that our model is promising with a limited number of sensors, and the model can be created by a small number of testing subjects. In terms of practicality, our approach has advantages in cost performance and maintenance.

Conclusion
A bed alarm for fall prevention needs a highly accurate bed position detection system. The system must be able to issue an alert as early as possible once it detects a position where there is a high risk of falling. In this study, a neural network is used to classify the signals from the designed sensors into five types of positions. The signal data from the sensors are normalized by using the unitybased normalization (or feature scaling) method to eliminate the biases of body weight and different types of sensors. In addition, the accumulation of the signal data in a one-second time slot (a set of 120 inputs) can also help improve the accuracy of the sitting and off-bed positions. The performance of 120 inputs with normalized signal data yields a better result than the three other types of inputs, i.e., 4 inputs, 4 inputs with normalized signal data, and 120 inputs. Furthermore, when the dataset is extended to a large and unclean dataset, the accuracy of the single neural network model significantly drops. To improve the performance of the neural network approach, we adopt the Bayesian network to restrict the possibility of transition of a position. As a result, the Bayesian network       11 Journal of Sensors approach against others is also promising. Even though it cannot outperform some of the other previously proposed methods that need a large number of sensors, our approach needs only four sensors. It can be concluded that our approach can perform at high accuracy for position detection and requires the fewest number of sensors.

Data Availability
The data of this study are available from the corresponding author upon request.

Disclosure
The manuscript is based on the thesis of the author Waranrach Viriyavit.

Conflicts of Interest
The authors declare that they have no conflicts of interest.

Acknowledgments
The sensor panel and IP camera, utilized in data collection, are provided by AIVS Co., Ltd. under the Japan International Cooperation Agency (JICA) grants for SME development support. The video and patient data are recorded under the consent of the patients and acknowledgment of Banphaeo Hospital. We are very thankful to Mr. Shunichi Yoshitake, Chairman of AIVS, for his strong support of the equipment and the director together with the staff of Banphaeo Hospital for the overall support in data collection. The research is financially supported by the Thammasat University Research Fund