a self-adaptive parameter selection trajectory prediction...

13
284 IEEE TRANSACTIONS ON INTELLIGENT TRANSPORTATION SYSTEMS, VOL. 16, NO. 1, FEBRUARY 2015 A Self-Adaptive Parameter Selection Trajectory Prediction Approach via Hidden Markov Models Shaojie Qiao, Dayong Shen, Xiaoteng Wang, Nan Han, and William Zhu Abstract—Trajectory prediction of objects in moving objects databases (MODs) has garnered wide support in a variety of applications and is gradually becoming an active research area. The existing trajectory prediction algorithms focus on discov- ering frequent moving patterns or simulating the mobility of objects via mathematical models. While these models are useful in certain applications, they fall short in describing the position and behavior of moving objects in a network-constraint envi- ronment. Aiming to solve this problem, a hidden Markov model (HMM)-based trajectory prediction algorithm is proposed, called Hidden Markov model-based Trajectory Prediction (HMTP). By analyzing the disadvantages of HMTP, a self-adaptive parameter selection algorithm called HMTPis proposed, which captures the parameters necessary for real-world scenarios in terms of objects with dynamically changing speed. In addition, a density-based trajectory partition algorithm is introduced, which helps improve the efficiency of prediction. In order to evaluate the effectiveness and efficiency of the proposed algorithms, extensive experiments were conducted, and the experimental results demonstrate that the effect of critical parameters on the prediction accuracy in the proposed paradigm, with regard to HMTP, can greatly improve the accuracy when compared with HMTP, when subjected to randomly changing speeds. Moreover, it has higher positioning precision than HMTP due to its capability of self-adjustment. Index Terms—Hidden Markov model (HMM), location-based services, moving objects, trajectory data, trajectory prediction. I. I NTRODUCTION M OBILE computing, wireless communication, and global position system (GPS) techniques are growing rapidly, and recent progress on satellite, sensor, RFID, and wireless technologies has made it possible for us to systematically Manuscript received December 31, 2013; revised April 6, 2014; accepted June 8, 2014. Date of publication October 8, 2014; date of current version January 30, 2015. This work was supported in part by the National Natural Science Foundation of China under Nos. 61100045, 61165013, 61170128, and 61379049; by the Specialized Research Fund for the Doctoral Program of Higher Education of China under Grant 20110184120008; by the Youth Foundation for Humanities and Social Sciences of Ministry of Education of China under Grant 14YJCZH046; and by the Fundamental Research Funds for the Central Universities under Grant 2682013BR023. The Associate Editor for this paper was L. Li. (Corresponding author: Nan Han.) S. Qiao and X. Wang are with the School of Information Science and Technology, Southwest Jiaotong University, Chengdu 610031, China (e-mail: [email protected]). D. Shen is with the College of Information System and Management, National University of Defense Technology, Changsha 410073, China. N. Han is with the School of Life Sciences and Engineering, Southwest Jiaotong University, Chengdu 610031, China (e-mail: [email protected]). W. Zhu is with Fujian Provincial Key Laboratory of Granular Computing, Minnan Normal University, Zhangzhou 363000, China. Color versions of one or more of the figures in this paper are available online at http://ieeexplore.ieee.org. Digital Object Identifier 10.1109/TITS.2014.2331758 track object movements while collecting a large amount of trajectory data, e.g., vessel positioning data and animal move- ment data [1], [2]. This side effect provides the opportunity for innovative methods that can help analyze the behavior of movements [3]. More importantly, data collected by mobile devices, sensors, and wearable devices can accurately describe the behavioral patterns of objects, from which the capabilities of prediction accuracy and real-time response can be greatly improved. The large-scale and variable trajectory data urgently need us to propose new, intelligent, efficient, and effective ap- proaches to discovering the hidden knowledge buried within it [4]. Location-based intelligent services [5] have emerged as new technical strategies for discovering position relationships among moving objects, which are used in order to provide personalized location-based services. In order to accurately provide good location-based services, it is necessary to capture and track the current position of individuals in real-time fashion or possibly in advance. This qualifies trajectory prediction of moving objects (TPMO) as an active area of research. This, in turn, provides a better understanding of human mobility [6], [7]. Essentially, TPMO has a greater potential for research value, which, if done effectively, can provide theoretical sig- nificance in various directions. For example, trajectory com- pressing and simplification in TPMO can help improve the runtime efficiency of various location-based applications and provide normalized data that can be used to reduce potential errors caused by raw data. Moreover, TPMO is of important practical value, and we can demonstrate this with an application scenario: Consider the difficulty of finding a taxi during peak time in an area with a limited number of taxis. By tracking techniques in TPMO, we can identify available taxis in the vicinity within a given time constraint. This can save time for commuters by instructing them to wait at the proper stations at given time frames. Trajectory prediction or tracking in transportation networks is a very common and challenging problem in TPMO. In order to account for the storage space necessary for storing the massive amount of spatial points and also to accelerate prediction, we often partition the digital map into multiple cells, which can be used to represent trajectory points. Inevitably, this will cause answer–loss and precision dependence problems in the aforementioned process. In addition, traditional distance vector-based TPMO approaches can only be applied to predict possible paths within fixed (constrained) roadways and do not work well when objects remain in road junctions due to traffic jams. 1524-9050 © 2014 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission. See http://www.ieee.org/publications_standards/publications/rights/index.html for more information.

Upload: others

Post on 26-Jun-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A Self-Adaptive Parameter Selection Trajectory Prediction ...static.tongtianta.site/paper_pdf/4ded7b5c-8c16-11e9-aa97-00163e08… · A Self-Adaptive Parameter Selection Trajectory

284 IEEE TRANSACTIONS ON INTELLIGENT TRANSPORTATION SYSTEMS, VOL. 16, NO. 1, FEBRUARY 2015

A Self-Adaptive Parameter Selection TrajectoryPrediction Approach via Hidden Markov Models

Shaojie Qiao, Dayong Shen, Xiaoteng Wang, Nan Han, and William Zhu

Abstract—Trajectory prediction of objects in moving objectsdatabases (MODs) has garnered wide support in a variety ofapplications and is gradually becoming an active research area.The existing trajectory prediction algorithms focus on discov-ering frequent moving patterns or simulating the mobility ofobjects via mathematical models. While these models are usefulin certain applications, they fall short in describing the positionand behavior of moving objects in a network-constraint envi-ronment. Aiming to solve this problem, a hidden Markov model(HMM)-based trajectory prediction algorithm is proposed, calledHidden Markov model-based Trajectory Prediction (HMTP). Byanalyzing the disadvantages of HMTP, a self-adaptive parameterselection algorithm called HMTP∗ is proposed, which captures theparameters necessary for real-world scenarios in terms of objectswith dynamically changing speed. In addition, a density-basedtrajectory partition algorithm is introduced, which helps improvethe efficiency of prediction. In order to evaluate the effectivenessand efficiency of the proposed algorithms, extensive experimentswere conducted, and the experimental results demonstrate thatthe effect of critical parameters on the prediction accuracy in theproposed paradigm, with regard to HMTP∗, can greatly improvethe accuracy when compared with HMTP, when subjected torandomly changing speeds. Moreover, it has higher positioningprecision than HMTP due to its capability of self-adjustment.

Index Terms—Hidden Markov model (HMM), location-basedservices, moving objects, trajectory data, trajectory prediction.

I. INTRODUCTION

MOBILE computing, wireless communication, and globalposition system (GPS) techniques are growing rapidly,

and recent progress on satellite, sensor, RFID, and wirelesstechnologies has made it possible for us to systematically

Manuscript received December 31, 2013; revised April 6, 2014; acceptedJune 8, 2014. Date of publication October 8, 2014; date of current versionJanuary 30, 2015. This work was supported in part by the National NaturalScience Foundation of China under Nos. 61100045, 61165013, 61170128,and 61379049; by the Specialized Research Fund for the Doctoral Programof Higher Education of China under Grant 20110184120008; by the YouthFoundation for Humanities and Social Sciences of Ministry of Education ofChina under Grant 14YJCZH046; and by the Fundamental Research Funds forthe Central Universities under Grant 2682013BR023. The Associate Editor forthis paper was L. Li. (Corresponding author: Nan Han.)

S. Qiao and X. Wang are with the School of Information Science andTechnology, Southwest Jiaotong University, Chengdu 610031, China (e-mail:[email protected]).

D. Shen is with the College of Information System and Management,National University of Defense Technology, Changsha 410073, China.

N. Han is with the School of Life Sciences and Engineering, SouthwestJiaotong University, Chengdu 610031, China (e-mail: [email protected]).

W. Zhu is with Fujian Provincial Key Laboratory of Granular Computing,Minnan Normal University, Zhangzhou 363000, China.

