Predicting Transportation Modes of GPS Trajectories using Feature Engineering and Noise Removal
Mohammad Etemad Amilcar Soares Junior Stan Matwin




Predicting Trans. Mode using Feature Engineering&Noise Removal  

Institute for Big Data Analytics, Dalhousie University, Halifax
Institute for Computer Science, Polish Academy of Sciences, Warsaw



Predicting Transportation Modes of GPS Trajectories using Feature Engineering and Noise Removal
    Mohammad Etemad1
Amílcar Soares Júnior1 Stan Matwin12

    Received: date / Accepted: date
===============================================================================================





Understanding transportation mode  from GPS (Global Positioning System) traces is an essential topic in the data mobility domain. 
In this paper, a framework is proposed to predict transportation modes. 
This framework follows a sequence of five steps: (i) data preparation, where GPS points are grouped in trajectory samples; (ii) point features generation; (iii) trajectory features extraction; (iv) noise removal; (v) normalization. 
We show that the extraction of the new point features: bearing rate,  the rate of rate of change of the bearing rate and the global and local trajectory features, like medians and percentiles enables many classifiers to achieve high accuracy (96.5%) and f1 (96.3%) scores.
We also show that the noise removal task affects the performance of all the models tested.
Finally, the empirical tests where we compare this work against state-of-art transportation mode prediction strategies show that our framework is competitive and outperforms most of them. 







§ INTRODUCTION


Research on trajectory analysis is a mature area since positioning devices are now used to track people, vehicles, vessels, and animals. 
In the case of trajectory data, the object's movement is represented as a discrete collection of spatiotemporal points.

A domain where trajectories are frequently analyzed is the prediction of transportation modes from users, which is essential for cities and people to reduce travel time and traffic congestion. 
Transportation mode estimation involves two steps <cit.>: (i) extraction of segments of the same transportation modes; and  (ii) classification of transportation modes for each segment.
For the first step, several segmentation algorithms have been proposed in the past years and include temporal-based <cit.>, cost function-based <cit.> and semantic-based methods <cit.>.
For the second step, which is the focus of this work, the classification (or prediction) of the transportation modes is performed by creating domain expert features for supervised classification (e.g., the distance between consecutive points, velocities, acceleration, and bearing).

We classify the research in transportation modes prediction regarding the type of features in two branches: (i) domain expert features; and (ii) learned features.
From raw GPS data points (e.g., latitude, longitude and time) it is possible to calculate many attributes regarding the moving object's movement. 
Examples include distance traveled between points, estimated speed, bearing, acceleration, etc. 
For segments of trajectories, it is possible to extract mean, median, minimum, maximum, standard deviations, etc., of point-wise features.
These are examples of domain expert features employed to predict transportation modes.
Examples of works that apply domain expert features include <cit.>.

In this work, we also explore the effects of noise removal in the prediction of transportation modes. 
Dealing with noise in trajectories is essential because GPS recorder devices are not accurate in the moving object's positioning due to many reasons like satellite geometry, signal blockage, atmospheric conditions, and receiver design features/quality. 
By removing GPS noise, it is expected that the derived features from the trajectories are more likely to represent the standard pattern of a transportation mode. 

Noise-perturbed GPS data influences the quality of the domain expert features, e.g.  distance traveled, speed or acceleration are susceptible to errors. 
It is important to point out that these errors may impact the distributions of values, where statistics like the mean, in trajectory segments of transportation modes. 
This uncertainty of data can lead a classifier to create models that are not able to accurately predict a transportation mode from a trajectory.
Thus, the works in transportation mode prediction are classified regarding the (i) presence or (ii) absence of noise removal strategies. 
An example of work in the transportation mode prediction that does not deal with noise removal is <cit.>. 
In others, like <cit.>, noise is removed. 
This paper applies domain expert features and noise removal to predict transportation are as follows: (i) we introduce new point and trajectory features; (ii) we propose a framework composed of 5 steps for transportation mode prediction; (iii) we compare the proposed approach with state-of-art strategies and show that our results are competitive.










§ A FRAMEWORK FOR TRANSPORTATION MODE PREDICTION



In this section, we present the sequence of steps used in this work to predict transportation modes (Figure <ref>).
This framework has five steps and is described in detail below.  




In this work, we define a trajectory as a sequence of GPS points that belongs to the same transportation mode. 
In the first (step 1), we group the raw GPS points by user id, day and transportation mode to create trajectory samples. 
We discard trajectory samples with less than 10 GPS points because these examples may affect our model since trajectories with low quality may be created. 

In this work, we calculate some point features (step 2) that were used previously in literature <cit.>: distance, speed, acceleration, jerk<cit.>, and bearing. 

Two new features are introduced in this work, named bearing rate, and the rate of bearing rate. They are detailed as follows.
The bearing rate was computed using Eq. <ref>, where B_i and B_i+1 are the bearing values in points i and i+1, and Δ t is the time difference. 


    B_rate(i+1)=(B_i+1-B_i)/Δ t


