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

Authors: Waranrach Viriyavit; Virach Sornlertlamvanich
Journal: Journal of Sensors
 (2020)

---

## Abstract

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.


---

## Body

## 1. 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–29]. There are some reports of using an ultrasonic sensor, air pressure sensor, and vibration sensor [10–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–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.


## 2. 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 is60×18cm. 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.Figure 1
Sensor panel.Figure 2
Components of a sensor panel.To detect the weight applied on the bed, we use two low-cost 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 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 Figure3. 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.Figure 3
Sensor panel under the mattress in the thoracic area.Placing the panel in such a position can distinguish between sitting and lying positions on the bed. Figure4 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.Figure 4
Correlation between signals and positions, where the first bold line is the signal of the piezoelectric sensor on the left, the second bold line is the signal of the piezoelectric sensor on the right, the solid line is the signal of pressure on the left, and the dashed line is the signal of pressure on the right.
(a)
Off-bed
(b)
Sitting
(c)
Lying center
(d)
Lying left
(e)
Lying right


### 2.2. 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. Table1 shows the details of the structure of the signal data package.Table 1
Structure of the signal data package.
Header
Data from four sensors
Ender
Sensor ID
Piezo right
Weight right
Piezo left
Weight left
8 bytes
2 bytes
8 bytes
8 bytes
8 bytes
8 bytes
3 bytes


### 2.3. 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:(i)
Off-bed (O): nobody is on the bed
(ii)
Sitting (S): a subject is sitting on the bed
(iii)
Lying center (C): a subject is lying in the center of the bed
(iv)
Lying left (L): a subject is lying on the left-hand side of the bed
(v)
Lying right (R): a subject is lying on the right-hand side of the bedLying left (L) and lying right (R) positions are defined as positions in which the subject is lying on either the left or the right side of the bed, regardless of the subject’s lateral position. An ambiguous position or changing movement is not considered in this experiment.The structure of the dataset is shown in Figure5. Each set of the accumulated data is composed of 30samples×4sensors=120samples, which is called the time slot in one second. The holding period of one position is called the interval time. Normally, one position held in one interval time lasts more than one second. Therefore, there are many time slots in one interval time. The time length of each position can then be measured by accumulating the number of time slots. The change of interval time shows the change of position. The sequence of changing positions can then be detected by the sequence of time intervals.Figure 5
Structure of the dataset.


## 2.1. Sensor Panel

The sensor panel is a ready-made set of sensors provided by AIVS Co., Ltd. The size of the panel is60×18cm. 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.Figure 1
Sensor panel.Figure 2
Components of a sensor panel.To detect the weight applied on the bed, we use two low-cost 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 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 Figure3. 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.Figure 3
Sensor panel under the mattress in the thoracic area.Placing the panel in such a position can distinguish between sitting and lying positions on the bed. Figure4 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.Figure 4
Correlation between signals and positions, where the first bold line is the signal of the piezoelectric sensor on the left, the second bold line is the signal of the piezoelectric sensor on the right, the solid line is the signal of pressure on the left, and the dashed line is the signal of pressure on the right.
(a)
Off-bed
(b)
Sitting
(c)
Lying center
(d)
Lying left
(e)
Lying right


## 2.2. 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. Table1 shows the details of the structure of the signal data package.Table 1
Structure of the signal data package.
Header
Data from four sensors
Ender
Sensor ID
Piezo right
Weight right
Piezo left
Weight left
8 bytes
2 bytes
8 bytes
8 bytes
8 bytes
8 bytes
3 bytes


## 2.3. 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:(i)
Off-bed (O): nobody is on the bed
(ii)
Sitting (S): a subject is sitting on the bed
(iii)
Lying center (C): a subject is lying in the center of the bed
(iv)
Lying left (L): a subject is lying on the left-hand side of the bed
(v)
Lying right (R): a subject is lying on the right-hand side of the bedLying left (L) and lying right (R) positions are defined as positions in which the subject is lying on either the left or the right side of the bed, regardless of the subject’s lateral position. An ambiguous position or changing movement is not considered in this experiment.The structure of the dataset is shown in Figure5. Each set of the accumulated data is composed of 30samples×4sensors=120samples, which is called the time slot in one second. The holding period of one position is called the interval time. Normally, one position held in one interval time lasts more than one second. Therefore, there are many time slots in one interval time. The time length of each position can then be measured by accumulating the number of time slots. The change of interval time shows the change of position. The sequence of changing positions can then be detected by the sequence of time intervals.Figure 5
Structure of the dataset.


