# A Method for Driving Route Predictions Based on Hidden Markov Model

Authors: Ning Ye; Zhong-qin Wang; Reza Malekian; Qiaomin Lin; Ru-chuan Wang
Journal: Mathematical Problems in Engineering
 (2015)

---

## Abstract

We present a driving route prediction method that is based on Hidden Markov Model (HMM). This method can accurately predict a vehicle’s entire route as early in a trip’s lifetime as possible without inputting origins and destinations beforehand. Firstly, we propose the route recommendation system architecture, where route predictions play important role in the system. Secondly, we define a road network model, normalize each of driving routes in the rectangular coordinate system, and build the HMM to make preparation for route predictions using a method of training set extension based onK-means++ and the add-one (Laplace) smoothing technique. Thirdly, we present the route prediction algorithm. Finally, the experimental results of the effectiveness of the route predictions that is based on HMM are shown.


---

## Body

## 1. Introduction

Currently, many drivers use different kinds of navigation software to acquire better driving routes. The main function of vehicle route recommendation in the software is to find several routes between given origins and destinations by combing some path algorithms with historical traffic data, for example, Google Map and Baidu Map. And then a driver could select one of those recommendation routes according to personal preference, driving distance, and current road congestion information. People usually would like to choose routes with more smooth roads. However, the above methods for driving route recommendation have some problems. Firstly, more people would like to choose routes with many smooth road segments. Thus, the original relatively smooth roads will become congested and the original congested roads will become smooth. Secondly, once a route is selected, the software could not timely inform the driver to adjust the route according to real-time traffic congestion data as the trip progresses. Finally, most of traffic route navigation software programs rely on historical data to predict traffic congestion [1]. While some emergency situations arise, for example, when organizing a large rally in an area, a large number of vehicles will move to this region in a short time, leading to traffic congestion in the area. Obviously, this case may not have happened in previous historical data.In view of the above problems, a driving route recommendation system is proposed and highlights a method for driving route predictions based on the knowledge of Hidden Markov Model (HMM). The method can predict which road segments are congested or smooth through route predictions. The system will also update traffic information in real time in the near future and inform the driver to adjust the driving route as the trip progresses.At present, several methods of route prediction have been suggested, but there remain some problems. Karbassi and Barth [2] described a method to predict smart vehicles’ routes between given starting and ending drop-off stations based on a car-sharing application. In our work, the destination never needs to be inputted into the system beforehand. Our approach also differentiates from the short-term route prediction in Krumm’s work [3]. Our method makes long-term predictions about the entire route. Froehlich and Krumm [4] found that a large portion of a typical driver’s trips are repeated from the collected GPS data. So based on this fact, they predicted a driver’s entire route by using drivers’ trip history. Simmons et al. [5] firstly assumed that drivers have certain routine routes and that, by learning a model based on previous experience, one can accurately predict what a driver will do in the future. So based on this underlying premise, they presented an approach to predict driver intent using Hidden Markov Models. However, in fact, it is impractical to build a Hidden Markov Model for every driver, and many routes are not fully regular. When a driver takes a new route, the model for this driver could not predict the driver’s route and destination intent.This paper is organized as follows. The next section describes the architecture of our route recommendation system and explains each module in the system. Section3 introduces how to construct a road network model and Section 4 presents how to define each of the driving routes based on Section 3. The process of building HMM and the method of making route predictions are discussed in Section 5. Then Section 6 shows experimental results. Finally, Section 7 will conclude the paper.


## 2. The Architecture of Driving Route Recommendation System Based on HMM

The architecture of the driving route recommendation consists of the following phases (see Figure1).Figure 1
The architecture of route recommendation system.(i) Driving Route Predictions Based on HMM. It is the core of our recommendation system and is chiefly introduced in this paper. The module could find which routes a driver will be on when making a route prediction. Even though we could not accurately gain the completely correct routes in practice, these possible routes are still very important for preestimating traffic congestion in the future.(ii) Traffic Congestion Preestimation. It is mainly used to predict the congestion of each road. At the time T
k, the congestion level R
S
T
k
,
R
i of each road R
i is denoted by the total number of possible driving routes with the road R
i in a time period. The higher the value R
S
T
k
,
R
i is, the more congested the road R
i is.(iii) Vehicle Route Recommendation. It collects information about just-driven road segments and traffic congestion situations to introduce better routes for drivers based on existing path algorithms [6–10] (all of these route planning algorithms take traffic congestion situations into account in the process of a vehicle route guidance) without presetting the destination beforehand.(iv) HMM Correction. It is used to correct the HMM depending on new input driving routes. The given corpus of training samples may not fully include all of possible driving routes. With the increase of inputting driving routes, the amount of training data for training HMM will also grow, which could improve the prediction accuracy.


## 3. The Definition of Road Network Model

This section will give details on how to build a road network model in the rectangular coordinate system. The connection relationship between roads is followed strictly in the model. And it should reflect the difference between roads as large as possible.Assume that each roadR
i is described as a line segment R
i
x perpendicular to x-axis: that is, the coordinate of two endpoints of a line segment R
i
x is separately defined by X
i
1
,
Y
i
1 and X
i
1
,
Y
i
2, where Y
i
1
≠
Y
i
2, or a line segment R
i
y perpendicular to y-axis: that is, the coordinate of two endpoints of a line segment R
i
y is separately defined by X
i
1
,
Y
i
1 and X
i
2
,
Y
i
1, where X
i
1
≠
X
i
2.In the rectangular coordinate system, the rule for a road network model construction composed of different road segments is represented as follows:(i)
If and only ifn (n
≤
5) roads R
m
1
,
…
,
R
m
5 intersect at an approximate point, suppose that the road R
m
1 is defined by the line segment R
m
1
x perpendicular to x-axis, so roads R
m
2 and R
m
5 adjacent to the road R
m
1 are represented as line segments R
m
2
y and R
m
5
y intersected with the line segment R
m
1
x and perpendicular to y-axis, and roads R
m
3 and R
m
4 not adjacent to road R
m
1 are separately defined by the line segments R
m
3
x and R
m
4
x intersected with the line segment R
m
i
y (R
m
2
y or R
m
5
y) and perpendicular to X. For example, there are five line segments intersected at a point in Figure 2.
(ii)
If and only if three different roadsR
i, R
j, and R
k intersect at three points (as shown in Figure 3), suppose that the road R
i is defined by the line segment R
i
x perpendicular to x-axis; then the road R
j is defined by the line segment R
j
y intersected with the line segment R
i
x and perpendicular to y-axis, and the road R
k is divided into two segments: one is the line segment R
k
x intersected with the line segment R
i
x and perpendicular to x-axis and another is the line segment R
k
y intersected with the line segment R
j
y and perpendicular to y-axis.Figure 2
Five roads intersect at a point.Figure 3
Three different roads intersect at three points.The length of each line segment is defined as follows: the length of the line segmentR
i
x (D
i
s
t
R
i
x
=
Y
i
2
-
Y
i
1) is represented as the amount of line segments perpendicular to y-axis between two endpoints of R
i
x (including two endpoints), and the length of the line segment R
i
y (D
i
s
t
R
i
y
=
X
i
2
-
X
i
1) is represented as the amount of line segments perpendicular to x-axis between two endpoints of R
i
y (including two endpoints). But in Figure 3 the length of R
k is different from others. The definitions for the length of R
k
x and R
k
y are both limited in the region made up of roads R
i, R
j, and R
k.Therefore, as shown in Figure4, our method transforms the map into the road network model in a rectangular coordinate system. Our method only deals with main roads in the map to clearly describe the process of building the model.Figure 4
An example of the road network model construction.


## 4. The Definition of Driving Routes inx-Axis and y-Axis

Suppose that the starting point of the vehicle route isA and the endpoint is B; the route composed of n roads R
1
,
R
2
,
…
,
R
n from A to B is expressed as an ordered coordinate points’ sequence composed of n
-
1 coordinate points:(1)
A
⟶
n
B
=
R
1
x
R
1
y
A
⟶
n
B
=
∩
R
2
y
R
2
x
,
…
,
R
n
-
1
y
R
n
-
1
x
∩
R
n
x
R
n
y
,where A is represented as the endpoint of the line segment R
1
x or R
1
y, B is represented as the endpoint of the line segment R
n
x or R
n
y, and R
(
i
-
1
)
x
∩
R
i
y is represented as the intersection point of the line segments R
(
i
-
1
)
x and R
i
y.For example, the line connecting pointA (i.e., Huafuyuan) with point B (i.e., Kang’ai Hospital) is a driving route in Figure 5. The vehicle has passed through 5 roads, including Fujian Road, Zhongfu Road, Heilongjiang Road, Jinmao Street, and Xufu Alley. Suppose that A is the starting point and B is the endpoint; then the route can be represented as follows based on Figure 4: (2)
H
u
a
f
u
y
u
a
n
⟶
5
Kang’ai
H
o
s
p
i
t
a
l
=
1,3
,
1,4
,
3,4
,
3,1
.Figure 5
A path between pointsA and B.


## 5. Driving Route Predictions Based on HMM

### 5.1. A Method of Extending Training Set Based onK-Means++

