# Activity Prediction Based on Deep Learning Techniques
## 4 Results and Discussion
### Performance Evaluation  
The performance of both models was evaluated in terms of predictive accuracy, as shown in Tables 6-9. For the experiments, we chose a learning rate of 0.01, epoch of 100, and batch size of 32, 64, 128, and 256, respectively. Training accuracy for both models was higher than the test accuracy for all subject persons. Further, for all subject persons, the training accuracy was more than 90%, except for the ID_01 case, where the test accuracy was lower than 90%. However, in general, the accuracy rates for all subject experiments were very high, which is more than 90%, except in the ID_01 case. \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Batch Size**} & \multicolumn{2}{c}{**Training Accuracy**} & \multicolumn{2}{c}{**Test Accuracy**} \\ \cline{2-5}  & **MLP** & **LSTM** & **MLP** & **LSTM** \\ \hline
32 & 0.97 & 0.98 & 0.83 & 0.85 \\
64 & 0.97 & 0.98 & 0.83 & 0.86 \\
128 & 0.96 & 0.98 & 0.80 & 0.86 \\
256 & 0.95 & 0.97 & 0.77 & 0.86 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Training and test accuracy of ID_01. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Specifications** & **MLP** & **LSTM** \\ \hline Window size & 3 & 3 \\ Input dimension & 3 \(\times\) 5 & 3 \(\times\) 5 \\ Number of hidden layers & 1 & 1 \\ Number of out layers & 1 & 1 \\ Number of hidden nodes & 128 & 128 \\ Number of output nodes & 13 & 13 \\ Hidden layer activation functions & ReLU & ReLU \\ Optimizer & Adam & Adam \\ Output layer activation functions & SoftMax & SoftMax \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Network model setup for the MLP and the LSTM. \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Batch Size**} & \multicolumn{2}{c}{**Training Accuracy**} & \multicolumn{2}{c}{**Test Accuracy**} \\ \cline{2-5}  & **MLP** & **LSTM** & **MLP** & **LSTM** \\ \hline
32 & 0.98 & 0.99 & 0.94 & 0.94 \\
64 & 0.98 & 0.99 & 0.94 & 0.94 \\
128 & 0.97 & 0.99 & 0.94 & 0.94 \\
256 & 0.97 & 0.98 & 0.93 & 0.94 \\ \hline \hline \end{tabular}
\end{table} 
Table 7: Training and test accuracy of ID_02. \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Specifications**} & **MLP** & **LSTM** \\ \hline Window size & 3 & 3 \\ Input dimension & 3 \(\times\) 5 & 3 \(\times\) 5 \\ Number of hidden layers & 1 & 1 \\ Number of out layers & 1 & 1 \\ Number of hidden nodes & 128 & 128 \\ Number of output nodes & 13 & 13 \\ Hidden layer activation functions & ReLU & ReLU \\ Optimizer & Adam & Adam \\ Output layer activation functions & SoftMax & SoftMax \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Pilot training and test accuracy of ID_01 depending on a different number of hidden layers while fixing the number of hidden nodes. As shown in the table, the LSTM had higher accuracy for all batch-size experiments compared to the MLP. The test accuracy for both models was lower compared to that of the training data, which is expected in machine learning. However, given the heterogeneous nature of the collected data, i.e., both indoor and outdoor activity patterns, this difference was low and was not statistically significant. Nevertheless, our model may demonstrate even higher performance in more homogeneous environmental settings. Specifically, we anticipate that applying our model in such settings will result in improved performance compared with the current result. It is worth examining the overall percentages of correct predictions for each activity pattern, as illustrated in Figure 9 below. The \(x\)-axis (x-label) in Figure 9 corresponds to each activity pattern, while the \(y\)-axis (y-label) indicates the ratio between the total number of occurrences and the number of correct predictions for each activity pattern. If there are no occurrences of activities, we omit corresponding drawings in the bar plot. This may correspond to the cases where a subject did not engage in any activities or when data collection was in error due to a sudden movement of the subject. The ratio was calculated for both training and test datasets.