## 3. Position Detection

### 3.1. 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 (Pl), right piezoelectric signal (Pr), left pressure signal (Wl), and right pressure signal (Wr), 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.
(1)X=x1,x2,x3,x4=Pl,Wl,Pr,Wr.Figure 6
Neural network diagram of four input signal types, where O is off-bed, S is sitting, C is lying center, L is lying left, and R is lying right.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 and the different types of sensors. All sensor data are normalized into the same range of 0 to 1 by [30]
(2)Yi=xi−minmax−min,where Yi is the normalized value, xi is the sensor data in the ith 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(3)X=x1,x2,x3,⋯,x120=Pl1,Wl1,Pr1,Wr1,Pl2,Wl2,Pr2,Wr2,⋯,Pl120,Wl120,Pr120,Wr120.


### 3.2. Estimation of Consecutive Position by the Bayesian Network

In normal practice, not all positions are equally transitioned to form a specific position. For example, it is 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.
(4)PS,P=PSPP∣S=PPPS∣P,(5)PS,P=PPi∣Pi−1,Pi−2PS∣Pi,where Pi, Pi−1, and Pi−2Pi−2 are, respectively, the positions in the i−2th, i−1th, and ith time positions of the sequence. S is the current set of signals consisting of four sensor signals (Pl, Wl, Pr, and Wr). The normalized signal is divided into three levels, i.e., low, middle, and high, by converting the continuous values of signal data to nominal values. For piezoelectric signals, 0-0.25, 0.26-0.50, and 0.51-1 are defined as low, middle, and high, respectively. For pressure signals, 0-0.35, 0.36-0.70, and 0.70-1 are defined as low, middle, and high, respectively.


### 3.3. 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 Figure7 and (5).
(6)αN+βB=C,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.Figure 7
Diagram of the position classification approach.


## 3.1. 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 (Pl), right piezoelectric signal (Pr), left pressure signal (Wl), and right pressure signal (Wr), 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.
(1)X=x1,x2,x3,x4=Pl,Wl,Pr,Wr.Figure 6
Neural network diagram of four input signal types, where O is off-bed, S is sitting, C is lying center, L is lying left, and R is lying right.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 and the different types of sensors. All sensor data are normalized into the same range of 0 to 1 by [30]
(2)Yi=xi−minmax−min,where Yi is the normalized value, xi is the sensor data in the ith 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(3)X=x1,x2,x3,⋯,x120=Pl1,Wl1,Pr1,Wr1,Pl2,Wl2,Pr2,Wr2,⋯,Pl120,Wl120,Pr120,Wr120.


## 3.2. Estimation of Consecutive Position by the Bayesian Network

In normal practice, not all positions are equally transitioned to form a specific position. For example, it is 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.
(4)PS,P=PSPP∣S=PPPS∣P,(5)PS,P=PPi∣Pi−1,Pi−2PS∣Pi,where Pi, Pi−1, and Pi−2Pi−2 are, respectively, the positions in the i−2th, i−1th, and ith time positions of the sequence. S is the current set of signals consisting of four sensor signals (Pl, Wl, Pr, and Wr). The normalized signal is divided into three levels, i.e., low, middle, and high, by converting the continuous values of signal data to nominal values. For piezoelectric signals, 0-0.25, 0.26-0.50, and 0.51-1 are defined as low, middle, and high, respectively. For pressure signals, 0-0.35, 0.36-0.70, and 0.70-1 are defined as low, middle, and high, respectively.


## 3.3. 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 Figure7 and (5).
(6)αN+βB=C,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.Figure 7
Diagram of the position classification approach.


## 4. Experiment and Result

### 4.1. Input Feature Evaluation

