# Regressive Machine Learning for Real-Time Monitoring of Bed-Based Patients
## 2 Materials and Methods
### Data Collection  
In this study, we utilized a high-fidelity mannequin, a tool commonly used in medical education and simulation centers, to simulate the various movements typically experienced by inpatient individuals in a bed setting. This mannequin, often employed by medical students for practicing diverse patient scenarios, was adapted to replicate the common movements and positions of bedridden patients.  
In the data collection process, a single high-fidelity mannequin, CAE iStan manikin (serial number MMPH1010) (Canadian Aviation Electronics Ltd., Montreal, QC, Canada), was utilized. This mannequin was equipped with Movella DOT sensors (Movella, Inc., Henderson, NV, USA) to simulate and capture the various movements typically experienced by inpatient individuals in a bed setting. The use of a single mannequin ensured consistency in the data collected and controlled for any potential variability that might arise from using multiple mannequins. This approach allowed the focus to be on the effectiveness of the ML algorithms in detecting these movements. The Movella DOT sensors are wearable sensor development platforms known for their signal processing and sensor fusion framework, making them particularly optimized for applications involving human movement. The sensor was positioned on the mannequin's torso, specifically at the midpoint of the sternum, i.e., a critical anatomical landmark. This placement was chosen to ensure optimal data capture and the reproducibility of the measurements. To secure the sensor in place and prevent any displacement during the experiments, a cross-shaped fixation method was employed using a high-strength, adhesive-backed material. The Movella DOT sensors, which include an accelerometer, a gyroscope, and a magnetometer, were strategically placed on the mannequin, as shown in Figure 1. These sensors recorded velocities, accelerations, and Euler angles at specific time intervals, providing a comprehensive dataset of the mannequin's movements [20]. The data were transmitted wirelessly via Bluetooth to eliminate any potential interference from cables.  
The accelerometer measured the acceleration of the mannequin's movements, the gyroscope captured the rotational speed, and the magnetometer recorded the magnetic field. The data from these individual components were then combined using sensor fusion algorithms to accurately calculate the mannequin's orientation.  
The sensor was placed on both adult-sized and infant-sized mannequins to simulate a range of patient demographics. Each movement was repeated approximately 100 times to  
Figure 1: Illustration of pitch, roll, and yaw relative to a patient in both supine and sitting positions.  
gather a substantial amount of data for each movement type. For breathing, the mannequin performed one full cycle of tidal volume inhalations and exhalations for 3 min straight. For seizures, the mannequin underwent a seizure for 10 min straight. For the rolling and falling off the bed movements, the infant mannequin was used. The mannequin was started in the supine position and rolled approximately 90 degrees to its left or right side and back to the original supine position. This was repeated approximately 100 times for each side. The data for dropping off the bed from the left were collected by having the infant mannequin start in the supine position and rolling it beyond its left side to the point where it falls off the bed. This was also repeated approximately 100 times.  
This approach of using a high-fidelity mannequin and sensors like Movella DOT has enabled us to gather precise and reliable data on the movements typically experienced by inpatients. The movements were then categorized into six distinct labels: \"Roll right\" (0), \"Roll left\" (1), \"Drop right\" (2), \"Drop left\" (3), \"Breathing\" (4), and \"Seizure\" (5). These labels represent the most common movements and positions experienced by inpatients, providing a comprehensive understanding of patient behavior in a bed setting.