Color versions of one or more of the figures in this paper are available onlineat http://ieeexplore.ieee.org.

Digital Object Identifier 10.1109/TITS.2014.2331758

track object movements while collecting a large amount oftrajectory data, e.g., vessel positioning data and animal move-ment data [1], [2]. This side effect provides the opportunityfor innovative methods that can help analyze the behavior ofmovements [3]. More importantly, data collected by mobiledevices, sensors, and wearable devices can accurately describethe behavioral patterns of objects, from which the capabilitiesof prediction accuracy and real-time response can be greatlyimproved.

The large-scale and variable trajectory data urgently needus to propose new, intelligent, efficient, and effective ap-proaches to discovering the hidden knowledge buried withinit [4]. Location-based intelligent services [5] have emerged asnew technical strategies for discovering position relationshipsamong moving objects, which are used in order to providepersonalized location-based services. In order to accuratelyprovide good location-based services, it is necessary to captureand track the current position of individuals in real-time fashionor possibly in advance. This qualifies trajectory prediction ofmoving objects (TPMO) as an active area of research. This,in turn, provides a better understanding of human mobility[6], [7]. Essentially, TPMO has a greater potential for researchvalue, which, if done effectively, can provide theoretical sig-nificance in various directions. For example, trajectory com-pressing and simplification in TPMO can help improve theruntime efficiency of various location-based applications andprovide normalized data that can be used to reduce potentialerrors caused by raw data. Moreover, TPMO is of importantpractical value, and we can demonstrate this with an applicationscenario: Consider the difficulty of finding a taxi during peaktime in an area with a limited number of taxis. By trackingtechniques in TPMO, we can identify available taxis in thevicinity within a given time constraint. This can save time forcommuters by instructing them to wait at the proper stations atgiven time frames.

Trajectory prediction or tracking in transportation networksis a very common and challenging problem in TPMO. Inorder to account for the storage space necessary for storingthe massive amount of spatial points and also to accelerateprediction, we often partition the digital map into multiple cells,which can be used to represent trajectory points. Inevitably,this will cause answer–loss and precision dependence problemsin the aforementioned process. In addition, traditional distancevector-based TPMO approaches can only be applied to predictpossible paths within fixed (constrained) roadways and donot work well when objects remain in road junctions due totraffic jams.

1524-9050 © 2014 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.See http://www.ieee.org/publications_standards/publications/rights/index.html for more information.

Page 2: A Self-Adaptive Parameter Selection Trajectory Prediction ...static.tongtianta.site/paper_pdf/4ded7b5c-8c16-11e9-aa97-00163e08… · A Self-Adaptive Parameter Selection Trajectory

QIAO et al.: SELF-ADAPTIVE PARAMETER SELECTION TRAJECTORY PREDICTION APPROACH VIA HMMS 285

With the goal of overcoming some of the challenges in ex-isting path tracking algorithms, we make the following originalcontributions in this paper.

• We propose a Hidden Markov model-based TrajectoryPrediction (HMTP) approach that can predict continuouspaths of moving objects instead of slices of trajectorypatterns. In order to cope with the case of objects that movewith dynamically changing speeds, we improve the HMTPmodel and propose a self-adaptive parameter selectionalgorithm, called HMTP∗, which can automatically adjustparameters in the size of cells, clusters, and trajectory seg-ments. More fundamentally, we work to address methodsfor using the forward algorithm to solve the trajectory eval-uation problem and methods for using Viterbi algorithm todiscover trajectory hidden state sequences.

• We propose new strategies to solve the discontinuoushidden state chain problem in order to detect false positivestates. In addition, we provide the strategy for handlingthe state retention problem in the hidden Markov model(HMM)-based prediction model, which helps guaranteethe accuracy of prediction.

• In order to further process large-scale data, we propose atrajectory partition algorithm, i.e., TraSeg, which traversestrajectory points in a breadth-first fashion and does notneed to iteratively visit each point in the clusters. It has twoadvantages: 1) further process trajectory data before train-ing the HMTP model in order to improve the efficiency;and 2) retrieve trajectory hidden states.

II. RELATED WORK

The problem of predicting trajectories with uncertainty inmoving objects databases (MODs) has recently received in-creased attention. Existing work relevant to trajectory pre-diction mainly focuses on discovering frequent patterns [8].A representative work was conducted by Mamoulis et al. [9].They proposed a top-down technique, called STPMine2, whichcan efficiently identify periodic patterns. In addition, an in-dexing scheme was proposed to effectively manage the un-certainty of trajectory data. Morzy et al. [10] combined thePrefixSpan algorithm and the FP-tree to predict the movementrules of objects. However, mining of frequent trajectory pat-terns is extremely computationally costly. In order to infer anobject’s future locations, Jeung et al. [11] proposed a hybridprediction model based on its pattern information and motionfunctions using the object’s recent movements. However, theproposed query processing approaches can only support near-and distant-time predictive queries, which are not suitablefor long-term trajectory prediction. In other research findings,Monreale et al. [3] proposed a method called WhereNext, whichuses previously extracted moving patterns as a source of com-monly visited regions within a given travel period. It predictsthe next location of a new trajectory by finding the best match-ing path in the T-pattern Tree. Many of the existing predictiontechniques are developed based only on the geographic featuresof trajectories. However, an exception to this was the researchconducted by Ying et al. [12], who proposed an approach forpredicting the next location of individuals based on both geo-

graphic and semantic features of trajectories. It follows, though,that this method requires the calculation of a Semantic Scorefor each candidate path, and this generally produces additionaloverhead when compared with other methods. Zheng et al. [13]proposed a hypertext-induced topic search-based model to inferthe interest of a location by taking into account the users’ travelexperiences and interests. However, this method is useful onlyfor recommending interesting places.

In our background research, we have encountered manyexamples in which Markov models have been used to dis-cover frequent trajectory patterns. Ishikawa et al. [14] proposedthe Markov transition probability, which is based on a cell-based organization of a target space, and employed it to ex-tract mobility statistics from indexed spatiotemporal databases.Jeung et al. [15] used HMMs to mine trajectory patterns byutilizing the effectiveness of space-partitioning methods. How-ever, this approach cannot be applied to predict future locationof moving objects due to the spatiotemporal characteristic oftrajectory data. Another work by Peng et al. [16] used Markovchains to predict trajectories of moving objects in which histor-ical trajectories are transmitted into directed graphs to constructa Markov chain, which is used to compute the k-order transitionmatrix and predict the moving path. However, the processheavily depends on historical data, and thus, accuracy cannotbe guaranteed. Another example is the work proposed byFeng et al. [17], where the authors utilized the spatial cor-relation of the layout of base stations to improve the partialprobability of the solution process in the HMMs, which worksto restore the trajectory sequence without taking into consider-ation the missing observable states. However, if the degree ofstate orientation is low, the prediction results will be greatly af-fected. In order to predict pedestrian movement, Asahara et al.[18] proposed a mixed Markov-chain model (MMM) that hasan observable parameter like HMM, but the unobservable pa-rameter of MMM is fixed during the state transition. Experi-mental results demonstrate that the prediction accuracy of theMMM method is higher than that of the Markov-chain modeland HMMs. Gambs et al. [19] have recently extended mobilityMarkov chain model by taking into account the effect of visitingplace before n number of states, which is more like a high-orderMarkov chain. However, most of the Markov models do nottake into account the discontinuous hidden state chain, and thus,state retention problems continue to greatly affect predictionaccuracy.

Our work is motivated by the studies published in Scienceby Song et al. [6], which proved that human mobility ispredictable. Results showed that there can be 93% potentialfor predictability in user mobility across the whole user baseby measuring the entropy of each individual’s trajectory. Re-cent work in path (trajectory) prediction, such as the afore-mentioned, has begun to attract more and more researchers,which has lead to a number of new state-of-the-art approaches.Hunter et al. [20] proposed a vehicle trajectory discoveryalgorithm from sparse sequences of GPS points, in which thesampling interval is between 1 s and 2 min. However, in thecase when the sampling interval is longer than 2 min, it needsto adapt aggressive pruning method to achieve good perfor-mance. In order to support short-term traffic state prediction,

Page 3: A Self-Adaptive Parameter Selection Trajectory Prediction ...static.tongtianta.site/paper_pdf/4ded7b5c-8c16-11e9-aa97-00163e08… · A Self-Adaptive Parameter Selection Trajectory

286 IEEE TRANSACTIONS ON INTELLIGENT TRANSPORTATION SYSTEMS, VOL. 16, NO. 1, FEBRUARY 2015