Some moving objects tend to change the bearing more often because they commute in a straightforward route. This behavior can be captured by using the rate of the bearing rate. 
This feature is calculated using Eq.<ref>.


    Br_rate(i+1) =(B_rate(i+1)-B_rate(i))/Δ t




After calculating all the point features for each trajectory, we extract some statistical attributes referred to as trajectory features (step 3). 
Trajectory features are divided into two different types: (i) global trajectory features, which summarize information regarding the whole trajectory in a single value; and (ii) local trajectory features, which describe a local part of the trajectory. 
In this work, we extracted global features like the Minimum, Maximum, Mean, Median, and Standard Deviation values of each trajectory point feature to feed our classifier. 
The local trajectory features extracted in this work was the percentiles of every point feature.
Five different percentiles were extracted (10, 25, 50, 75, and 90) and were used in the models tested in this work. 
In summary, we compute 70 trajectory features (10 statistical measures including five global and five local features calculated for 7 point features) for each transportation mode example. 

In step 4, the framework deals with noise in the data. 
In this work, we used a simple method called median filter to create a mask.  The method is described in Algorithm <ref> (threshold=3) and it removes the noise based on speed mean (i.e. the average speed of a trajectory) attribute since a human can classify the transportation mode mostly by knowing the mean speed of a trajectory. 



Finally, we normalized the features (step 5) using the Min-Max normalization method, since this method preserves the relationship between the values to transform features to the same range and improve the quality of classification process <cit.>. 









§ EXPERIMENTS



In this section, we detail the experiments performed in this work to validate our framework. 
The data used in this work is the GeoLife GPS dataset, that was collected by Microsoft Research Asia from April 2007 to October 2011 <cit.>. 
The dataset has a 5,504,363 number of records labeled by eleven transportation modes: taxi (4.41%); car (9.40%); train (10.19%); subway (5.68%); walk (29.35%); airplane (0.16%); boat (0.06%); bike (17.34%); run (0.03%); motorcycle (0.006%); and bus (23.33%).


In the literature, we observed different sub-selections of these classes for evaluating transportation mode prediction strategies;  
therefore, we decided to select different target subsets for comparing our result with other papers.

To evaluate the performance of classifiers in this work we used the Accuracy and the F1 measure.
In all our experiments, we used a 10-fold cross-validation strategy and computed a paired t-test to verify if the difference in the means were statistically different. 
We executed our framework with different classifiers such as Decision Tree (DT) (with max depth equals five), Random Forest (RF) (with 50 trees estimators), Neural Network (NN), Naive Bayes (NB), and Quadratic Discriminant Analysis (QDA). In all cases, the random forest surpasses all the other classifiers in both accuracy and f1.


Subsequently, we compared the RF using all the steps of our framework against the results of five papers. 
It is important to point out that all these papers  reported their accuracy values on the Geolife dataset. 
Table <ref> shows a side-by-side comparison between some related works and the results of our framework. 
Our work does not surpass Jiang's et al. accuracy <cit.> but outperforms all the others.
It is important to highlight that the complexity and high training time of the RNN model used in his work may not be worth the 1.42% difference in accuracy. 



Finally, we evaluated the effects of noise removal performed by our framework. 
We established as a baseline the performance of our framework using the data to train classifiers with noise and without noise (clean).
Table <ref> shows the mean of the f1 values obtained by 10-fold cross-validation for the different group of classes.
We can observe in Table <ref> that for all classifiers and different subgroups of classes, performance gains ranging from 2.56 (Decision Tree, using classes of <cit.>) to 28.15 (QDA, using classes of <cit.>) in f1. 




Finally, Table <ref> shows the mean of the accuracy values obtained by 10-fold cross-validation. 
For all classifiers and different subgroups of classes and classifiers, performance gains ranging from 3.36 (Decision Tree, using classes of <cit.>) to 29.04 (QDA, using classes of  <cit.>) in accuracy were observed. 
The results presented in this section indicate that dealing with noise in transportation mode prediction is an important topic, and the lack of this step in the classification task decreases the performance of the classifiers. 








§ CONCLUSIONS AND FUTURE WORKS



In this work, we propose a framework for transportation mode prediction using feature engineering and noise removal. 
The results showed that the newly engineered features (e.g., bearing rate, and rate of bearing rate) and the application of a noise removal technique improve the performance of all tested classifiers. 
We intend to extend this work in two directions:
(i) test and evaluate different noise removal techniques like wavelet-based, MCMC and fast Fourier based denoising methods, and (ii) investigate the performance of trajectory segmentation algorithms and include this step in our framework.  



  §.§.§ Acknowledgments

The authors would like to thank NSERC (Natural Sciences and Engineering Research Council of Canada) for financial support.

plain


