# Detection of Walking Features Using Mobile Health and Deep Learning
## 3 Analysis and Experimental Results  
We analyzed subjects' acceleration in m/s\({}^{2}\) for the rate of rotations around spatial X, Y, Z axes; the nine parameters of rotation vector; and the rotation vector component along the X, Y, Z axes. Table 2 shows the resulting statistical analysis from one of the subjects in terms of acceleration (accX, accY accZ); the rate of rotations as measured by the on-board gyroscope (gyroX, gyroY, gyro Z); and the rotation vector component assessed by the rotation vector software-based sensor (rotX, rotY, rotZ). Table 2 shows the minimum value, maximum value, mean, median, variance (var), standard deviation (SD), and Quartiles (Q). For example, A01 has a higher acceleration speed downward from its current location (X axis in Figure 2a) than upwards (\(-\)X axis in Figure 2a) due to the effect of gravity. In addition, although subjects intended to walk in a straight line (as indicated by the Z axis in Figure 2a), some subjects proceeded to deviate left (\(-\)Y axis in Figure 2a) or right (Y axis in Figure 2a) from the target path. All the subjects' statistical information on walking data are displayed in Appendices A and B and show a scatter plot of rotation X, Y, Z with the first 30 s of walking data. Data corresponding to the first 10 s (1000 rows) and the last 10 s (1000 rows) during each subject's data collection session were removed to account for the start- and stop-button activation within the mHealth application. The data were then analyzed by the deep learning algorithms originally developed within Tensorflow and Keras in R, as shown in Figure 3. The model uses one input layer, one output layer, and three hidden layers. The output layer uses softmax activation [22] function and the inner and hidden layers use the Rectified Linear Units (relu) [23] function for activation. Figure 4 shows the detailed information of each layer. Both the input layer and hidden layers contain 256 arbitrarily decided neurons and the output layer contains 7 neurons for classifying seven subjects. The dropout rate [24] is 50% for both the input and hidden layers to avoid overfitting from the training data set (x_data_train, y_data_train). For initializing the weight of neurons, the model uses the Glorot normal initializer (also called Xavier normal initializer) [25]. \begin{table}
\begin{tabular}{c c c c c c c c c c c c} \hline \hline \multicolumn{1}{c}{**ID**} & **Sensor** & **Min** & **Max** & **Mean** & **Med** & **Var** & **SD** & **Q1** & **Q2** & **Q3** & **Q4** \\ \hline \multirow{8}{*}{A01} & accX & 4.111 & 17.638 & 9.459 & 8.731 & 4.848 & 2.202 & 4.111 & 7.844 & 8.731 & 10.873 \\ \cline{2-11}  & accY & \(-\)5.259 & 5.494 & \(-\)0.276 & \(-\)0.309 & 2.207 & 1.486 & \(-\)5.259 & \(-\)1.286 & \(-\)0.309 & 0.692 \\ \cline{2-11}  & accZ & \(-\)6.954 & 7.104 & \(-\)0.174 & 0.230 & 3.122 & 1.767 & \(-\)6.954 & \(-\)1.101 & 0.230 & 1.105 \\ \cline{2-11}  & gyroX & \(-\)1.185 & 2.714 & 0.014 & 0.042 & 0.190 & 0.436 & \(-\)1.185 & \(-\)0.315 & 0.042 & 0.344 \\ \cline{2-11}  & gyroY & \(-\)1.260 & 1.510 & 0.002 & \(-\)0.033 & 0.094 & 0.306 & \(-\)1.260 & \(-\)0.213 & \(-\)0.033 & 0.181 \\ \cline{2-11}  & gyroZ & \(-\)1.115 & 1.229 & 0.002 & \(-\)0.008 & 0.103 & 0.322 & \(-\)1.115 & \(-\)0.209 & \(-\)0.008 & 0.200 \\ \cline{2-11}  & rotX & \(-\)0.756 & 0.749 & 0.033 & \(-\)0.412 & 0.260 & 0.510 & \(-\)0.756 & \(-\)0.466 & \(-\)0.412 & 0.552 \\ \cline{2-11}  & rotY & \(-\)0.600 & 0.011 & \(-\)0.493 & \(-\)0.493 & 0.004 & 0.060 & \(-\)0.600 & \(-\)0.544 & \(-\)0.493 & \(-\)0.444 \\ \cline{2-11}  & rotZ & \(-\)0.662 & 0.672 & 0.056 & \(-\)0.393 & 0.251 & 0.501 & \(-\)0.662 & \(-\)0.433 & \(-\)0.393 & 0.567 \\ \hline \end{tabular}
\end{table} 
Table 2: Statistical information of A01 subject’s data. Figure 4: Deep learning model. Figure 3: (**a**) Deep learning model using Tensorflow and Keras. (**b**) Compile the model. (**c**) Train the model. (**d**) Evaluate the model. Figure 3b shows the compilation of the deep learning model.