It is necessary to train the HMM from drivers’ past history. In particular, the larger the size of training examples is, the more accurate the HMM for path predictions is. In view of the limitation of given training examples, the training set cannot contain all of routes that drivers will take in the future. So the paper proposes a method of extending training examples based onK-means++ [11]. It could enlarge the training data as much as possible based on given training examples.After analyzing the given training examples, it is found that starting and endpoints of vehicle routes are distributed in residential, commercial, and work areas. People usually go to work from residential areas in the morning and then go back from work areas or they will first go to commercial areas and then go home. Therefore, it is believed that vehicle routes are generally regular in some extent so that a path can be regarded as two return paths. In addition, it is also found that when traffic reaches its peak, a driver will generally avoid congested roads and select a route with the shortest time to the destination. In other times, drivers will select the shortest distance to the destination to save costs. For a beginning and end of a path, it is able to generate two kinds of routes according to different times.Last, it is not sure how many clusters the coordinate point setp should be classified beforehand, so the K-means++ algorithm to automatically classify coordinate points into k clusters is exploited in the paper. Here it should be pointed out that the distance of vehicle routes in the same cluster is rather short so that people would not have to drive from one point to another. It is not necessary to calculate vehicle routes for the above case. This assumption will be verified in the experiment.The algorithm of extending training examples based onK-means++ is as follows (see Algorithm 1).(i)
Initialize coordinate point setsp and p
′ and an extending route set NewD (Lines 01-02).
(ii)
Traverse a given training setD and read all of vehicle routes’ starting points x
i
1
,
y
i
1 and endpoints x
i
n
,
y
i
n, and then insert these coordinate points into the set p. Filter repeated coordinates in the set p, which could get the set p
′ composed of different starting and endpoints (Lines 03–07).
(iii)
Use theK-means++ algorithm to classify p
′ and then acquire n clusters C
1
,
…
,
C
i
,
…
,
C
n (Line 08).
(iv)
Traverse each clusterC
i and then distinguish whether or not two coordinate points belong to the same cluster C
i. If not, use the function Best
_
route
(
c
[
i
]
[
k
], c
[
j
]
[
l
]
) to calculate routes between two coordinate points (Lines 09–13).Algorithm 1:New_Track (a training set D).
Input: A training setD.
Output: The extending training set NewD.
(1)Coordinate Point Set p, p
′ = ϕ;
(2)Extending route Set NewD = ϕ;
(3)foreach (route t
i in D)
(4) Starting point A
=
x
i
1
,
y
i
1;
(5) End point B
=
(
x
i
n
,
y
i
n
);
(6) Insert A and B into the set p;
(7) p
′ = Filter(p);
(8) Cluster Set C
=
K-means++ (p
′);
/∗  c
=
{
c
[
1
]
,
c
[
2
]
,
…
,
c
[
n
]
}, which is n clusters altogether. ∗/
(9)for (int i
=
0; i
<
n; i++)
(10) for (int j
=
i
+
1; j
<
n; j++)
(11)  for (int k
=
0; k
<
c
[
i
].length; k++)
/∗
c
[
i
].length represents the number of coordinate points in the ith cluster. ∗/
(12)  for (int l
=
0; l
<
c
[
j
].length; l++)
(13)  Insert Best_route(c
[
i
]
[
k
], c
[
j
]
[
l
]) into NewD;
/∗
c
[
i
]
[
k
] represents the kth coordinate point in the ith cluster. ∗/


### 5.2. Parameter Definitions of a HMM for Route Predictions

Since it is necessary to input a driver’s just-driven path represented by coordinate points into a HMM and then output future entire paths, coordinate points’ sequence corresponding to the just-driven path can be regarded as an observation sequence and the corresponding sequence composed of different route sets can be regarded as a hidden state sequenceQ. The next gives details on the process of the HMM construction by following training examples (shown in (3)). Note the number of training examples is much more than following data in practice.Training Examples. Consider(3)
t
1
<
1,3
1,4
3,4
3,1
>
t
2
<
3,1
3,4
1,4
1,3
>
t
3
<
0,3
1,3
1,5
4,5
>
t
4
<
0,3
0,0
0,4
4,1
>
t
5
<
2,0
2,1
3,1
3,2
4,2
>
t
1
<
1,3
1,4
3,4
3,1
>
.In (3), assume that t
1
,
t
2
,
… are routes’ symbols in order to distinguish different vehicle routes. The observation set V includes the starting symbol (<), the end symbol (>), and different coordinate points. Each observation is defined by p
i
j, where i is the number of route t
i in the training set and j is the number of coordinate points in each route t
i. For example, the observation set of the above training example is {<, >, (1,3), (1,4), (3,4), (3,1), (0,3), (1,5), (4,5), (0,0), (0,4), (4,1), (2,0), (2,1), (3,2), (4,2)}. And an observation sequence O is an ordered sequence of symbols and coordinate points from the starting to the end. For example, the observation sequence of the route t
1 is p
11
→  <,  p
12
→
(
1,3
), p
13
→
(
1,4
), p
14
→
(
3,4
), p
15
→
(
3,1
), and p
16
→  >.Besides, the definition of hidden states is relatively more complex than observation states. At first, assume that each hidden state is defined byq
i
j, where i is the number of route t
i in the training set and j is the number of coordinate points in each vehicle route t
i. The hidden state set S includes the symbol • being produced from the observations <, > and different routes’ symbol sets (e.g., {
t
1
,
t
2
,
t
3
,
…
}) corresponding to different coordinate points. For example, hidden states being produced from the above observations of the route t
1 are separately q
11
→
•, q
12
→
t
1
,
t
3, q
13
→
t
1, q
14
→
t
1, q
15
→
t
1
,
t
5, and q
16
→
•. A hidden state sequence set is defined by QS, storing hidden state sequences Q being produced from hidden states and each vehicle route is directed. Suppose that A
→
n
B represents that a vehicle passes through n road segments from the starting point A to the endpoint B, but B
→
n
A represents that a vehicle passes through the same road segments from B to A. Even though each observation state is same in the two opposite routes, ordered coordinate points’ sequences are completely opposite. So a method is explored to calculate hidden states corresponding to each coordinate point next.The algorithm for hidden state determinations is as follows (see Algorithm2).(i)
Initialize a hidden state sequence set QS (Line 1).
(ii)
Obtain a beginning pointA
i
x
i
1
,
y
i
1 and an endpoint B
i
x
i
n
,
y
i
n from the vehicle route t
i and a beginning point A
j
=
x
j
1
,
y
j
1 and an endpoint B
j
=
x
j
n
,
y
j
n from the vehicle route t
j; then calculate A
i
B
i
→
=
x
i
n
-
x
i
1
,
y
i
n
-
y
i
1 denoted by a
→
i and A
j
B
j
→
=
x
j
n
-
x
j
1
,
y
j
n
-
y
j
1 denoted by a
→
j (Lines 2–9).
(iii)
Compute the cosine value of intersection angle between vectorsa
→
i and a
→
j (Line 10):(4)
c
o
s
a
→
i
,
a
→
j
=
a
→
i
·
a
→
j
a
→
i
·
a
→
j
=
x
i
n
-
x
i
1
·
y
i
n
-
y
i
1
x
j
n
-
x
j
1
·
y
j
n
-
y
j
1
p
p
+
x
j
n
-
x
j
1
·
y
j
n
-
y
j
1
·
x
i
n
-
x
i
1
2
+
y
i
n
-
y
i
1
2
x
j
n
-
x
j
1
2
+
y
j
n
-
y
j
1
2
p
p
p
p
·
x
j
n
-
x
j
1
2
+
y
j
n
-
y
j
1
2
-
1
.
(iv)
If0
≤
c
o
s
a
→
i
,
a
→
j
≤
1, traverse each coordinate point in vehicle routes t
i and t
j, and then judge whether or not a coordinate point o
k
1 in t
i is also included in t
j. If it is included, insert a symbol t
j into the corresponding location of the sequence Q
i (Lines 10–14). If -
1
<
c
o
s
a
→
i
,
a
→
j
<
0, driving directions of the two routes are opposite although the routes include the same coordinate point. For example, if a vehicle is driving east in a route t
i, the possibility of passing through south or western roads in a route t
j in our road network model is low. So the kind of hidden states will not be taken into account. And then insert a symbol • and a symbol t
i into Q
i on the basis of the given Q
i (Lines 15–20).
(v)
After calculating all of the hidden state sequence, insert each hidden state sequenceQ into the sequence set QS (Line 21).Algorithm 2:Hidden_State_Sequence (a training set D).
Input: A training setD.
Output: A hidden state sequence set QS.
(1)Hidden state sequence set QS = ϕ;
(2)for (int i
=
1; i
<
m; i++)
/∗  m is the number of routes in D. ∗/
(3) Starting point A
i
=
(
x
i
1
,
y
i
1
);
(4) End point B
i
=
(
x
i
n
,
y
i
n
);
(5) Vector a
→
i
=
(
x
i
n
-
x
i
1
,
y
i
n
-
y
i
1
);
(6) for (int j
=
i
+
1; j
<
m; j++)
(7)  Starting point A
j
=
(
x
j
1
,
y
j
1
);
(8)  End point B
j
=
(
x
j
n
,
y
j
n
);
(9)  Vector a
→
j
=
(
x
j
n
-
x
j
1
,
y
j
n
-
y
j
1
);
(10)  if (0
≤
cos
⁡
a
→
i
,
a
→
j
≤
1)
(11)   foreach (Coordinate point o
k
1 in t
i)
(12)    foreach (Coordinate point o
k
2 in t
j)
(13)     If (o
k
1
=
o
k
2)
(14)      Insert a symbol t
j into Q
i corresponding to the coordinate point;
(15)  else
(16)   foreach (Coordinate point o
j in t
i)
(17)    If (o
j is a symbol “<” or “>”)
(18)     Insert a symbol • into Q
i corresponding to the starting and end point;
(19)    else
(20)     Insert a symbol t
i into Q
i corresponding to each coordinate point;
(21) Insert each hidden state sequence Q into the sequence set QS


### 5.3. Parameter Estimation of a HMM for Route Predictions