To evaluate the coverage of the trained model, the clean datasets are prepared by eliminating the possible noise of the signals. The evaluation set is defined in five categories, i.e., subject A, subject B, subject C, the combination of subject A and subject B in the same room, and the combination of data from two different rooms (subjects A, B, and C). The features of input are conducted for 4 inputs, 120 inputs, 4 inputs with normalized signals, and 120 inputs with normalized signals.The selected datasets are tabulated in Table2. The dataset of subject A consists of 2,000 samples (5positions×400samples), the same as subject B. This means that the combination of subject A and subject B in the same room includes 4,000 samples (5positions×800samples). For subject C, collected from another room, the dataset includes 1,335 samples (5positions×267samples). Totally, there are 5,335 samples (5positions×1067samples) as shown in the “Total” row in 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 2
Small clean dataset.
Subject
Position
Clean dataset
Training set
Test set
# of samples
# of time intervals
# of samples
# of time intervals
A
Off-bed
280
4
120
4
Sitting
280
4
120
4
Lying center
280
4
120
4
Lying left
280
4
120
4
Lying right
280
4
120
4
B
Off-bed
280
4
120
4
Sitting
280
4
120
4
Lying center
280
4
120
4
Lying left
280
4
120
4
Lying right
280
4
120
4
C
Off-bed
187
4
80
4
Sitting
187
4
80
4
Lying center
187
4
80
4
Lying left
187
4
80
4
Lying right
187
4
80
4
Total
Off-bed
747
12
320
12
Sitting
747
12
320
12
Lying center
747
12
320
12
Lying left
747
12
320
12
Lying right
747
12
320
12Table3 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.Table 3
Accuracy of input features on the small clean dataset.
Dataset
Input
Raw signal data
Normalized signal data
4 inputs
120 inputs
4 inputs
120 inputs
A (room 1)
99.3
99.8
99.6
99.9
B (room 1)
99.5
100
100
100
C (room 2)
99.9
99.9
100
99.9
A+B (room 1)
97.6
98.2
98.2
98.8
Room 1+room 2
97.2
98.1
98.5
100In 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 Figures8 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 classifying off-bed as sitting and an error of 6.8 in classifying sitting as off-bed, as shown in Figure 10.Figure 8
Signal of the off-bed position (the first bold line is the signal of the piezoelectric sensor on the left, the second bold line is the signal of the piezoelectric sensor on the right, the solid line is the signal of pressure on the left, and the dashed line is the signal of pressure on the right).Figure 9
Signal of the sitting position (the first bold line is the signal of the piezoelectric sensor on the left, the second bold line is the signal of the piezoelectric sensor on the right, the solid line is the signal of pressure on the left, and the dashed line is the signal of pressure on the right).Figure 10
Confusion matrix of the 5-position classification of subject B with 4 inputs.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 Figure11. 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.Figure 11
Confusion matrix of the 5-position classification of subject B with 120 inputs.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.Table4 shows the number of time intervals, sampled from the position data. The total size of the unclean dataset of the single subject A consists of 394,113 samples. The sizes of the 5 positions are 44,172, 32,012, 90,486, 4,820, and 222,643 for off-bed (O), sitting (S), lying center (C), lying left (L), and lying right (R), respectively. The total number of time intervals for each position is 42, 160, 111, 26, and 173, respectively.Table 4
Large unclean dataset.
Position
Unclean dataset
From one subject276922+117211=394113samples=109h28m53s
Training set
Test set
# of samples
# of time intervals
# of samples
# of time intervals
Off-bed
30,650
42
13,522
42
Sitting
22,408
160
9,604
160
Lying center
64,340
111
26,146
111
Lying left
3,674
26
1,146
26
Lying right
15,5850
173
66,793
173
Total
276922
512
117211
512The result of the feature evaluation test on subject A is shown in Table5. 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.Table 5
Accuracy of the unclean dataset.
Input
Raw signal data
Normalized signal data
4 inputs
120 inputs
4 inputs
120 inputs
95.17
95.45
96.54
96.64


### 4.2. 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. Figures12 and 13 show some examples of errors. For the signals shown in Figure 12, the signals of the sitting position 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.Figure 12
Similarity of the signal patterns between the sitting position and lying right position.
(a)
Sitting
(b)
Lying rightFigure 13
Similarity of the signal pattern between the lying center position and lying right position.
(a)
Lying center
(b)
Lying rightSimilarly, the signals in Figure14 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.Figure 14
State transition of the 5 positions, i.e., off-bed (O), sitting (S), lying center (C), lying left (L), and lying right (R).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 Table4. 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.Table 6
Accuracy of the combination of the neural network and Bayesian network.
α
β
Accuracy rate
1
0
96.64
0.7
0.3
96.74
0.5
0.5
96.85
0.3
0.7
97.06
0
1
91.40Looking into the details of improvement, Figure15 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.Figure 15
Detailed comparison between the results of classification of using only a neural network and a neural network with a Bayesian network.
(a)
Results of coefficientsα=1 and β=0
(b)
Results of coefficientsα=0.3 and β=0.7


