Keywords

1 Introduction

Physical inactivity is a major health concern: according to the WHO, every year around three million people die because of physical inactivity [1]. One of the causes of physical inactivity is that people are more inclined to passive modes of transportation. Active travelling options such as biking and walking provide ample opportunities to improve physical activity [2]. Studies have shown that people who frequently use public transport are more physically active than those who use other types of inactive transport [3, 4], as walking to and from a public transport can also lead to a substantial increase in physical activity levels. Self-monitoring is a well-known and often used behavior change technique for supporting people in improving their physical activity [5]. Fostering a change in behavior that prefers active transport over inactive transport could start with self-monitoring of travel choices. In order to provide support in behavior change or self-monitoring, automatic measuring of (active/inactive) travel behavior is inevitable.

This paper describes and evaluates an approach that can be used within an online mobile coaching system for stimulating physical activity [6]. The approach exploits existing techniques for determining frequently visited locations, transition periods (periods of traveling between two locations) and travel modes (active vs. inactive transport) of individuals based on GPS and accelerometer data. Unsupervised learning methods (density based clustering methods) on GPS data are used to determine frequent locations. These locations and the other GPS readings are subsequently used to derive transition periods. Finally, GPS speed measurements and accelerometer data are combined to obtain a more precise result about travel modes and activity levels of individuals. Most of the techniques that we use have been developed and tested in lab-settings or controlled environments. We evaluate the approach in a real-life pilot study. In this study, people kept an online diary of their travelling behavior, which was compared with the results of the automatic approach. The main research question investigated in this paper is whether this combination of existing techniques can reliably be used to detect important locations, transitions, and transport modes in a real-life context with smartphone-based GPS data and an off-the-shelf activity tracker. Our hypothesis is that the combination of both (GPS and activity tracker) will provide better results compared to only using on one of the sources.

This study was conducted in the context of the development of an online mobile coaching system [6]. Although in the current implementation of that system transportation options were asked in the form of user input, the objective is to automate the process of travel mode detection from raw GPS data and activity tracker data. The ultimate aim of such an integrated system is to provide personalized support to individuals based on their traveling context and physical environment.

2 Background

This section discusses the state-of-the-art in terms of the detection of locations, transitions, and travel modes.

2.1 Location Detection

Literature suggests various techniques for identifying important places within a list of visited locations. An important place could be home, work, college and/or office. Clustering is a popular approach to perform this task [7, 8]. One class of clustering methods that is of particular relevance for clustering geospatial data is based on density. Density is defined as the number of points within a given radius [9]. In [7], K-means clustering is compared with the density-based technique DJ-cluster (a variation of DBSCAN). The conclusion is that density-based clustering provides better results for finding important places. A disadvantage of the K-means approach is that it needs to know the number of clusters in advance.

Besides clustering, other techniques for detecting important locations are also applied convincingly on GPS data. For example, in [10] a kernel-based algorithm is applied to synthetic GPS data; this gives better results compared to traditional approaches. However, the authors admit that one drawback of their study is that they use synthetic data, which are uninterrupted, while real world data is usually interrupted because of various reasons (e.g., inside a building, underground metro station).

2.2 Identification of Transitions

One of the difficult steps in the process of detecting travel behavior is to find transitions [11] from one location to another. A transition has two aspects: the travel period and the start and end locations. A transition occurs between two locations (e.g., between home and study). A travel period is usually detected by separating the periods with a significant speed from periods in which the speed is almost zero; in addition, the change in GPS location itself can be used.

The detection approaches presented in the literature are usually based on dedicated GPS trackers in combination with geographical information systems (GIS software) [12, 13]. The problem with approaches that depend on external sources such as GIS is that the transition can only be detected once the data is loaded into a GIS based application, which means that it cannot always be executed on devices with low computing power and bandwidth (e.g., smartphones). When smartphone-based GPS data is used, the experiments are usually conducted in extremely controlled lab settings [11, 14]. For example, in the study conducted by Reddy et al., participants were asked to attach six phones to different parts of their body [14].

2.3 Travel Mode Detection