After determining observation states and corresponding hidden states in the HMM for route predictions, our method uses the total training dataset TotalD, including the given training set D and the extending training set NewD, to estimate model parameters. To reduce the negative impact on the HMM, a weighted method is used to improve the process of estimating HMM parameters. In addition, the problem of data sparseness, also known as the zero-frequency problem, arises in the process of building the HMM. So our method adopts the add-one (Laplace) [12] smoothing technique to deal with events that do not occur in the total training set. The process of estimating HMM parameters by a weighted method and add-one (Laplace) smoothing is described as follows.(i)
The following equation is used for the initial probability distribution:(5)
π
i
=
C
o
u
n
t
s
D
i
+
λ
C
o
u
n
t
s
N
e
w
D
i
∑
j
=
1
n
C
o
u
n
t
s
D
j
+
λ
C
o
u
n
t
s
N
e
w
D
j
,
wheren is the number of hidden states (i.e., the total number of different vehicle routes), C
o
u
n
t
s
D
i and C
o
u
n
t
s
N
e
w
D
i separately represent the number of times the hidden state s
i appears in the given and extending training sets, and λ represents the weight (0
<
λ
<
1).
(ii)
The following equation is used for the hidden state transition matrix:(6)
P
s
i
∣
s
i
-
1
=
C
o
u
n
t
s
D
i
-
1
,
s
D
i
+
λ
C
o
u
n
t
s
N
e
w
D
i
-
1
,
s
N
e
w
D
i
+
1
C
o
u
n
t
s
D
i
-
1
+
λ
C
o
u
n
t
s
N
e
w
D
i
-
1
+
m
,
whereC
o
u
n
t
s
D
i
-
1
,
s
D
i and C
o
u
n
t
s
N
e
w
D
i
-
1
,
s
N
e
w
D
i separately represent the number of times a hidden state s
i followed s
i
-
1 in the given and extending training sets and m is the number of times the hidden state s
i occurs in the total training set.
(iii)
The following equation is used for the confusion matrix:(7)
P
v
j
∣
s
i
=
C
o
u
n
t
s
D
i
-
1
,
v
D
i
+
λ
C
o
u
n
t
s
N
e
w
D
i
-
1
,
v
N
e
w
D
i
+
1
C
o
u
n
t
s
D
i
+
λ
C
o
u
n
t
s
N
e
w
D
i
+
n
,
whereC
o
u
n
t
s
D
i
-
1
,
v
D
i and C
o
u
n
t
s
N
e
w
D
i
-
1
,
v
N
e
w
D
i separately represent the number of times the hidden state s
i accompanies the observation state v
j in the given and extending training sets and n is the number of times the observation state v
j occurs in the total training set.As described above, our method could build the HMM for vehicle route predictions. But drivers would like to choose different vehicle routes from a starting point to an endpoint during different time of each day. For example, people hope to reach the end during the rush hour (7:00~9:00 A.M. and 17:00~19:00 P.M.) as quickly as possible and try their best to avoid congested roads. But at other times people may choose the shortest route to drive. Therefore, training examples can be classified according to the time of day. A group of training examples is from 7:00~9:00 A.M. and 17:00~19:00 P.M., and another is from other times. Section7 will test the impact on the prediction accuracy with different training examples by building different HMMs at different times.


### 5.4. Driving Route Predictions

The aim of this section is to introduce how to predict upcoming routes based on just-driven road segments. The solution to this problem is corresponding to a HMM decoding which is to discover the hidden state sequence that was most likely to have produced a given observation sequence. Here, the Viterbi algorithm [13] is used to find the best hidden state sequence composed of different symbols for an observation sequence (a given vehicle route). The process of a vehicle route prediction is shown in Figure 6.Figure 6
The process of driving route prediction.Perhaps it will encounter some problems in the process of implementing Viterbi algorithm. The total training set, including the given and extending training examples, is still so limited that it could not fully contain all of possible upcoming vehicle routes. Assuming that the upcoming route does not occur in the total training set, which means(
1
) part of coordinate points are new ones for training examples and (
2
) each coordinate point has occurred in the total training set, a group from these coordinate points does not appear in the training examples. For this case (
1
), the Viterbi algorithm could not be directly used to compute the hidden state sequence. For example, in Figure 5, if a vehicle is on the current road segment represented by (4,4) and the representation of the corresponding just-driven route is t
6  <  0,3
1,3
1,4
(
4,4
), the Viterbi algorithm is not adopted to find hidden state sequence for this observation sequence. And for case (
2
), even though the Viterbi algorithm can be used, each hidden state will not contain this new route’s symbol. For example, if a new route is represented by t
6  <  0,3
1,3
1,4
3,4
(
3,2
) and all of these coordinate points have occurred in Figure 5, the symbol t
6 of the upcoming vehicle route will not appear in each hidden state, which means people could not directly understand where the vehicle will drive to. Applied to these problems, an algorithm for vehicle route predictions is proposed as follows (see Algorithm 3).(i)
Suppose thatO
=
p
i
1
,
p
i
2
,
…
,
p
i
k is an observation sequence composed of k coordinate points after the vehicle has passed through k roads; then initialize three sets D
1, D
2, and R, where R represents a set of upcoming vehicle routes’ symbols, D
1
=
{
p
i
x
1
,
p
i
x
2
,
…
,
p
i
x
m
} (D
1
∈
V; as described above, V is a set of all of observations in the training set), D
2
=
{
p
i
y
1
,
p
i
y
2
,
…
,
p
i
y
n
} (D
2
∉
V), and the elements of O are all in the set D
1
∪
D
2 (Lines 1-2).
(ii)
Traverse the observation sequenceO and determine whether or not each coordinate point belongs to the set V. If a coordinate point belongs to V, then insert the point into the set D
1. If not, insert it into D
2 (Lines 3–8).
(iii)
Define thatm is the number of elements in the set D
1 and n is the number of elements in the set D
2 (Lines 9-10).
(iv)
Ifm
=
0, the Viterbi algorithm is not used to find the upcoming routes and then R
=
ϕ (Lines 11-12).
(v)
Ifn
=
0, the Viterbi algorithm could be used to predict and then use a function Viterbi_Route to acquire the route set related to the upcoming routes most likely. This set will be helpful for people to drive as much as possible (Lines 13-14).
(vi)
If the input observation sequenceO has not appeared in the total training set before and part of coordinate points in O have also not appeared in V (i.e., D
2
≠
ϕ), four cases should be discussed:
(a)
Suppose thatD
2
=
{
p
i
2
,
…
,
p
i
k
}; then possible routes’ set could be calculated by the function Viterbi_Route (p
i
1) (Lines 15–17).
(b)
Suppose thatD
2
=
{
p
i
y
1
,
p
i
y
2
,
…
,
p
i
k
}; then use the function recursion to predict with the observation sequence composed of remaining coordinate points p
i
1
,
p
i
2
,
…
,
p
i
(
k
-
1
) (Lines 18-19).
(c)
Suppose thatD
2
=
{
p
i
1
,
p
i
y
2
,
…
,
p
i
y
n
}; then use the function recursion to predict with the observation sequence composed of remaining coordinate points p
i
2
,
p
i
3
,
…
,
p
i
k (Lines 20-21).
(d)
In addition to the above cases, suppose thatD
2
=
{
p
i
y
1
,
p
i
y
2
,
…
,
p
i
y
n
} and y
1
≠
1, y
n
≠
k, m
≠
1; then use the function recursion to predict with the observation sequence composed of remaining coordinate points p
i
y
1
,
p
i
y
2
,
…
,
p
i
y
n (Lines 22-23). For example, the input observation sequence is (0,3) (1,3) (1,4) (4,4) (4,5), where (
4,4
)
∉
V; then the result of vehicle route prediction is the set of hidden states corresponding to the coordinate point (4,5).Algorithm 3:Possible_Routes (an observation sequence O).
Input: An observation sequenceO.
Output: A setR of upcoming vehicle routes’ symbols.
(1)Ordered Observation Set D
1, D
2
=
ϕ;
(2)Possible Route Set R
=
ϕ;
(3)Foreach (Observation p
i
j in O)
(4) if (
p
i
j
∈
V
)
(5)  /∗  V is a set of all of observations in the training set. ∗/
(6)  Insert p
i
j into D
1;
(7) else
(8)  Insert p
i
j into D
2;
(9)int m = length of D
1;
(10)int n = length of D
2;
(11)if (m
=
0)
(12) R
=
ϕ;
(13)else if (n
=
0)
(14) R = Viterbi_Route (p
i
1
,
p
i
2
,
…
,
p
i
k);
(15)else if (m
=
1 and D
1
(
1
)
=
p
i
1)
(16) /∗  D
1
(
1
) represents the first element in the set D
1. ∗/
(17) R = Viterbi_Route (p
i
1);
(18)else if (D
2
(
1
)
=
p
i
k)
(19) Possible_Routes (p
i
1
,
p
i
2
,
…
,
p
i
(
k
-
1
));
(20)else if (D
2
(
1
)
=
p
i
1)
(21) Possible_Routes (p
i
2
,
…
,
p
i
k);
(22)else
(23) Possible_Routes (p
i
(
j
+
1
)
,
…
,
p
i
k);The function Viterbi_Route is described as follows (see Algorithm4).(i)
Use Viterbi algorithm to calculate the hidden state sequenceQ corresponding to the observation sequence O
′ (Line 1).
(ii)
Define that the number of elements in the hidden state sequenceQ is m (Line 2).
(iii)
Ifm
=
1, a set R of upcoming vehicle routes’ symbols is the hidden state set Q
1 (Lines 3-4).
(iv)
Calculate the intersection betweenR and another hidden state set Q
i. If this intersection exists, R
=
R
∩
Q
i. If not, R
=
Q
i (Lines 5–10).Algorithm 4:Viterbi_Route (an observation sequence O
′).
(1) Hidden state sequenceQ = Viterbi(O
′);
(2) intm = length of Q;
(3) if (m
=
1)
(4)R
=
Q
1;
(5) else
(6)  for (inti
=
2; i < Num of Q; i++)
(7)   if (R
∩
Q
i
≠
ϕ)
(8)
R
=
R
∩
Q
i;
(9)   else
(10)
R
=
Q
i;For example, if two hidden states are separatelyq
11
→
t
1
,
t
3 and q
12
→
t
1, then R
=
t
1
,
t
3
∩
t
1
=
t
1 and the most likely upcoming route is t
1. If two hidden states are separately q
11
→
t
3 and q
12
→
t
1 and t
3
∩
t
1
=
ϕ, then the most likely upcoming route is t
3.