Pan et al. [21] proposed a multivariate normal distribution-based best linear predictor, which is adopted as an auxiliarydynamic system to forecast boundary variables and supplyfunctions. However, the proposed approach suffers from a time-lag effect since it is reactive in nature and cannot capture themoving-bottleneck effect due to limitations in the proposedframework. By contrary, Sadilek and Krumm [22] proposeda nonparametric method that can discover significant patternsin locative data far into the future, in the scale of months andyears, and does so by mining the associations of contextualfeatures. The method then leverages this information and usesit to predict the most likely location at any given time inthe future. Zhou et al. [23] proposed a “semi-lazy” approachthat builds models on the fly by using dynamically selectedreference trajectories. The advantages of this proposed modelare that the target trajectories to be predicted are known beforethe models are built, and thus, it can derive accurate predictionmodels with an acceptable delay based on a small number ofselected reference trajectories.

Aiming to cope with the drawbacks of the previously statedwork on TPMO, we proposed new trajectory prediction al-gorithms based on HMMs that can self-adjust parameters. Inthe proposed model, the time cost of constructing the HMMsis relatively minimized, and the prediction is extremely ef-ficient. The prediction model does not need to produce ad-ditional overhead when compared with tree-based frequentpattern discovery methods and traditional Markov-chain-basedapproaches. In addition, the self-adaptive algorithm can auto-matically tune the size of cells, clusters, and trajectory seg-ments, which increases the effectiveness when compared withother methods.

III. PROBLEM STATEMENT AND PRELIMINARIES

In general, TPMO contains the following essential phases:1) Obtain the historical data of MODs; 2) extract, simplify, andcluster trajectory points in order to construct a model that canbe used to discover the motion patterns; and 3) lastly, employa trained prediction model to convey the significant motiontrend and predict moving behavior of objects. Based on HMM,TPMO problem can be formalized as follows.

Definition 1 (Trajectory Prediction Based on HMM): As-sume that a trajectory is depicted by {T (t)|t = 1, 2, 3, . . . , n},where t is a distinct timestamp, and λ = {π,A,B} is anHMM-based trajectory prediction model, where π is the ini-tial state distribution, A is the hidden states transition prob-ability matrix, and B is the transition matrix of observationsymbol probabilities; the goal is to compute the position ofT (n+ 1) in the {n+ 1}-th timestamp based on the previousnth states.

To facilitate the process of describing trajectories, we parti-tion the digital map into a series of conjoint cells and transformthe point sequence into a cell sequence. The phase of trajectorypoint transformation is threefold: It helps simplify trajectories,optimizes the memory storage, and improves the efficiency ofcomputing the similarity between trajectories. However, it doesnot avoid the answer–loss problem, as shown in Fig. 1, in whichTraj1 is similar to Traj2. However, after partitioning the grid

Fig. 1. Space partition by cells and answer–loss problem on it.

into cells, Traj1 and Traj2 are viewed to be two unrelatedtrajectories because the two points p and q, marked by dashedlines, are falsely distributed into two cells.

HMM is a two-tiered random process in which the upperlayer is composed of a Markov chain that describes the tran-sition between hidden states, and the bottom layer is a randommodel that depicts the relationship between observation sym-bols (also called observable states) and hidden states [24]. In theremainder of this section, we will introduce the fundamentals ofHMTP and formalize the proposed model.

Definition 2 (Trajectory HMM): The trajectory HMM is asix-tuple H = {S,H,R,Π, A,B} and it is assumed that X(n)represents a trajectory hidden state sequence, and O(n) is atrajectory observation sequence; it then follows:

S is a trajectory sequence and S = {s1, s2, . . . , sn}, and S iscomposed of discrete points, where si = (xi, yi, ti), 1 ≤i ≤ n.

H is a set of trajectory hidden states that is formed by partition-ing training trajectories into segments with fixed length.The hidden state is denoted by {ai|i = 1, 2, 3, . . . , N},where N represents the number of hidden states.

R is a set of trajectory observation symbols that is composed ofcells in a digital map. The observation symbol is expressedby {oi|i = 1, 2, 3, . . . ,M}, where M corresponds to thetotal number of observable states.

Π = {πi}(1 ≤ i ≤ N) describes the distribution over the ini-tial states, where πi = p denotes the initial probability ofchoosing state i.

A = {aij} is a trajectory state transition probability matrix,where aij = P{X(t+ 1) = aj |X(t) = ai}, i.e., the tran-sition probability matrix of the upper layer of the trajectorychain.

B = {bik} is a transition probability matrix composed ofprobability values from hidden states to observable states,which can be also called a confused matrix, where bik =P{O(t) = ok|X(t) = ai}, which denotes the probabil-ity of transformation from hidden state ai to observablestate ok.

Fig. 2 is a typical HMM-based trajectory prediction model,where circle points stand for hidden states and the gridpartitions cells as observable states. In terms of this ex-ample, the HMTP parameters can be denoted as follows:The hidden state set H = {s1, s2, s3, s4, s5} where the num-ber of states N = 5, and the observable state set R ={r1, r2, r3, r4, r5, r6, r7, r8, r9} where M = 9.

The trajectory state transition probability matrix and observa-tion symbol probabilities corresponding to Fig. 2 are illustrated

Page 4: A Self-Adaptive Parameter Selection Trajectory Prediction ...static.tongtianta.site/paper_pdf/4ded7b5c-8c16-11e9-aa97-00163e08… · A Self-Adaptive Parameter Selection Trajectory

QIAO et al.: SELF-ADAPTIVE PARAMETER SELECTION TRAJECTORY PREDICTION APPROACH VIA HMMS 287

Fig. 2. Example of trajectory prediction model based on HMM.

as follows:

A={aij} =

⎛⎜⎜⎜⎝

0 0.4 0.3 0.3 00 0 0.6 0.4 00 0 0 0.2 0.80 0 0 0 10 0 0 0 0

⎞⎟⎟⎟⎠ (1)

B={bjk}=

⎛⎜⎜⎜⎝

0.5 0.5 0 0 0 0 0 0 00 0 0 0 0 0 1 0 00 0 0.15 0 0.25 0.6 0 0 00 0 0 0 0 0 0 1 00 0 0 0 0 0.5 0 0 0.5

⎞⎟⎟⎟⎠. (2)

In order to compute A, we first need to partition a trajectoryT into different segments Ti with fixed length. Then, we haveto investigate whether each point pk in a subtrajectory Ti isgeometrically within a trajectory sequence S. If this is true,then we can report the id of the corresponding hidden state;otherwise, we tag this as a wild card using the symbol “∗”to denote a null record. Consider Fig. 2 as an example, asubtrajectory sequence can be depicted by the state sequence as{s1s3 ∗ ∗s5}. We then compute the probabilities of each statetransition from the sequence, and we do the same for π. Thecomputation of B is done by checking whether pk belongs toboth ri and si or ri alone.

IV. TRAJECTORY DATA PROCESSING

Before inferring the trajectories of moving objects, we haveto preprocess trajectory data, which includes detecting abnor-mal points and partitioning trajectories into segments. In orderto achieve this goal, we propose a density-based trajectoryclustering method analogous to DBSCAN [25], as presented inthe following section.

A. Cluster Analysis for Trajectory Data

In this section, we present a comprehensive description of thetrajectory clustering algorithm. The method is twofold, whichworks to partition the real-world trajectories and detect abnor-mal points caused by the aforementioned factors affecting dataintegrity. There are two important parameters in it, which are

ε-neighborhood and the minimum number of trajectory points(MinPts). It is worthwhile to note that the proposed clusteringmethod takes into consideration the distribution of trajectorypoints to choose appropriate values of these two parameters.

Definition 3 (ε-Neighborhood): The ε-neighborhood of agiven trajectory point p, denoted by Nε(p), is defined byNε(p)={q∈D|dist(p, q)≤ε}, where ε is the radius of area D.

Definition 4 (Core Points): In MODs, assume that the num-ber of points in ε-neighborhood with respect to a given point kis greater than MinPts, then k is called the core point.

Definition 5 (Trajectory Cluster): Given that D is a MOD, acluster C with respect to ε and MinPts is a nonempty subset ofD satisfying the following two conditions.

1) ∀ p, q: If p ∈ C and q is density reachable from p withrespect to ε and MinPts, then q∈C.

2) ∀ p, q ∈ C : p is density connected to q with respect to εand MinPts.

The detail of this density-based trajectory clustering algo-rithm is given below.

Algorithm 1 A density-based trajectory clustering algorithm

Input: A MOD D, the cluster radius ε, and the minimumnumber of points MinPts.

Output: A set of clusters C = {C1, C2, . . . , Cn}, where n isthe number of clusters.

1. n = 0;2. for each unvisited point p ∈ D do3. mark p as Visited;4. S = getNeighors(p, ε);5. if S.size < MinPts then6. mark p as Noise;7. else8. create a new cluster Ck;9. ExpandCluster (p, S, Ck, ε,MinPts);

