# Upper Body Posture Recognition Using Inertial Sensors and Recurrent Neural Networks
## 3 Results  
Six healthy adults (four males and two females), aged 20-65, were involved in this study to simulate seven sitting postures in daily life: upright, slump, lean, right and left bending, and right and left twisting postures. Raw signals were collected by using IMUs during one single trial in each corresponding axis (Figure 4). Data labeling showed serial transitions during trials (Figure 5).  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Description** & **Value** \\ \hline Environment & Intel Core i7-7700 HQ CPU, 12 GB RAM \\  & GPU NVIDIA GeForce GTX1050 \\ Mini-batch size & 32 \\ Epoch & 600 \\ Learning rate & 0.001 \\ Optimization (Backpropagation) & Adam optimizer \\ Validation & 10-fold CV \\ \hline \hline \end{tabular}
\end{table}
Table 1: Experimental setup in the training procedure.  
Figure 3: Schematic diagram of the LSTM-RNN machine learning classifier.  
The confusion matrix of classification results was shown for the LSTM-RNN machine learning classifier (Figure 6). For seven sitting postures, the model's average accuracy increased to 99.0 \(\pm\) 0.3% in 600 epochs, and the average F1 score was approximately 0.966 \(\pm\) 0.012 (Table 2). In order to evaluate the performance of the trained model, a testing sequence was input with labels. According to the leave-one-subject-out (LOSO) method, test sets consisted of persons not included in the training. Training and validation sets were created by using a 95% to 5% splitting [32]. The unused dataset including the sixth subject was tested (Figure 7), resulting in a model accuracy of 81.2%. Results showed the practicality and potential of IMUs-based applications using LSTM-RNNs in sitting posture detection.  
Figure 4: Original time-dependent signals collected from IMU sensors in one single human trial.  
Figure 5: Results of data labeling. The blue line represents the raw signal collected from the IMU, and the orange line shows that the raw signal had been extracted to 28 intermittent phases by first-order differentiation of acceleration.  
In order to determine the optimal number of sensors, we evaluated the relevance between the numbers of sensors and the classifier's performance. After excluding specific  
\begin{table}
\begin{tabular}{c c c} \hline \hline  & **Accuracy (\%)** & **F1 Score** \\ \hline Upright & 98.3 & 0.942 \\ Slump & 99.2 & 0.974 \\ Lean & 99.3 & 0.975 \\ Right bending & 99.1 & 0.967 \\ Left bending & 99.4 & 0.976 \\ Right twisting & 98.9 & 0.960 \\ Left twisting & 99.1 & 0.966 \\ \hline Average & 99.0 \(\pm\) 0.3 & 0.966 \(\pm\) 0.012 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Accuracy and F1 scores of the LSTM-RNN model after training with five datasets collected from 4 IMU sensors.  
Figure 6: Confusion matrix of classification results for the LSTM-RNN model after training collected from 4 IMU sensors. Model precision and recall were calculated and indicated as green figures in the last line and the last row, respectively. Precision: proportion of correctly classified predicted positives; recall: proportion of correctly classified actual positives.  
Figure 7: Classification performance of the trained LSTM-RNN model by using a testing sequence collected in the same protocol but not in the training dataset. The red line represents postures performed by subjects during human trials. The blue line represents postures predicted by the model with a sampling rate of 50 Hz. Classification errors are shown in green rectangles.  
sensors, the classifier's performance was compared with the performance of the four-sensor IMU, which was designated as the control group in this test. According to the comparison (Figure 8), model accuracy decreased as the number of sensors was reduced. The combination of three sensors covering the thoracic area (B1-B3) exhibited an accuracy of 98.1%.