# Advanced Smartphone-Based Identification of Transport Modes: Resilience under GNSS-Based Attacks
## 3 Deceiving the Ticketing System
### Multisensor-Based Transport Mode Identification
#### 3.1.1 Convolutional Neural Network  
For the convolutional neural network subsystem depicted in Figure 9, we use the information of the accelerometer, the magnetometer and the barometer embedded in the smartphone to identify the currently used transport mode.  
For the algorithm depicted in Figure 10, the input is a coded image containing information of the acceleration, magnetic field and air pressure. The first layer of the feature extraction contains 32 filters that are applied with a 3 \(\times\) 3 pixel kernel. The activation layer chosen is ReLu to eliminate possible negative values that may appear after the convolution operation with the filters. A second layer of filters is used to extract higher-order features and detect more complex patterns than with only one layer. This layer contains 64 filters that are applied with a 3 \(\times\) 3 pixel kernel. Again, the activation layer is ReLu.  
The third activation layer is a maximum pooling layer applied with a 2 \(\times\) 2 pixel kernel. The next layer is a 25% drop-out layer, in which the connections between neurons are removed with a 25% probability. The last part is the flatten layer, where the features obtained are serialized to serve as input for the next stage.  
After the feature extraction comes the classification layer. This stage consists of three different layers. The first is a fully connected neural network consisting of 128 neurons and a ReLu activation function. The second is a 50% drop-out layer. Finally, there is a layer that performs the classification between transport modes, with a softmax activation function.  
Figure 11 shows the output of the identification of transport modes based on the accelerometer, the magnetometer and the barometer signals corresponding to the journey recorded in Munich shown in Figure 2. This figure shows how the transport modes are correctly identified with the multisensor approach. There are, however, some outliers indicating confusion between different transport modes that can be afterwards eliminated comparing the multisensor identification and the only-GNSS-based identification.  
Figure 9: This figure presents the flow diagram of the multisensor-based transport mode identification.  
Figure 12 shows the output of the identification of transport modes based on the accelerometer, the magnetometer and the barometer signals corresponding to the journey recorded in Paris shown in Figure 3. This figure shows how the transport modes are correctly identified with the multisensor approach. There are, however, some outliers indicating confusion between different transport modes that can be afterwards eliminated comparing the multisensor identification and the only-GNSS-based identification.  
Figure 11: This figure shows the representation over time of the transport mode used during the journey in Munich in blue and the transport modes identified by the convolutional neural network in orange.  
Figure 10: This figure presents the block diagram of the convolutional neural network identification of transport modes.