10. end if11. end for12. output C = {C1, C2, . . . , Cn}

Algorithm 1 contains two essential steps, i.e., DBSCAN andExpandCluster. In the phase of DBSCAN, it first visits all pointsin D, initializes the number of clusters (line 1), traverses eachpoint (line 2), and marks each point p ∈ D as visited (line 3).Second, it calculates the distance between p and other pointsin D and assigns such points (whose distance to p is shorterthan ε) to the ε-neighborhood S (line 4). If the number of S issmaller than MinPts, report p as a noise point (lines 5 and 6);otherwise, create a new cluster viewing p as a core point andcall the function of ExpandCluster [25] to traverse all points inS (lines 7–11). Finally, it returns a series of trajectory clusters(line 12).

B. Trajectory Partition Algorithm

After clustering trajectories, we have to partition a wholetrajectory into a chain of segments. In this paper, we develop

Page 5: A Self-Adaptive Parameter Selection Trajectory Prediction ...static.tongtianta.site/paper_pdf/4ded7b5c-8c16-11e9-aa97-00163e08… · A Self-Adaptive Parameter Selection Trajectory

288 IEEE TRANSACTIONS ON INTELLIGENT TRANSPORTATION SYSTEMS, VOL. 16, NO. 1, FEBRUARY 2015

a density-based partition approach, called TraSeg. Parameter εplays a critical role in TraSeg, and it differs fundamentally fromtraditional density-based partition methods in the followingtwo ways: 1) It traverses trajectory points in a breadth-firstfashion, instead of depth-first traversal; and 2) it does not needto iteratively visit each point.

Algorithm 2 Trajectory partition algorithm—TraSeg

Input: A link list TLink with n points and a cluster radius ε.Output: A set of fragments satisfying the condition with

respect to ε.1. cluNum = 1;2. for i = 0 to TLink.count do3. if TLink[i]==TRUE then4. CONTINUE;5. else6. TLink[i].id = cluNum;7. TLink[i].visit = Visited;8. end if9. for j = i+ 1 to TLink.count do

10. if TLink[j].flag==TRUE then11. CONTINUE;12. end if13. if distance(TLink[i], TLink[j])< ε then14. TLink[j].id = cluNum;15. TLink[i].flag = TRUE;16. end if17. end for18. cluNum + +;19. end for

In HMTP, we do not use the commonly used Sort-tree to sorttrajectory data. This is because tests have shown that the TraSegalgorithm performs just as well without sorted data points.The basic idea of the TraSeg algorithm is given as follows:1) Initialize and specify the id of clusters (line 1); 2) visittrajectory points in TLink and check whether a point has beenvisited; if so, omit it, else specify its cluster id to cluNum andreport it to be “visited” (lines 2–8); and 3) traverse the jthpoint in TLink, where j = i+ 1, and if the Euclidean distancebetween the ith and jth points is less than ε, mark the cluster idof the jth point to cluNum and “visited” (lines 9–17).

The merits of trajectory segmentation include: 1) Furtherprocess trajectory data before training the HMTP model inorder to improve the efficiency; and 2) retrieve trajectory hiddenstates. After partitioning, a continuous path is cut into discreteslices and each slice corresponds to one hidden state. By theoperation of trajectory partitioning, we can describe the movingbehavior of objects by a chain of hidden states.

V. TRAJECTORY PREDICTION MODEL VIA HMM

In this section, we will introduce the HMM-based trajectoryprediction algorithms, which can be used to approximate themost probable paths in arbitrary and constant-speed trajectories.

Fig. 3. Working mechanism of HMTP.

A. Working Mechanism of HMTP

At its most basic level, HMTP contains two essential phases,as shown in Fig. 3: 1) model training: retrieve hidden states cor-responding to the historical observable states; and 2) prediction:solve the three essential problems in HMM, and create a trajec-tory prediction model using HMM. The working mechanism ofHMTP is illustrated in Fig. 3.

In the proposed model, each trajectory is transformed to a cellsequence, and we can obtain a chain of hidden states. In addi-tion, consequently, solving the decoding problem is an essentialproblem in HMM. In this paper, we are interested in hiddenstates that contain lots of valuable information that cannot bedirectly observed. Consider a trajectory prediction model withthe given trajectory sequence R(t) = {ri|i ∈ [1, 2, 3, . . . ,M ]}with t time points; one of the essential problems that needs to besolved is how we can obtain the most possible cluster sequenceC(t) = {Ci|i ∈ [1, 2, 3, . . . , N ]} within t timestamps. It turnsout that this problem can be transformed to a decoding problemthat is formalized as follows. Given that

P (R|λ) = Max{C1,C2,...,CN} {P (R|Ci, λ) ∗ P (Ci|λ)} (3)

where R represents a trajectory chain of points, and Ci, i ∈{1, 2, . . . , N} is the corresponding cluster sequence of R.

The goal of HMTP is to identify the clustering sequence thatguarantees P (R|λ) to be the maximum probability value. Inorder to achieve this goal, we input all cluster sequences to (3)to calculate the probability of the given cell sequence. In HMTP,we first use the Viterbi algorithm [26] to find the chain of hiddenstates with n states having the maximum likelihood, then we

Page 6: A Self-Adaptive Parameter Selection Trajectory Prediction ...static.tongtianta.site/paper_pdf/4ded7b5c-8c16-11e9-aa97-00163e08… · A Self-Adaptive Parameter Selection Trajectory

QIAO et al.: SELF-ADAPTIVE PARAMETER SELECTION TRAJECTORY PREDICTION APPROACH VIA HMMS 289

employ the forward algorithm [27] to induce the target of the(n+ 1)-th state.

B. Viterbi Algorithm in HMTP

A Viterbi variable δt(i) represents the highest probabilitywhen extended to hidden state i at the timestamp t from the(i− 1)-th state ψi(t), P ∗ is the output probability, and C∗

T

represents the last state in an optimal hidden state sequence.The Viterbi algorithm contains four major steps as follows.Step 1: Initialization

δt(i) =πibi{R(1)}, 1 ≤ i ≤ n (4)

ψt(i) = 0. (5)

Step 2: Inductive calculation

δt(i) =max1≤i≤N [δt−1(i)aij ] bj{R(t)} (6)

ψt(t) = arg {max1≤i≤N [δt−1(i)aij ]} . (7)

Step 3: Termination

P ∗ =max1≤i≤N [δT (i)] (8)

C∗T = arg {max1≤i≤N [δT (i)]} . (9)

Step 4: Backtracking

C∗T = ψt+1

(C∗

t+1

). (10)

The four essential phases in the Viterbi algorithm are de-scribed as follows.1) Compute the probability correspondingto each hidden state where t = 1, and the condition of theinitial observable state is R(1). Then, multiply it with the initialprobability πi, and assign the result to δt(i).2) In terms ofinductive calculation, calculate the probability of each hiddenstate with respect to the observable state in R(t) at time tand designate the result to transition matrix A to compute thetransition probability from the (t− 1)-th to the tth timestamp.Then, find the highest probability value, and assign it to δt(i).3)Find the Viterbi path with the maximum transition probabilityby calculating the inverse function of δt(i) in the third step.4)Finally, use the path backtracking method to obtain the hiddenstate sequence corresponding to the given sequence of observ-able states.

C. Forward Algorithm in HMTP

HMTP applies the evaluation problem to perform the pre-diction. This is accomplished as follows: 1) each trajectory isused as input to the HMTP model, and the probability of eachoccurrence is computed; and 2) the highest probability is found,and it becomes the target trajectory, denoted as R(t), where t isthe (n+ 1)-th timestamp. Note that we use the central point ofeach trajectory segment to represent the predicted point and achain of central points to comprise a target path.

The evaluation problem can be described as follows: Giventhe parameter λ = {π,A,B} in HMTP, we examine how to

calculate the occurrence probability of P (R|λ) with regard toa given trajectory sequence that is expressed by R(t) = {ri|i ∈[1, 2, 3, . . . ,M ]} of cells. Based on the definition of HMM, fora given observable sequence, the number of candidate hiddenstate sequences corresponds to NL, where L is the length ofthe given observable sequence. Thus, a set of cluster sequences,with respect to the cell chain R is Ci = {C1, C2, . . . , Ck},where k = NL, yields the following:

P (R|λ) =T∑

i=1

P (R|Ci, λ)P (Ci|λ). (11)

The time complexity of (11) is O(NL), which turns out to bevery time intensive. In order to improve the time performanceof the evaluation problem in HMTP, we adopt the forwardalgorithm [27].

Assume that the forward parameter is αt(i), the forwardalgorithm contains three important steps.Step 1: Initialization

α1(i) = πibi{R(1)}, 1 ≤ i ≤ n. (12)

Step 2: Inductive calculation

αt+1(j) =N∑i=1