In the literature, mainly two approaches are used for the identification of the mode of travel: one is time dependent and the other is trip dependent. In a time dependent approach, a transport mode is assigned to every time frame of travel data (usually one minute [15] or one second [16]), while in trip level approaches, a mode is assigned to the whole trip. Zheng, Liu et al. visualize participants’ GPS log data in a prototype application named GeoLife [17, 18]. This application shows the user a visualized version of his/her own GPS data. Besides plainly visualizing the path the user has taken, several other features are available as well. An example of an additional feature is the possibility to see the distinction between different travel modes (like traveling by foot or car) in terms of color-differences. In GeoLife this is done using a supervised learning algorithm which is based on the raw GPS data. This algorithm divides each GPS track in different trips and each trip in different segments. A segment consists of a (part of a) trip using one single travel mode.

Since the current study is conducted in the context of a coaching system (to increase physical activity levels of individuals by encouraging active transport), we are more concerned with the activity level of participants. Therefore, our aim is to differentiate active and inactive travel modes by means of raw GPS and activity tracker data; detecting the precise means of transportation is of less concern.

3 Our Approach

An integrated approach is required that starts with collecting raw data and is finally able to suggest active transport options to the participants. This means that our approach has to integrate different analyses of GPS data: the extraction of frequently visited locations, the detection of transition periods and finally determination of the travel modes.

3.1 Location Detection

Raw GPS data are processed with a clustering algorithm to find the frequently visited locations. We use the OPTICS [19] clustering method in this step, which is a density based clustering technique and requires two parameters: the minimum number of points within a cluster (MinPts) and the maximum distance between two points (Eps). We have chosen this algorithm because it does not require to specify the number of clusters in advance. OPTICS is an extension of the DBSCAN algorithm. DBSCAN is able to find arbitrarily shaped clusters, but is not effective when it comes to finding clusters with varying densities because it is sensitive to the particular settings of its parameters. The OPTICS algorithm computes an augmented ordering of points. To extract the actual clusters, another algorithm is used, which is known as OPTICSXI and is also suggested in [19]. In our approach, we have used the implementation of the algorithm in the ELKI [20] framework.

Additionally, selecting an appropriate distance metric is important for the clustering process. Since we are dealing with spatial data, the “great circle distance” is used, which is a shortest distance between two latitude and longitude points. The Haversine formula [21] is used to calculate the “great circle distance”. Several experiments were conducted to see which value of parameters (Eps and MinPts) provides better results.

3.2 Transitions

Based on the results of the cluster analysis, the travel behaviors are extracted in the form of transitions (travel periods between locations). This step involves separating periods of transition from periods at locations. A transition is detected by combining different factors, according to the following algorithm. First, the periods are identified in which an increase in average GPS speed coincides with a change in clustered location. Different thresholds were tested i.e. between 0.4 and 1.5 m/s inclusive (with a step size of 0.1 m/s) which are close to the average walking speed (between 2 and 6.6 km/h [22]). As a second step, transitions are merged when the time difference between two or more consecutive transitions is less than some threshold. Different time intervals were checked, namely 3, 4, 5, 6 and 7 min. These transitions can be the result of, for instance, waiting at a train station, bus stop or perhaps erroneous GPS readings. There are various possible causes for such errors, for example being inside a building, in an underground metro station, or because of connectivity problems.

3.3 Travelling Modes

As the main goal of the envisioned system is to find physical activity opportunities it is relevant to detect the mode of travels. To find these modes, combinations of both kinds of data sources are used: accelerometer and GPS. Travel modes are classified in terms of active (biking and walking) or inactive (train, tram, metro, etc.). We do not differentiate the transportation modes at a more detailed level; rather, the focus is on active versus inactive options.

We investigate three different ways to detect travel modes. First, a threshold value is used for the GPS speed parameter to decide on the mode of travelling. Another method is using accelerometer data for determining the travel modes. In this approach, we used the average number of steps per minute during a transition period. Various thresholds were compared for average speed (5, 6, 7, 8, 9, 10 m/s) and for average steps per minute (10, 15, 20, 25, 30, 35) to see which works better. In the third method, we used the combination of GPS speed and average steps per minute to see whether that performs better than one of the individual forms.

4 Experimental Setup

