Probabilistic Ship Trajectory Forecasting using Transformer Models on AIS Data
Authors: Frederik E. T. Schöller
Organizations: Automation and Control Group, Department of Electrical Engineering, Technical University of Denmark, Kgs. Lyngby, Denmark · Technical University of Denmark
Anticipation of vessel trajectories is an essential task when navigating at sea. This applies to both human navigators and autonomous surface vessels. Trajectory forecasting enables sub-routines such as collision avoidance to assess the situation and react accordingly in time. This paper investigates Transformer and Performer models for trajectory prediction of surface vessels in confined waters. Using widely available position data from the Automatic Identification System (AIS), candidate models are trained and evaluated. Historical information on how other vessels have moved in the local area surrounding each agent is conveyed using positional heat maps. The heat maps are generated using Kernel Density Estimation (KDE) and encoded with a Convolutional Neural Network (CNN) before entering the Transformer models. The models are trained with quantile loss to efficiently obtain a model-aware prediction interval, as this is crucial for timely collision avoidance. The proposed model architectures are shown to greatly outperform previous work while the inclusion of local heat maps enables the prediction of vessel movement that is not otherwise indicated from the previous positions.
Figures & tables
Figure 1: Example of linear interpolation of positional AIS data.
Area
Bounding rectangle
# Trajectories
Period
The Great Belt
55∘4.2259′ N, 10∘0.1282′ E 55∘26.8333′ N, 11∘19.216′ E
574 171
September 2018
Hven
55∘47.9365′ N, 12∘23.3764′ E 56∘8.0261′ N, 13∘3.6935′ E
653 979
May 2018
Falsterborev
55∘12.6989′ N, 12∘27.1789′ E 55∘26.144′ N, 12∘50.4963′ E
408 070
September 2018
Table 1: Overview of the training data.
Figure 2: Heat maps of AIS data from the areas around The Great Belt, Oresund, and Falsterborev. The heat maps are generated using kernel density estimation.
Figure 3: Model illustration of the implemented Transformer architecture.
Operation
# Filters
Kernel
Stride
Padding
Output size
Input
–
–
–
–
64×64×1
Conv2d
8
3
1
1
64×64×8
Conv2d
8
3
1
1
64×64×8
Conv2d
8
3
2
1
32×32×8
Conv2d
16
3
1
1
32×32×16
Conv2d
16
3
1
1
32×32×16
Table 2: Structure of the spatial feature extractor. Each Conv2d block is followed by batch normalization and LeakyReLU activation.
Figure 6
Method
ADE ↓
FDE ↓
IAcc ↑
Inference time (ms)
The Great Belt
Linear
0.415
1.054
7.0%
14.5
GP
0.534
1.303
59.5%
14.5
LSTM-GAN
0.363
0.767
78.0%
157
Transformer
0.137
0.289
94.6%
6.0
Performer
0.137
0.291
94.7%
7.1
Table 4: Evaluation results on the three test areas. ADE and FDE are given in kilometres. Inference time is the average time per prediction measured over 1000 batches with a batch size of 1 on an NVIDIA RTX 3090 GPU. The best result in each group is shown in bold.
Method
ADE ↓
FDE ↓
IAcc ↑
Transformer
0.222
0.483
71.1%
Performer
0.206
0.461
75.0%
TransformerNo Heat
0.247
0.585
86.6%
PerformerNo Heat
0.257
0.608
85.3%
Table 5: Evaluation results on the Oresund area using models trained on data from the same area gathered during a different month. ADE and FDE are given in kilometres.
Figure 5: Trajectory forecasting of a vessel using the different methods. Here, the background shows the local heat map, the pink coordinates indicate the input data, the blue coordinates the true trajectory, the yellow coordinates show the predicted trajectory, and the orange ellipsoids indicate the 95% prediction interval for each time step. It is clearly seen that including the heat map yields a far better prediction. The scale of the sub-figures is shown by the scale bar at the top of Figure 5(a) .