This study proposes an analytical framework for identifying stops from trajectory data. The framework seeks to measure and analyze spatio-temporal environment features surrounding the point sequence of a stop so that more accurate stop information can be obtained.
Figure 2 illustrates the framework that integrates the environment information into trajectory movement. For this study, POIs and the road network structure are selected to construct stop environment context cubes according to specific business hours, which presents spatio-temporal dynamics of sequences of environmental contexts when the staying behavior occurs. A method based on the time-distance threshold is used to extract the suspected stops after reconstructing the vehicle’s trajectory data. By projecting the stop subsequences of trajectories into three-dimensional environmental context cubes, multiple characteristics of the trajectory stops could be selected and calculated, and the space-time correlation between environment context and stop sub-trajectories is further analyzed in each period. An SVM-based classifier is then employed to identify stops and predict the accuracy of the stop test dataset. Details of mobility context cube, capturing stop candidates, and stop classification will be discussed in the following sections.
3.1. Representing Dynamic Spatiotemporal Features Using Mobility Context Cube
The stopping behaviors are affected by the surrounding environmental factors. Hence the Mobility Context Cube (MCC) model is developed for presenting the surrounding environmental information dynamically and extracting appropriate features about stopping behaviors for the following SVM-based classification. This model can set the different temporal and spatial resolution to divide the surrounding space-time of stop candidates into a series of small cells. By analyzing these small cells, one can obtain crucial information (dynamic POIs and road network contexts) for the judgment of staying behaviors of moving objects. For instance, there is a restaurant POI near the candidate stop, and the occurrence time of this stop also coincides with the mealtime, and it may be a real stop. In the same way, if an entertainment POI near the candidate stops during the daytime, then this candidate stop is likely to be a false stop.
As some researchers have pointed out [
54], environmental contexts are constantly changing. By that analogy, the contextual influences of the POI and road network environment may also differ in time of day. In consequence, the identification of stops may lead to erroneous conclusions when the variability of the environmental context is ignored. Additionally, the contextual impacts of the surrounding environment may also vary over time. Various types and business hours of POIs have an impact on stopping behaviors. It is clear that a majority of POIs can only offer services during their opening hours on weekdays, which affects the occurrence of staying behaviors to a varying degree. However, previous studies have largely ignored temporal variations in the POIs environment. For example, the probability of staying behavior near restaurants’ types of POIs needs more concentration during the weekdays, especially around noon and at about 7 p.m., while it appears to vary significantly over time on weekends. As a result, further research is needed to take account of the surrounding environmental factors from a dynamic spatio-temporal change perspective.
The Mobility Context Cube (MCC) connects objects and mobile environments while accurately identifying individual behaviors. It is designed to capture the complex dynamic environment and individual staying behavior. Hagerstrand T. [
55] first introduced the concept of the space-time cube in the 1980s, which represents the geographic contexts of the study area (x-axis and y-axis), with three-dimension lines inside the cube representing an individual’s movement trajectories. Space-time cubes can be used for some visual analysis but have their limitations because visualization and analysis of spatio-temporal data in GIS are further complicated. In fact, GPS tracking contains dual information of time and space. If the x-axis and y-axis, respectively, describe the geographic location of the GPS points, and the z-axis represents the acquisition time of the GPS points, this stereoscopic representation method is the three-dimensional representation of the GPS trajectory. In real-world contexts, however, geographic environment contexts represented by the x-axis and y-axis are not a simple two-dimensional situation, and their influence on moving objects may change with both space and time in highly complex ways. Representation of the environmental context should thus be also extended to capture and represent the dynamic characteristics of the environment and staying behaviors by integrating the POIs’ business hours as the third dimension.
By extending the traditional space-time cube, the MCC was developed as a new analytical framework for analyzing people’s staying behavior and their dynamic relationships with their POIs environmental context. As shown in
Figure 3, the MCC can be viewed as a collection of small cubes arranged on a regular grid, each of those values represents the POI context at a specific geographic location (longitude and latitude coordinates) at a specific time (POIs’ business hours). Thus, spatial and temporal variations in the POI context are rendered as the different values of the cubes in three-dimension space at various locations and times. In the time dimension of the MCC, each layer represents the POI contexts that are in business at a particular time of the day. The size of each small cube represents the temporal and spatial resolution. Different spatial and temporal resolutions of MCCs may directly be related to the dynamic expression of POIs’ spatial and temporal characteristics, thereby affecting the accuracy of recognition of staying behavior. We establish a combination of two different spatial resolutions (200 m, 100 m) and two different time resolutions (30 min, 60 min), and then compare their performance. In this way, we establish a series of MCCs to represent the POI environment around the stops.
The geographic scope of services from POIs can be assessed by creating homogeneous buffer areas covering POI locations with a specific distance (such as 200 m or 1 km). However, representation of POIs’ effects on staying behavior should take into account the effect of distance decay rather than using arbitrary distance cut-offs: environmental effects change as a function of distance, with locations farther from a factor less affected by influencing that POIs than nearer locations are, that is, it has less possibility that the staying behavior is caused by POIs. Additionally, the influence of the road network can be considered as the distance from the stop location to the nearest section, or the number of road intersections within the neighborhood of the stops.
According to the types of services and influence on moving objects, POIs in the study area were classified into 11 categories: accommodation, medical services, transport facilities, scenic spots, restaurants, financial services, educations, shopping malls, life services, entertainments, and corporate institutions.
Figure 4 shows the location of these POIs at a different time of day in the study area. On the right of the picture is the POIs that influence the staying behaviors at a different period in Meixi Lake Park. Obviously, the number of POIs has changed in the same place. In addition, we discovered that POIs may have different business hours whether they are of the same type. Taking restaurants as an example, the opening hours of a Chinese restaurant are from 9 a.m. to 10 p.m., while the opening hours of KFC are 24 h a day. As a result, it is necessary to capture the POI environmental context that is in operation in different time periods in order to construct an MCC for one day. Layers of POIs would be voxelized and organized chronologically to form MCCs with a specific temporal resolution. For each time interval, based on the locations of POIs that were operated at a specific period, the surrounding POIs’ impact on staying behaviors could be analyzed. Theoretically, the higher temporal resolution provides more detailed temporal dynamics of the environmental features on any particular day.
Figure 5 shows the spatial and temporal distribution between the stops, the POIs, and road networks. The red points represent candidate stops; the yellow points symbolize all types of POI at different business hours in a day. Not only does the picture directly analyze the spatial distribution of stops in different business hours, but it also shows a visual representation of the spatial-temporal distribution of candidate stops and POIs. As mentioned above, according to two different spatial resolutions of 200 m × 200 m, 100 m × 100 m, and time resolutions of 30 min and 60 min, four MCCs were finally established. In order to conveniently analyze the spatio-temporal relationship between MCCs and stop behaviors, the geographical coordinates and time stamps of the candidate stop points in the vehicle GPS tracking are projected into MCCs. It is obvious that locations of stopping near what types of POIs at what time.
3.2. Capturing Candidate Stop Set
Once the MCCs were established, a set of sub-trajectories was extracted from raw trajectory data, and the center point of these sub-trajectories was considered to be suspected stops; it extracts sub-trajectories related to the stopping behaviors from raw trajectories. This approach sets out in detail the spatial and temporal distribution of various forms of POIs, road networks and stops during different business hours. It is a novel way for this paper to extract the stops by calculating the surrounding environmental factors.
Algorithm 1 describes the work of extracting stop candidates from raw trajectory data, where
calculates the great circle distance between current GPS point
and all points in
,
is computing the duration between current GPS point
and all points in a_stop,
represents the merge function that combines clusters that are continuous in time and adjacent in space. It first checks whether a sampling point
in trajectory satisfies the predefined distance threshold
, and time threshold
and generates the candidates set consisting of stop candidates in form of successive sampling points. In this paper, we used two empirical values to determine
and
. We define
as 60 m, and
is 60 s. This method takes into account both the temporal and spatial characteristics of the staying behavior, which presents clustering characteristics according to the spatio-temporal distribution of tracking points to a certain extent.
Algorithm 1 Extracting Stops Candidates Sub-trajectories (ESCS). |
Input: Trajectory T; The time threshold ; The distance threshold |
Output: Stop candidates sub-trajectories |
1: Initialize as an empty set; |
2: Initialize as an empty set; |
3: for do // is the ith point in T; |
4: = CalculateDistance(); //calculate distance between and all points in . |
5: if then |
6: if is an empty then |
7: continue; |
8: else |
9: set as an enmpty set; |
10: end if |
11: else |
12: duration = CalculateDuration(); |
13: if then |
14: append to ; |
15: else |
16: append to ; |
17: set as an enmpty set; |
18: end if |
19: end if |
20: end for |
21: = Merge(); |
22: return |
After the time-distance threshold filtering, a merge is necessary to employ a merge to refine
. Some consecutive candidate stops sequences are very close in space. In fact, they are likely to be the same staying behavior after further inquiring about this situation. A constraint is added to merge the stops sub-trajectories that are continuous in time and adjacent in space. If the distance between two stop sub-trajectories is less than
, two stop groups should be mixed. As shown in
Figure 6, there are two sub-trajectories (marked in yellow and green) contiguous both in space and time, which obviously should belong to one stopping behavior (marked in red).
In order to understand the relationship between mobility and stops more clearly, a center point from a sub-trajectories needs to be selected, which represents the stops that project into MCCs. How to choose an appropriate center point from the stops sequence? To traverse each GPS point in the stops sequence and calculate the sum of distances from that point to other points, a point in the sequence with the lowest sum of distances to all other points can be selected as the center point. Note that the center point we extracted here is the actual point in the GPS trajectory, and the real information of the trajectory is not modified.
3.3. Stop Classification Using SVM Classifier
To improve the identify precision of the real stops, this paper exploits the support vector machine classifier to distinguish staying and walking slowly to solve the problem of identifying the real stops. Unlike other classifiers, such as KNN, the decision tree, and the Ensemble algorithm, the SVM classifier has its unique advantages: low computational complexity, high prediction accuracy, efficiency, and flexibility. SVM is a supervised machine learning method, which is often used to solve classification and regression problems. The SVM-based classification, essentially, separates all the data points from the origin (in feature space) and maximizes the distance from this hyperplane to the origin (e.g., Scholkopf B. et al. [
56]). The data is generally divided into two datasets: the training dataset and the test dataset. Each sample in the training set contains a “target value” (i.e., category label) and some attribute values (i.e., features or observed variables). It aims to build a model based on the training set to predict its target value by attributes of the test data.
The core idea of SVM is to use a hyperplane to divide the training data set and maximize the boundary between the two categories, and then apply the learning model of the training set to the test set to achieve classification.
A hyperplane can be defined as
where
is a normal vector perpendicular to the hyperplane. For a given sample point (
), if
, then
; if
, then
.
is put into the formula, when
, this can be explained as the sample point is above the hyperplane; otherwise, the sample point is below the hyperplane. In order to find the optimal decision hyperplane, the distance from any point
is defined in the training set to the hyperplane. The formula is presented as
Moreover, the point closest to the hyperplane is needed to be the farthest away from the hyperplane, which is
but
,
can be defined as 1. Therefore,
By the transformation of the primal-dual relationship, the above equation can be converted to
the optimal model can be represented as
SVM can also use kernel functions to map feature vectors to a higher-dimensional space to reduce the complexity because of several features. The RBF kernel is usually to be the first choice when selecting the kernel function, which maps the nonlinear sample into a higher-dimensional space. Therefore, unlike the linear kernel, the RBF kernel function can deal with the nonlinear correlation between class labels and attributes. Certainly, the sigmoid kernel function also behaves similar to the RBF kernel under certain parameters. Moreover, the number of hyperparameters also affects the complexity of kernel selection, and the polynomial kernel has more hyperparameters than the RBF kernel. Generally, the RBF kernel has fewer numerical calculation difficulties. The key is that the value range from the RBF kernel is fixed. In contrast, the value of the polynomial kernel may be infinite or zero when the degree is verified large. Therefore, a RBF kernel is regarded as the most suitable function given attributes size. This kernel function is shown as follows,
where
is the Euclidean distance between vectors
and
, and
is the Gaussian parameter.
There are two main parameters in the RBF kernel: C and Gamma. C is a penalty coefficient, namely, the tolerance for error. Gamma is a parameter that comes with RBF function when it is selected as kernel, which implicitly determines the distribution of data mapped to the new feature space. The optimal value for a given problem is unknown, so model selection (parameter search) are needed to perform to find them. A common strategy is to divide the dataset into two parts, one of which is considered unknown, the other is used to train the model. The prediction accuracy obtained from this “unknow” dataset can accurately reflect the performance of the device in classifying an independent dataset, the process of the improved version is called cross-validation. To train the classification algorithms and tune their parameters, a cross-validation and grid search are applied.
The purpose of MCC is also constructed to extract some characteristics of the surrounding environment intuitively. According to MCC with the different spatial and temporal resolution, (200 m, 60 min) is the most convenient MCC to discover features of staying behaviors. We also need to select these characteristics that can be used to describe the information of stops of GPS trajectory, and then we could distinguish between staying and walking slowly. Part of the data is selected to reflect a correlation study of the characteristics as shown in
Figure 7a. For any stop behavior that occurs for any reason, the length of a stop and the speed of a stop are essential criteria for the recognition of stops. This is valid for considering the pace and length of stops according to this image. But there are still other contextual variables that need to be considered in
Figure 7b. The various types of POIs, the number of road intersections and other factors have all contributed to improving the precision of the identification of stops.
For example, when only speed and stop length are considered, the Entropy is measured as 4.95, whereas the environmental contexts are added as variables, the Entropy is 1.78. It suggests that the consideration of contextual features would reduce the uncertainty of the outcome and make the extraction of stops more accurate.
As mentioned above, the staying behaviors should not only consider the characteristics of the stops themselves, for any cell of the MCC, but also the restrictive factors of the surrounding environment. Therefore, in this paper, the stop duration, the average speed, the average distance between candidate stops and 11 types of POIs, the number of 11 types of POIs, the total number of POIs, and the number of road intersections are selected as input features of SVM for stops identification (as shown in
Table 1).
To meet the computation cost raised by the massive training sample size, a GPU-accelerated LibSVM package is used to implement SVM classification. Depending on the size of the dataset and the number of attributes, we should choose the appropriate kernel function and corresponding parameters.