A pilot study was conducted between January 21 and March 18, 2015. A total of 26 persons participated in this study. Individuals were recruited via personal networks of the researchers. All participants had an Android based smartphone with GPS logger software installed on it. We did not impose any restriction on the model of the smartphone, apart from running on Android. Activity data (floors, steps, calories) were collected by means of a Fitbit One activity tracker. The GPS logger records the data for each participant every minute. The average age of participants was 22 years, ranging between 18–26 years, 15 of them were male. Twenty of the participants were university students. Two participants dropped out due to technical problems. During this study, each individual filled in an intake questionnaire and replied to daily questionnaires. The intake questionnaire includes questions about demographics, location information and travel options. Daily questionnaires include questions about travel log to work/study/sports location and sports activity log. These questionnaires provide the ground truth for each participant’s important places and their travel behavior and are used to validate the travel behavior and mode of transport. Due to problems with the daily questionnaires, the questions about the travel modes were not asked in the beginning of the experiment. Therefore, the participants were asked to report their travel modes in the first weeks of the experiment in hindsight together with a confidence level.

To facilitate the validation process, travel periods in the ground truth file are labeled as active/inactive depending on the minutes of active travel during the travel period. When the minutes of active travel exceeds the minutes of inactive for a travelling period, the whole transition is labeled as active. Travel mode data in the survey questionnaire are reported in the following form: “walk: 7, metro: 8, walk: 5, train: 35, walk: 5”. This example is an instance of mixed mode travel, and since the active travel minutes are 17 and the passive travel minutes are 43, the travel mode is labeled as “inactive”. Another part of the ground truth consists of a set of latitude and longitude values corresponding to each participant’s reported significant places. This file is used to validate significant locations.

5 Results

In this section, we validate the described approach by comparing the results of the algorithms with the ground truth as provided in the travel logs.

Before explaining the results, we first provide an illustration of the collected data in Fig. 1. This figure shows a map of two locations which are marked as home and work, and a transition path between them. The transition path is generated based on the heuristics we used to find transitions (see Sect. 3.2) in the location data. The high spikes in Fig. 1(b) show that the person uses an active mode of transport – in this case walking. Similarly, the high spikes in Fig. 1(c) illustrate that the person uses an inactive mode of transport with a relatively high speed. In this example, the user started his/her travel to the work location by taking 9 to 10 min of walk to a nearby public transport facility. This is visible in Fig. 1(b), which shows the steps taken during time period 7:34 and 7:43. After that, an inactive mode of transport is used to travel further, as the speed graph (Fig. 1(c)) shows that the speed is quite high between 7:44 and 7:53.

Fig. 1.
figure 1

An example transition period between two locations that includes active and inactive travelling modes. (a) refers to map, (b) to activity tracker data (steps per minute) and (c) to GPS speed (meter per second).

5.1 Locations

We evaluate the performance of the OPTICS clustering algorithm based on the recall score, as we would like to find most of the significant locations listed by the participants, but it is not a problem if other frequently visited locations are found as well. An instance of the clustering result is considered to be a true positive when it matches with one of the user locations given in the intake survey, a false negative is a location instance for which we do not find any cluster, and a false positive is a cluster instance which does not match to any location specified in the survey. A higher number of true positives means that a higher number of significant locations is returned that could also lead to better chances of extracting more transitions and travel modes. Figure 2 gives an overview of the recall scores obtained when Eps varies between 90–330 and MinPts between 50–100 To find the optimal parameters for the remaining analysis, we first select the Eps values with a high recall, i.e. 270, 290, 310, 330, which all have a similar score. From these, we choose a value based on the lowest number of false positives. The choice for Eps is reduced to 290 and 330 with MinPts 40 or 50. Finally, we selected Eps = 290 and MinPts = 50 because of the smallest Eps distance.

Fig. 2.
figure 2

An overview of the recall scores, with Eps between 90–330 and MinPts between 50–100.

5.2 Transitions

As described in the Sect. 3.2, two parameters are used to detect transitions. When checking all combinations of average speed and interval length in minutes, the recall score ranged between 0.4 and 0.44. The best recall was achieved when the average speed was set to a threshold of 1.2 m/s and minutes interval to 5 min. We use two different methods to evaluate the algorithm: (1) check the travel period only, i.e. start and end time of a transition, and (2) in combination with travel locations. For evaluation method (1) a travel period is considered a true positive when it has overlapping minutes with an actual travel period reported by the participants. For evaluation method (2), in addition to the previous criterion, also the (start and end) locations should match. False positives are those travel periods that are not found in the user’s survey and which are probably results of shorter or longer trips to unimportant locations that users did not mention in the surveys. False negatives are the travel periods which are not found by the algorithm. We compare the results of the algorithm using different time windows for what we consider to be a match between the time according to the algorithm and the time reported in the survey: half an hour, 45 min and one hour. It is apparent that increasing the time window also increases the recall. A threshold of one hour gives a recall of 64% while a 54% recall is obtained when the time window is half an hour. Table 1 provides the detailed results. It can be seen that all values in the third column are smaller than the respective values in the second column.