αt(i)aijbj{R(1)}. (13)

Step 3: Termination

P (R|λ) =N∑i=1

αT (i). (14)

The basic idea of the forward algorithm is given as follows:1) it implements a procedure of initialization similar to that ofthe Viterbi algorithm, then it assigns an initial probability toα1(i) of the ith state, where t = 1; 2) it computes the probabil-ity of each hidden state corresponding to the observable state inR(t), then inputs the result to A, and computes the probabilityof the hidden state at time t by transforming from the (t− 1)-thtimestamp; and 3) lastly, it recursively calculates the sumof probabilities with respect to each hidden state sequenceusing (14).

It is worthwhile to note that the time complexity of theforward algorithm is O(N2L), which can greatly help reducethe overall complexity of calculation.

D. Trajectory Prediction Algorithm

Here, we present the details of the HMTP algorithm asfollows.

Algorithm 3 Trajectory prediction via HMMs–HMTP

Input: A set of trajectory sequences S = {s1, s2, . . . , sn} ina MOD D.

Output: The predicted trajectory point (xn+1, yn+1, tn+1)at the (n+ 1)-th timestamp.

1. Initialize parameters;

Page 7: A Self-Adaptive Parameter Selection Trajectory Prediction ...static.tongtianta.site/paper_pdf/4ded7b5c-8c16-11e9-aa97-00163e08… · A Self-Adaptive Parameter Selection Trajectory

290 IEEE TRANSACTIONS ON INTELLIGENT TRANSPORTATION SYSTEMS, VOL. 16, NO. 1, FEBRUARY 2015

2. Transform(S);3. if S.length ≤ 0 then4. Return FALSE;5. end if6. Viterbi(S, bestPath);7. Forward(S, prLast);8. for i = 0 to m_DimA do9. if i in bestPath then

10. Continue;11. end if12. for j = 0 to m_DimA do13. prNext[i]+ = prLast[j] ∗A[j, i];14. end for15. if (prNext[i] > prNext[i− 1])&&(i− 1) > 0) then16. pMax = i;17. end if18. end for19. Return (xn+1, yn+1, tn+1);

As shown in Algorithm 3, we aim to predict the positionof the (n+ 1)-th time point beyond the previous n numberof points. HMTP contains the following steps: 1) initializethe parameters (line 1); 2) transfer the original data into achain of cells in 2-D space (line 2); 3) check if the lengthof trajectory meets the requirement (lines 3–5); 4) use theViterbi and forward algorithms (lines 6 and 7) to obtain thelast column of the forward variable (denoted as prLast), whichis used to store the transition probability of the current staterelative to other candidates, and then obtain the hidden statesequence bestPath with the highest probability; and 5) traverseall possible hidden states at the next timestamp (lines 8–18). Inthe last step, it first checks whether the hidden state exists in thebestPath; if so, omit it. Hereafter, it calculates the probabilitiesfrom the last hidden state in S to other visited states, and if theprobability value is the maximum, it returns the central pointcorresponding to this hidden state (line 19).

It is worthwhile to notice that the creation of HMM-basedtrajectory prediction model can be greatly affected by the sizeof the region the trajectory locates. As aforementioned, theaccuracy of HMTP is influenced by four essential factors,including λ = {π,A,B}, the size of cells α, the size of clustersβ, and the size of trajectory segments γ. In reality, the changeof segment is trivial and behaves almost like a constant value inHMTP, in which, because of this property, HMTP can be alsocalled a constant-speed trajectory prediction algorithm.

E. Strategy for Discontinuous Hidden State Chain Problem

Ordinarily, each HMTP model employs a Markov chain todescribe the phase of state transition among clusters. This isshown in Fig. 4(a), where solid circle points represent a trainingsequence and triangles represent the previous n number ofpoints in MODs. The jump among clusters depicts the transitionof states in terms of a trajectory chain. When the size of acell is not greater than that of clusters, then the cell containingthe training points corresponds to the trajectory cluster. Con-sequently, we can observe that the hidden states of a given

Fig. 4. Example of trajectory hidden state transition. (a) State transition chainwith an appropriate size of cells. (b) Deviation caused by specifying a large sizeof cells.

trajectory are consecutive by specifying an appropriate α valuein Fig. 4(a).

Intuitively, as the specified cell grows very large, the resultsbegin to deviate from the real-world situation. For example,consider the case shown in Fig. 4(b), where α (the size of cells)is very large compared with β (the size of clusters). In thisscenario, when we determine the hidden state of the trianglepoint p, as a consequence, there exists a large discrepancy be-tween the predicted and real values. Consider another example,given a cell R where p stays in, the cluster with respect to Rwith the highest state transition probability is reported to becluster C; hence, the points in R are distributed to C, and thisdeviates from the actual situation, such that p belongs to anothercluster. This “false positive” is known as the phenomenon of adiscontinuous hidden state chain.

Because HMTP uses the forward algorithm to predict the(n+ 1)-th hidden state beyond the nth state, at this point,the transition probability of the discontinuous hidden state iszero in the state transition matrix, which makes the output ofthe forward algorithm zero as well, and thus, the predictionfails. In this paper, we apply two strategies to handle thisproblem: 1) progressively increase the value of α in order tofind an appropriate value that guarantees an accurate transitionprobability for the discontinuous hidden states; and 2) adjustthe value of β by experimenting until it no longer appears inthe phenomena of discontinuous hidden states. However, thiswill cause the problem of state retention, which is addressednext.

F. Strategy for State Retention Problem

The state retention problem can be described as follows:Given a number of trajectory points, there are several consecu-tive points that are included in one cluster. We can obtain thatthe probability pii = 0, 1 ≤ i ≤ N relatively easily; however,this is a failed prediction. In order to solve this problem, we canmanually specify the probability of pii, which is an empiricalvalue, and guarantees that

0 < pii < max{pij}, 1 ≤ i ≤ N, 1 ≤ j ≤ N (15)

where N is the number of hidden states.

G. Self-Adaptive Parameter Selection Algorithm

In real-world applications, the given trajectories might notmeet the requirements of the trajectory prediction model.

Page 8: A Self-Adaptive Parameter Selection Trajectory Prediction ...static.tongtianta.site/paper_pdf/4ded7b5c-8c16-11e9-aa97-00163e08… · A Self-Adaptive Parameter Selection Trajectory

QIAO et al.: SELF-ADAPTIVE PARAMETER SELECTION TRAJECTORY PREDICTION APPROACH VIA HMMS 291

Generally, the speed of moving objects is randomly and dy-namically changing with uncertainty [8]. The interval betweenany two points is different, which can also cause the problemof a discontinuous hidden state chain. Aiming to cope with thisproblem, we first calculate the minimum length expressed byminLen between points and then zoom in or out of the regionencircling the training data (this phase is similar to adjusting thesize of cells) until minLen is less than the minimum distancebetween points in clusters. With the above operations, minLencan meet the requirement of predicting consecutive state chains.However, zooming in a 2-D space can amplify the distance be-tween points. Therefore, we have to fill in incomplete trajectorypoints.

HMTP∗ goes beyond HMTP by combining parameter selec-tion approaches. It has the capability of self-learning and cantune the parameters according to the different kinds of trajec-tories taken from objects with constant or variable speeds. Inparticular, it can be used to handle the limitations of predictionaccuracy due to the frequently changing trajectory segmentsunder variable speed. Moreover, HMTP∗ applies the proposedstrategies for solving problems of discontinuous hidden statechain, state retention, and incomplete trajectory before predic-tion. Here, we will present the essential technique for HMTP∗parameter selection.

Algorithm 4 A self-adaptive parameter selection algorithm

Input: A trajectory sequence S = {s1, s2, . . . , sn} in aMOD.

Output: A set of trajectory points in cells.1. minLen = GetMinDistance(S);2. α = minLen;3. β = minLen;4. dist = 0.0;5. for i = 0; i < S.count− 1; i++ do6. dist = Distance(si, si+1);7. if dist > β ∗ 2 then8. insertPoint();9. end if

10. end for11. for each p ∈ S do12. cell.add(TransformIntoCell(p));13. end for14. RETURN cell;

In Algorithm 4, it first calculates the minimum intervalbetween trajectory points (line 1). Second, it specifies α andβ to be minLen (lines 2 and 3). Third, it determines whethertrajectory segment is appropriate; if it exceeds the constraintcondition (line 7), insert points to complete this trajectory (lines4–10). Finally, it projects trajectory points into cells of the givendigital map and returns a set of trajectory points (lines 11–14).It is important to note that the resulting trajectory sequence inthe cells is used as the input for HMTP, which is used to achieveprediction in HMTP∗.

VI. EXPERIMENTS

A. Experimental Setup