## 5.1. A Method of Extending Training Set Based onK-Means++

It is necessary to train the HMM from drivers’ past history. In particular, the larger the size of training examples is, the more accurate the HMM for path predictions is. In view of the limitation of given training examples, the training set cannot contain all of routes that drivers will take in the future. So the paper proposes a method of extending training examples based onK-means++ [11]. It could enlarge the training data as much as possible based on given training examples.After analyzing the given training examples, it is found that starting and endpoints of vehicle routes are distributed in residential, commercial, and work areas. People usually go to work from residential areas in the morning and then go back from work areas or they will first go to commercial areas and then go home. Therefore, it is believed that vehicle routes are generally regular in some extent so that a path can be regarded as two return paths. In addition, it is also found that when traffic reaches its peak, a driver will generally avoid congested roads and select a route with the shortest time to the destination. In other times, drivers will select the shortest distance to the destination to save costs. For a beginning and end of a path, it is able to generate two kinds of routes according to different times.Last, it is not sure how many clusters the coordinate point setp should be classified beforehand, so the K-means++ algorithm to automatically classify coordinate points into k clusters is exploited in the paper. Here it should be pointed out that the distance of vehicle routes in the same cluster is rather short so that people would not have to drive from one point to another. It is not necessary to calculate vehicle routes for the above case. This assumption will be verified in the experiment.The algorithm of extending training examples based onK-means++ is as follows (see Algorithm 1).(i)
Initialize coordinate point setsp and p
′ and an extending route set NewD (Lines 01-02).
(ii)
Traverse a given training setD and read all of vehicle routes’ starting points x
i
1
,
y
i
1 and endpoints x
i
n
,
y
i
n, and then insert these coordinate points into the set p. Filter repeated coordinates in the set p, which could get the set p
′ composed of different starting and endpoints (Lines 03–07).
(iii)
Use theK-means++ algorithm to classify p
′ and then acquire n clusters C
1
,
…
,
C
i
,
…
,
C
n (Line 08).
(iv)
Traverse each clusterC
i and then distinguish whether or not two coordinate points belong to the same cluster C
i. If not, use the function Best
_
route
(
c
[
i
]
[
k
], c
[
j
]
[
l
]
) to calculate routes between two coordinate points (Lines 09–13).Algorithm 1:New_Track (a training set D).
Input: A training setD.
Output: The extending training set NewD.
(1)Coordinate Point Set p, p
′ = ϕ;
(2)Extending route Set NewD = ϕ;
(3)foreach (route t
i in D)
(4) Starting point A
=
x
i
1
,
y
i
1;
(5) End point B
=
(
x
i
n
,
y
i
n
);
(6) Insert A and B into the set p;
(7) p
′ = Filter(p);
(8) Cluster Set C
=
K-means++ (p
′);
/∗  c
=
{
c
[
1
]
,
c
[
2
]
,
…
,
c
[
n
]
}, which is n clusters altogether. ∗/
(9)for (int i
=
0; i
<
n; i++)
(10) for (int j
=
i
+
1; j
<
n; j++)
(11)  for (int k
=
0; k
<
c
[
i
].length; k++)
/∗
c
[
i
].length represents the number of coordinate points in the ith cluster. ∗/
(12)  for (int l
=
0; l
<
c
[
j
].length; l++)
(13)  Insert Best_route(c
[
i
]
[
k
], c
[
j
]
[
l
]) into NewD;
/∗
c
[
i
]
[
k
] represents the kth coordinate point in the ith cluster. ∗/


## 5.2. Parameter Definitions of a HMM for Route Predictions

Since it is necessary to input a driver’s just-driven path represented by coordinate points into a HMM and then output future entire paths, coordinate points’ sequence corresponding to the just-driven path can be regarded as an observation sequence and the corresponding sequence composed of different route sets can be regarded as a hidden state sequenceQ. The next gives details on the process of the HMM construction by following training examples (shown in (3)). Note the number of training examples is much more than following data in practice.Training Examples. Consider(3)
t
1
<
1,3
1,4
3,4
3,1
>
t
2
<
3,1
3,4
1,4
1,3
>
t
3
<
0,3
1,3
1,5
4,5
>
t
4
<
0,3
0,0
0,4
4,1
>
t
5
<
2,0
2,1
3,1
3,2
4,2
>
t
1
<
1,3
1,4
3,4
3,1
>
.In (3), assume that t
1
,
t
2
,
… are routes’ symbols in order to distinguish different vehicle routes. The observation set V includes the starting symbol (<), the end symbol (>), and different coordinate points. Each observation is defined by p
i
j, where i is the number of route t
i in the training set and j is the number of coordinate points in each route t
i. For example, the observation set of the above training example is {<, >, (1,3), (1,4), (3,4), (3,1), (0,3), (1,5), (4,5), (0,0), (0,4), (4,1), (2,0), (2,1), (3,2), (4,2)}. And an observation sequence O is an ordered sequence of symbols and coordinate points from the starting to the end. For example, the observation sequence of the route t
1 is p
11
→  <,  p
12
→
(
1,3
), p
13
→
(
1,4
), p
14
→
(
3,4
), p
15
→
(
3,1
), and p
16
→  >.Besides, the definition of hidden states is relatively more complex than observation states. At first, assume that each hidden state is defined byq
i
j, where i is the number of route t
i in the training set and j is the number of coordinate points in each vehicle route t
i. The hidden state set S includes the symbol • being produced from the observations <, > and different routes’ symbol sets (e.g., {
t
1
,
t
2
,
t
3
,
…
}) corresponding to different coordinate points. For example, hidden states being produced from the above observations of the route t
1 are separately q
11
→
•, q
12
→
t
1
,
t
3, q
13
→
t
1, q
14
→
t
1, q
15
→
t
1
,
t
5, and q
16
→
•. A hidden state sequence set is defined by QS, storing hidden state sequences Q being produced from hidden states and each vehicle route is directed. Suppose that A
→
n
B represents that a vehicle passes through n road segments from the starting point A to the endpoint B, but B
→
n
A represents that a vehicle passes through the same road segments from B to A. Even though each observation state is same in the two opposite routes, ordered coordinate points’ sequences are completely opposite. So a method is explored to calculate hidden states corresponding to each coordinate point next.The algorithm for hidden state determinations is as follows (see Algorithm2).(i)
Initialize a hidden state sequence set QS (Line 1).
(ii)
Obtain a beginning pointA
i
x
i
1
,
y
i
1 and an endpoint B
i
x
i
n
,
y
i
n from the vehicle route t
i and a beginning point A
j
=
x
j
1
,
y
j
1 and an endpoint B
j
=
x
j
n
,
y
j
n from the vehicle route t
j; then calculate A
i
B
i
→
=
x
i
n
-
x
i
1
,
y
i
n
-
y
i
1 denoted by a
→
i and A
j
B
j
→
=
x
j
n
-
x
j
1
,
y
j
n
-
y
j
1 denoted by a
→
j (Lines 2–9).
(iii)
Compute the cosine value of intersection angle between vectorsa
→
i and a
→
j (Line 10):(4)
c
o
s
a
→
i
,
a
→
j
=
a
→
i
·
a
→
j
a
→
i
·
a
→
j
=
x
i
n
-
x
i
1
·
y
i
n
-
y
i
1
x
j
n
-
x
j
1
·
y
j
n
-
y
j
1
p
p
+
x
j
n
-
x
j
1
·
y
j
n
-
y
j
1
·
x
i
n
-
x
i
1
2
+
y
i
n
-
y
i
1
2
x
j
n
-
x
j
1
2
+
y
j
n
-
y
j
1
2
p
p
p
p
·
x
j
n
-
x
j
1
2
+
y
j
n
-
y
j
1
2
-
1
.
(iv)
If0
≤
c
o
s
a
→
i
,
a
→
j
≤
1, traverse each coordinate point in vehicle routes t
i and t
j, and then judge whether or not a coordinate point o
k
1 in t
i is also included in t
j. If it is included, insert a symbol t
j into the corresponding location of the sequence Q
i (Lines 10–14). If -
1
<
c
o
s
a
→
i
,
a
→
j
<
0, driving directions of the two routes are opposite although the routes include the same coordinate point. For example, if a vehicle is driving east in a route t
i, the possibility of passing through south or western roads in a route t
j in our road network model is low. So the kind of hidden states will not be taken into account. And then insert a symbol • and a symbol t
i into Q
i on the basis of the given Q
i (Lines 15–20).
(v)
After calculating all of the hidden state sequence, insert each hidden state sequenceQ into the sequence set QS (Line 21).Algorithm 2:Hidden_State_Sequence (a training set D).
Input: A training setD.
Output: A hidden state sequence set QS.
(1)Hidden state sequence set QS = ϕ;
(2)for (int i
=
1; i
<
m; i++)
/∗  m is the number of routes in D. ∗/
(3) Starting point A
i
=
(
x
i
1
,
y
i
1
);
(4) End point B
i
=
(
x
i
n
,
y
i
n
);
(5) Vector a
→
i
=
(
x
i
n
-
x
i
1
,
y
i
n
-
y
i
1
);
(6) for (int j
=
i
+
1; j
<
m; j++)
(7)  Starting point A
j
=
(
x
j
1
,
y
j
1
);
(8)  End point B
j
=
(
x
j
n
,
y
j
n
);
(9)  Vector a
→
j
=
(
x
j
n
-
x
j
1
,
y
j
n
-
y
j
1
);
(10)  if (0
≤
cos
⁡
a
→
i
,
a
→
j
≤
1)
(11)   foreach (Coordinate point o
k
1 in t
i)
(12)    foreach (Coordinate point o
k
2 in t
j)
(13)     If (o
k
1
=
o
k
2)
(14)      Insert a symbol t
j into Q
i corresponding to the coordinate point;
(15)  else
(16)   foreach (Coordinate point o
j in t
i)
(17)    If (o
j is a symbol “<” or “>”)
(18)     Insert a symbol • into Q
i corresponding to the starting and end point;
(19)    else
(20)     Insert a symbol t
i into Q
i corresponding to each coordinate point;
(21) Insert each hidden state sequence Q into the sequence set QS


