# Application of Online Transportation Mode Recognition in Games
## 5 Results
### Online Transportation Mode Detection  
Online tests using the random tree classifier are employed within the prototype game. For all tests, the historical set is used (usually size 12) and sleep settings are set to the same number as the historical set. Using a setting of 12 means that the background sensor service should have been active for 1 min, followed by sleep for 1 min, and restarting.  
A screen within the game enables users to view the detected transportation mode for the past day, as well as other timeframes (minutes, hours, and weeks). Figure 12 shows the screen design within the app. At the top part of the screen, the current sensor state and detected transport are displayed. Some settings could be selected, a graph for the chosen time is displayed, and at the bottom, a list of the \(N\) last detected transportation modes is listed. In the initial versions of the app, the historical set size and sleep sessions are configurable for testing purposes. However, for all tests with the four test users, the values of the historical set and sleep sessions are locked at 12 for consistency purposes. Figure 12 also shows the detection results when the state is first idle followed by a brief walk. However, the user does not take a bus nor a boat during that day, and thus, their associated values are false positives.  
Figure 13 shows the results for when a user is in a bus and exits at a bus stop to change buses. As can be seen, false positives arise again for train and car, as well as plane. Similarly, Figure 14 shows the results of 1 h of usage for foot, bus, and train, and their respective false positives that predominantly occur during transition. For both data gathering and evaluation, some devices encounter difficulties or are not able to gather gyroscope data.  
\begin{table}
\begin{tabular}{c c c c c c c c} \multirow{2}{*}{**Classifier**} & \multirow{2}{*}{**Training**} & \multicolumn{5}{c}{**Prediction**} \\ \cline{3-9}  & & **HSS 0** & **HSS 10** & **HSS 20** & **HSS 30** & **HSS 50** \\ \hline Random Forest & 12,053 ms & 202 ms & 183 ms & 219 ms & 201 ms & 200 ms \\ \hline Random Tree & 188 ms & 2 ms & 2 ms & 3 ms & 3 ms & 4 ms \\ \hline Bayesian Network & 117 ms & 13 ms & 13 ms & 15 ms & 15 ms & 16 ms \\ \hline Naïve Bayesian & 24 ms & 105 ms & 105 ms & 106 ms & 108 ms & 106 ms \\ \hline \end{tabular}
\end{table}
Table 10: Time consumption for classification training and prediction.  
\begin{table}
\begin{tabular}{c c c c c c c c c c} \hline \hline \multicolumn{10}{c}{**Predicted Values in Each Column, True Values in Each Row**} \\ \hline
**a** & **b** & **c** & **d** & **e** & **f** & **g** & **h** & **i** & **j** & \\ \hline
2561 & 16 & 0 & 1 & 0 & 22 & 0 & 0 & 0 & 0 & a—TP 98.5 Idle \\ \hline
0 & 3372 & 0 & 92 & 0 & 0 & 0 & 0 & 41 & 69 & b—TP 94.3 Bus \\ \hline
0 & 19 & 1666 & 10 & 0 & 9 & 0 & 0 & 0 & 0 & c—TP 97.8 Foot \\ \hline
0 & 111 & 0 & 3636 & 0 & 0 & 0 & 0 & 0 & 66 & d—TP 95.4 Car \\ \hline
0 & 26 & 11 & 7 & 795 & 4 & 0 & 0 & 0 & 20 & e—TP 92.1 Bike \\ \hline
0 & 406 & 7 & 443 & 26 & 1766 & 0 & 0 & 0 & 41 & f—TP 65.7 Train \\ \hline
0 & 229 & 44 & 345 & 0 & 10 & 680 & 0 & 0 & 1 & g—TP 51.9 Tram \\ \hline
0 & 291 & 0 & 82 & 20 & 0 & 23 & 0 & 28 & 0 & h—TP 0.0 Subway \\ \hline
26 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1218 & 30 & i—TP 95.6 Boat \\ \hline
41 & 76 & 29 & 3 & 11 & 25 & 0 & 0 & 37 & 2604 & j—TP 92.1 Plane \\ \hline \hline \end{tabular}
\end{table}
Table 9: Confusion matrix for normalised acceleration values (2-fold cross-validation, RF, HSS30).  
One of the test user's devices prevents the transport detection background service from operating normally in the background, resulting always in near-0 total seconds for the past 24 h, as compared to thousands of seconds for other users.  
Figure 12: Screenshot of the transportation usage screen. Within Evergreen (1 day).  
Figure 13: Transportation detection while in a bus and exiting at a bus stop (total of 10 min total).