The trajectory data set is obtained from the GeoLife projectin Microsoft Research Asia [28], which includes 17 621 trajec-tories composed of 23 667 828 points. This data set containsmore than 1 292 951 miles of GPS data that has been collectedover more than five years. This data is collected by a variety ofGPS-enabled devices, which leads to the problem of multipleand incongruent sampling frequencies, and consequently, it canassume that the time periods of sampling data are different. Inorder to account for this, we have to adjust the size of the cellswith regard to observable states.

To evaluate the performance of HMTP, we apply three mea-sures, i.e., hit rate, accuracy, and deviation, which are definedbelow.

Definition 6 (Hit rate): Given a trajectory sequence S ={s1, s2, . . . , sk}, the predicted trajectory sequence Tp ={p1, p2, . . . , pk} beyond S, where k < n. dist(p, q) representsthe Euclidean distance between points p and q, and θ is adistance threshold.

Then, the formula dist(si, pi) < θ implies one time of hit intrajectory prediction; the hit rate is defined as follows:

H(si, pi) =

{1 if dist(si, pi) < θ0 if dist(si, pi) > θ.

(16)

Definition 7 (Prediction accuracy): Given a trajectory se-quence S and a predicted trajectory sequence Tp, the predictionaccuracy is defined to be

Accuracy =

∑ni=1 H(si, pi)

|Tp|, si ∈ S (17)

where |Tp| represents the length of points in Tp.Definition 8 (Deviation): Given a sequence S and a pre-

dicted trajectory sequence Tp, the deviation is defined as

Deviation =

∑ni=1 dist(si, pi)

|Tp|, si ∈ S. (18)

B. Effect Analysis of the Size of Clusters

As aforementioned, the prediction accuracy is greatly af-fected by the size of cells (denoted as α) and the size ofclusters (denoted as β) after trajectory partition. In this set ofexperiments, we will give a detailed analysis of parameter βon prediction accuracy based on the given HMM model usingparameter λ = {π,A,B}.

For this set of experiments, we employ the HMTP algorithmto evaluate the effect of β. We randomly choose 100 trajectorieswith 5583 points and specified α to 20. The results are given inFig. 5, where the x-axis represents the size of clusters and they-axis shows the prediction accuracy.

As shown in Fig. 5, the accuracy increases and peaks whenβ goes from 10 to 14. After that, it will progressively dropdown. We can reasonably conclude that there is a β value,which guarantees that HMTP will reach to an optimal accuracyvalue under a given α value. When β is greater than 20, the

Page 9: A Self-Adaptive Parameter Selection Trajectory Prediction ...static.tongtianta.site/paper_pdf/4ded7b5c-8c16-11e9-aa97-00163e08… · A Self-Adaptive Parameter Selection Trajectory

292 IEEE TRANSACTIONS ON INTELLIGENT TRANSPORTATION SYSTEMS, VOL. 16, NO. 1, FEBRUARY 2015

Fig. 5. Prediction accuracy under different sizes of clusters.

accuracy decreases drastically. This is because the size of theclusters is too large when compared with the size of the tra-jectory segments, which causes the problem of a discontinuoushidden state chain, which was addressed in Section V-E, andconsequently negatively affects the accuracy of the prediction.

C. Effect Analysis of the Size of Cells and Clusters

In this section, we will analyze the effects of α and β onprediction accuracy.

As shown in Fig. 6, when β and α are specified to 30 and 15,respectively, HMTP tends to perform accurately, which impliesthat we can improve the prediction accuracy by specifying moreappropriate β and α values. In real-world scenarios, these twoparameters dynamically change in response to the differenttrajectory data, which is a typical process used in simulatingthe real mobile behavior of moving objects. In addition, itis interesting to observe that, when these two parameters arespecified to {α = 10, β = 25} and {α = 15, β = 25}, the pre-diction accuracy improves to the point to which it can satisfy therequirements necessitated by real-world applications. This con-clusion agrees with the assumption that α should not be largerthan β in Section V-E. However, when {α = 30, β = 15}, thisconclusion does not hold. The reason is that the experimentalenvironment deviates from the assumption. In other words, theprecondition of the discontinuous hidden state chains is givenby the case in which gaps between points are very large and thatcauses the cells (where two distinct points reside) to containanother state. This requires that the distance between points isless than α in all of our experiments. Thus, no matter what thevalue of the size of cells, there is no third state between any twopoints.

D. Effect Analysis of the Size of Trajectory Segments

As previously stated, the size of a trajectory segment γ, alsocalled the interval between points, will affect the performanceof HMTP with constant speed. Additionally, the speed of mov-ing objects dynamically changes, which caused the value of γto be distinct and have different sampling times in real-worldscenarios. In order to evaluate the influence of γ on accuracy,

Fig. 6. Prediction accuracy under different α and β values.

Fig. 7. Prediction accuracy under different β and γ values.

we randomly generated four kinds of trajectory data set withgradually growing speeds, where {ξ1 < ξ2 < ξ3 < ξ4}. Theresults are given in Fig. 7.

According to Fig. 7, we can see that the prediction accuracyreaches peak values on these four trajectory data sets when thesize of clusters are specified to 12, 15, 17, and 19, respectively,which is proportionate to γ. We can conclude that γ can directlyaffect the prediction accuracy under different β values. Inother words, for the original trajectory data, HMTP needs todetermine the mean value of γ and then dynamically adjustparameters α and γ in TraSeg algorithm. This is used to ap-proximate the β value relative to γ after the trajectory partitionoperation. Note that, as β goes above 25, the accuracy beginsto degrade drastically; this is caused by suboptimal parametersselection, which is shown in Fig. 7. Categorically, β should notbe specified as a very large value, this will invariably causethe empirical results to drastically deviate from the theoreticalbasis.

E. Performance Evaluation Between Naive and HMTP

In order to verify the benefits of HMTP, we implementeda naive algorithm called Naive that does not use the HMM

Page 10: A Self-Adaptive Parameter Selection Trajectory Prediction ...static.tongtianta.site/paper_pdf/4ded7b5c-8c16-11e9-aa97-00163e08… · A Self-Adaptive Parameter Selection Trajectory

QIAO et al.: SELF-ADAPTIVE PARAMETER SELECTION TRAJECTORY PREDICTION APPROACH VIA HMMS 293

Fig. 8. Predicted results of HMTP and Naive under distinct α values. (a) α =20 pixels. (b) α = 30 pixels. (c) α = 40 pixels. (d) α = 50 pixels.

Fig. 9. Prediction accuracy comparison between HMTP and Naive.

model. The naive algorithm functions as follows: It partitionsthe digital map into cells; then it computes the occurrenceprobability of the objects; lastly, it employs the transitionprobability of the cells to obtain the most probable trajectory.Fig. 8(a)–(d) illustrates an example of the predicted trajectoriesbetween these two algorithms as α is set to 20, 30, 40, and 50,respectively, where the circles represent the predicted results ofHMTP, and the rectangles denote the results of the naive algo-rithm. In Fig. 8, the predicted trajectory by Naive is connectedby cells, whereas HMTP can accurately depict a continuoustrajectory.

In order to analyze the quantitative performance of the abovetwo algorithms, we report the Accuracy defined in (17) and theDeviation given (18) between the HMTP and the Naive models.In this series of experiments, we use the GPS data to train themodel and randomly select ten trajectories to predict, and thenwe compute the average value to verify the performance ofNaive and HMTP. With regard to the naive algorithm, we usethe position of the central points in the rectangle to representthe predicted position. The results are given in Figs. 9 and 10.

Fig. 10. Deviation comparison between HMTP and Naive.

Based on the experimental results, we find that the accuracyof HMTP is higher than Naive with an average gap of 32.9%,this is due to the following reasons.

1) The way in which predicted points are represented differssuch that Naive uses the central point of the rectangle todenote predicted points, whereas HMTP uses the centerof the clusters to denote trajectories. The latter represen-tation, for HMTP, is necessary in order to make the resultsconform more closely to real-world situations.

2) The Naive algorithm, more simply, computes the tran-sition probability of points between cells and omits themoving direction of trajectories. Consequently, it mayreturn the opposite direction. Comparatively, HMTP isintelligent enough to recognize the direction of objectsby employing the decoding problem and abandoning thehidden states of the previously visited points in order toavoid moving to the wrong direction.

Moreover, we can see that HMTP is more stable than Naivein Fig. 9, and it is also apparent that the accuracy of Naivedecreases with cells; this is because α is the only parameterto be considered. When α is large, the predicted points areonly approximate values, which causes the accuracy to degrade.Notwithstanding, HMTP is mutually affected by α and γ, andα works optimally when HMTP projects trajectory points intocells. Therefore, we can conclude that the accuracy is primarilydetermined by γ and only moderately affected by α.

