3.1.2 The Model
The model used in this paper is a four layers LSTM
with tree hidden layers of 128 neurones each and an
output layer with 10 neurones corresponding each to
a given class C
j
, 1 ≤ j ≤ 10. The hidden layers use
the rectified linear unit (ReLU) as activation function.
The output layer use the softmax function to compute
the probability that the observation is the in a given
class. This model use as loss function the categorical
crossentropy given by the fellowing equation:
L(Y,
ˆ
Y ) = −
1
M
M
∑
i=1
N
∑
j=1
1
o
i
∈C
j
log(P(o
i
∈C
j
)) (11)
Where, N is the number of classes, M the number of
observation, o
i
the ith observation, Y vector of the
truth labels, and
ˆ
Y the vector of predicted labels.
To find the minimum of the loss function or ap-
proximate it the model uses a stochastic optimization
method called the Adam optimized (D. P. Kingma,
2015). The model is trained on dataset for differ-
ent time windows size and different number of fea-
tures in order to select the those that gives the best
performances. The model was tested on data coming
from time windows situated at different time to inten-
tion occurrence values, to evaluate its performances
in term of it.
3.2 Trajectory Prediction
The trajectory prediction method use the same fea-
tures as the intention prediction one. Since the trajec-
tory prediction is mainly about predicting a sequence
of the vehicle’s positions in future, we denote
ˆ
T the
predicted trajectory,
ˆ
T = {( ˆx
k
, ˆy
k
) ∈ R
2
: m +1 ≤k ≤
K + m}, where K is the number of the predicted po-
sitions, and m is the length of the previous time win-
dow used to prediction (x
k
, y
k
), let L be the size of the
window in second L =
m
f
s
, where f
s
= 10 Hz is the
frequency of data collection.
Since (x
k
, y
k
) are in R
2
, this means we are facing
a regression task. To predict trajectories we use the
same model used for intention prediction with differ-
ent loss function and different output layer. The loss
function in this case is the mean squared error. The
model was trained on different time window size for
different number of features in order to select those
which give better performances.
3.2.1 Prediction of One Point of the Trajectory
To predict the point (x
t
, y
t
) of the trajectory, the model
takes as input, the previous m sequence of features
collected during the past time window of size L. Let
F
t
= [ f
1,t
, ..., f
n,t
] be the sequence of features at time t
and n the number of features, the model uses the pre-
vious m sequences of features to predict the vector F
t
.
The first two features of each vector of features cor-
responds to the position of the vehicle. In this part
we are just interested in predicting only the next posi-
tion of the vehicle, thus there is no need to predict all
features.
3.2.2 Prediction of a Sequence of Points
To predict a sequence of positions T ( trajectory to
be predicted), we first start by predicting the first next
point (x
t
, y
t
) of the trajectory by predicting F
t
. As in
the previous case the model takes the previous m se-
quence of the feature as input to perform the predic-
tion. To predict the position (x
t
, y
t
) of a vehicle, the
model takes a sequences of features as input, for this
reason and in order to be able to predict the following
position (x
t+1
, y
t+1
) of the vehicle, the model predict
the sequence F
t
of features.
The predicted sequence of features F
t
and the last
m −1 sequences of features are given to the model
as input to predict the following sequence F
t+1
which
contains the point (x
t+1
, y
t+1
) of the trajectory
ˆ
T , this
step is repeated till we predict all points of the trajec-
tory. The disadvantage of this technic is that the error
made on predicting F
t
will affect the prediction of the
next sequence of features F
t+1
thus it will affect the
prediction of (x
t+1
, y
t+1
).
4 EXPERIMENT
In this section we use the 3/4 of the database to train
the model and the remaining data is used as valida-
tion set. Datasets with different time windows size
were constituted. In this part we compare the model
performances by varying time window size and the
number of features used to train the model, for both
trajectory prediction and intention prediction. For in-
tention prediction we study the model performances
according to time to intention occurrence.
4.1 Data Collection
Our model use data collected from the driving simu-
lator CARLA (A. Dosovitskiy and V. Koltun, 2017).
CARLA is an open source software developed by
Alexey Dosovitski and al. at the computer and vi-
sion center of Barcelona. The CARLA simulator use
a virtual environment which represents maps of vir-
tual towns. These maps use a cartesian coordinate
An Effective Driver Intention and Trajectory Prediction for Autonomous Vehicle based on LSTM
1093