# Dynamic Segmentation for Physical Activity Recognition Using a Single Wearable Sensor
## 4 Proposed Method
### Determining Segment Boundaries
In the second phase, for the purpose of determining the effectiveness of the proposed method using the SVM classifier, other common classifiers, including J48, K-Nearest Neighbors (KNN), and Naive Bayes (NB), were used for comparison. Table 2 reports the classification performance of the proposed method in comparison to the fixed-size sliding window approach. It indicates that not only a performance improvement in accuracy measures was obtained when using the proposed method but also the values for precision, recall, and F-measure showed statistically significant improvements. Additionally, an evaluation of activity type recognition accuracy and prediction error was undertaken for each of the three physical activities. As shown in Table 3, the algorithm had the greatest difficulties when recognizing abduction and flexion. This was expected because these two activities are similar, especially with regard to the starting and ending points of the movement, as well as the range of motion. However, the algorithm still achieved a recognition accuracy of 96% for these physical activities. Figure 8 depicts the recall, precision, and F-measure values for each activity obtained by the model using the SVM classifier. Both segmentation methods achieved high classification performance in recognizing EF, and the enhancement achieved by the proposed method was small. However, the enhancement became increasingly large when recognizing more similar activities: abduction and flexion. The increase in recall when using the proposed method was 5% in abduction and approximately 4% in flexion, while precision increased by 5% and 7% in recognizing abduction and flexion, respectively. In addition, our method increased the F-measure of abduction by 7% and flexion by 5%. These results show that the proposed method not only enhanced performance but also increased model robustness. \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & **Accuracy** & **Recall** & **Precision** & **F-Measure** \\ \hline Our method & 96.67 \(\pm\) 2.7\% & 96.67 \(\pm\) 1.2\% & 96.97 \(\pm\) 1.9\% & 96.82 \(\pm\) 1.5\% \\ Sliding Window & 91.44 \(\pm\) 5.9\% & 91.90 \(\pm\) 3.9\% & 92.51 \(\pm\) 4.5 \% & 92.21 \(\pm\) 3.8\% \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Performance comparison using accuracy, recall, and precision measures (mean \(\pm\) standard deviation) between segmentation using the proposed method and fixed-size sliding window. \begin{table}
\begin{tabular}{c c c} \hline \hline  & **Abduction** & **EF** & **Flexion** \\ \hline Abduction & 96 & 1 & 3 \\ EF & 98 & 2 \\ Flexion & 4 & 96 \\ \hline EF: Elbow Flexion. & & \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Confusion matrix of activity recognition (in %). Rows represent actual exercise, whereas columns show algorithm predictions (cells with value 0 are left blank). To investigate the effectiveness of the proposed method using the SVM classifier, three common machine learning algorithms were further used for the comparison. Table 4 shows the performance of the proposed method and sliding window using NB, J48, and KNN classifiers. ## 7 Discussion

In this study, we proposed and verified a machine learning-based method for physical activity segmentation using wearable sensors. Our method enabled the algorithm to classify specific types of physical activity with an accuracy reaching up to 96%. Overall classification performance improved by approximately 5% compared to a commonly used approach, namely the sliding window. Furthermore, the results in Table 2 clearly indicate that the statistically significant improvement occurred not only in terms of accuracy but also \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & **SVM** & **NB** & **J48** & **KNN** \\ \hline Our method & 96.67 \(\pm\) 2.7\% & 91 \(\pm\) 3.4\% & 95 \(\pm\) 5.1\% & 95.65 \(\pm\) 1.9\% \\ Sliding Window & 91.44 \(\pm\) 5.9\% & 84.49 \(\pm\) 3.9\% & 89.78 \(\pm\) 5.4\% & 90.28 \(\pm\) 5.4\% \\ \hline \hline \end{tabular}
\end{table}