## 5.3. Parameter Estimation of a HMM for Route Predictions

After determining observation states and corresponding hidden states in the HMM for route predictions, our method uses the total training dataset TotalD, including the given training set D and the extending training set NewD, to estimate model parameters. To reduce the negative impact on the HMM, a weighted method is used to improve the process of estimating HMM parameters. In addition, the problem of data sparseness, also known as the zero-frequency problem, arises in the process of building the HMM. So our method adopts the add-one (Laplace) [12] smoothing technique to deal with events that do not occur in the total training set. The process of estimating HMM parameters by a weighted method and add-one (Laplace) smoothing is described as follows.(i)
The following equation is used for the initial probability distribution:(5)
π
i
=
C
o
u
n
t
s
D
i
+
λ
C
o
u
n
t
s
N
e
w
D
i
∑
j
=
1
n
C
o
u
n
t
s
D
j
+
λ
C
o
u
n
t
s
N
e
w
D
j
,
wheren is the number of hidden states (i.e., the total number of different vehicle routes), C
o
u
n
t
s
D
i and C
o
u
n
t
s
N
e
w
D
i separately represent the number of times the hidden state s
i appears in the given and extending training sets, and λ represents the weight (0
<
λ
<
1).
(ii)
The following equation is used for the hidden state transition matrix:(6)
P
s
i
∣
s
i
-
1
=
C
o
u
n
t
s
D
i
-
1
,
s
D
i
+
λ
C
o
u
n
t
s
N
e
w
D
i
-
1
,
s
N
e
w
D
i
+
1
C
o
u
n
t
s
D
i
-
1
+
λ
C
o
u
n
t
s
N
e
w
D
i
-
1
+
m
,
whereC
o
u
n
t
s
D
i
-
1
,
s
D
i and C
o
u
n
t
s
N
e
w
D
i
-
1
,
s
N
e
w
D
i separately represent the number of times a hidden state s
i followed s
i
-
1 in the given and extending training sets and m is the number of times the hidden state s
i occurs in the total training set.
(iii)
The following equation is used for the confusion matrix:(7)
P
v
j
∣
s
i
=
C
o
u
n
t
s
D
i
-
1
,
v
D
i
+
λ
C
o
u
n
t
s
N
e
w
D
i
-
1
,
v
N
e
w
D
i
+
1
C
o
u
n
t
s
D
i
+
λ
C
o
u
n
t
s
N
e
w
D
i
+
n
,
whereC
o
u
n
t
s
D
i
-
1
,
v
D
i and C
o
u
n
t
s
N
e
w
D
i
-
1
,
v
N
e
w
D
i separately represent the number of times the hidden state s
i accompanies the observation state v
j in the given and extending training sets and n is the number of times the observation state v
j occurs in the total training set.As described above, our method could build the HMM for vehicle route predictions. But drivers would like to choose different vehicle routes from a starting point to an endpoint during different time of each day. For example, people hope to reach the end during the rush hour (7:00~9:00 A.M. and 17:00~19:00 P.M.) as quickly as possible and try their best to avoid congested roads. But at other times people may choose the shortest route to drive. Therefore, training examples can be classified according to the time of day. A group of training examples is from 7:00~9:00 A.M. and 17:00~19:00 P.M., and another is from other times. Section7 will test the impact on the prediction accuracy with different training examples by building different HMMs at different times.


## 5.4. Driving Route Predictions

The aim of this section is to introduce how to predict upcoming routes based on just-driven road segments. The solution to this problem is corresponding to a HMM decoding which is to discover the hidden state sequence that was most likely to have produced a given observation sequence. Here, the Viterbi algorithm [13] is used to find the best hidden state sequence composed of different symbols for an observation sequence (a given vehicle route). The process of a vehicle route prediction is shown in Figure 6.Figure 6
The process of driving route prediction.Perhaps it will encounter some problems in the process of implementing Viterbi algorithm. The total training set, including the given and extending training examples, is still so limited that it could not fully contain all of possible upcoming vehicle routes. Assuming that the upcoming route does not occur in the total training set, which means(
1
) part of coordinate points are new ones for training examples and (
2
) each coordinate point has occurred in the total training set, a group from these coordinate points does not appear in the training examples. For this case (
1
), the Viterbi algorithm could not be directly used to compute the hidden state sequence. For example, in Figure 5, if a vehicle is on the current road segment represented by (4,4) and the representation of the corresponding just-driven route is t
6  <  0,3
1,3
1,4
(
4,4
), the Viterbi algorithm is not adopted to find hidden state sequence for this observation sequence. And for case (
2
), even though the Viterbi algorithm can be used, each hidden state will not contain this new route’s symbol. For example, if a new route is represented by t
6  <  0,3
1,3
1,4
3,4
(
3,2
) and all of these coordinate points have occurred in Figure 5, the symbol t
6 of the upcoming vehicle route will not appear in each hidden state, which means people could not directly understand where the vehicle will drive to. Applied to these problems, an algorithm for vehicle route predictions is proposed as follows (see Algorithm 3).(i)
Suppose thatO
=
p
i
1
,
p
i
2
,
…
,
p
i
k is an observation sequence composed of k coordinate points after the vehicle has passed through k roads; then initialize three sets D
1, D
2, and R, where R represents a set of upcoming vehicle routes’ symbols, D
1
=
{
p
i
x
1
,
p
i
x
2
,
…
,
p
i
x
m
} (D
1
∈
V; as described above, V is a set of all of observations in the training set), D
2
=
{
p
i
y
1
,
p
i
y
2
,
…
,
p
i
y
n
} (D
2
∉
V), and the elements of O are all in the set D
1
∪
D
2 (Lines 1-2).
(ii)
Traverse the observation sequenceO and determine whether or not each coordinate point belongs to the set V. If a coordinate point belongs to V, then insert the point into the set D
1. If not, insert it into D
2 (Lines 3–8).
(iii)
Define thatm is the number of elements in the set D
1 and n is the number of elements in the set D
2 (Lines 9-10).
(iv)
Ifm
=
0, the Viterbi algorithm is not used to find the upcoming routes and then R
=
ϕ (Lines 11-12).
(v)
Ifn
=
0, the Viterbi algorithm could be used to predict and then use a function Viterbi_Route to acquire the route set related to the upcoming routes most likely. This set will be helpful for people to drive as much as possible (Lines 13-14).
(vi)
If the input observation sequenceO has not appeared in the total training set before and part of coordinate points in O have also not appeared in V (i.e., D
2
≠
ϕ), four cases should be discussed:
(a)
Suppose thatD
2
=
{
p
i
2
,
…
,
p
i
k
}; then possible routes’ set could be calculated by the function Viterbi_Route (p
i
1) (Lines 15–17).
(b)
Suppose thatD
2
=
{
p
i
y
1
,
p
i
y
2
,
…
,
p
i
k
}; then use the function recursion to predict with the observation sequence composed of remaining coordinate points p
i
1
,
p
i
2
,
…
,
p
i
(
k
-
1
) (Lines 18-19).
(c)
Suppose thatD
2
=
{
p
i
1
,
p
i
y
2
,
…
,
p
i
y
n
}; then use the function recursion to predict with the observation sequence composed of remaining coordinate points p
i
2
,
p
i
3
,
…
,
p
i
k (Lines 20-21).
(d)
In addition to the above cases, suppose thatD
2
=
{
p
i
y
1
,
p
i
y
2
,
…
,
p
i
y
n
} and y
1
≠
1, y
n
≠
k, m
≠
1; then use the function recursion to predict with the observation sequence composed of remaining coordinate points p
i
y
1
,
p
i
y
2
,
…
,
p
i
y
n (Lines 22-23). For example, the input observation sequence is (0,3) (1,3) (1,4) (4,4) (4,5), where (
4,4
)
∉
V; then the result of vehicle route prediction is the set of hidden states corresponding to the coordinate point (4,5).Algorithm 3:Possible_Routes (an observation sequence O).
Input: An observation sequenceO.
Output: A setR of upcoming vehicle routes’ symbols.
(1)Ordered Observation Set D
1, D
2
=
ϕ;
(2)Possible Route Set R
=
ϕ;
(3)Foreach (Observation p
i
j in O)
(4) if (
p
i
j
∈
V
)
(5)  /∗  V is a set of all of observations in the training set. ∗/
(6)  Insert p
i
j into D
1;
(7) else
(8)  Insert p
i
j into D
2;
(9)int m = length of D
1;
(10)int n = length of D
2;
(11)if (m
=
0)
(12) R
=
ϕ;
(13)else if (n
=
0)
(14) R = Viterbi_Route (p
i
1
,
p
i
2
,
…
,
p
i
k);
(15)else if (m
=
1 and D
1
(
1
)
=
p
i
1)
(16) /∗  D
1
(
1
) represents the first element in the set D
1. ∗/
(17) R = Viterbi_Route (p
i
1);
(18)else if (D
2
(
1
)
=
p
i
k)
(19) Possible_Routes (p
i
1
,
p
i
2
,
…
,
p
i
(
k
-
1
));
(20)else if (D
2
(
1
)
=
p
i
1)
(21) Possible_Routes (p
i
2
,
…
,
p
i
k);
(22)else
(23) Possible_Routes (p
i
(
j
+
1
)
,
…
,
p
i
k);The function Viterbi_Route is described as follows (see Algorithm4).(i)
Use Viterbi algorithm to calculate the hidden state sequenceQ corresponding to the observation sequence O
′ (Line 1).
(ii)
Define that the number of elements in the hidden state sequenceQ is m (Line 2).
(iii)
Ifm
=
1, a set R of upcoming vehicle routes’ symbols is the hidden state set Q
1 (Lines 3-4).
(iv)
Calculate the intersection betweenR and another hidden state set Q
i. If this intersection exists, R
=
R
∩
Q
i. If not, R
=
Q
i (Lines 5–10).Algorithm 4:Viterbi_Route (an observation sequence O
′).
(1) Hidden state sequenceQ = Viterbi(O
′);
(2) intm = length of Q;
(3) if (m
=
1)
(4)R
=
Q
1;
(5) else
(6)  for (inti
=
2; i < Num of Q; i++)
(7)   if (R
∩
Q
i
≠
ϕ)
(8)
R
=
R
∩
Q
i;
(9)   else
(10)
R
=
Q
i;For example, if two hidden states are separatelyq
11
→
t
1
,
t
3 and q
12
→
t
1, then R
=
t
1
,
t
3
∩
t
1
=
t
1 and the most likely upcoming route is t
1. If two hidden states are separately q
11
→
t
3 and q
12
→
t
1 and t
3
∩
t
1
=
ϕ, then the most likely upcoming route is t
3.


