# Convolutional Neural Network-Based Travel Mode Recognition Based on Multiple Smartphone Sensors
## 4 Results
### Hyperparameters Analysis  
We analyzed the effect of the model under six different hyperparameters. Figure 6 shows the F-measure in each activity by using different hyperparameters. The \(x\)-axis of Figure 6 is F-measure, and the \(x\)-axis is the travel models. Experimental results show that the model with three convolutional layers outperforms other results in each type of travel modes in Figure 6a. The experimental results show that when the number of convolutional layers in the CNN model is less than 3 layers, it is difficult to effectively extract features for classification, and when the number of convolutional layers is more than 3 layers, it is prone to over-fitting problems. Therefore, the results show that the network structure of the three convolutional layers can better balance the over-fitting phenomenon and the classification accuracy. We set the number of feature maps from 40 to 80 and compared the effectiveness of the travel mode classification results. Figure 6b shows the influence of different feature map numbers on the model classification. Feature map is the key to extracting features from data. It is not the more the better, nor the less the better. It is noted that the best performance for each travel state is achieved when the feature map is set as 70. We performed an experimental analysis of different filter sizes. Figure 6c shows the classification performance based on different filter size. We tried the filter size as 2, 3, 4, 5, and 6, respectively. The experimental results show that the travel mode classification results are better when the filter size is 2, 4, 6, and the best performance was obtained when \begin{table}
\begin{tabular}{c c c} \hline \hline
**Hyperparameters** & **Range** & **Values** \\ \hline Number of convolutional layers & [2; 5] & 2, 3, 4, 5 \\ Filter size & [2; 6] & 2, 3, 4, 5, 6 \\ Number of feature maps & [40; 80] & 40, 50, 60, 70, 80 \\ Pooling size & [2; 6] & 2, 3, 4, 5, 6 \\ Learning rate & [0.0001, 0.005] & 0.0001, 0.0005, 0.001, 0.005 \\ Batch size & [2\({}^{4}\), 2\({}^{8}\)] & 16, 32, 64, 128, 256 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: The hyperparameters of the proposed CNN model. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Travel Mode** & **Bike** & **Bus** & **Car** & **Metro** & **Walk** \\ \hline Data size & 5572 & 5560 & 5567 & 5367 & 5392 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Datasets. the filter size is 2. We chose 3, 4, 5, 6, and 7 as pooling size in our experiments. Figure 6d demonstrates the classification performance for each travel mode with different pooling sizes. According to Figure 6d, the classification achieves the best performance when the pooling size is set to 3. We finally set the pooling size as 3. Figure 6e demonstrates the classification performance for each travel mode with different batch size. As we known, the batch size is commonly set to \(2^{\text{n}}\). We choose candidate of batch size from \(2^{\text{4}}\) to \(2^{\text{8}}\). It can be seen from Figure 6e that the performance is obviously inferior to other values when the batch size is 128 or 256. In fact, the performance was improved by the increasing of the batch size at the first stage. The classification achieved the best performance when the batch size increased to 64. Then, the performance was decreased by the increasing of the batch size. Therefore, we set the batch size as 64. Figure 6f show the performance of the proposed model of detecting each types of travel mode based on different learning rate. The algorithm shows poorer performance when the learning rate is less than 0.0005 or bigger than 0.001. The reason for the bad performance of big learning rate is that the variables update too fast to change to proper gradient descent direction timely. Given more iterations, the tiny learning rate can achieve better performance. However, tiny learning rate is also not the best choice because it means the slow update of the variables and it leads to time consuming of the training.