Table 1. Recall scores for detecting transitions for two different methods

5.3 Travel Modes

Travel modes provide information about whether a person chooses active or inactive modes of transport. A travel mode is determined by using (a combination of) GPS speed and activity tracker data. For detecting active modes of transport (such as biking or walking) based on speed, a threshold of 8 m/s (28,8 km/h) is used. In [23] an upper limit of 32.2 km/h is suggested, but since all the participants reside in an urban area, the upper limit is set lower. Consequently, if the average speed during a travelling period is less than 8 m/s, it is considered as an active mode of travelling, otherwise it is considered as inactive. To find travel modes based on activity tracker data, also various thresholds were tested. We observed that a threshold of 30 or more steps per minute provides good results. This implies that if an individual takes on average 30 or more steps per minute during a transition, it is considered as an active travel.

In our experiment, travel modes are detected for the transitions found in the previous step using a time window of half an hour and taking locations into account. Table 2 illustrates the results for the different approaches. The first row shows that a recall of 0.9 is obtained when modes are detected based on GPS speed only. If only the activity tracker is used, a score of 0.7 is obtained. When both parameters are combined, then a recall of 0.97 is achieved. We can conclude that the activity tracker data on itself is not a very accurate method, but that it can be used to improve the results of the method based on GPS speed.

Table 2. Travel modes detected with speed and/or activity tracker

6 Discussion and Conclusion

The ultimate aim of our work is to create a mechanism that can be employed in a system that motivates and encourages individuals to engage more in physical activity by exploiting their physical context and using this to find opportunities for active ways of travelling. In this study, existing algorithms for finding important locations and detecting transitions and travel modes were validated using a smartphone-based GPS and an off-the-shelf activity tracker. It turned out that in this setting, the clustering algorithm (OPTICS) for detecting locations provides a good recall with a setting of 290 for Eps and 50 for MinPts. The high number of false positives could be explained by the fact that participants were only asked to report the most important locations of type home, work, study, sports location, but that it was not required to mention every significant location. Of course, in daily life we do visit more locations than the ones listed above.

There are a few limitations of our study that we would like to mention. First, the participants reported about their travel modes in hindsight. Due to technical issues the participants provided the travel information for the first period only after two weeks, for the remaining period information was provided on the day after the travel took place. For this reason, a confidence level was associated with each trip in the travel log. It is possible that people underestimated or overestimated their travel periods which could affect the reliability of data and hence leads to less performance. However, in our validation we did not take the confidence level into account, all reported travel modes were considered equally important.

There are a number of possible explanations for the low number of transitions that were found. First of all, it is known that the young population that we have in our pilot study tends to underreport or misreport travels [24]. Another possible reason is that the detection process becomes more complex when different types of smartphones are used [25]. Since in this study no restriction was imposed to use a particular brand (apart from the operating system), we had a large variety of devices. Furthermore, it is also known that a dedicated GPS receiver is more accurate than the GPS sensor in a smartphone [25].

Our attempt to detect locations, trips, and mode was made in the context of a mobile coaching app. We therefore abstained from using GIS, since the goal was to automatically detect in real time. However, as can be seen in the literature, using GIS data provides more reliable trip information as compared to only relying on GPS and accelerometer data [12, 13].

We can conclude that it is difficult to find transition periods based on GPS locations only. Our hypothesis is that this is caused by the fact that there are many gaps in the GPS logs. Several factors could have contributed to this problem, for example: the smartphone is not charged, an accurate location cannot be obtained – especially when inside a building, or a transition is not reported correctly. However, for the transition periods that were correctly identified, we have shown that travel modes can be very well detected based on GPS speed. Adding accelerometer data to GPS speed further improves detection performance. The results of travel mode detection are comparable to the literature. For example Ellis et al. [15] reported an overall accuracy between 89.8% and 91.9% based on different methods when combining GPS and accelerometer. For the trip level detections Gong et al. reported 82.6% accuracy [26].