## 6. Route Prediction Results

### 6.1. Experimental Platform

Every vehicle should be equipped with a device for collecting vehicle route data. And data collectors use a mobile phone with software Map Plus. We mainly focus on one of functions, path tracking, to record down the path of driving. It runs in the background, while someone could run other apps or lock the device at the same time. It also can export or send tracked paths as KML files. However, continued use of GPS running in the background can dramatically decrease battery life of mobile phone. So the experiment also needs an external large-capacity battery to support the phone continuously. In addition, researchers install the software Google Earth on the computer to present each of collected vehicle routes.


### 6.2. Data Collection

A total of 20 volunteers are selected for the purpose of collecting the experimental data. In order to facilitate the communication between volunteers and us, all volunteers are from our university, including 15 teachers and 5 students. A month later our researchers finally acquire a total of 1052 paths, where the number of different routes is 51. The same path is the journey that volunteers start from a point to the end through the same road segments. But in the process of the data collection, there are some problems inevitably.(i)
In tunnels, underground parking, and high-rise dense areas, the phenomenon that part of paths are offset from GPS noise will appear [14].
(ii)
Volunteers forget to open the software for recording route data, resulting in collecting route data unsuccessfully.
(iii)
Volunteers forget to turn off the software when they drive to the end, resulting in the path to be relatively concentrated in a small area.Once researchers come across the above problems when checking path data, we will manually correct the GPS data. In summary, the experimental results can overcome the influence of GPS noise and human factor to ensure the accuracy of the collected data.In the actual process of collecting the GPS data, collective data do not only focus on the longitude and latitude but also combine the GPS data of the starting point, the middle, and the end with road segments, describing the route as a path that is made up of the starting and endpoints and driven streets.


### 6.3. Experimental Metric

To evaluate the performance of route predictions based on HMM, a metric to explore is the correct prediction accuracy based on driven process. Suppose that a vehicle has passed throughi roads; the possible route set R after predicting based on HMM is R
=
R
1
,
R
2
,
…
,
R
n. So the definition of the prediction accuracy is as follows:(8)
P
i
=
∑
k
=
1
n
D
R
k
,
C
R
∑
t
=
1
n
Dist
R
t
×
100
%
,where C
R indicates an entirely upcoming route, D
R
k
,
C
R represents the number of duplicate road segments between one of possible vehicle routes in the set R
—
R
k and the entirely upcoming route, and Dist
R
t represents the length of the route R
t, that is, the number of road segments.For example, assume that the total training examples are shown in (3) and t
1 is the upcoming vehicle route, which means C
R is t
1 from the starting point 1,3 to the end 3,1. When the vehicle has traveled through one road, the observation sequence O is denoted by O
=
<
,
1,3 and the corresponding hidden state sequence is Q
=
•
,
t
1
,
t
3. So the duplicate between t
1 and t
1, t
3 separately is D
R
1
,
R
1
=
6, D
R
3
,
R
1
=
1. The length of routes R
1 and R
3 is separately Dist
R
1
=
6 and Dist
R
3
=
7. So when the vehicle has passed through the first point, the prediction accuracy is as follows:(9)
P
1
=
Repeat
R
1
,
R
1
+
Repeat
R
3
,
R
1
Dist
R
1
+
Dist
R
3
×
100
%
=
6
+
1
6
+
7
×
100
%
=
53.85
%
.


### 6.4. Experimental Results

#### 6.4.1. Training and Test Data

In the experiment, all of collected route examples are from the software Map Plus, where each route is included in a  .KML file composed of a series of GPS data. Researchers check these data in a certain time period through Google Earth. According to previous description of the road network model, routes represented by GPS data points could be changed into ones represented by coordinate points.Besides, some extending training examples are introduced here. These examples are extended from original collected data through a method to enlarge the training set based onK-means++ described before. Firstly, raw training examples composed of coordinate points have been entered. Then all of starting and endpoints can be divided into 5 clusters based on K-means++. It is known that the distance between each coordinate point and the corresponding clustering center is, on average, 0.314 km and the farthest distance between two points in a cluster is, on average, 0.628 km. It can illustrate that the distance between two places in a cluster is relatively short, so most of people would not like to drive. Therefore, this is the reason that extending algorithm was not used to calculate driving route in a cluster.Figure7 displays the trip data overlaid on two maps, one of original different routes (a) and the other of original and extending different routes (b). The number of extending training examples is 13605, where the number of routes different from original training examples is 13556.Figure 7
The trip data overlaid on two maps, one of original data (a) and another of original data and extending data (b).
(a)
(b)Finally, the composition of test training examples is illustrated in detail. To test the prediction accuracy of our prediction algorithm, our method should acquire part of real-world vehicle route data. Here the method applies a leave-one-out approach [4, 15], meaning that part of route data are extracted from total training examples as test examples.Test Examples (i). It includes part of routes that have not appeared in the training examples. So it can simulate real-world trip data to evaluate the prediction accuracy of our algorithm in actual applications.Test Examples (ii). All of the route examples have appeared in the training examples. It can evaluate the prediction accuracy compared to test examples (i) in order to illustrate a fact that the number of different routes in the training examples should be as much as possible.


#### 6.4.2. Prediction Accuracy

