# Detection of Walking Features Using Mobile Health and Deep Learning
## 3 Analysis and Experimental Results
The model is compiled with the categorical cross entropy loss function [17; 18] to classify seven categories, and the Adam algorithm [26] to find a minimized cost of the model. For training of the model, we used the ID of subjects as a label (y_data) and the time series data (accX, accY, accZ, gyroX, gyroY, gyroZ, rotX, rotY, rotZ, and the nine parameters for the rotation vector) as input data (x_data). The ratio of input (x_data_train)-output(y_data_train) training data set, to input (x_data_test)-output(y_data_test) test data set is seven to three. So, approximately 100,000 input rows of data (x_data_train)-output(y_data_train) are used for training and approximately 43,000 input rows of data (x_data_test)-output(y_data_test) are used to test the model. Model training used the training data set (x_data_train, y_data_train). The training data set was used 300 times (epoch) to train the deep learning model as shown in Figures 3c and 5 shows the loss and accuracy of the model during training, where X-axis of the graph represents epoch time and Y-axis represents a loss value by optimizer and accuracy of evaluation. Improving the accuracy of the deep learning model was facilitated with five different combinations of data sets including acceleration (Acc X, Y, Z) in the X, Y, and Z directions for the data set corresponding to the gyroscope (data set titled, Gyro X, Y, Z); the rotation vector component along the X, Y, Z axis (Rot X, Y, Z) data set; the nine parameters of the rotation vector (Rot vector--9); and the previously stated datasets combined. The trained deep learning model used Acc data (Figure 5a) and Gyro data (Figure 5b) to gradually minimize loss and increased the accuracy of the model up to 50 epochs. However, models of more than 100 epochs experienced few significant gains in terms of greater accuracy and minimization of loss. The deep learning model trained with the Rot data (Figure 5c), the Rotation vector data (Figure 5d) and the dataset composed of all existing data sets combined (Figure 5e), each experienced significant decreases in the loss and similarly significant increases in model accuracy. Rotation vector (Figure 5d) and the combination of all data sets (Figure 5e) achieved up to 100% accuracy during the training of the deep learning model. Accuracy for the Rot (Figure 5c) increased to approximately 80% during model training. Among the multiple data sets, the deep learning model presented the highest performance when trained with the Rot XYZ (Figure 5d) and with all datasets combined (Figure 5e). Outcomes associated with model training were evaluated with the test data set (x_data_test, y_data_test) using Keras code (Figure 3d). Table 3 shows the result of this evaluation. Model training with acceleration (Acc X, Y, Z) in X, Y, and Z directions data sets indicates a 50.5% accuracy in classifying subjects' walking characteristics using the test data (x_data_test). The model trained with Gyroscope data (Gyro X, Y, Z) presents an accuracy rate of 48.3%. The model trained with the rotation vector component along the X, Y, Z axis data set (Rot X, Y, Z) reveals 77.1 % accuracy. Rot XYZ is calculated from the nine parameters associated with the rotational vector. Thus, the trained model with Rot XYZ presents a higher accuracy than the accuracies derived from the accelerometer-related, and gyroscope-related datasets. The model trained with the nine parameters of rotation vector (Rot vector--9) displays accuracy of 99.5%. The model trained with all datasets shows 99.9% accuracy in matching the subject's unique walking features with the corresponding correct subject (y_data_test) using test data (x_data_test). According to evaluation of the model, using nine parameters of rotation vector data was most effective in training the deep learning model for classifying the walking characteristics of the seven subjects. Figure 5: (a) Training model with Acc XYZ. (b) Training model with Gyro XYZ. (c) Training model with Rot XYZ. (d) Training model with Rot vector—\(\theta\), (e) Training model with all data sets.