### 4.3. 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. Table7 is tabulated by accumulating the results of the sleeping position estimation only. Our approach can reach 97.8% accuracy in classifying the three 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.Table 7
Comparison of sleep position classification algorithms.
Ref
# of positions
Accuracy (%)
Algorithm
Type of sensors
# of sensors
[13]
8
97.1
kNN
Pressure sensors
2,048
[14]
3
98.4
GMM+kNN
Pressure sensors
1,728
[15]
5
97.7
PCA+SVM
Pressure sensors
360
[16]
5
98.1
HoG+DNN
Pressure sensors
2,048
[17]
4
99.7
SVM
Pressure sensors
512
[18]
5
97.7
kNN
Force sensing array
2048
[19]
6
83.5
Raw data+SVM
FSR sensors
56
[20]
9
94.1
Joint feature extraction and normalization+SVM+PCA
FSR sensors/video
60
[21]
3
100
Kurtosis+skewness
FSR sensors
16
[22]
5
98.4
SVM (linear)+SVM (RBF)+LDA
CC-electrodes
12
Ours
3
97.8
NN+Bayesian network
Pressure and piezoelectric sensors
4In 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 position-by-position comparison result is shown in Table 8.Table 8
Comparison of sleep three-position classification algorithms.
Ref
Accuracy (%)
# of sensors
Left
Middle
Right
[21]
100
100
100
16
Ours
93.05
96.40
98.46
4The 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.


## 4.1. Input Feature Evaluation

To evaluate the coverage of the trained model, the clean datasets are prepared by eliminating the possible noise of the signals. The evaluation set is defined in five categories, i.e., subject A, subject B, subject C, the combination of subject A and subject B in the same room, and the combination of data from two different rooms (subjects A, B, and C). The features of input are conducted for 4 inputs, 120 inputs, 4 inputs with normalized signals, and 120 inputs with normalized signals.The selected datasets are tabulated in Table2. The dataset of subject A consists of 2,000 samples (5positions×400samples), the same as subject B. This means that the combination of subject A and subject B in the same room includes 4,000 samples (5positions×800samples). For subject C, collected from another room, the dataset includes 1,335 samples (5positions×267samples). Totally, there are 5,335 samples (5positions×1067samples) as shown in the “Total” row in 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 2
Small clean dataset.
Subject
Position
Clean dataset
Training set
Test set
# of samples
# of time intervals
# of samples
# of time intervals
A
Off-bed
280
4
120
4
Sitting
280
4
120
4
Lying center
280
4
120
4
Lying left
280
4
120
4
Lying right
280
4
120
4
B
Off-bed
280
4
120
4
Sitting
280
4
120
4
Lying center
280
4
120
4
Lying left
280
4
120
4
Lying right
280
4
120
4
C
Off-bed
187
4
80
4
Sitting
187
4
80
4
Lying center
187
4
80
4
Lying left
187
4
80
4
Lying right
187
4
80
4
Total
Off-bed
747
12
320
12
Sitting
747
12
320
12
Lying center
747
12
320
12
Lying left
747
12
320
12
Lying right
747
12
320
12Table3 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.Table 3
Accuracy of input features on the small clean dataset.
Dataset
Input
Raw signal data
Normalized signal data
4 inputs
120 inputs
4 inputs
120 inputs
A (room 1)
99.3
99.8
99.6
99.9
B (room 1)
99.5
100
100
100
C (room 2)
99.9
99.9
100
99.9
A+B (room 1)
97.6
98.2
98.2
98.8
Room 1+room 2
97.2
98.1
98.5
100In 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 Figures8 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 classifying off-bed as sitting and an error of 6.8 in classifying sitting as off-bed, as shown in Figure 10.Figure 8
Signal of the off-bed position (the first bold line is the signal of the piezoelectric sensor on the left, the second bold line is the signal of the piezoelectric sensor on the right, the solid line is the signal of pressure on the left, and the dashed line is the signal of pressure on the right).Figure 9
Signal of the sitting position (the first bold line is the signal of the piezoelectric sensor on the left, the second bold line is the signal of the piezoelectric sensor on the right, the solid line is the signal of pressure on the left, and the dashed line is the signal of pressure on the right).Figure 10
Confusion matrix of the 5-position classification of subject B with 4 inputs.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 Figure11. 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.Figure 11
Confusion matrix of the 5-position classification of subject B with 120 inputs.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.Table4 shows the number of time intervals, sampled from the position data. The total size of the unclean dataset of the single subject A consists of 394,113 samples. The sizes of the 5 positions are 44,172, 32,012, 90,486, 4,820, and 222,643 for off-bed (O), sitting (S), lying center (C), lying left (L), and lying right (R), respectively. The total number of time intervals for each position is 42, 160, 111, 26, and 173, respectively.Table 4
Large unclean dataset.
Position
Unclean dataset
From one subject276922+117211=394113samples=109h28m53s
Training set
Test set
# of samples
# of time intervals
# of samples
# of time intervals
Off-bed
30,650
42
13,522
42
Sitting
22,408
160
9,604
160
Lying center
64,340
111
26,146
111
Lying left
3,674
26
1,146
26
Lying right
15,5850
173
66,793
173
Total
276922
512
117211
512The result of the feature evaluation test on subject A is shown in Table5. 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.Table 5
Accuracy of the unclean dataset.
Input
Raw signal data
Normalized signal data
4 inputs
120 inputs
4 inputs
120 inputs
95.17
95.45
96.54
96.64