We further compute the deviation between these two algo-rithms, with results shown in Fig. 10 According to the exper-imental results, we find that the deviation of Naive is greaterthan HMTP by 27.7 pixels on average, which is a significantgap for accurate positioning. This is because HMTP uses thecentral points of clusters to denote predicted points instead of aless accurate rectangle.

F. Time Performance Analysis

In a real-time location-awareness system, time consumptionin modeling training and prediction plays a critical role. Weevaluate the time performance, including the model training andprediction time between HMTP, HMTP∗with respect to self-adaptive parameter selection, and PutMode [8], which is basedon continuous-time Bayesian networks (CTBNs) and is proved

Page 11: A Self-Adaptive Parameter Selection Trajectory Prediction ...static.tongtianta.site/paper_pdf/4ded7b5c-8c16-11e9-aa97-00163e08… · A Self-Adaptive Parameter Selection Trajectory

294 IEEE TRANSACTIONS ON INTELLIGENT TRANSPORTATION SYSTEMS, VOL. 16, NO. 1, FEBRUARY 2015

Fig. 11. Execution time comparison among algorithms.

to be an effective and efficient trajectory prediction model. Thetraining data set contains 800 trajectories with about 100 000points, and the results are given in Fig. 11.

The results show the following.

1) HMTP performs best, followed by HMTP∗ and Put-Mode, which shows significant degradation in perfor-mance when compared to the other two methods. Thereason for this is because it is time intensive to trainCTBNs in PutMode. All three algorithms linearly growwith regard to the number of trajectories. For HMTP,the best performing method, the sum of training andprediction time, which meets the real-time requirement,is about 0.2 s.

2) The execution time of HMTP∗ is greater than that ofHMTP in an acceptable level and grows with the numberof trajectories. The increased time cost is caused by thephase of trajectory preprocessing since it needs to dynam-ically adjust the parameters and to frequently divide theworking space into cells and partition trajectories, whichis time consuming. In contrast, HMTP trains the modelin one operation; hence, the cost in time is relatively low.In the experiments, we deliberately choose the adversarialcases for the data, with varying speeds, in order to demon-strate the characteristic of these two algorithms. However,the speeds ordinarily do not fluctuate very frequently inreal-world scenarios, which implies that the parametersremain relatively constant; thus, costs stay relatively lowin HMTP∗.

G. Empirical Study in Different Speed Cases

The speed of moving objects can be categorized into twocases, namely, randomly changing and slightly changing. Here,we compare the prediction accuracy and deviation betweenHMTP, HMTP∗, and PutMode.

1) Performance Analysis in Randomly Changing Speeds: Inreal-world scenarios, moving objects have dynamically chang-ing speeds and do not show constant speeds, which cause theinterval between trajectory points to be different. HMTP doesnot work well in this case; hence, we propose the HMTP∗algorithm, which can automatically tune parameters. Here,

Fig. 12. Accuracy comparison of algorithms in randomly changing speed.

we compare the prediction accuracy of these three algorithmswith randomly changing speeds under different γ values. It isworthwhile to note that PutMode does not partition trajectoriesinto segments; thus, it does take into account the effect of γ. Inthe experiments, we chose five distinct data sets, each of whichuses 260 000 points to train the model. As shown in Fig. 12, wecan see the following.

• HMTP∗ algorithm outperforms HMTP and PutMode indistinct data sets. The average accuracy values of HMTP∗,HMTP, and PutMode are 80.6%, 52.5%, and 59.7%, re-spectively. This is because HMTP∗ can discover charac-teristics of hidden states by HMM, which allows it toself-adjust parameters as objects dynamically change theirspeeds. In addition, HMTP∗ can accurately determinethe speed of information by analyzing the input dataand adjusting α and β values. PutMode does not applythe process of trajectory segmentation, which works toprocess trajectory data in order to improve the efficiencyand retrieve the hidden states. We can also observe inFig. 12 that HMTP and PutMode have comparable rangesfor accuracy of prediction.

• For different data sets, the accuracy of HMTP is not asstable when fluctuations are present, whereas the accuracyof HMTP∗ keeps at a high and stable level nevertheless.This is because HMTP∗ can self-tune α and β values inorder to adapt to different kinds of trajectory data withchanging speeds.

In addition, we observe the change of deviation on theabove five data sets; the results are given in Fig. 13 Whenthe predicted trajectories are generated by moving objects withdynamically changing speed, i.e., γ is different, HMTP∗ cantune the γ value. This plays an important role in the deviationof prediction. In Fig. 13, we demonstrate using real data setsthat the deviation using self-adaptive parameter selection byHMTP∗ is less than that of HMTP for most cases, i.e., datasets D1, D2, and D5. In addition, the deviation of the PutModealgorithm in each data set is much bigger than that of HMTPand HMTP∗. This is because we have to carefully tune theradius of the disk in a trajectory volume in PutMode. If theradius is not suitable, the deviation between the predicted andthe real-world locations is very big.

Page 12: A Self-Adaptive Parameter Selection Trajectory Prediction ...static.tongtianta.site/paper_pdf/4ded7b5c-8c16-11e9-aa97-00163e08… · A Self-Adaptive Parameter Selection Trajectory

QIAO et al.: SELF-ADAPTIVE PARAMETER SELECTION TRAJECTORY PREDICTION APPROACH VIA HMMS 295

Fig. 13. Deviation comparison of algorithms in randomly changing speed.

Fig. 14. Prediction accuracy comparison among algorithms in constant speed.

Fig. 15. Deviation comparison among algorithms in constant speed.

2) Performance Analysis in Constant Speeds: We comparethe prediction accuracy and deviation between HMTP, HMTP∗,and PutMode with constant speed. Here, constant speed impliesthat objects change their speed in a slight or near-constantfashion. The results are given in Figs. 14 and 15.

We can find that HMTP and HMTP∗ have comparable accu-racy on distinct trajectory data sets. This is because γ slightly

varies in the case of constant speed, and thus, there is no need toadjust the γ and α values; hence, HMTP can obtain highly accu-rate predictions that are comparable with HMTP∗. However, thedeviation of HMTP∗ is greatly reduced when compared withHMTP, which implies that the precision of HMTP∗ is higherthan that of HMTP. The reason for this big deviation betweenthese two algorithms is that HMTP∗ can dynamically tune theγ value, which makes the partition of trajectory segment veryfine and the deviation between the predicted and real points verysmall. In addition, we find the accuracy of the HMTP modelsto be higher than that of PutMode; this is because the PutModealgorithm is more suitable for predicting moving objects withdynamically changing speeds. In the case of a constant speed,the transition of states is infrequent, which then just degeneratesinto a naive prediction method. Furthermore, the deviationbetween trajectory points is large for PutMode, with the reasonbeing similar to the explanation given in Section VI-G1.

VII. CONCLUSION

In order to accurately and efficiently predict the mobilityof individuals, we have applied the HMMs that are especiallysuited to discover transition rules from one cell to another andprecisely depicted the state transition between trajectory points.Aiming to predict a continuous chain of trajectory points, wefirst proposed a density-based trajectory clustering algorithmto avoid time-intensive distance computation between trajec-tory points. Second, we partitioned trajectory into segmentsto extract trajectory hidden states. Third, we proposed anHMM-based trajectory prediction algorithm called HMTP. Inthe general case for dynamically changing speed, we improveHMTP to automatically adjust important parameters. In partic-ular, we present new strategies for solving the discontinuoushidden state chain and the state retention problems. Finally, weconducted experiments to vary the advantages of the proposedprediction algorithms.

In terms of our future work, we plan to apply urban comput-ing techniques to our system to improve the time performanceof the HMTP algorithms. In addition, we can extrapolate themodel to high-order Markov properties of trajectory data, suchas studying the effects of two or more previously hiddenstates on the current position. Given that the moving speed isan important factor affecting the moving behavior of objects,for example, a pedestrian will choose the route based on theshortest distance without considering traffic congestion, wewill classify them before predicting or add them as anotherstate. Furthermore, we will propose new uncertain managementmethods to model the dynamic factors, e.g., weather conditionsand traffic lights, and apply them to the HMTP model toimprove the prediction accuracy.

ACKNOWLEDGMENT

The authors would like to sincerely thank L. A. Gutierrezwho is a Ph.D. candidate in computer science at RensselaerPolytechnic Institute, Troy, NY, USA, for his suggestions andfor proofreading this article.

Page 13: A Self-Adaptive Parameter Selection Trajectory Prediction ...static.tongtianta.site/paper_pdf/4ded7b5c-8c16-11e9-aa97-00163e08… · A Self-Adaptive Parameter Selection Trajectory

296 IEEE TRANSACTIONS ON INTELLIGENT TRANSPORTATION SYSTEMS, VOL. 16, NO. 1, FEBRUARY 2015

REFERENCES