Figure8 shows the average correct prediction rate of test examples (i) and test examples (ii) by percent of route completed and by current travel distance with different weight values and also shows the comparison of results between Jon Froehlich’s algorithm and our method in these graphs. “Percent of trip completed” is an intuitive evaluation criterion and it is useful in evaluating how well the algorithm performed. However, it is difficult to achieve in practice. A vehicle navigation system can never be sure of how far along a route it is in terms of percentage completed without knowing the exact route of the trip from start-to-end—this is what our prediction method is trying to predict. Instead, a much more practical input parameter is the trip’s current distance traveled—that is, how far the vehicle has traveled since the trip began. Furthermore, it also should evaluate the weight value λ to impact HMM for driving route prediction. The algorithm separately set the threshold value λ as 0.2, 0.5, and 0.8.Figure 8
The performance of our prediction algorithm and Jon Froehlich’s algorithm.
(a)
Correct prediction rate of all trips by percent of trip completed
(b)
Correct prediction rate of repeated trips by percent of trip completed
(c)
Correct prediction rate of all trips by miles driven
(d)
Correct prediction rate of repeated trips by miles drivenFor test examples (i), Figure8(a) shows that, as expected, after a vehicle has driven the first road segment, little information is known about its path, and the correct prediction rates of both algorithms are much lower. After 35% of the trip has been completed, the correct prediction rate of our algorithm increases to, on average, 49.69% and Jon Froehlich’s algorithm only increases to, on average, 29.94%; after 50% completion, the correct prediction rate of our algorithm moves to, on average, 62.52% and Jon Froehlich’s algorithm moves to, on average, 38.54%. Figure 8(c) can more accurately show the performance of our proposed algorithm for driving route prediction in a real-world scenario. By the end of the first mile, the correct prediction rate of our algorithm jumps to 31.93% accuracy and by the tenth mile this percentage increases to 61.12%. And the results of Jon Froehlich’s algorithm are only between 23.037% and 29.2% for each mile traveled up to 20 miles.For test examples (ii), Figures8(b) and 8(d) show that the correct prediction accuracy for both algorithms is, on average, higher than the test dataset (i). In Figure 8(b), the percentage of our algorithm jumps to 90.86% accuracy at the halfway point, but Jon Froehlich’s algorithm can increase to this percentage only after 65% of the trip has been completed. In Figure 8(d), by the end of first mile, the correct prediction accuracy is similar to Figure 8(c), but as the trip progresses, there is a significant jump in prediction accuracy. By the end of 10 miles, the percentage of our algorithm already increases to 83.87%, but at this time Jon Froehlich’s algorithm only increases to 63%. As the vehicle has traveled up to 20 miles, the percentage of our algorithm can move to 99.29%.Figure8 concludes that the accuracy for driving route predictions increases as the number of observed road segments increases. This means that a longer sequence of road segments will be more helpful for our predictions. Also both of algorithms should take the driving direction into account by the end of first road segment because the vehicle could be heading toward either end of the current road segment and observing only one segment is not indicative of a driver’s direction so that the correct prediction rate is nearly zero. Furthermore, the prediction accuracy for repeated trips is already, on average, much higher than for unknown trips. It can demonstrate the necessity of extending the training examples. The probability that new routes occur will be reduced so that the prediction accuracy will be improved as much as possible. At last, the larger the threshold value “λ” is, the lower the correct prediction rate is. In our opinion, driving routes are relatively regular but many route data from extending examples do not follow this rule. Indeed, it will disturb this rule to drop the prediction accuracy. On the other hand, we have to acquire these extending samples, which could improve the prediction accuracy as mentioned before. Therefore, we should keep balance, meaning that extending data not only reduces the impact on a driver’s regularity (a regular route is a path that a driver often takes) as much as possible but also keeps it in existence (in the training set) for training and improving the accuracy of HMM. It is similar to core thought of add-one (Laplace) smoothing for the problem of data sparseness. This threshold value is defined as λ
=
0.01 in future applications.Figure9 shows the results of prediction accuracy based on different HMMs by the percent of trip completed and by current travel distance depending on the time of day into two categories: (i) 7:00~9:00 A.M. and 17:00~19:00 P.M. and (ii) other time periods. Then, HMMs are trained and tested according to classified test examples. The plot shows that the prediction accuracy is not very sensitive to the time of day, so this is not an important factor to consider when making driving route predictions. Froehlich and Krumm [4] also found a similar lack of sensitivity to both time of day and day of week for increasing prediction accuracy. Above all, it is not necessary to classify training samples to acquire different HMMs for route predictions according to the time of day.Figure 9
Our algorithm’s sensitivity to time of day.


## 6.1. Experimental Platform

Every vehicle should be equipped with a device for collecting vehicle route data. And data collectors use a mobile phone with software Map Plus. We mainly focus on one of functions, path tracking, to record down the path of driving. It runs in the background, while someone could run other apps or lock the device at the same time. It also can export or send tracked paths as KML files. However, continued use of GPS running in the background can dramatically decrease battery life of mobile phone. So the experiment also needs an external large-capacity battery to support the phone continuously. In addition, researchers install the software Google Earth on the computer to present each of collected vehicle routes.


## 6.2. Data Collection

A total of 20 volunteers are selected for the purpose of collecting the experimental data. In order to facilitate the communication between volunteers and us, all volunteers are from our university, including 15 teachers and 5 students. A month later our researchers finally acquire a total of 1052 paths, where the number of different routes is 51. The same path is the journey that volunteers start from a point to the end through the same road segments. But in the process of the data collection, there are some problems inevitably.(i)
In tunnels, underground parking, and high-rise dense areas, the phenomenon that part of paths are offset from GPS noise will appear [14].
(ii)
Volunteers forget to open the software for recording route data, resulting in collecting route data unsuccessfully.
(iii)
Volunteers forget to turn off the software when they drive to the end, resulting in the path to be relatively concentrated in a small area.Once researchers come across the above problems when checking path data, we will manually correct the GPS data. In summary, the experimental results can overcome the influence of GPS noise and human factor to ensure the accuracy of the collected data.In the actual process of collecting the GPS data, collective data do not only focus on the longitude and latitude but also combine the GPS data of the starting point, the middle, and the end with road segments, describing the route as a path that is made up of the starting and endpoints and driven streets.


## 6.3. Experimental Metric

To evaluate the performance of route predictions based on HMM, a metric to explore is the correct prediction accuracy based on driven process. Suppose that a vehicle has passed throughi roads; the possible route set R after predicting based on HMM is R
=
R
1
,
R
2
,
…
,
R
n. So the definition of the prediction accuracy is as follows:(8)
P
i
=
∑
k
=
1
n
D
R
k
,
C
R
∑
t
=
1
n
Dist
R
t
×
100
%
,where C
R indicates an entirely upcoming route, D
R
k
,
C
R represents the number of duplicate road segments between one of possible vehicle routes in the set R
—
R
k and the entirely upcoming route, and Dist
R
t represents the length of the route R
t, that is, the number of road segments.For example, assume that the total training examples are shown in (3) and t
1 is the upcoming vehicle route, which means C
R is t
1 from the starting point 1,3 to the end 3,1. When the vehicle has traveled through one road, the observation sequence O is denoted by O
=
<
,
1,3 and the corresponding hidden state sequence is Q
=
•
,
t
1
,
t
3. So the duplicate between t
1 and t
1, t
3 separately is D
R
1
,
R
1
=
6, D
R
3
,
R
1
=
1. The length of routes R
1 and R
3 is separately Dist
R
1
=
6 and Dist
R
3
=
7. So when the vehicle has passed through the first point, the prediction accuracy is as follows:(9)
P
1
=
Repeat
R
1
,
R
1
+
Repeat
R
3
,
R
1
Dist
R
1
+
Dist
R
3
×
100
%
=
6
+
1
6
+
7
×
100
%
=
53.85
%
.


## 6.4. Experimental Results

### 6.4.1. Training and Test Data

In the experiment, all of collected route examples are from the software Map Plus, where each route is included in a  .KML file composed of a series of GPS data. Researchers check these data in a certain time period through Google Earth. According to previous description of the road network model, routes represented by GPS data points could be changed into ones represented by coordinate points.Besides, some extending training examples are introduced here. These examples are extended from original collected data through a method to enlarge the training set based onK-means++ described before. Firstly, raw training examples composed of coordinate points have been entered. Then all of starting and endpoints can be divided into 5 clusters based on K-means++. It is known that the distance between each coordinate point and the corresponding clustering center is, on average, 0.314 km and the farthest distance between two points in a cluster is, on average, 0.628 km. It can illustrate that the distance between two places in a cluster is relatively short, so most of people would not like to drive. Therefore, this is the reason that extending algorithm was not used to calculate driving route in a cluster.Figure7 displays the trip data overlaid on two maps, one of original different routes (a) and the other of original and extending different routes (b). The number of extending training examples is 13605, where the number of routes different from original training examples is 13556.Figure 7
The trip data overlaid on two maps, one of original data (a) and another of original data and extending data (b).
(a)
(b)Finally, the composition of test training examples is illustrated in detail. To test the prediction accuracy of our prediction algorithm, our method should acquire part of real-world vehicle route data. Here the method applies a leave-one-out approach [4, 15], meaning that part of route data are extracted from total training examples as test examples.Test Examples (i). It includes part of routes that have not appeared in the training examples. So it can simulate real-world trip data to evaluate the prediction accuracy of our algorithm in actual applications.Test Examples (ii). All of the route examples have appeared in the training examples. It can evaluate the prediction accuracy compared to test examples (i) in order to illustrate a fact that the number of different routes in the training examples should be as much as possible.


### 6.4.2. Prediction Accuracy