## 4.2. 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. Figures12 and 13 show some examples of errors. For the signals shown in Figure 12, the signals of the sitting position 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.Figure 12
Similarity of the signal patterns between the sitting position and lying right position.
(a)
Sitting
(b)
Lying rightFigure 13
Similarity of the signal pattern between the lying center position and lying right position.
(a)
Lying center
(b)
Lying rightSimilarly, the signals in Figure14 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.Figure 14
State transition of the 5 positions, i.e., off-bed (O), sitting (S), lying center (C), lying left (L), and lying right (R).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 Table4. 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.Table 6
Accuracy of the combination of the neural network and Bayesian network.
α
β
Accuracy rate
1
0
96.64
0.7
0.3
96.74
0.5
0.5
96.85
0.3
0.7
97.06
0
1
91.40Looking into the details of improvement, Figure15 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.Figure 15
Detailed comparison between the results of classification of using only a neural network and a neural network with a Bayesian network.
(a)
Results of coefficientsα=1 and β=0
(b)
Results of coefficientsα=0.3 and β=0.7


## 4.3. 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. Table7 is tabulated by accumulating the results of the sleeping position estimation only. Our approach can reach 97.8% accuracy in classifying the three 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.Table 7
Comparison of sleep position classification algorithms.
Ref
# of positions
Accuracy (%)
Algorithm
Type of sensors
# of sensors
[13]
8
97.1
kNN
Pressure sensors
2,048
[14]
3
98.4
GMM+kNN
Pressure sensors
1,728
[15]
5
97.7
PCA+SVM
Pressure sensors
360
[16]
5
98.1
HoG+DNN
Pressure sensors
2,048
[17]
4
99.7
SVM
Pressure sensors
512
[18]
5
97.7
kNN
Force sensing array
2048
[19]
6
83.5
Raw data+SVM
FSR sensors
56
[20]
9
94.1
Joint feature extraction and normalization+SVM+PCA
FSR sensors/video
60
[21]
3
100
Kurtosis+skewness
FSR sensors
16
[22]
5
98.4
SVM (linear)+SVM (RBF)+LDA
CC-electrodes
12
Ours
3
97.8
NN+Bayesian network
Pressure and piezoelectric sensors
4In 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 position-by-position comparison result is shown in Table 8.Table 8
Comparison of sleep three-position classification algorithms.
Ref
Accuracy (%)
# of sensors
Left
Middle
Right
[21]
100
100
100
16
Ours
93.05
96.40
98.46
4The 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.


## 5. 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 unity-based 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 trigram probability effectively improves the accuracy from 96.64% to 97.06%, with a coefficient of 0.3 and 0.7 for the neural network and the Bayesian network probability, respectively. The combination model essentially improves the sitting position detection 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 evaluation of our 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.



---

*Source: 5689860-2020-01-31.xml*