[1] J. G. Lee, J. Han, X. Li, and H. Gonzalez, “TraClass: Trajectory classi-fication using hierarchical region-based and trajectory-based clustering,”Proc. VLDB Endowment, vol. 1, no. 1, pp. 1081–1094, Aug. 2008.

[2] J. Zhang et al., “Data-driven intelligent transportation systems: A survey,”IEEE Trans. Intell. Transp. Syst., vol. 12, no. 4, pp. 1624–1639, Dec. 2011.

[3] A. Monreale, F. Pinelli, R. Trasarti, and F. Giannotti, “WhereNext: A loca-tion predictor on trajectory pattern mining,” in Proc. 15th ACM SIGKDDInt. Conf. Mining, 2009, pp. 637–646.

[4] F. Y. Wang, “Parallel control and management for intelligent transporta-tion systems: Concepts, architectures, and applications,” IEEE Trans.Intell. Transp. Syst., vol. 11, no. 3, pp. 630–638, Sep. 2010.

[5] J. Lu and G. Sun, “Location-based intelligent services of scenic ar-eas,” in Proc. 2nd Int. Conf. Consum. Electron., Commun. Netw., 2012,pp. 1882–1885.

[6] C. Song, Z. Qu, N. Blumm, and A.-L. Barabsi, “Limits of predictability inhuman mobility,” Science, vol. 327, no. 5968, pp. 1018–1021, Feb. 2010.

[7] F. Y. Wang and S. Tang, “Artificial societies for integrated and sus-tainable development of metropolitan systems,” in IEEE Intell. Syst.,Jul./Aug. 2004, vol. 19, no. 4, pp. 82–87.

[8] S. Qiao et al., “PutMode: Prediction of uncertain trajectories in movingobjects databases,” Appl. Intell., vol. 33, no. 3, pp. 370–386, Dec. 2010.

[9] N. Mamoulis et al., “Mining, indexing, and querying historical spatio-temporal data,” in Proc. 10th ACM SIGKDD Int. Conf. Mining, 2004,pp. 236–245.

[10] M. Morzy, “Mining frequent trajectories of moving objects for locationprediction,” in Proc. 5th Int. Conf. Mach. Learn. Data Mining PatternRecognit., vol. 4571, ser. Lecture Notes in Computer Science, 2007,pp. 667–680, Springer-Verlag.

[11] H. Jeung, Q. Liu, H. Shen, and X. Zhou, “A hybrid prediction modelfor moving objects,” in Proc. IEEE 24th Int. Conf. Data Eng., Cancun,Mexico, 2008, pp. 70–79.

[12] J. C. Ying, W. C. Lee, T. C. Weng, and S. Tseng, “Semantic trajectorymining for location prediction,” in Proc. 19th ACM SIGSPATIAL Int.Conf. Adv. Geograph. Inf. Syst., 2011, pp. 34–43.

[13] Y. Zheng, L. Zhang, X. Xie, and W. Ma, “Mining interesting locations andtravel sequences from GPS trajectories,” in Proc. 18th Int. Conf. WorldWide Web, 2009, pp. 791–800.

[14] Y. Ishikawa, Y. Tsukamoto, and H. Kitagawa, “Extracting mobility statis-tics from indexed spatio-temporal datasets,” in Proc. 2nd WorkshopSpatio-Temporal Database Manage., 2004, pp. 9–16.

[15] H. Jeung, H. Shen, and X. Zhou, “Mining trajectory patterns using hid-den Markov models,” in Proc. 9th Int. Conf. Data Warehousing Knowl.Discov., vol. 4654, ser. Lecture Notes in Computer Science, 2007, pp. 470–480, Springer-Verlag.

[16] Q. Peng, Z. Ding, and L. Guo, “Prediction of trajectory based on Markovchains,” Compu. Sci., vol. 37, no. 8, pp. 189–193, 2010.

[17] T. Feng, Y. Guo, K. Huang, and J. Ji, “A behavior trajectory restoration al-gorithm based on hidden Markov models,” Comput. Eng., vol. 38, no. 12,pp. 1–5, 2012.

[18] A. Asahara, A. Sato, K. Maruyama, and K. Seto, “Pedestrian-movementprediction based on mixed Markov-chain model,” in Proc. 19th ACMSIGSPATIAL Int. Conf. Adv. Geograph. Inf. Syst., 2011, pp. 25–33.

[19] S. Gambs, M. Killijian, D. P. Cortez, and N. Miguel, “Next place pre-diction using mobility Markov chains,” in Proc. 1st Workshop Meas.,Privacy, Mobility, 2012, pp. 1–6.

[20] T. Hunter, P. Abbeel, and A. Bayen, “The path inference filter: Model-based low-latency map matching of probe vehicle data,” IEEE Trans.Intell. Transp. Syst., vol. 15, no. 2, pp. 507–529, Apr. 2014.

[21] T. L. Pan, A. Sumalee, R. X. Zhong, and N. Indra-payoong, “Short-term traffic state prediction based on temporal–spatial correlation,” IEEETrans. Intell. Transp. Syst., vol. 14, no. 3, pp. 1–23, Sep. 2013.

[22] A. Sadilek and J. Krumm, “Far out: Predicting long-term human mobil-ity,” in Proc. 26th AAAI Conf. Artif. Intell., 2012, pp. 814–820.

[23] J. Zhou, K. H. Tung, W. Wu, and W. S. Ng, “A semi-lazy approach toprobabilistic path prediction in dynamic environments,” in Proc. 19thACM SIGKDD Conf. Mining, 2013, pp. 748–756.

[24] L. E. Baum and T. Petrie, “Statistical inference for probabilistic functionsof finite state Markov chains,” Ann. Math. Stat., vol. 37, no. 6, pp. 1554–1563, Dec. 1966.

[25] J. Sander, M. Ester, H. P. Kriegel, and X. Xu, “Density-based clusteringin spatial databases: The algorithm DBSCAN and its applications,” DataMining Knowl. Discov., vol. 2, no. 2, pp. 169–194, Jun. 1998.

[26] J. Feldman, I. Abou-faycal, and M. Frigo, “A fast maximum-likelihooddecoder for convolutional codes,” in Proc. IEEE 56th Veh. Technol. Conf.,2002, vol. 1, pp. 371–375.

[27] S. Russell and P. Norvig, Artificial Intelligence: A Modern Approach,3rd ed. Upper Saddle River, NJ, USA: Prentice-Hall, 2010.

[28] Y. Zheng, X. Xie, and W. Ma, “GeoLife: A collaborative social network-ing service among user, location and trajectory,” IEEE Data Eng. Bull.,vol. 33, no. 2, pp. 32–39, Jun. 2010.

Shaojie Qiao received the B.S. and Ph.D. degreesfrom Sichuan University, Chengdu, China, in 2004and 2009, respectively.

From 2009 to 2012, he was a Postdoctoral Re-searcher with the Postdoctoral Research Station ofEngineering of Traffic Transportation, SouthwestJiaotong University, Chengdu. He is currently anAssociate Professor with the School of InformationScience and Technology, Southwest Jiaotong Uni-versity. He has led several research projects in theareas of moving objects databases and intelligent

traffic control. He is the author of more than 30 high-quality papers and thecoauthor of more than 80 papers. His research interests include trajectory datamining and intelligent transportation systems.

Dr. Qiao is a Senior Member of China Computer Federation and a memberof the Association for Computing Machinery.

Dayong Shen received the M.S. degree in 2013from the National University of Defense Technology,Changsha, China, where he is currently working to-ward the Ph.D. degree in the College of InformationSystem and Management.

His research interests include web data mining,social network analysis, and machine learning.

Xiaoteng Wang received the B.S. degree fromSouthwest Jiaotong University, Chengdu, China,where he is currently working toward the Master’sdegree in the School of Information Science andTechnology.

His research interests include trajectory predictionand intelligent traffic control.

Nan Han received the M.S. and Ph.D. degreesfrom Chengdu University of Traditional ChineseMedicine, Chengdu, China.

She is currently an Engineer with the School ofLife Sciences and Engineering, Southwest JiaotongUniversity, Chengdu. She is the author of more thanten high-quality papers, and she participated in sev-eral projects supported by the National Natural Sci-ence Foundation of China. She is the correspondingauthor of this paper. Her research interests includebioinformatics and data mining.

William Zhu received the M.S. degree in sys-tem engineering from The University of Arizona,Tucson, AZ, USA, and the Ph.D. degree in computerscience from The University of Auckland, Auckland,New Zealand.

He is currently a Minjiang Chair Professor andthe Director of Fujian Provincial Key Laboratoryof Granular Computing, Minnan Normal Univer-sity, Zhangzhou, China. He has led several researchprojects and is the author of more than 100 refereedhigh-quality papers with an H-index of 15 in Scopus.