Figure8 shows the average correct prediction rate of test examples (i) and test examples (ii) by percent of route completed and by current travel distance with different weight values and also shows the comparison of results between Jon Froehlich’s algorithm and our method in these graphs. “Percent of trip completed” is an intuitive evaluation criterion and it is useful in evaluating how well the algorithm performed. However, it is difficult to achieve in practice. A vehicle navigation system can never be sure of how far along a route it is in terms of percentage completed without knowing the exact route of the trip from start-to-end—this is what our prediction method is trying to predict. Instead, a much more practical input parameter is the trip’s current distance traveled—that is, how far the vehicle has traveled since the trip began. Furthermore, it also should evaluate the weight value λ to impact HMM for driving route prediction. The algorithm separately set the threshold value λ as 0.2, 0.5, and 0.8.Figure 8
The performance of our prediction algorithm and Jon Froehlich’s algorithm.
(a)
Correct prediction rate of all trips by percent of trip completed
(b)
Correct prediction rate of repeated trips by percent of trip completed
(c)
Correct prediction rate of all trips by miles driven
(d)
Correct prediction rate of repeated trips by miles drivenFor test examples (i), Figure8(a) shows that, as expected, after a vehicle has driven the first road segment, little information is known about its path, and the correct prediction rates of both algorithms are much lower. After 35% of the trip has been completed, the correct prediction rate of our algorithm increases to, on average, 49.69% and Jon Froehlich’s algorithm only increases to, on average, 29.94%; after 50% completion, the correct prediction rate of our algorithm moves to, on average, 62.52% and Jon Froehlich’s algorithm moves to, on average, 38.54%. Figure 8(c) can more accurately show the performance of our proposed algorithm for driving route prediction in a real-world scenario. By the end of the first mile, the correct prediction rate of our algorithm jumps to 31.93% accuracy and by the tenth mile this percentage increases to 61.12%. And the results of Jon Froehlich’s algorithm are only between 23.037% and 29.2% for each mile traveled up to 20 miles.For test examples (ii), Figures8(b) and 8(d) show that the correct prediction accuracy for both algorithms is, on average, higher than the test dataset (i). In Figure 8(b), the percentage of our algorithm jumps to 90.86% accuracy at the halfway point, but Jon Froehlich’s algorithm can increase to this percentage only after 65% of the trip has been completed. In Figure 8(d), by the end of first mile, the correct prediction accuracy is similar to Figure 8(c), but as the trip progresses, there is a significant jump in prediction accuracy. By the end of 10 miles, the percentage of our algorithm already increases to 83.87%, but at this time Jon Froehlich’s algorithm only increases to 63%. As the vehicle has traveled up to 20 miles, the percentage of our algorithm can move to 99.29%.Figure8 concludes that the accuracy for driving route predictions increases as the number of observed road segments increases. This means that a longer sequence of road segments will be more helpful for our predictions. Also both of algorithms should take the driving direction into account by the end of first road segment because the vehicle could be heading toward either end of the current road segment and observing only one segment is not indicative of a driver’s direction so that the correct prediction rate is nearly zero. Furthermore, the prediction accuracy for repeated trips is already, on average, much higher than for unknown trips. It can demonstrate the necessity of extending the training examples. The probability that new routes occur will be reduced so that the prediction accuracy will be improved as much as possible. At last, the larger the threshold value “λ” is, the lower the correct prediction rate is. In our opinion, driving routes are relatively regular but many route data from extending examples do not follow this rule. Indeed, it will disturb this rule to drop the prediction accuracy. On the other hand, we have to acquire these extending samples, which could improve the prediction accuracy as mentioned before. Therefore, we should keep balance, meaning that extending data not only reduces the impact on a driver’s regularity (a regular route is a path that a driver often takes) as much as possible but also keeps it in existence (in the training set) for training and improving the accuracy of HMM. It is similar to core thought of add-one (Laplace) smoothing for the problem of data sparseness. This threshold value is defined as λ
=
0.01 in future applications.Figure9 shows the results of prediction accuracy based on different HMMs by the percent of trip completed and by current travel distance depending on the time of day into two categories: (i) 7:00~9:00 A.M. and 17:00~19:00 P.M. and (ii) other time periods. Then, HMMs are trained and tested according to classified test examples. The plot shows that the prediction accuracy is not very sensitive to the time of day, so this is not an important factor to consider when making driving route predictions. Froehlich and Krumm [4] also found a similar lack of sensitivity to both time of day and day of week for increasing prediction accuracy. Above all, it is not necessary to classify training samples to acquire different HMMs for route predictions according to the time of day.Figure 9
Our algorithm’s sensitivity to time of day.


## 6.4.1. Training and Test Data

In the experiment, all of collected route examples are from the software Map Plus, where each route is included in a  .KML file composed of a series of GPS data. Researchers check these data in a certain time period through Google Earth. According to previous description of the road network model, routes represented by GPS data points could be changed into ones represented by coordinate points.Besides, some extending training examples are introduced here. These examples are extended from original collected data through a method to enlarge the training set based onK-means++ described before. Firstly, raw training examples composed of coordinate points have been entered. Then all of starting and endpoints can be divided into 5 clusters based on K-means++. It is known that the distance between each coordinate point and the corresponding clustering center is, on average, 0.314 km and the farthest distance between two points in a cluster is, on average, 0.628 km. It can illustrate that the distance between two places in a cluster is relatively short, so most of people would not like to drive. Therefore, this is the reason that extending algorithm was not used to calculate driving route in a cluster.Figure7 displays the trip data overlaid on two maps, one of original different routes (a) and the other of original and extending different routes (b). The number of extending training examples is 13605, where the number of routes different from original training examples is 13556.Figure 7
The trip data overlaid on two maps, one of original data (a) and another of original data and extending data (b).
(a)
(b)Finally, the composition of test training examples is illustrated in detail. To test the prediction accuracy of our prediction algorithm, our method should acquire part of real-world vehicle route data. Here the method applies a leave-one-out approach [4, 15], meaning that part of route data are extracted from total training examples as test examples.Test Examples (i). It includes part of routes that have not appeared in the training examples. So it can simulate real-world trip data to evaluate the prediction accuracy of our algorithm in actual applications.Test Examples (ii). All of the route examples have appeared in the training examples. It can evaluate the prediction accuracy compared to test examples (i) in order to illustrate a fact that the number of different routes in the training examples should be as much as possible.


## 6.4.2. Prediction Accuracy

Figure8 shows the average correct prediction rate of test examples (i) and test examples (ii) by percent of route completed and by current travel distance with different weight values and also shows the comparison of results between Jon Froehlich’s algorithm and our method in these graphs. “Percent of trip completed” is an intuitive evaluation criterion and it is useful in evaluating how well the algorithm performed. However, it is difficult to achieve in practice. A vehicle navigation system can never be sure of how far along a route it is in terms of percentage completed without knowing the exact route of the trip from start-to-end—this is what our prediction method is trying to predict. Instead, a much more practical input parameter is the trip’s current distance traveled—that is, how far the vehicle has traveled since the trip began. Furthermore, it also should evaluate the weight value λ to impact HMM for driving route prediction. The algorithm separately set the threshold value λ as 0.2, 0.5, and 0.8.Figure 8
The performance of our prediction algorithm and Jon Froehlich’s algorithm.
(a)
Correct prediction rate of all trips by percent of trip completed
(b)
Correct prediction rate of repeated trips by percent of trip completed
(c)
Correct prediction rate of all trips by miles driven
(d)
Correct prediction rate of repeated trips by miles drivenFor test examples (i), Figure8(a) shows that, as expected, after a vehicle has driven the first road segment, little information is known about its path, and the correct prediction rates of both algorithms are much lower. After 35% of the trip has been completed, the correct prediction rate of our algorithm increases to, on average, 49.69% and Jon Froehlich’s algorithm only increases to, on average, 29.94%; after 50% completion, the correct prediction rate of our algorithm moves to, on average, 62.52% and Jon Froehlich’s algorithm moves to, on average, 38.54%. Figure 8(c) can more accurately show the performance of our proposed algorithm for driving route prediction in a real-world scenario. By the end of the first mile, the correct prediction rate of our algorithm jumps to 31.93% accuracy and by the tenth mile this percentage increases to 61.12%. And the results of Jon Froehlich’s algorithm are only between 23.037% and 29.2% for each mile traveled up to 20 miles.For test examples (ii), Figures8(b) and 8(d) show that the correct prediction accuracy for both algorithms is, on average, higher than the test dataset (i). In Figure 8(b), the percentage of our algorithm jumps to 90.86% accuracy at the halfway point, but Jon Froehlich’s algorithm can increase to this percentage only after 65% of the trip has been completed. In Figure 8(d), by the end of first mile, the correct prediction accuracy is similar to Figure 8(c), but as the trip progresses, there is a significant jump in prediction accuracy. By the end of 10 miles, the percentage of our algorithm already increases to 83.87%, but at this time Jon Froehlich’s algorithm only increases to 63%. As the vehicle has traveled up to 20 miles, the percentage of our algorithm can move to 99.29%.Figure8 concludes that the accuracy for driving route predictions increases as the number of observed road segments increases. This means that a longer sequence of road segments will be more helpful for our predictions. Also both of algorithms should take the driving direction into account by the end of first road segment because the vehicle could be heading toward either end of the current road segment and observing only one segment is not indicative of a driver’s direction so that the correct prediction rate is nearly zero. Furthermore, the prediction accuracy for repeated trips is already, on average, much higher than for unknown trips. It can demonstrate the necessity of extending the training examples. The probability that new routes occur will be reduced so that the prediction accuracy will be improved as much as possible. At last, the larger the threshold value “λ” is, the lower the correct prediction rate is. In our opinion, driving routes are relatively regular but many route data from extending examples do not follow this rule. Indeed, it will disturb this rule to drop the prediction accuracy. On the other hand, we have to acquire these extending samples, which could improve the prediction accuracy as mentioned before. Therefore, we should keep balance, meaning that extending data not only reduces the impact on a driver’s regularity (a regular route is a path that a driver often takes) as much as possible but also keeps it in existence (in the training set) for training and improving the accuracy of HMM. It is similar to core thought of add-one (Laplace) smoothing for the problem of data sparseness. This threshold value is defined as λ
=
0.01 in future applications.Figure9 shows the results of prediction accuracy based on different HMMs by the percent of trip completed and by current travel distance depending on the time of day into two categories: (i) 7:00~9:00 A.M. and 17:00~19:00 P.M. and (ii) other time periods. Then, HMMs are trained and tested according to classified test examples. The plot shows that the prediction accuracy is not very sensitive to the time of day, so this is not an important factor to consider when making driving route predictions. Froehlich and Krumm [4] also found a similar lack of sensitivity to both time of day and day of week for increasing prediction accuracy. Above all, it is not necessary to classify training samples to acquire different HMMs for route predictions according to the time of day.Figure 9
Our algorithm’s sensitivity to time of day.


## 7. Conclusion

This paper firstly presents a driving route recommendation system, where the prediction module is the core of recommendation system, thereby giving details on a method to accurately predict a driver’s entire route very early in a trip. Then, a road network model was defined and normalized each of driving routes in the rectangular coordinate system. The method also builds HMMs to make preparation for route prediction using a method of training set extension based onK-means++ and the add-one (Laplace) smoothing technique. Next the paper introduces how to predict upcoming routes in a trip by HMMs and Viterbi algorithm. Finally, experimental results demonstrate the correction of our assumptions as mentioned before and also verify the effectiveness of our algorithm for routes predictions.As a direction of the future work, the improvement will be from two points: (i) investigate to enhance the Laplace smoothing technique to suit HMM for driving route predictions; (ii) apply the statistics method to make Viterbi algorithm work with unknown coordinate points.



---

*Source: 824532-2015-10-18.xml*