# Adaptive Learning Approach for Human Activity Recognition Using Data from Smartphone Sensors
## 3 Results and Discussion
### Experiments
Six different activities--standing, sitting, laying, walking, walking downstairs, walking upstairs--were chosen for this experiment. Laying on the floor and falling activities were left out because of the insufficient number of observations in the dataset. The confusion matrix of the proposed method was calculated (see Table 4). Table 4 shows that more than 90% of standing and walking upstairs instances were correctly recognized. Walking downstairs was correctly recognized 80%. Laying and walking are above 70%, whereas sitting activity has the lowest recognition rate among all activities, at 69%. Further study showed that sitting and laying are often confused. The \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & & & \multicolumn{4}{c}{**Predicted a**} \\ \hline  & & **ST** & **SI** & **L** & **W** & **WD** & **WU** \\ \hline \multirow{4}{*}{\(\mathbf{\text{W}=\text{Walking}}\)} & **ST** & 98 & 0 & 2 & 0 & 0 & 0 \\  & **SI** & 20 & 70 & 10 & 0 & 0 & 0 \\  & **L** & 13 & 8 & 79 & 0 & 0 & 0 \\  & **W** & 0 & 0 & 0 & 77 & 18 & 6 \\  & **WD** & 0 & 0 & 0 & 3 & 87 & 10 \\  & **WU** & 0 & 1 & 1 & 4 & 2 & 92 \\ \hline \hline \end{tabular}  
* W = Walking, WU = Walking upstairs; WD = Walking downstairs, ST = Standing, SI = Sitting, L = Laying.  
\end{table} 
Table 4: Confusion matrix of activities for the proposed method where each activity is modeled as a single state of HMM. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & & \multicolumn{4}{c}{**Predicted a**} \\ \hline  & & **R** & **W** & **WU** & **WD** & **ST** & **SI** & **L** & **F** \\ \hline \multirow{4}{*}{\(\mathbf{\text{W}=\text{Walking}}\)} & **Run** & 80 & 0 & 0 & 0 & 0 & 0 & 5 \\  & **W** & 0 & 40 & 35 & 75 & 0 & 0 & 0 & 0 \\  & **WD** & 0 & 30 & 200 & 20 & 0 & 0 & 0 & 5 \\  & **WD** & 5 & 20 & 50 & 175 & 0 & 0 & 0 & 5 \\  & **ST** & 0 & 25 & 0 & 0 & 870 & 465 & 0 & 0 \\  & **SI** & 0 & 0 & 0 & 0 & 90 & 10 & 0 \\  & **L** & 0 & 0 & 0 & 0 & 0 & 40 & 50 & 5 \\  & **F** & 0 & 5 & 0 & 0 & 0 & 0 & 0 & 175 \\ \hline \hline \end{tabular}  
* R = Running, W = Walking, WU = Walking upstairs; WD = Walking downstairs, ST = Standing, SI = Sitting, L = Laying, F = Falling.  
\end{table} 
Table 2: Confusion matrix for proposed algorithm where each activity is modeled as separate seven-state HMM. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline  & & **Precision** & **Recall** & **F1-Score** & **Accuracy** \\ \hline \multirow{4}{*}{\(\mathbf{\text{W}=\text{Walking}}\)} & **Running** & 0.94 & 0.94 & 0.94 & 1.00 \\  & **Walking** & 0.27 & 0.33 & 0.30 & 0.92 \\  & **Walking upstairs** & 0.78 & 0.70 & 0.74 & 0.94 \\  & **Walking downstairs** & 0.69 & 0.65 & 0.67 & 0.93 \\  & **Standing** & 0.64 & 1.00 & 0.78 & 0.80 \\  & **Sitting** & 0.90 & 0.15 & 0.26 & 0.79 \\  & **Laying on the floor** & 0.53 & 0.83 & 0.65 & 0.98 \\  & **Falling** & 0.97 & 0.90 & 0.93 & 0.99 \\ \hline \multicolumn{2}{c}{**Overall**} & 0.68 & 0.68 & 0.68 & 0.92 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Performance metrics for each activity. same applies for standing and sitting. However, activities of standing, sitting, and laying are well discriminated from walking, walking downstairs, and walking upstairs. The computational time needed for the first and the second part of the algorithm to process one observation vector in the five-state HMM model was collected. The first part of the algorithm performs initial model training, whereas the second part performs recognition and parameter re-estimation. Experiments were conducted on Matlab with an Acer computer with Intel(R) Core(TM) i7-9750H CPU @ 2.60 GHz 2.59 GHz processor and 16.0 GB RAM. Computational time (in seconds) is given in Table 5. It shows the computational time's dependency on dimensions of observation. We can see that there is a small increase (around 1 millisecond) in computational time when dimensions of observation increase.